From 28d35d8168bb21b842997cf4dc78c806d0b46fe8 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:23:57 -0800 Subject: [PATCH 001/179] Refactors for beta (#1212) * MyTestHandler rename * Extract from _api_requestor.request_raw * Fix --- stripe/_api_requestor.py | 59 +++++++++++++++++++++++++++++++++------ tests/test_integration.py | 16 +++++------ 2 files changed, 59 insertions(+), 16 deletions(-) diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index fe75e0f0b..6dd202478 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -366,18 +366,17 @@ def request_headers(self, method, options: RequestOptions): return headers - def request_raw( + def _args_for_request_with_retries( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, options: Optional[RequestOptions] = None, - is_streaming: bool = False, *, base_address: BaseAddress, api_mode: ApiMode, _usage: Optional[List[str]] = None, - ) -> Tuple[object, int, Mapping[str, str]]: + ): """ Mechanism for issuing an API call """ @@ -446,11 +445,55 @@ def request_raw( for key, value in supplied_headers.items(): headers[key] = value + max_network_retries = request_options.get("max_network_retries") + + return ( + # Actual args + method, + abs_url, + headers, + post_data, + max_network_retries, + _usage, + # For logging + encoded_params, + request_options.get("stripe_version"), + ) + + def request_raw( + self, + method: str, + url: str, + params: Optional[Mapping[str, Any]] = None, + options: Optional[RequestOptions] = None, + is_streaming: bool = False, + *, + base_address: BaseAddress, + api_mode: ApiMode, + _usage: Optional[List[str]] = None, + ) -> Tuple[object, int, Mapping[str, str]]: + ( + method, + abs_url, + headers, + post_data, + max_network_retries, + _usage, + encoded_params, + api_version, + ) = self._args_for_request_with_retries( + method, + url, + params, + options, + base_address=base_address, + api_mode=api_mode, + _usage=_usage, + ) + log_info("Request to Stripe api", method=method, url=abs_url) log_debug( - "Post details", - post_data=encoded_params, - api_version=request_options.get("stripe_version"), + "Post details", post_data=encoded_params, api_version=api_version ) if is_streaming: @@ -463,7 +506,7 @@ def request_raw( abs_url, headers, post_data, - max_network_retries=request_options.get("max_network_retries"), + max_network_retries=max_network_retries, _usage=_usage, ) else: @@ -476,7 +519,7 @@ def request_raw( abs_url, headers, post_data, - max_network_retries=request_options.get("max_network_retries"), + max_network_retries=max_network_retries, _usage=_usage, ) diff --git a/tests/test_integration.py b/tests/test_integration.py index 81b81d2a8..74e44a4c4 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -20,7 +20,7 @@ from http.server import BaseHTTPRequestHandler, HTTPServer -class TestHandler(BaseHTTPRequestHandler): +class MyTestHandler(BaseHTTPRequestHandler): num_requests = 0 requests = defaultdict(Queue) @@ -118,7 +118,7 @@ def setup_mock_server(self, handler): self.mock_server_thread.start() def test_hits_api_base(self): - class MockServerRequestHandler(TestHandler): + class MockServerRequestHandler(MyTestHandler): pass self.setup_mock_server(MockServerRequestHandler) @@ -129,7 +129,7 @@ class MockServerRequestHandler(TestHandler): assert reqs[0].path == "/v1/balance" def test_hits_proxy_through_default_http_client(self): - class MockServerRequestHandler(TestHandler): + class MockServerRequestHandler(MyTestHandler): pass self.setup_mock_server(MockServerRequestHandler) @@ -150,7 +150,7 @@ class MockServerRequestHandler(TestHandler): assert MockServerRequestHandler.num_requests == 2 def test_hits_proxy_through_custom_client(self): - class MockServerRequestHandler(TestHandler): + class MockServerRequestHandler(MyTestHandler): pass self.setup_mock_server(MockServerRequestHandler) @@ -164,7 +164,7 @@ class MockServerRequestHandler(TestHandler): assert MockServerRequestHandler.num_requests == 1 def test_hits_proxy_through_stripe_client_proxy(self): - class MockServerRequestHandler(TestHandler): + class MockServerRequestHandler(MyTestHandler): pass self.setup_mock_server(MockServerRequestHandler) @@ -179,7 +179,7 @@ class MockServerRequestHandler(TestHandler): assert MockServerRequestHandler.num_requests == 1 def test_hits_proxy_through_stripe_client_http_client(self): - class MockServerRequestHandler(TestHandler): + class MockServerRequestHandler(MyTestHandler): pass self.setup_mock_server(MockServerRequestHandler) @@ -196,7 +196,7 @@ class MockServerRequestHandler(TestHandler): assert MockServerRequestHandler.num_requests == 1 def test_passes_client_telemetry_when_enabled(self): - class MockServerRequestHandler(TestHandler): + class MockServerRequestHandler(MyTestHandler): def do_request(self, req_num): if req_num == 0: time.sleep(31 / 1000) # 31 ms @@ -248,7 +248,7 @@ def do_request(self, req_num): assert "usage" not in metrics def test_uses_thread_local_client_telemetry(self): - class MockServerRequestHandler(TestHandler): + class MockServerRequestHandler(MyTestHandler): local_num_requests = 0 seen_metrics = set() stats_lock = Lock() From c80b4b79800fc9937bc211a8a6407f6b7733d413 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Thu, 1 Feb 2024 14:08:08 -0800 Subject: [PATCH 002/179] Standardize method implementations: sanitize_id (#1215) * Standardize method implementations * Import sanitize_id directly --- stripe/_account.py | 62 ++++++------- stripe/_account_capability_service.py | 12 +-- stripe/_account_external_account_service.py | 18 ++-- stripe/_account_link.py | 2 +- stripe/_account_login_link_service.py | 4 +- stripe/_account_person_service.py | 18 ++-- stripe/_account_service.py | 16 +--- stripe/_account_session.py | 2 +- stripe/_apple_pay_domain.py | 13 ++- stripe/_apple_pay_domain_service.py | 6 +- stripe/_application_fee.py | 21 ++--- stripe/_application_fee_refund.py | 6 +- stripe/_application_fee_refund_service.py | 18 ++-- stripe/_application_fee_service.py | 4 +- stripe/_balance_transaction_service.py | 6 +- stripe/_bank_account.py | 17 ++-- stripe/_capability.py | 6 +- stripe/_card.py | 17 ++-- stripe/_cash_balance.py | 4 +- stripe/_charge.py | 18 ++-- stripe/_charge_service.py | 12 +-- stripe/_country_spec_service.py | 4 +- stripe/_coupon.py | 21 +++-- stripe/_coupon_service.py | 14 +-- stripe/_credit_note.py | 20 ++-- stripe/_credit_note_line_item_service.py | 4 +- stripe/_credit_note_service.py | 8 +- stripe/_customer.py | 91 ++++++++++--------- stripe/_customer_balance_transaction.py | 6 +- .../_customer_balance_transaction_service.py | 14 +-- stripe/_customer_cash_balance_service.py | 6 +- ...stomer_cash_balance_transaction_service.py | 8 +- .../_customer_funding_instructions_service.py | 4 +- stripe/_customer_payment_method_service.py | 8 +- stripe/_customer_payment_source_service.py | 22 ++--- stripe/_customer_service.py | 10 +- stripe/_customer_session.py | 2 +- stripe/_customer_tax_id_service.py | 14 +-- stripe/_dispute.py | 16 ++-- stripe/_dispute_service.py | 12 +-- stripe/_ephemeral_key.py | 11 ++- stripe/_ephemeral_key_service.py | 4 +- stripe/_event_service.py | 4 +- stripe/_exchange_rate_service.py | 4 +- stripe/_file.py | 2 +- stripe/_file_link.py | 12 ++- stripe/_file_link_service.py | 6 +- stripe/_file_service.py | 4 +- stripe/_invoice.py | 42 +++++---- stripe/_invoice_item.py | 21 +++-- stripe/_invoice_item_service.py | 8 +- stripe/_invoice_line_item_service.py | 4 +- stripe/_invoice_service.py | 24 ++--- stripe/_mandate_service.py | 6 +- stripe/_payment_intent.py | 38 ++++---- stripe/_payment_intent_service.py | 18 ++-- stripe/_payment_link.py | 18 ++-- stripe/_payment_link_line_item_service.py | 4 +- stripe/_payment_link_service.py | 6 +- stripe/_payment_method.py | 22 +++-- stripe/_payment_method_configuration.py | 12 ++- .../_payment_method_configuration_service.py | 6 +- stripe/_payment_method_domain.py | 20 ++-- stripe/_payment_method_domain_service.py | 14 +-- stripe/_payment_method_service.py | 10 +- stripe/_payout.py | 22 +++-- stripe/_payout_service.py | 14 +-- stripe/_person.py | 6 +- stripe/_plan.py | 21 +++-- stripe/_plan_service.py | 8 +- stripe/_price.py | 12 ++- stripe/_price_service.py | 6 +- stripe/_product.py | 21 +++-- stripe/_product_service.py | 8 +- stripe/_promotion_code.py | 12 ++- stripe/_promotion_code_service.py | 6 +- stripe/_quote.py | 46 ++++------ ...ote_computed_upfront_line_items_service.py | 4 +- stripe/_quote_line_item_service.py | 4 +- stripe/_quote_service.py | 22 ++--- stripe/_refund.py | 22 +++-- stripe/_refund_service.py | 12 +-- stripe/_reversal.py | 6 +- stripe/_review.py | 7 +- stripe/_review_service.py | 8 +- stripe/_setup_intent.py | 26 +++--- stripe/_setup_intent_service.py | 12 +-- stripe/_shipping_rate.py | 12 ++- stripe/_shipping_rate_service.py | 6 +- stripe/_source.py | 26 +++--- stripe/_source_service.py | 16 ++-- stripe/_source_transaction_service.py | 4 +- stripe/_subscription.py | 26 +++--- stripe/_subscription_item.py | 26 ++++-- stripe/_subscription_item_service.py | 14 +-- ..._subscription_item_usage_record_service.py | 4 +- ...ption_item_usage_record_summary_service.py | 4 +- stripe/_subscription_schedule.py | 22 +++-- stripe/_subscription_schedule_service.py | 10 +- stripe/_subscription_service.py | 12 +-- stripe/_tax_code_service.py | 4 +- stripe/_tax_id.py | 6 +- stripe/_tax_rate.py | 12 ++- stripe/_tax_rate_service.py | 6 +- stripe/_token.py | 2 +- stripe/_token_service.py | 4 +- stripe/_topup.py | 20 ++-- stripe/_topup_service.py | 10 +- stripe/_transfer.py | 27 +++--- stripe/_transfer_reversal_service.py | 18 ++-- stripe/_transfer_service.py | 6 +- stripe/_webhook_endpoint.py | 21 +++-- stripe/_webhook_endpoint_service.py | 8 +- stripe/apps/_secret.py | 2 +- stripe/billing_portal/_configuration.py | 12 ++- .../billing_portal/_configuration_service.py | 6 +- stripe/billing_portal/_session.py | 2 +- stripe/checkout/_session.py | 13 ++- stripe/checkout/_session_line_item_service.py | 4 +- stripe/checkout/_session_service.py | 6 +- stripe/climate/_order.py | 18 ++-- stripe/climate/_order_service.py | 12 +-- stripe/climate/_product_service.py | 4 +- stripe/climate/_supplier_service.py | 4 +- stripe/financial_connections/_account.py | 23 +++-- .../_account_owner_service.py | 4 +- .../financial_connections/_account_service.py | 12 +-- stripe/financial_connections/_session.py | 2 +- .../financial_connections/_session_service.py | 4 +- .../_transaction_service.py | 4 +- .../identity/_verification_report_service.py | 4 +- stripe/identity/_verification_session.py | 22 +++-- .../identity/_verification_session_service.py | 10 +- stripe/issuing/_authorization.py | 44 ++++----- stripe/issuing/_authorization_service.py | 10 +- stripe/issuing/_card.py | 30 +++--- stripe/issuing/_card_service.py | 10 +- stripe/issuing/_cardholder.py | 12 ++- stripe/issuing/_cardholder_service.py | 6 +- stripe/issuing/_dispute.py | 18 ++-- stripe/issuing/_dispute_service.py | 8 +- stripe/issuing/_token.py | 10 +- stripe/issuing/_token_service.py | 10 +- stripe/issuing/_transaction.py | 16 ++-- stripe/issuing/_transaction_service.py | 6 +- stripe/radar/_early_fraud_warning_service.py | 4 +- stripe/radar/_value_list.py | 21 +++-- stripe/radar/_value_list_item.py | 13 ++- stripe/radar/_value_list_item_service.py | 6 +- stripe/radar/_value_list_service.py | 8 +- stripe/reporting/_report_run.py | 2 +- stripe/reporting/_report_run_service.py | 4 +- stripe/reporting/_report_type_service.py | 4 +- stripe/sigma/_scheduled_query_run_service.py | 4 +- stripe/tax/_calculation.py | 9 +- stripe/tax/_calculation_line_item_service.py | 4 +- stripe/tax/_registration.py | 12 ++- stripe/tax/_registration_service.py | 6 +- stripe/tax/_settings.py | 6 +- stripe/tax/_transaction.py | 7 +- stripe/tax/_transaction_line_item_service.py | 4 +- stripe/tax/_transaction_service.py | 4 +- stripe/terminal/_configuration.py | 21 +++-- stripe/terminal/_configuration_service.py | 8 +- stripe/terminal/_connection_token.py | 2 +- stripe/terminal/_location.py | 21 +++-- stripe/terminal/_location_service.py | 8 +- stripe/terminal/_reader.py | 46 ++++++---- stripe/terminal/_reader_service.py | 18 ++-- stripe/test_helpers/_customer_service.py | 4 +- stripe/test_helpers/_refund_service.py | 4 +- stripe/test_helpers/_test_clock.py | 18 ++-- stripe/test_helpers/_test_clock_service.py | 8 +- .../issuing/_authorization_service.py | 10 +- stripe/test_helpers/issuing/_card_service.py | 10 +- .../issuing/_transaction_service.py | 4 +- .../test_helpers/terminal/_reader_service.py | 4 +- .../treasury/_inbound_transfer_service.py | 8 +- .../treasury/_outbound_payment_service.py | 8 +- .../treasury/_outbound_transfer_service.py | 8 +- stripe/treasury/_credit_reversal.py | 2 +- stripe/treasury/_credit_reversal_service.py | 4 +- stripe/treasury/_debit_reversal.py | 2 +- stripe/treasury/_debit_reversal_service.py | 4 +- stripe/treasury/_financial_account.py | 22 +++-- .../_financial_account_features_service.py | 6 +- stripe/treasury/_financial_account_service.py | 6 +- stripe/treasury/_inbound_transfer.py | 21 ++--- stripe/treasury/_inbound_transfer_service.py | 6 +- stripe/treasury/_outbound_payment.py | 21 ++--- stripe/treasury/_outbound_payment_service.py | 6 +- stripe/treasury/_outbound_transfer.py | 27 ++---- stripe/treasury/_outbound_transfer_service.py | 6 +- stripe/treasury/_received_credit_service.py | 4 +- stripe/treasury/_received_debit_service.py | 6 +- stripe/treasury/_transaction_entry_service.py | 4 +- stripe/treasury/_transaction_service.py | 6 +- 197 files changed, 1194 insertions(+), 1152 deletions(-) diff --git a/stripe/_account.py b/stripe/_account.py index 829ea20fc..6c928934d 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField @@ -12,7 +11,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import ( Literal, @@ -21,7 +20,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._bank_account import BankAccount @@ -3644,7 +3642,7 @@ def create(cls, **params: Unpack["Account.CreateParams"]) -> "Account": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -3659,10 +3657,14 @@ def _cls_delete( If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Account", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -3740,7 +3742,7 @@ def _cls_persons( cls._static_request( "get", "/v1/accounts/{account}/persons".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), @@ -3777,7 +3779,7 @@ def persons( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/accounts/{account}/persons".format( - account=_util.sanitize_id(self.get("id")) + account=sanitize_id(self.get("id")) ), params=params, ), @@ -3797,7 +3799,7 @@ def _cls_reject( cls._static_request( "post", "/v1/accounts/{account}/reject".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), @@ -3838,7 +3840,7 @@ def reject( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/accounts/{account}/reject".format( - account=_util.sanitize_id(self.get("id")) + account=sanitize_id(self.get("id")) ), params=params, ), @@ -3863,7 +3865,7 @@ def _build_instance_url(cls, sid): if not sid: return "/v1/account" base = cls.class_url() - extn = quote_plus(sid) + extn = sanitize_id(sid) return "%s/%s" % (base, extn) def instance_url(self): @@ -3898,8 +3900,8 @@ def retrieve_capability( cls._static_request( "get", "/v1/accounts/{account}/capabilities/{capability}".format( - account=_util.sanitize_id(account), - capability=_util.sanitize_id(capability), + account=sanitize_id(account), + capability=sanitize_id(capability), ), params=params, ), @@ -3920,8 +3922,8 @@ def modify_capability( cls._static_request( "post", "/v1/accounts/{account}/capabilities/{capability}".format( - account=_util.sanitize_id(account), - capability=_util.sanitize_id(capability), + account=sanitize_id(account), + capability=sanitize_id(capability), ), params=params, ), @@ -3939,7 +3941,7 @@ def list_capabilities( cls._static_request( "get", "/v1/accounts/{account}/capabilities".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), @@ -3959,7 +3961,7 @@ def create_external_account( cls._static_request( "post", "/v1/accounts/{account}/external_accounts".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), @@ -3980,8 +3982,7 @@ def retrieve_external_account( cls._static_request( "get", "/v1/accounts/{account}/external_accounts/{id}".format( - account=_util.sanitize_id(account), - id=_util.sanitize_id(id), + account=sanitize_id(account), id=sanitize_id(id) ), params=params, ), @@ -4004,8 +4005,7 @@ def modify_external_account( cls._static_request( "post", "/v1/accounts/{account}/external_accounts/{id}".format( - account=_util.sanitize_id(account), - id=_util.sanitize_id(id), + account=sanitize_id(account), id=sanitize_id(id) ), params=params, ), @@ -4026,8 +4026,7 @@ def delete_external_account( cls._static_request( "delete", "/v1/accounts/{account}/external_accounts/{id}".format( - account=_util.sanitize_id(account), - id=_util.sanitize_id(id), + account=sanitize_id(account), id=sanitize_id(id) ), params=params, ), @@ -4047,7 +4046,7 @@ def list_external_accounts( cls._static_request( "get", "/v1/accounts/{account}/external_accounts".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), @@ -4067,7 +4066,7 @@ def create_login_link( cls._static_request( "post", "/v1/accounts/{account}/login_links".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), @@ -4085,7 +4084,7 @@ def create_person( cls._static_request( "post", "/v1/accounts/{account}/persons".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), @@ -4106,8 +4105,7 @@ def retrieve_person( cls._static_request( "get", "/v1/accounts/{account}/persons/{person}".format( - account=_util.sanitize_id(account), - person=_util.sanitize_id(person), + account=sanitize_id(account), person=sanitize_id(person) ), params=params, ), @@ -4128,8 +4126,7 @@ def modify_person( cls._static_request( "post", "/v1/accounts/{account}/persons/{person}".format( - account=_util.sanitize_id(account), - person=_util.sanitize_id(person), + account=sanitize_id(account), person=sanitize_id(person) ), params=params, ), @@ -4150,8 +4147,7 @@ def delete_person( cls._static_request( "delete", "/v1/accounts/{account}/persons/{person}".format( - account=_util.sanitize_id(account), - person=_util.sanitize_id(person), + account=sanitize_id(account), person=sanitize_id(person) ), params=params, ), @@ -4169,7 +4165,7 @@ def list_persons( cls._static_request( "get", "/v1/accounts/{account}/persons".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), diff --git a/stripe/_account_capability_service.py b/stripe/_account_capability_service.py index 7a6876f22..fc7365adb 100644 --- a/stripe/_account_capability_service.py +++ b/stripe/_account_capability_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._capability import Capability from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -48,7 +48,7 @@ def list( self._requestor.request( "get", "/v1/accounts/{account}/capabilities".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", @@ -72,8 +72,8 @@ def retrieve( self._requestor.request( "get", "/v1/accounts/{account}/capabilities/{capability}".format( - account=_util.sanitize_id(account), - capability=_util.sanitize_id(capability), + account=sanitize_id(account), + capability=sanitize_id(capability), ), api_mode="V1", base_address="api", @@ -97,8 +97,8 @@ def update( self._requestor.request( "post", "/v1/accounts/{account}/capabilities/{capability}".format( - account=_util.sanitize_id(account), - capability=_util.sanitize_id(capability), + account=sanitize_id(account), + capability=sanitize_id(capability), ), api_mode="V1", base_address="api", diff --git a/stripe/_account_external_account_service.py b/stripe/_account_external_account_service.py index f34b7046f..817793e2e 100644 --- a/stripe/_account_external_account_service.py +++ b/stripe/_account_external_account_service.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._bank_account import BankAccount from stripe._card import Card from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -217,8 +217,8 @@ def delete( self._requestor.request( "delete", "/v1/accounts/{account}/external_accounts/{id}".format( - account=_util.sanitize_id(account), - id=_util.sanitize_id(id), + account=sanitize_id(account), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -242,8 +242,8 @@ def retrieve( self._requestor.request( "get", "/v1/accounts/{account}/external_accounts/{id}".format( - account=_util.sanitize_id(account), - id=_util.sanitize_id(id), + account=sanitize_id(account), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -269,8 +269,8 @@ def update( self._requestor.request( "post", "/v1/accounts/{account}/external_accounts/{id}".format( - account=_util.sanitize_id(account), - id=_util.sanitize_id(id), + account=sanitize_id(account), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -293,7 +293,7 @@ def list( self._requestor.request( "get", "/v1/accounts/{account}/external_accounts".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", @@ -316,7 +316,7 @@ def create( self._requestor.request( "post", "/v1/accounts/{account}/external_accounts".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", diff --git a/stripe/_account_link.py b/stripe/_account_link.py index ca958de5e..b16247d89 100644 --- a/stripe/_account_link.py +++ b/stripe/_account_link.py @@ -87,6 +87,6 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) diff --git a/stripe/_account_login_link_service.py b/stripe/_account_login_link_service.py index 7aeb58947..b5e02f25b 100644 --- a/stripe/_account_login_link_service.py +++ b/stripe/_account_login_link_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._login_link import LoginLink from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -31,7 +31,7 @@ def create( self._requestor.request( "post", "/v1/accounts/{account}/login_links".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", diff --git a/stripe/_account_person_service.py b/stripe/_account_person_service.py index c87e9e6f9..233c66972 100644 --- a/stripe/_account_person_service.py +++ b/stripe/_account_person_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._person import Person from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -828,8 +828,8 @@ def delete( self._requestor.request( "delete", "/v1/accounts/{account}/persons/{person}".format( - account=_util.sanitize_id(account), - person=_util.sanitize_id(person), + account=sanitize_id(account), + person=sanitize_id(person), ), api_mode="V1", base_address="api", @@ -853,8 +853,8 @@ def retrieve( self._requestor.request( "get", "/v1/accounts/{account}/persons/{person}".format( - account=_util.sanitize_id(account), - person=_util.sanitize_id(person), + account=sanitize_id(account), + person=sanitize_id(person), ), api_mode="V1", base_address="api", @@ -878,8 +878,8 @@ def update( self._requestor.request( "post", "/v1/accounts/{account}/persons/{person}".format( - account=_util.sanitize_id(account), - person=_util.sanitize_id(person), + account=sanitize_id(account), + person=sanitize_id(person), ), api_mode="V1", base_address="api", @@ -902,7 +902,7 @@ def list( self._requestor.request( "get", "/v1/accounts/{account}/persons".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", @@ -925,7 +925,7 @@ def create( self._requestor.request( "post", "/v1/accounts/{account}/persons".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 898f5ba2f..670fb96bd 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._account import Account from stripe._account_capability_service import AccountCapabilityService from stripe._account_external_account_service import ( @@ -11,6 +10,7 @@ from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -2958,9 +2958,7 @@ def delete( Account, self._requestor.request( "delete", - "/v1/accounts/{account}".format( - account=_util.sanitize_id(account), - ), + "/v1/accounts/{account}".format(account=sanitize_id(account)), api_mode="V1", base_address="api", params=params, @@ -2981,9 +2979,7 @@ def retrieve( Account, self._requestor.request( "get", - "/v1/accounts/{account}".format( - account=_util.sanitize_id(account), - ), + "/v1/accounts/{account}".format(account=sanitize_id(account)), api_mode="V1", base_address="api", params=params, @@ -3012,9 +3008,7 @@ def update( Account, self._requestor.request( "post", - "/v1/accounts/{account}".format( - account=_util.sanitize_id(account), - ), + "/v1/accounts/{account}".format(account=sanitize_id(account)), api_mode="V1", base_address="api", params=params, @@ -3103,7 +3097,7 @@ def reject( self._requestor.request( "post", "/v1/accounts/{account}/reject".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", diff --git a/stripe/_account_session.py b/stripe/_account_session.py index f439c0f0a..d79d80cfa 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -276,7 +276,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) diff --git a/stripe/_apple_pay_domain.py b/stripe/_apple_pay_domain.py index 553279c94..ac0370412 100644 --- a/stripe/_apple_pay_domain.py +++ b/stripe/_apple_pay_domain.py @@ -5,10 +5,9 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, Unpack -from urllib.parse import quote_plus class ApplePayDomain( @@ -87,7 +86,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -98,10 +97,14 @@ def _cls_delete( """ Delete an apple pay domain. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "ApplePayDomain", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload diff --git a/stripe/_apple_pay_domain_service.py b/stripe/_apple_pay_domain_service.py index a8aa554d8..7380a09e2 100644 --- a/stripe/_apple_pay_domain_service.py +++ b/stripe/_apple_pay_domain_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._apple_pay_domain import ApplePayDomain from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -59,7 +59,7 @@ def delete( self._requestor.request( "delete", "/v1/apple_pay/domains/{domain}".format( - domain=_util.sanitize_id(domain), + domain=sanitize_id(domain), ), api_mode="V1", base_address="api", @@ -82,7 +82,7 @@ def retrieve( self._requestor.request( "get", "/v1/apple_pay/domains/{domain}".format( - domain=_util.sanitize_id(domain), + domain=sanitize_id(domain), ), api_mode="V1", base_address="api", diff --git a/stripe/_application_fee.py b/stripe/_application_fee.py index ef0a2c7da..654b58c80 100644 --- a/stripe/_application_fee.py +++ b/stripe/_application_fee.py @@ -1,12 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -234,9 +233,7 @@ def _cls_refund( "ApplicationFeeRefund", cls._static_request( "post", - "/v1/application_fees/{id}/refunds".format( - id=_util.sanitize_id(id) - ), + "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), params=params, ), ) @@ -296,7 +293,7 @@ def refund( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/application_fees/{id}/refunds".format( - id=_util.sanitize_id(self.get("id")) + id=sanitize_id(self.get("id")) ), params=params, ), @@ -332,9 +329,7 @@ def create_refund( "ApplicationFeeRefund", cls._static_request( "post", - "/v1/application_fees/{id}/refunds".format( - id=_util.sanitize_id(id) - ), + "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), params=params, ), ) @@ -354,7 +349,7 @@ def retrieve_refund( cls._static_request( "get", "/v1/application_fees/{fee}/refunds/{id}".format( - fee=_util.sanitize_id(fee), id=_util.sanitize_id(id) + fee=sanitize_id(fee), id=sanitize_id(id) ), params=params, ), @@ -377,7 +372,7 @@ def modify_refund( cls._static_request( "post", "/v1/application_fees/{fee}/refunds/{id}".format( - fee=_util.sanitize_id(fee), id=_util.sanitize_id(id) + fee=sanitize_id(fee), id=sanitize_id(id) ), params=params, ), @@ -394,9 +389,7 @@ def list_refunds( ListObject["ApplicationFeeRefund"], cls._static_request( "get", - "/v1/application_fees/{id}/refunds".format( - id=_util.sanitize_id(id) - ), + "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), params=params, ), ) diff --git a/stripe/_application_fee_refund.py b/stripe/_application_fee_refund.py index 556c2a71f..4ae51aeb3 100644 --- a/stripe/_application_fee_refund.py +++ b/stripe/_application_fee_refund.py @@ -3,9 +3,9 @@ from stripe._application_fee import ApplicationFee from stripe._expandable_field import ExpandableField from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, Dict, Optional, cast from typing_extensions import Literal, TYPE_CHECKING -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction @@ -57,8 +57,8 @@ class ApplicationFeeRefund(UpdateableAPIResource["ApplicationFeeRefund"]): @classmethod def _build_instance_url(cls, fee, sid): base = ApplicationFee.class_url() - cust_extn = quote_plus(fee) - extn = quote_plus(sid) + cust_extn = sanitize_id(fee) + extn = sanitize_id(sid) return "%s/%s/refunds/%s" % (base, cust_extn, extn) @classmethod diff --git a/stripe/_application_fee_refund_service.py b/stripe/_application_fee_refund_service.py index 91eed41be..dc1c14502 100644 --- a/stripe/_application_fee_refund_service.py +++ b/stripe/_application_fee_refund_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._application_fee_refund import ApplicationFeeRefund from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -73,8 +73,8 @@ def retrieve( self._requestor.request( "get", "/v1/application_fees/{fee}/refunds/{id}".format( - fee=_util.sanitize_id(fee), - id=_util.sanitize_id(id), + fee=sanitize_id(fee), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -100,8 +100,8 @@ def update( self._requestor.request( "post", "/v1/application_fees/{fee}/refunds/{id}".format( - fee=_util.sanitize_id(fee), - id=_util.sanitize_id(id), + fee=sanitize_id(fee), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -123,9 +123,7 @@ def list( ListObject[ApplicationFeeRefund], self._requestor.request( "get", - "/v1/application_fees/{id}/refunds".format( - id=_util.sanitize_id(id), - ), + "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, @@ -154,9 +152,7 @@ def create( ApplicationFeeRefund, self._requestor.request( "post", - "/v1/application_fees/{id}/refunds".format( - id=_util.sanitize_id(id), - ), + "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_application_fee_service.py b/stripe/_application_fee_service.py index 3e41d3b66..4a18f132b 100644 --- a/stripe/_application_fee_service.py +++ b/stripe/_application_fee_service.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._application_fee import ApplicationFee from stripe._application_fee_refund_service import ApplicationFeeRefundService from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -95,7 +95,7 @@ def retrieve( ApplicationFee, self._requestor.request( "get", - "/v1/application_fees/{id}".format(id=_util.sanitize_id(id)), + "/v1/application_fees/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_balance_transaction_service.py b/stripe/_balance_transaction_service.py index 9dca28642..281a37a15 100644 --- a/stripe/_balance_transaction_service.py +++ b/stripe/_balance_transaction_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._balance_transaction import BalanceTransaction from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -106,9 +106,7 @@ def retrieve( BalanceTransaction, self._requestor.request( "get", - "/v1/balance_transactions/{id}".format( - id=_util.sanitize_id(id), - ), + "/v1/balance_transactions/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index b462d4d28..6c5d6e236 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -8,11 +8,10 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from stripe._verify_mixin import VerifyMixin from typing import ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._card import Card @@ -370,10 +369,14 @@ def _cls_delete( """ Delete a specified external account for a given account. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( Union["BankAccount", "Card"], - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -410,7 +413,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] def instance_url(self): token = self.id - extn = quote_plus(token) + extn = sanitize_id(token) if hasattr(self, "customer"): customer = self.customer @@ -418,7 +421,7 @@ def instance_url(self): assert customer is not None if isinstance(customer, Customer): customer = customer.id - owner_extn = quote_plus(customer) + owner_extn = sanitize_id(customer) class_base = "sources" elif hasattr(self, "account"): @@ -428,7 +431,7 @@ def instance_url(self): assert account is not None if isinstance(account, Account): account = account.id - owner_extn = quote_plus(account) + owner_extn = sanitize_id(account) class_base = "external_accounts" else: diff --git a/stripe/_capability.py b/stripe/_capability.py index 5233977f2..af7250ce7 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -4,9 +4,9 @@ from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, List, Optional from typing_extensions import Literal -from urllib.parse import quote_plus class Capability(UpdateableAPIResource["Capability"]): @@ -351,8 +351,8 @@ def instance_url(self): base = Account.class_url() if isinstance(account, Account): account = account.id - acct_extn = quote_plus(account) - extn = quote_plus(token) + acct_extn = sanitize_id(account) + extn = sanitize_id(token) return "%s/%s/capabilities/%s" % (base, acct_extn, extn) @classmethod diff --git a/stripe/_card.py b/stripe/_card.py index 4682f92de..47d00eafc 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -7,10 +7,9 @@ from stripe._expandable_field import ExpandableField from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._bank_account import BankAccount @@ -168,10 +167,14 @@ def _cls_delete( """ Delete a specified external account for a given account. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( Union["BankAccount", "Card"], - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -208,7 +211,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] def instance_url(self): token = self.id - extn = quote_plus(token) + extn = sanitize_id(token) if hasattr(self, "customer"): customer = self.customer @@ -216,7 +219,7 @@ def instance_url(self): assert customer is not None if isinstance(customer, Customer): customer = customer.id - owner_extn = quote_plus(customer) + owner_extn = sanitize_id(customer) class_base = "sources" elif hasattr(self, "account"): @@ -226,7 +229,7 @@ def instance_url(self): assert account is not None if isinstance(account, Account): account = account.id - owner_extn = quote_plus(account) + owner_extn = sanitize_id(account) class_base = "external_accounts" else: diff --git a/stripe/_cash_balance.py b/stripe/_cash_balance.py index 325e363f1..287e786a8 100644 --- a/stripe/_cash_balance.py +++ b/stripe/_cash_balance.py @@ -2,9 +2,9 @@ # File generated from our OpenAPI spec from stripe._customer import Customer from stripe._stripe_object import StripeObject +from stripe._util import sanitize_id from typing import ClassVar, Dict, Optional from typing_extensions import Literal -from urllib.parse import quote_plus class CashBalance(StripeObject): @@ -45,7 +45,7 @@ class Settings(StripeObject): def instance_url(self): customer = self.customer base = Customer.class_url() - cust_extn = quote_plus(customer) + cust_extn = sanitize_id(customer) return "%s/%s/cash_balance" % (base, cust_extn) @classmethod diff --git a/stripe/_charge.py b/stripe/_charge.py index 3a0038b24..d16d37dea 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -10,7 +9,7 @@ from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ( ClassVar, Dict, @@ -28,7 +27,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._account import Account @@ -2226,7 +2224,7 @@ def _cls_capture( cls._static_request( "post", "/v1/charges/{charge}/capture".format( - charge=_util.sanitize_id(charge) + charge=sanitize_id(charge) ), params=params, ), @@ -2273,7 +2271,7 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/charges/{charge}/capture".format( - charge=_util.sanitize_id(self.get("id")) + charge=sanitize_id(self.get("id")) ), params=params, ), @@ -2291,7 +2289,7 @@ def create(cls, **params: Unpack["Charge.CreateParams"]) -> "Charge": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -2323,10 +2321,14 @@ def modify( """ Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Charge", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index 41a15b86c..8a3e5b2eb 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._charge import Charge from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -417,9 +417,7 @@ def retrieve( Charge, self._requestor.request( "get", - "/v1/charges/{charge}".format( - charge=_util.sanitize_id(charge) - ), + "/v1/charges/{charge}".format(charge=sanitize_id(charge)), api_mode="V1", base_address="api", params=params, @@ -440,9 +438,7 @@ def update( Charge, self._requestor.request( "post", - "/v1/charges/{charge}".format( - charge=_util.sanitize_id(charge) - ), + "/v1/charges/{charge}".format(charge=sanitize_id(charge)), api_mode="V1", base_address="api", params=params, @@ -491,7 +487,7 @@ def capture( self._requestor.request( "post", "/v1/charges/{charge}/capture".format( - charge=_util.sanitize_id(charge), + charge=sanitize_id(charge), ), api_mode="V1", base_address="api", diff --git a/stripe/_country_spec_service.py b/stripe/_country_spec_service.py index 4b1ad1fa8..95629ddb9 100644 --- a/stripe/_country_spec_service.py +++ b/stripe/_country_spec_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._country_spec import CountrySpec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -68,7 +68,7 @@ def retrieve( self._requestor.request( "get", "/v1/country_specs/{country}".format( - country=_util.sanitize_id(country), + country=sanitize_id(country), ), api_mode="V1", base_address="api", diff --git a/stripe/_coupon.py b/stripe/_coupon.py index 35377c582..65f565558 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -7,10 +7,9 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, TypedDict, Unpack -from urllib.parse import quote_plus class Coupon( @@ -264,7 +263,7 @@ def create(cls, **params: Unpack["Coupon.CreateParams"]) -> "Coupon": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -275,10 +274,14 @@ def _cls_delete( """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Coupon", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -337,10 +340,14 @@ def modify( """ Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Coupon", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_coupon_service.py b/stripe/_coupon_service.py index e6e0d5a21..29aa7c295 100644 --- a/stripe/_coupon_service.py +++ b/stripe/_coupon_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._coupon import Coupon from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -166,9 +166,7 @@ def delete( Coupon, self._requestor.request( "delete", - "/v1/coupons/{coupon}".format( - coupon=_util.sanitize_id(coupon) - ), + "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), api_mode="V1", base_address="api", params=params, @@ -189,9 +187,7 @@ def retrieve( Coupon, self._requestor.request( "get", - "/v1/coupons/{coupon}".format( - coupon=_util.sanitize_id(coupon) - ), + "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), api_mode="V1", base_address="api", params=params, @@ -212,9 +208,7 @@ def update( Coupon, self._requestor.request( "post", - "/v1/coupons/{coupon}".format( - coupon=_util.sanitize_id(coupon) - ), + "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 78063bf6a..dc8ab7619 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -9,7 +8,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -18,7 +17,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._credit_note_line_item import CreditNoteLineItem @@ -738,7 +736,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -770,10 +768,14 @@ def modify( """ Updates an existing credit note. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "CreditNote", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -830,7 +832,7 @@ def _cls_void_credit_note( "CreditNote", cls._static_request( "post", - "/v1/credit_notes/{id}/void".format(id=_util.sanitize_id(id)), + "/v1/credit_notes/{id}/void".format(id=sanitize_id(id)), params=params, ), ) @@ -866,7 +868,7 @@ def void_credit_note( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/credit_notes/{id}/void".format( - id=_util.sanitize_id(self.get("id")) + id=sanitize_id(self.get("id")) ), params=params, ), @@ -884,7 +886,7 @@ def list_lines( cls._static_request( "get", "/v1/credit_notes/{credit_note}/lines".format( - credit_note=_util.sanitize_id(credit_note) + credit_note=sanitize_id(credit_note) ), params=params, ), diff --git a/stripe/_credit_note_line_item_service.py b/stripe/_credit_note_line_item_service.py index 27835a5e5..90636ad9b 100644 --- a/stripe/_credit_note_line_item_service.py +++ b/stripe/_credit_note_line_item_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._credit_note_line_item import CreditNoteLineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -42,7 +42,7 @@ def list( self._requestor.request( "get", "/v1/credit_notes/{credit_note}/lines".format( - credit_note=_util.sanitize_id(credit_note), + credit_note=sanitize_id(credit_note), ), api_mode="V1", base_address="api", diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index c4f9d460b..23b7133c0 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._credit_note import CreditNote from stripe._credit_note_line_item_service import CreditNoteLineItemService from stripe._credit_note_preview_lines_service import ( @@ -9,6 +8,7 @@ from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -373,7 +373,7 @@ def retrieve( CreditNote, self._requestor.request( "get", - "/v1/credit_notes/{id}".format(id=_util.sanitize_id(id)), + "/v1/credit_notes/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, @@ -394,7 +394,7 @@ def update( CreditNote, self._requestor.request( "post", - "/v1/credit_notes/{id}".format(id=_util.sanitize_id(id)), + "/v1/credit_notes/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, @@ -435,7 +435,7 @@ def void_credit_note( CreditNote, self._requestor.request( "post", - "/v1/credit_notes/{id}/void".format(id=_util.sanitize_id(id)), + "/v1/credit_notes/{id}/void".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_customer.py b/stripe/_customer.py index 4b086ed6f..ebedbfb26 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField @@ -13,7 +12,7 @@ from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ( ClassVar, Dict, @@ -32,7 +31,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._account import Account @@ -1391,7 +1389,7 @@ def create(cls, **params: Unpack["Customer.CreateParams"]) -> "Customer": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -1411,7 +1409,7 @@ def _cls_create_funding_instructions( cls._static_request( "post", "/v1/customers/{customer}/funding_instructions".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -1455,7 +1453,7 @@ def create_funding_instructions( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/customers/{customer}/funding_instructions".format( - customer=_util.sanitize_id(self.get("id")) + customer=sanitize_id(self.get("id")) ), params=params, ), @@ -1468,10 +1466,14 @@ def _cls_delete( """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Customer", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -1516,7 +1518,7 @@ def _cls_delete_discount( cls._static_request( "delete", "/v1/customers/{customer}/discount".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -1553,7 +1555,7 @@ def delete_discount( # pyright: ignore[reportGeneralTypeIssues] self._request( "delete", "/v1/customers/{customer}/discount".format( - customer=_util.sanitize_id(self.get("id")) + customer=sanitize_id(self.get("id")) ), params=params, ), @@ -1594,7 +1596,7 @@ def _cls_list_payment_methods( cls._static_request( "get", "/v1/customers/{customer}/payment_methods".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -1631,7 +1633,7 @@ def list_payment_methods( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/customers/{customer}/payment_methods".format( - customer=_util.sanitize_id(self.get("id")) + customer=sanitize_id(self.get("id")) ), params=params, ), @@ -1646,10 +1648,14 @@ def modify( This request accepts mostly the same arguments as the customer creation call. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Customer", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -1678,8 +1684,8 @@ def _cls_retrieve_payment_method( cls._static_request( "get", "/v1/customers/{customer}/payment_methods/{payment_method}".format( - customer=_util.sanitize_id(customer), - payment_method=_util.sanitize_id(payment_method), + customer=sanitize_id(customer), + payment_method=sanitize_id(payment_method), ), params=params, ), @@ -1722,8 +1728,8 @@ def retrieve_payment_method( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/customers/{customer}/payment_methods/{payment_method}".format( - customer=_util.sanitize_id(self.get("id")), - payment_method=_util.sanitize_id(payment_method), + customer=sanitize_id(self.get("id")), + payment_method=sanitize_id(payment_method), ), params=params, ), @@ -1761,7 +1767,7 @@ def create_balance_transaction( cls._static_request( "post", "/v1/customers/{customer}/balance_transactions".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -1782,8 +1788,8 @@ def retrieve_balance_transaction( cls._static_request( "get", "/v1/customers/{customer}/balance_transactions/{transaction}".format( - customer=_util.sanitize_id(customer), - transaction=_util.sanitize_id(transaction), + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), ), params=params, ), @@ -1804,8 +1810,8 @@ def modify_balance_transaction( cls._static_request( "post", "/v1/customers/{customer}/balance_transactions/{transaction}".format( - customer=_util.sanitize_id(customer), - transaction=_util.sanitize_id(transaction), + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), ), params=params, ), @@ -1825,7 +1831,7 @@ def list_balance_transactions( cls._static_request( "get", "/v1/customers/{customer}/balance_transactions".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -1846,8 +1852,8 @@ def retrieve_cash_balance_transaction( cls._static_request( "get", "/v1/customers/{customer}/cash_balance_transactions/{transaction}".format( - customer=_util.sanitize_id(customer), - transaction=_util.sanitize_id(transaction), + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), ), params=params, ), @@ -1867,7 +1873,7 @@ def list_cash_balance_transactions( cls._static_request( "get", "/v1/customers/{customer}/cash_balance_transactions".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -1889,7 +1895,7 @@ def create_source( cls._static_request( "post", "/v1/customers/{customer}/sources".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -1910,8 +1916,7 @@ def retrieve_source( cls._static_request( "get", "/v1/customers/{customer}/sources/{id}".format( - customer=_util.sanitize_id(customer), - id=_util.sanitize_id(id), + customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), @@ -1932,8 +1937,7 @@ def modify_source( cls._static_request( "post", "/v1/customers/{customer}/sources/{id}".format( - customer=_util.sanitize_id(customer), - id=_util.sanitize_id(id), + customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), @@ -1954,8 +1958,7 @@ def delete_source( cls._static_request( "delete", "/v1/customers/{customer}/sources/{id}".format( - customer=_util.sanitize_id(customer), - id=_util.sanitize_id(id), + customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), @@ -1973,7 +1976,7 @@ def list_sources( cls._static_request( "get", "/v1/customers/{customer}/sources".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -1991,7 +1994,7 @@ def create_tax_id( cls._static_request( "post", "/v1/customers/{customer}/tax_ids".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -2012,8 +2015,7 @@ def retrieve_tax_id( cls._static_request( "get", "/v1/customers/{customer}/tax_ids/{id}".format( - customer=_util.sanitize_id(customer), - id=_util.sanitize_id(id), + customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), @@ -2034,8 +2036,7 @@ def delete_tax_id( cls._static_request( "delete", "/v1/customers/{customer}/tax_ids/{id}".format( - customer=_util.sanitize_id(customer), - id=_util.sanitize_id(id), + customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), @@ -2053,7 +2054,7 @@ def list_tax_ids( cls._static_request( "get", "/v1/customers/{customer}/tax_ids".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -2073,7 +2074,7 @@ def modify_cash_balance( cls._static_request( "post", "/v1/customers/{customer}/cash_balance".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -2093,7 +2094,7 @@ def retrieve_cash_balance( cls._static_request( "get", "/v1/customers/{customer}/cash_balance".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -2116,7 +2117,7 @@ def _cls_fund_cash_balance( cls._static_request( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( - customer=_util.sanitize_id(customer) + customer=sanitize_id(customer) ), params=params, ), @@ -2153,7 +2154,7 @@ def fund_cash_balance( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( - customer=_util.sanitize_id(self.resource.get("id")) + customer=sanitize_id(self.resource.get("id")) ), params=params, ), diff --git a/stripe/_customer_balance_transaction.py b/stripe/_customer_balance_transaction.py index 4e08e6650..fd342c70f 100644 --- a/stripe/_customer_balance_transaction.py +++ b/stripe/_customer_balance_transaction.py @@ -3,9 +3,9 @@ from stripe._api_resource import APIResource from stripe._customer import Customer from stripe._expandable_field import ExpandableField +from stripe._util import sanitize_id from typing import ClassVar, Dict, Optional from typing_extensions import Literal, TYPE_CHECKING -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._credit_note import CreditNote @@ -95,8 +95,8 @@ def instance_url(self): if isinstance(customer, Customer): customer = customer.id base = Customer.class_url() - cust_extn = quote_plus(customer) - extn = quote_plus(token) + cust_extn = sanitize_id(customer) + extn = sanitize_id(token) return "%s/%s/balance_transactions/%s" % (base, cust_extn, extn) @classmethod diff --git a/stripe/_customer_balance_transaction_service.py b/stripe/_customer_balance_transaction_service.py index 73be56d15..aed9f57e1 100644 --- a/stripe/_customer_balance_transaction_service.py +++ b/stripe/_customer_balance_transaction_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._customer_balance_transaction import CustomerBalanceTransaction from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -84,7 +84,7 @@ def list( self._requestor.request( "get", "/v1/customers/{customer}/balance_transactions".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", @@ -107,7 +107,7 @@ def create( self._requestor.request( "post", "/v1/customers/{customer}/balance_transactions".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", @@ -131,8 +131,8 @@ def retrieve( self._requestor.request( "get", "/v1/customers/{customer}/balance_transactions/{transaction}".format( - customer=_util.sanitize_id(customer), - transaction=_util.sanitize_id(transaction), + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", @@ -156,8 +156,8 @@ def update( self._requestor.request( "post", "/v1/customers/{customer}/balance_transactions/{transaction}".format( - customer=_util.sanitize_id(customer), - transaction=_util.sanitize_id(transaction), + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", diff --git a/stripe/_customer_cash_balance_service.py b/stripe/_customer_cash_balance_service.py index 3bbbd7259..d4bb7a080 100644 --- a/stripe/_customer_cash_balance_service.py +++ b/stripe/_customer_cash_balance_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._cash_balance import CashBalance from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -49,7 +49,7 @@ def retrieve( self._requestor.request( "get", "/v1/customers/{customer}/cash_balance".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", @@ -72,7 +72,7 @@ def update( self._requestor.request( "post", "/v1/customers/{customer}/cash_balance".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", diff --git a/stripe/_customer_cash_balance_transaction_service.py b/stripe/_customer_cash_balance_transaction_service.py index 0b23aa02f..4ec8aec65 100644 --- a/stripe/_customer_cash_balance_transaction_service.py +++ b/stripe/_customer_cash_balance_transaction_service.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._customer_cash_balance_transaction import ( CustomerCashBalanceTransaction, ) from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -50,7 +50,7 @@ def list( self._requestor.request( "get", "/v1/customers/{customer}/cash_balance_transactions".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", @@ -74,8 +74,8 @@ def retrieve( self._requestor.request( "get", "/v1/customers/{customer}/cash_balance_transactions/{transaction}".format( - customer=_util.sanitize_id(customer), - transaction=_util.sanitize_id(transaction), + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", diff --git a/stripe/_customer_funding_instructions_service.py b/stripe/_customer_funding_instructions_service.py index 450ec212d..adee88a69 100644 --- a/stripe/_customer_funding_instructions_service.py +++ b/stripe/_customer_funding_instructions_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._funding_instructions import FundingInstructions from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -75,7 +75,7 @@ def create( self._requestor.request( "post", "/v1/customers/{customer}/funding_instructions".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 703b6e234..956db7238 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._payment_method import PaymentMethod from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -54,7 +54,7 @@ def list( self._requestor.request( "get", "/v1/customers/{customer}/payment_methods".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", @@ -78,8 +78,8 @@ def retrieve( self._requestor.request( "get", "/v1/customers/{customer}/payment_methods/{payment_method}".format( - customer=_util.sanitize_id(customer), - payment_method=_util.sanitize_id(payment_method), + customer=sanitize_id(customer), + payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", diff --git a/stripe/_customer_payment_source_service.py b/stripe/_customer_payment_source_service.py index 69f9272af..7c1f759bf 100644 --- a/stripe/_customer_payment_source_service.py +++ b/stripe/_customer_payment_source_service.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._account import Account from stripe._bank_account import BankAccount from stripe._card import Card @@ -8,6 +7,7 @@ from stripe._request_options import RequestOptions from stripe._source import Source from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -187,7 +187,7 @@ def list( self._requestor.request( "get", "/v1/customers/{customer}/sources".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", @@ -214,7 +214,7 @@ def create( self._requestor.request( "post", "/v1/customers/{customer}/sources".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", @@ -238,8 +238,8 @@ def retrieve( self._requestor.request( "get", "/v1/customers/{customer}/sources/{id}".format( - customer=_util.sanitize_id(customer), - id=_util.sanitize_id(id), + customer=sanitize_id(customer), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -263,8 +263,8 @@ def update( self._requestor.request( "post", "/v1/customers/{customer}/sources/{id}".format( - customer=_util.sanitize_id(customer), - id=_util.sanitize_id(id), + customer=sanitize_id(customer), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -288,8 +288,8 @@ def delete( self._requestor.request( "delete", "/v1/customers/{customer}/sources/{id}".format( - customer=_util.sanitize_id(customer), - id=_util.sanitize_id(id), + customer=sanitize_id(customer), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -313,8 +313,8 @@ def verify( self._requestor.request( "post", "/v1/customers/{customer}/sources/{id}/verify".format( - customer=_util.sanitize_id(customer), - id=_util.sanitize_id(id), + customer=sanitize_id(customer), + id=sanitize_id(id), ), api_mode="V1", base_address="api", diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 01771c31b..4dacf5b52 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._customer import Customer from stripe._customer_balance_transaction_service import ( CustomerBalanceTransactionService, @@ -24,6 +23,7 @@ from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -654,7 +654,7 @@ def delete( self._requestor.request( "delete", "/v1/customers/{customer}".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", @@ -677,7 +677,7 @@ def retrieve( self._requestor.request( "get", "/v1/customers/{customer}".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", @@ -702,7 +702,7 @@ def update( self._requestor.request( "post", "/v1/customers/{customer}".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", @@ -725,7 +725,7 @@ def delete_discount( self._requestor.request( "delete", "/v1/customers/{customer}/discount".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index 4d85e5763..23c33399c 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -134,7 +134,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index 91442a1e2..d41fd7278 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._tax_id import TaxId +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -133,8 +133,8 @@ def delete( self._requestor.request( "delete", "/v1/customers/{customer}/tax_ids/{id}".format( - customer=_util.sanitize_id(customer), - id=_util.sanitize_id(id), + customer=sanitize_id(customer), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -158,8 +158,8 @@ def retrieve( self._requestor.request( "get", "/v1/customers/{customer}/tax_ids/{id}".format( - customer=_util.sanitize_id(customer), - id=_util.sanitize_id(id), + customer=sanitize_id(customer), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -182,7 +182,7 @@ def list( self._requestor.request( "get", "/v1/customers/{customer}/tax_ids".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", @@ -205,7 +205,7 @@ def create( self._requestor.request( "post", "/v1/customers/{customer}/tax_ids".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", diff --git a/stripe/_dispute.py b/stripe/_dispute.py index 3ee8a41eb..4ecc4236e 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -16,7 +15,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction @@ -454,7 +452,7 @@ def _cls_close( cls._static_request( "post", "/v1/disputes/{dispute}/close".format( - dispute=_util.sanitize_id(dispute) + dispute=sanitize_id(dispute) ), params=params, ), @@ -495,7 +493,7 @@ def close( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/disputes/{dispute}/close".format( - dispute=_util.sanitize_id(self.get("id")) + dispute=sanitize_id(self.get("id")) ), params=params, ), @@ -531,10 +529,14 @@ def modify( Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Dispute", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_dispute_service.py b/stripe/_dispute_service.py index 0b85feedf..a2dafc16b 100644 --- a/stripe/_dispute_service.py +++ b/stripe/_dispute_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._dispute import Dispute from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -228,9 +228,7 @@ def retrieve( Dispute, self._requestor.request( "get", - "/v1/disputes/{dispute}".format( - dispute=_util.sanitize_id(dispute), - ), + "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), api_mode="V1", base_address="api", params=params, @@ -253,9 +251,7 @@ def update( Dispute, self._requestor.request( "post", - "/v1/disputes/{dispute}".format( - dispute=_util.sanitize_id(dispute), - ), + "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), api_mode="V1", base_address="api", params=params, @@ -279,7 +275,7 @@ def close( self._requestor.request( "post", "/v1/disputes/{dispute}/close".format( - dispute=_util.sanitize_id(dispute), + dispute=sanitize_id(dispute), ), api_mode="V1", base_address="api", diff --git a/stripe/_ephemeral_key.py b/stripe/_ephemeral_key.py index 4580b7e2b..8717ce371 100644 --- a/stripe/_ephemeral_key.py +++ b/stripe/_ephemeral_key.py @@ -2,10 +2,9 @@ # File generated from our OpenAPI spec from stripe._deletable_api_resource import DeletableAPIResource from stripe._request_options import RequestOptions -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, Unpack -from urllib.parse import quote_plus class EphemeralKey(DeletableAPIResource["EphemeralKey"]): @@ -49,10 +48,14 @@ def _cls_delete( """ Invalidates a short-lived API key for a given resource. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "EphemeralKey", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload diff --git a/stripe/_ephemeral_key_service.py b/stripe/_ephemeral_key_service.py index 3973ca9be..4bcb45a83 100644 --- a/stripe/_ephemeral_key_service.py +++ b/stripe/_ephemeral_key_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._ephemeral_key import EphemeralKey from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -50,7 +50,7 @@ def delete( EphemeralKey, self._requestor.request( "delete", - "/v1/ephemeral_keys/{key}".format(key=_util.sanitize_id(key)), + "/v1/ephemeral_keys/{key}".format(key=sanitize_id(key)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_event_service.py b/stripe/_event_service.py index b016d9b20..fdf30b619 100644 --- a/stripe/_event_service.py +++ b/stripe/_event_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._event import Event from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -98,7 +98,7 @@ def retrieve( Event, self._requestor.request( "get", - "/v1/events/{id}".format(id=_util.sanitize_id(id)), + "/v1/events/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_exchange_rate_service.py b/stripe/_exchange_rate_service.py index cb4120d9b..a4378d6aa 100644 --- a/stripe/_exchange_rate_service.py +++ b/stripe/_exchange_rate_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._exchange_rate import ExchangeRate from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -68,7 +68,7 @@ def retrieve( self._requestor.request( "get", "/v1/exchange_rates/{rate_id}".format( - rate_id=_util.sanitize_id(rate_id), + rate_id=sanitize_id(rate_id), ), api_mode="V1", base_address="api", diff --git a/stripe/_file.py b/stripe/_file.py index 9be5619da..37af1bbcd 100644 --- a/stripe/_file.py +++ b/stripe/_file.py @@ -195,7 +195,7 @@ def create(cls, **params: Unpack["File.CreateParams"]) -> "File": cls._static_request( "post", cls.class_url(), - params, + params=params, base_address="files", api_mode="V1FILES", ), diff --git a/stripe/_file_link.py b/stripe/_file_link.py index ef83b0f87..d4bb91f91 100644 --- a/stripe/_file_link.py +++ b/stripe/_file_link.py @@ -6,6 +6,7 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, @@ -14,7 +15,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._file import File @@ -163,7 +163,7 @@ def create(cls, **params: Unpack["FileLink.CreateParams"]) -> "FileLink": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -195,10 +195,14 @@ def modify( """ Updates an existing file link object. Expired links can no longer be updated. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "FileLink", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_file_link_service.py b/stripe/_file_link_service.py index 442c6c7ab..e83134337 100644 --- a/stripe/_file_link_service.py +++ b/stripe/_file_link_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._file_link import FileLink from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -146,7 +146,7 @@ def retrieve( FileLink, self._requestor.request( "get", - "/v1/file_links/{link}".format(link=_util.sanitize_id(link)), + "/v1/file_links/{link}".format(link=sanitize_id(link)), api_mode="V1", base_address="api", params=params, @@ -167,7 +167,7 @@ def update( FileLink, self._requestor.request( "post", - "/v1/file_links/{link}".format(link=_util.sanitize_id(link)), + "/v1/file_links/{link}".format(link=sanitize_id(link)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_file_service.py b/stripe/_file_service.py index fa1a3ad6b..e59b71686 100644 --- a/stripe/_file_service.py +++ b/stripe/_file_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._file import File from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Any, Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -155,7 +155,7 @@ def retrieve( File, self._requestor.request( "get", - "/v1/files/{file}".format(file=_util.sanitize_id(file)), + "/v1/files/{file}".format(file=sanitize_id(file)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 7f0980a9d..044327f09 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField @@ -11,7 +10,7 @@ from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ( ClassVar, Dict, @@ -29,7 +28,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._account import Account @@ -3738,7 +3736,7 @@ def create(cls, **params: Unpack["Invoice.CreateParams"]) -> "Invoice": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -3749,10 +3747,14 @@ def _cls_delete( """ 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://stripe.com/docs/api#void_invoice). """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Invoice", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -3797,7 +3799,7 @@ def _cls_finalize_invoice( cls._static_request( "post", "/v1/invoices/{invoice}/finalize".format( - invoice=_util.sanitize_id(invoice) + invoice=sanitize_id(invoice) ), params=params, ), @@ -3834,7 +3836,7 @@ def finalize_invoice( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/finalize".format( - invoice=_util.sanitize_id(self.get("id")) + invoice=sanitize_id(self.get("id")) ), params=params, ), @@ -3873,7 +3875,7 @@ def _cls_mark_uncollectible( cls._static_request( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( - invoice=_util.sanitize_id(invoice) + invoice=sanitize_id(invoice) ), params=params, ), @@ -3910,7 +3912,7 @@ def mark_uncollectible( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( - invoice=_util.sanitize_id(self.get("id")) + invoice=sanitize_id(self.get("id")) ), params=params, ), @@ -3928,10 +3930,14 @@ def modify( sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass auto_advance=false. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Invoice", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -3946,7 +3952,7 @@ def _cls_pay( cls._static_request( "post", "/v1/invoices/{invoice}/pay".format( - invoice=_util.sanitize_id(invoice) + invoice=sanitize_id(invoice) ), params=params, ), @@ -3979,7 +3985,7 @@ def pay( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/pay".format( - invoice=_util.sanitize_id(self.get("id")) + invoice=sanitize_id(self.get("id")) ), params=params, ), @@ -4010,7 +4016,7 @@ def _cls_send_invoice( cls._static_request( "post", "/v1/invoices/{invoice}/send".format( - invoice=_util.sanitize_id(invoice) + invoice=sanitize_id(invoice) ), params=params, ), @@ -4053,7 +4059,7 @@ def send_invoice( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/send".format( - invoice=_util.sanitize_id(self.get("id")) + invoice=sanitize_id(self.get("id")) ), params=params, ), @@ -4105,7 +4111,7 @@ def _cls_void_invoice( cls._static_request( "post", "/v1/invoices/{invoice}/void".format( - invoice=_util.sanitize_id(invoice) + invoice=sanitize_id(invoice) ), params=params, ), @@ -4142,7 +4148,7 @@ def void_invoice( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/void".format( - invoice=_util.sanitize_id(self.get("id")) + invoice=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index d1a2a0756..e5368dd08 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -8,7 +8,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -17,7 +17,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._customer import Customer @@ -462,7 +461,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -473,10 +472,14 @@ def _cls_delete( """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "InvoiceItem", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -539,10 +542,14 @@ def modify( """ Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "InvoiceItem", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_invoice_item_service.py b/stripe/_invoice_item_service.py index 7448e37fa..51fb3376f 100644 --- a/stripe/_invoice_item_service.py +++ b/stripe/_invoice_item_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._invoice_item import InvoiceItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -318,7 +318,7 @@ def delete( self._requestor.request( "delete", "/v1/invoiceitems/{invoiceitem}".format( - invoiceitem=_util.sanitize_id(invoiceitem), + invoiceitem=sanitize_id(invoiceitem), ), api_mode="V1", base_address="api", @@ -341,7 +341,7 @@ def retrieve( self._requestor.request( "get", "/v1/invoiceitems/{invoiceitem}".format( - invoiceitem=_util.sanitize_id(invoiceitem), + invoiceitem=sanitize_id(invoiceitem), ), api_mode="V1", base_address="api", @@ -364,7 +364,7 @@ def update( self._requestor.request( "post", "/v1/invoiceitems/{invoiceitem}".format( - invoiceitem=_util.sanitize_id(invoiceitem), + invoiceitem=sanitize_id(invoiceitem), ), api_mode="V1", base_address="api", diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index 6a58e23e7..1c0333993 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._invoice_line_item import InvoiceLineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -42,7 +42,7 @@ def list( self._requestor.request( "get", "/v1/invoices/{invoice}/lines".format( - invoice=_util.sanitize_id(invoice), + invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 21aa70ddf..b5b454899 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._invoice import Invoice from stripe._invoice_line_item_service import InvoiceLineItemService from stripe._invoice_upcoming_lines_service import InvoiceUpcomingLinesService @@ -8,6 +7,7 @@ from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -1905,9 +1905,7 @@ def delete( Invoice, self._requestor.request( "delete", - "/v1/invoices/{invoice}".format( - invoice=_util.sanitize_id(invoice), - ), + "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), api_mode="V1", base_address="api", params=params, @@ -1928,9 +1926,7 @@ def retrieve( Invoice, self._requestor.request( "get", - "/v1/invoices/{invoice}".format( - invoice=_util.sanitize_id(invoice), - ), + "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), api_mode="V1", base_address="api", params=params, @@ -1956,9 +1952,7 @@ def update( Invoice, self._requestor.request( "post", - "/v1/invoices/{invoice}".format( - invoice=_util.sanitize_id(invoice), - ), + "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), api_mode="V1", base_address="api", params=params, @@ -2067,7 +2061,7 @@ def finalize_invoice( self._requestor.request( "post", "/v1/invoices/{invoice}/finalize".format( - invoice=_util.sanitize_id(invoice), + invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", @@ -2090,7 +2084,7 @@ def mark_uncollectible( self._requestor.request( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( - invoice=_util.sanitize_id(invoice), + invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", @@ -2113,7 +2107,7 @@ def pay( self._requestor.request( "post", "/v1/invoices/{invoice}/pay".format( - invoice=_util.sanitize_id(invoice), + invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", @@ -2138,7 +2132,7 @@ def send_invoice( self._requestor.request( "post", "/v1/invoices/{invoice}/send".format( - invoice=_util.sanitize_id(invoice), + invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", @@ -2161,7 +2155,7 @@ def void_invoice( self._requestor.request( "post", "/v1/invoices/{invoice}/void".format( - invoice=_util.sanitize_id(invoice), + invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", diff --git a/stripe/_mandate_service.py b/stripe/_mandate_service.py index d78cf5b88..2d77a1626 100644 --- a/stripe/_mandate_service.py +++ b/stripe/_mandate_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._mandate import Mandate from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -28,9 +28,7 @@ def retrieve( Mandate, self._requestor.request( "get", - "/v1/mandates/{mandate}".format( - mandate=_util.sanitize_id(mandate), - ), + "/v1/mandates/{mandate}".format(mandate=sanitize_id(mandate)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index e95d184eb..66cd2b673 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -10,7 +9,7 @@ from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ( Any, ClassVar, @@ -29,7 +28,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._account import Account @@ -7685,7 +7683,7 @@ def _cls_apply_customer_balance( cls._static_request( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( - intent=_util.sanitize_id(intent) + intent=sanitize_id(intent) ), params=params, ), @@ -7723,7 +7721,7 @@ def apply_customer_balance( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( - intent=_util.sanitize_id(self.get("id")) + intent=sanitize_id(self.get("id")) ), params=params, ), @@ -7745,7 +7743,7 @@ def _cls_cancel( cls._static_request( "post", "/v1/payment_intents/{intent}/cancel".format( - intent=_util.sanitize_id(intent) + intent=sanitize_id(intent) ), params=params, ), @@ -7794,7 +7792,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_intents/{intent}/cancel".format( - intent=_util.sanitize_id(self.get("id")) + intent=sanitize_id(self.get("id")) ), params=params, ), @@ -7816,7 +7814,7 @@ def _cls_capture( cls._static_request( "post", "/v1/payment_intents/{intent}/capture".format( - intent=_util.sanitize_id(intent) + intent=sanitize_id(intent) ), params=params, ), @@ -7865,7 +7863,7 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_intents/{intent}/capture".format( - intent=_util.sanitize_id(self.get("id")) + intent=sanitize_id(self.get("id")) ), params=params, ), @@ -7905,7 +7903,7 @@ def _cls_confirm( cls._static_request( "post", "/v1/payment_intents/{intent}/confirm".format( - intent=_util.sanitize_id(intent) + intent=sanitize_id(intent) ), params=params, ), @@ -8008,7 +8006,7 @@ def confirm( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_intents/{intent}/confirm".format( - intent=_util.sanitize_id(self.get("id")) + intent=sanitize_id(self.get("id")) ), params=params, ), @@ -8035,7 +8033,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -8076,7 +8074,7 @@ def _cls_increment_authorization( cls._static_request( "post", "/v1/payment_intents/{intent}/increment_authorization".format( - intent=_util.sanitize_id(intent) + intent=sanitize_id(intent) ), params=params, ), @@ -8183,7 +8181,7 @@ def increment_authorization( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_intents/{intent}/increment_authorization".format( - intent=_util.sanitize_id(self.get("id")) + intent=sanitize_id(self.get("id")) ), params=params, ), @@ -8223,10 +8221,14 @@ def modify( update and confirm at the same time, we recommend updating properties through the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentIntent", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -8258,7 +8260,7 @@ def _cls_verify_microdeposits( cls._static_request( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( - intent=_util.sanitize_id(intent) + intent=sanitize_id(intent) ), params=params, ), @@ -8296,7 +8298,7 @@ def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( - intent=_util.sanitize_id(self.get("id")) + intent=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 89b833cea..d51a928e3 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._payment_intent import PaymentIntent from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -5850,7 +5850,7 @@ def retrieve( self._requestor.request( "get", "/v1/payment_intents/{intent}".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent), ), api_mode="V1", base_address="api", @@ -5879,7 +5879,7 @@ def update( self._requestor.request( "post", "/v1/payment_intents/{intent}".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent), ), api_mode="V1", base_address="api", @@ -5925,7 +5925,7 @@ def apply_customer_balance( self._requestor.request( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent), ), api_mode="V1", base_address="api", @@ -5952,7 +5952,7 @@ def cancel( self._requestor.request( "post", "/v1/payment_intents/{intent}/cancel".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent), ), api_mode="V1", base_address="api", @@ -5979,7 +5979,7 @@ def capture( self._requestor.request( "post", "/v1/payment_intents/{intent}/capture".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent), ), api_mode="V1", base_address="api", @@ -6024,7 +6024,7 @@ def confirm( self._requestor.request( "post", "/v1/payment_intents/{intent}/confirm".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent), ), api_mode="V1", base_address="api", @@ -6070,7 +6070,7 @@ def increment_authorization( self._requestor.request( "post", "/v1/payment_intents/{intent}/increment_authorization".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent), ), api_mode="V1", base_address="api", @@ -6093,7 +6093,7 @@ def verify_microdeposits( self._requestor.request( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent), ), api_mode="V1", base_address="api", diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 35c77b8dd..16d2d3c4a 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -8,7 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -17,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._account import Account @@ -2437,7 +2435,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -2476,7 +2474,7 @@ def _cls_list_line_items( cls._static_request( "get", "/v1/payment_links/{payment_link}/line_items".format( - payment_link=_util.sanitize_id(payment_link) + payment_link=sanitize_id(payment_link) ), params=params, ), @@ -2513,7 +2511,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/payment_links/{payment_link}/line_items".format( - payment_link=_util.sanitize_id(self.get("id")) + payment_link=sanitize_id(self.get("id")) ), params=params, ), @@ -2526,10 +2524,14 @@ def modify( """ Updates a payment link. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentLink", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_payment_link_line_item_service.py b/stripe/_payment_link_line_item_service.py index 2173dbe23..c6692f46e 100644 --- a/stripe/_payment_link_line_item_service.py +++ b/stripe/_payment_link_line_item_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._line_item import LineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -42,7 +42,7 @@ def list( self._requestor.request( "get", "/v1/payment_links/{payment_link}/line_items".format( - payment_link=_util.sanitize_id(payment_link), + payment_link=sanitize_id(payment_link), ), api_mode="V1", base_address="api", diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index c176cbe38..f77c89f9f 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._payment_link import PaymentLink from stripe._payment_link_line_item_service import PaymentLinkLineItemService from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -1674,7 +1674,7 @@ def retrieve( self._requestor.request( "get", "/v1/payment_links/{payment_link}".format( - payment_link=_util.sanitize_id(payment_link), + payment_link=sanitize_id(payment_link), ), api_mode="V1", base_address="api", @@ -1697,7 +1697,7 @@ def update( self._requestor.request( "post", "/v1/payment_links/{payment_link}".format( - payment_link=_util.sanitize_id(payment_link), + payment_link=sanitize_id(payment_link), ), api_mode="V1", base_address="api", diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 54d9cfc07..416cb573c 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -8,7 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -17,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._charge import Charge @@ -1713,7 +1711,7 @@ def _cls_attach( cls._static_request( "post", "/v1/payment_methods/{payment_method}/attach".format( - payment_method=_util.sanitize_id(payment_method) + payment_method=sanitize_id(payment_method) ), params=params, ), @@ -1786,7 +1784,7 @@ def attach( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_methods/{payment_method}/attach".format( - payment_method=_util.sanitize_id(self.get("id")) + payment_method=sanitize_id(self.get("id")) ), params=params, ), @@ -1806,7 +1804,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -1824,7 +1822,7 @@ def _cls_detach( cls._static_request( "post", "/v1/payment_methods/{payment_method}/detach".format( - payment_method=_util.sanitize_id(payment_method) + payment_method=sanitize_id(payment_method) ), params=params, ), @@ -1861,7 +1859,7 @@ def detach( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_methods/{payment_method}/detach".format( - payment_method=_util.sanitize_id(self.get("id")) + payment_method=sanitize_id(self.get("id")) ), params=params, ), @@ -1895,10 +1893,14 @@ def modify( """ Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentMethod", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 72f0226b0..97f6ac5ee 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -6,9 +6,9 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack -from urllib.parse import quote_plus class PaymentMethodConfiguration( @@ -2343,7 +2343,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -2377,10 +2377,14 @@ def modify( """ Update payment method configuration """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentMethodConfiguration", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index 29e3c585c..5f8db1dda 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._payment_method_configuration import PaymentMethodConfiguration from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -1476,7 +1476,7 @@ def retrieve( self._requestor.request( "get", "/v1/payment_method_configurations/{configuration}".format( - configuration=_util.sanitize_id(configuration), + configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", @@ -1499,7 +1499,7 @@ def update( self._requestor.request( "post", "/v1/payment_method_configurations/{configuration}".format( - configuration=_util.sanitize_id(configuration), + configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", diff --git a/stripe/_payment_method_domain.py b/stripe/_payment_method_domain.py index 558dc295e..bce5ac13b 100644 --- a/stripe/_payment_method_domain.py +++ b/stripe/_payment_method_domain.py @@ -1,16 +1,14 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, Unpack -from urllib.parse import quote_plus class PaymentMethodDomain( @@ -212,7 +210,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -244,10 +242,14 @@ def modify( """ Updates an existing payment method domain. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentMethodDomain", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -280,9 +282,7 @@ def _cls_validate( cls._static_request( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( - payment_method_domain=_util.sanitize_id( - payment_method_domain - ) + payment_method_domain=sanitize_id(payment_method_domain) ), params=params, ), @@ -335,7 +335,7 @@ def validate( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( - payment_method_domain=_util.sanitize_id(self.get("id")) + payment_method_domain=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/_payment_method_domain_service.py b/stripe/_payment_method_domain_service.py index 41c9bc5e5..85fa56b3a 100644 --- a/stripe/_payment_method_domain_service.py +++ b/stripe/_payment_method_domain_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._payment_method_domain import PaymentMethodDomain from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -126,9 +126,7 @@ def retrieve( self._requestor.request( "get", "/v1/payment_method_domains/{payment_method_domain}".format( - payment_method_domain=_util.sanitize_id( - payment_method_domain - ), + payment_method_domain=sanitize_id(payment_method_domain), ), api_mode="V1", base_address="api", @@ -151,9 +149,7 @@ def update( self._requestor.request( "post", "/v1/payment_method_domains/{payment_method_domain}".format( - payment_method_domain=_util.sanitize_id( - payment_method_domain - ), + payment_method_domain=sanitize_id(payment_method_domain), ), api_mode="V1", base_address="api", @@ -181,9 +177,7 @@ def validate( self._requestor.request( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( - payment_method_domain=_util.sanitize_id( - payment_method_domain - ), + payment_method_domain=sanitize_id(payment_method_domain), ), api_mode="V1", base_address="api", diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index d10c92fa1..e6c8cfaf5 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._payment_method import PaymentMethod from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -678,7 +678,7 @@ def retrieve( self._requestor.request( "get", "/v1/payment_methods/{payment_method}".format( - payment_method=_util.sanitize_id(payment_method), + payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", @@ -701,7 +701,7 @@ def update( self._requestor.request( "post", "/v1/payment_methods/{payment_method}".format( - payment_method=_util.sanitize_id(payment_method), + payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", @@ -736,7 +736,7 @@ def attach( self._requestor.request( "post", "/v1/payment_methods/{payment_method}/attach".format( - payment_method=_util.sanitize_id(payment_method), + payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", @@ -759,7 +759,7 @@ def detach( self._requestor.request( "post", "/v1/payment_methods/{payment_method}/detach".format( - payment_method=_util.sanitize_id(payment_method), + payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", diff --git a/stripe/_payout.py b/stripe/_payout.py index 9843e1406..5aa5ec72d 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import ( Literal, @@ -16,7 +15,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction @@ -285,7 +283,7 @@ def _cls_cancel( cls._static_request( "post", "/v1/payouts/{payout}/cancel".format( - payout=_util.sanitize_id(payout) + payout=sanitize_id(payout) ), params=params, ), @@ -320,7 +318,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payouts/{payout}/cancel".format( - payout=_util.sanitize_id(self.get("id")) + payout=sanitize_id(self.get("id")) ), params=params, ), @@ -340,7 +338,7 @@ def create(cls, **params: Unpack["Payout.CreateParams"]) -> "Payout": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -372,10 +370,14 @@ def modify( """ Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Payout", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -403,7 +405,7 @@ def _cls_reverse( cls._static_request( "post", "/v1/payouts/{payout}/reverse".format( - payout=_util.sanitize_id(payout) + payout=sanitize_id(payout) ), params=params, ), @@ -444,7 +446,7 @@ def reverse( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payouts/{payout}/reverse".format( - payout=_util.sanitize_id(self.get("id")) + payout=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/_payout_service.py b/stripe/_payout_service.py index a263f93de..27155c0cb 100644 --- a/stripe/_payout_service.py +++ b/stripe/_payout_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._payout import Payout from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -201,9 +201,7 @@ def retrieve( Payout, self._requestor.request( "get", - "/v1/payouts/{payout}".format( - payout=_util.sanitize_id(payout) - ), + "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), api_mode="V1", base_address="api", params=params, @@ -224,9 +222,7 @@ def update( Payout, self._requestor.request( "post", - "/v1/payouts/{payout}".format( - payout=_util.sanitize_id(payout) - ), + "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), api_mode="V1", base_address="api", params=params, @@ -248,7 +244,7 @@ def cancel( self._requestor.request( "post", "/v1/payouts/{payout}/cancel".format( - payout=_util.sanitize_id(payout), + payout=sanitize_id(payout), ), api_mode="V1", base_address="api", @@ -273,7 +269,7 @@ def reverse( self._requestor.request( "post", "/v1/payouts/{payout}/reverse".format( - payout=_util.sanitize_id(payout), + payout=sanitize_id(payout), ), api_mode="V1", base_address="api", diff --git a/stripe/_person.py b/stripe/_person.py index cc16e1353..20c234088 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -4,9 +4,9 @@ from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional from typing_extensions import Literal, TYPE_CHECKING -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._file import File @@ -651,8 +651,8 @@ def instance_url(self): account = self.account base = stripe.Account.class_url() assert account is not None - acct_extn = quote_plus(account) - extn = quote_plus(token) + acct_extn = sanitize_id(account) + extn = sanitize_id(token) return "%s/%s/persons/%s" % (base, acct_extn, extn) @classmethod diff --git a/stripe/_plan.py b/stripe/_plan.py index bcee1427e..0fcfd06c0 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -8,7 +8,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import ( Literal, @@ -17,7 +17,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._product import Product @@ -391,7 +390,7 @@ def create(cls, **params: Unpack["Plan.CreateParams"]) -> "Plan": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -402,10 +401,14 @@ def _cls_delete( """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Plan", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -460,10 +463,14 @@ def modify(cls, id: str, **params: Unpack["Plan.ModifyParams"]) -> "Plan": """ Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Plan", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_plan_service.py b/stripe/_plan_service.py index 9873ad1c6..d71f1a06f 100644 --- a/stripe/_plan_service.py +++ b/stripe/_plan_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._plan import Plan from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -243,7 +243,7 @@ def delete( Plan, self._requestor.request( "delete", - "/v1/plans/{plan}".format(plan=_util.sanitize_id(plan)), + "/v1/plans/{plan}".format(plan=sanitize_id(plan)), api_mode="V1", base_address="api", params=params, @@ -264,7 +264,7 @@ def retrieve( Plan, self._requestor.request( "get", - "/v1/plans/{plan}".format(plan=_util.sanitize_id(plan)), + "/v1/plans/{plan}".format(plan=sanitize_id(plan)), api_mode="V1", base_address="api", params=params, @@ -285,7 +285,7 @@ def update( Plan, self._requestor.request( "post", - "/v1/plans/{plan}".format(plan=_util.sanitize_id(plan)), + "/v1/plans/{plan}".format(plan=sanitize_id(plan)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_price.py b/stripe/_price.py index 272b79131..96f1c4404 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -9,6 +9,7 @@ from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, Dict, Iterator, List, Optional, Union, cast from typing_extensions import ( Literal, @@ -17,7 +18,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._product import Product @@ -729,7 +729,7 @@ def create(cls, **params: Unpack["Price.CreateParams"]) -> "Price": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -759,10 +759,14 @@ def modify( """ Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Price", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_price_service.py b/stripe/_price_service.py index 2748d1c46..8dec76bc3 100644 --- a/stripe/_price_service.py +++ b/stripe/_price_service.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._price import Price from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -526,7 +526,7 @@ def retrieve( Price, self._requestor.request( "get", - "/v1/prices/{price}".format(price=_util.sanitize_id(price)), + "/v1/prices/{price}".format(price=sanitize_id(price)), api_mode="V1", base_address="api", params=params, @@ -547,7 +547,7 @@ def update( Price, self._requestor.request( "post", - "/v1/prices/{price}".format(price=_util.sanitize_id(price)), + "/v1/prices/{price}".format(price=sanitize_id(price)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_product.py b/stripe/_product.py index 66554a456..240d230bf 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -10,7 +10,7 @@ from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ( ClassVar, Dict, @@ -28,7 +28,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._price import Price @@ -549,7 +548,7 @@ def create(cls, **params: Unpack["Product.CreateParams"]) -> "Product": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -560,10 +559,14 @@ def _cls_delete( """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Product", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -624,10 +627,14 @@ def modify( """ Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Product", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_product_service.py b/stripe/_product_service.py index c21a2fc84..f80e2e097 100644 --- a/stripe/_product_service.py +++ b/stripe/_product_service.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._product import Product from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -409,7 +409,7 @@ def delete( Product, self._requestor.request( "delete", - "/v1/products/{id}".format(id=_util.sanitize_id(id)), + "/v1/products/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, @@ -430,7 +430,7 @@ def retrieve( Product, self._requestor.request( "get", - "/v1/products/{id}".format(id=_util.sanitize_id(id)), + "/v1/products/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, @@ -451,7 +451,7 @@ def update( Product, self._requestor.request( "post", - "/v1/products/{id}".format(id=_util.sanitize_id(id)), + "/v1/products/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_promotion_code.py b/stripe/_promotion_code.py index 0d96e0329..0bc39564e 100644 --- a/stripe/_promotion_code.py +++ b/stripe/_promotion_code.py @@ -7,6 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, @@ -15,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._coupon import Coupon @@ -282,7 +282,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -314,10 +314,14 @@ def modify( """ Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PromotionCode", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_promotion_code_service.py b/stripe/_promotion_code_service.py index 2c96e7d7f..0955be866 100644 --- a/stripe/_promotion_code_service.py +++ b/stripe/_promotion_code_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._promotion_code import PromotionCode from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -226,7 +226,7 @@ def retrieve( self._requestor.request( "get", "/v1/promotion_codes/{promotion_code}".format( - promotion_code=_util.sanitize_id(promotion_code), + promotion_code=sanitize_id(promotion_code), ), api_mode="V1", base_address="api", @@ -249,7 +249,7 @@ def update( self._requestor.request( "post", "/v1/promotion_codes/{promotion_code}".format( - promotion_code=_util.sanitize_id(promotion_code), + promotion_code=sanitize_id(promotion_code), ), api_mode="V1", base_address="api", diff --git a/stripe/_quote.py b/stripe/_quote.py index 2bdf32861..1ba645fc1 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -8,7 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import Any, ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -17,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._account import Account @@ -1115,9 +1113,7 @@ def _cls_accept( "Quote", cls._static_request( "post", - "/v1/quotes/{quote}/accept".format( - quote=_util.sanitize_id(quote) - ), + "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), params=params, ), ) @@ -1149,7 +1145,7 @@ def accept( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/quotes/{quote}/accept".format( - quote=_util.sanitize_id(self.get("id")) + quote=sanitize_id(self.get("id")) ), params=params, ), @@ -1166,9 +1162,7 @@ def _cls_cancel( "Quote", cls._static_request( "post", - "/v1/quotes/{quote}/cancel".format( - quote=_util.sanitize_id(quote) - ), + "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), params=params, ), ) @@ -1200,7 +1194,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/quotes/{quote}/cancel".format( - quote=_util.sanitize_id(self.get("id")) + quote=sanitize_id(self.get("id")) ), params=params, ), @@ -1216,7 +1210,7 @@ def create(cls, **params: Unpack["Quote.CreateParams"]) -> "Quote": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -1231,9 +1225,7 @@ def _cls_finalize_quote( "Quote", cls._static_request( "post", - "/v1/quotes/{quote}/finalize".format( - quote=_util.sanitize_id(quote) - ), + "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), params=params, ), ) @@ -1269,7 +1261,7 @@ def finalize_quote( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/quotes/{quote}/finalize".format( - quote=_util.sanitize_id(self.get("id")) + quote=sanitize_id(self.get("id")) ), params=params, ), @@ -1308,7 +1300,7 @@ def _cls_list_computed_upfront_line_items( cls._static_request( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( - quote=_util.sanitize_id(quote) + quote=sanitize_id(quote) ), params=params, ), @@ -1346,7 +1338,7 @@ def list_computed_upfront_line_items( # pyright: ignore[reportGeneralTypeIssues self._request( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( - quote=_util.sanitize_id(self.get("id")) + quote=sanitize_id(self.get("id")) ), params=params, ), @@ -1364,7 +1356,7 @@ def _cls_list_line_items( cls._static_request( "get", "/v1/quotes/{quote}/line_items".format( - quote=_util.sanitize_id(quote) + quote=sanitize_id(quote) ), params=params, ), @@ -1401,7 +1393,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/quotes/{quote}/line_items".format( - quote=_util.sanitize_id(self.get("id")) + quote=sanitize_id(self.get("id")) ), params=params, ), @@ -1414,10 +1406,14 @@ def modify( """ A quote models prices and services for a customer. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Quote", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -1429,9 +1425,7 @@ def _cls_pdf(cls, quote: str, **params: Unpack["Quote.PdfParams"]) -> Any: Any, cls._static_request_stream( "get", - "/v1/quotes/{quote}/pdf".format( - quote=_util.sanitize_id(quote) - ), + "/v1/quotes/{quote}/pdf".format(quote=sanitize_id(quote)), params=params, base_address="files", ), @@ -1464,7 +1458,7 @@ def pdf( # pyright: ignore[reportGeneralTypeIssues] self._request_stream( "get", "/v1/quotes/{quote}/pdf".format( - quote=_util.sanitize_id(self.get("id")) + quote=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/_quote_computed_upfront_line_items_service.py b/stripe/_quote_computed_upfront_line_items_service.py index 1aa0487c6..edac48208 100644 --- a/stripe/_quote_computed_upfront_line_items_service.py +++ b/stripe/_quote_computed_upfront_line_items_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._line_item import LineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -42,7 +42,7 @@ def list( self._requestor.request( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( - quote=_util.sanitize_id(quote), + quote=sanitize_id(quote), ), api_mode="V1", base_address="api", diff --git a/stripe/_quote_line_item_service.py b/stripe/_quote_line_item_service.py index dd3d61de6..5ea172d9f 100644 --- a/stripe/_quote_line_item_service.py +++ b/stripe/_quote_line_item_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._line_item import LineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -42,7 +42,7 @@ def list( self._requestor.request( "get", "/v1/quotes/{quote}/line_items".format( - quote=_util.sanitize_id(quote), + quote=sanitize_id(quote), ), api_mode="V1", base_address="api", diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 0584404c6..0fadc0faf 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._quote import Quote from stripe._quote_computed_upfront_line_items_service import ( @@ -9,6 +8,7 @@ from stripe._quote_line_item_service import QuoteLineItemService from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Any, Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -618,7 +618,7 @@ def retrieve( Quote, self._requestor.request( "get", - "/v1/quotes/{quote}".format(quote=_util.sanitize_id(quote)), + "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, @@ -639,7 +639,7 @@ def update( Quote, self._requestor.request( "post", - "/v1/quotes/{quote}".format(quote=_util.sanitize_id(quote)), + "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, @@ -660,9 +660,7 @@ def accept( Quote, self._requestor.request( "post", - "/v1/quotes/{quote}/accept".format( - quote=_util.sanitize_id(quote), - ), + "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, @@ -683,9 +681,7 @@ def cancel( Quote, self._requestor.request( "post", - "/v1/quotes/{quote}/cancel".format( - quote=_util.sanitize_id(quote), - ), + "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, @@ -706,9 +702,7 @@ def finalize_quote( Quote, self._requestor.request( "post", - "/v1/quotes/{quote}/finalize".format( - quote=_util.sanitize_id(quote), - ), + "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, @@ -729,9 +723,7 @@ def pdf( Any, self._requestor.request_stream( "get", - "/v1/quotes/{quote}/pdf".format( - quote=_util.sanitize_id(quote) - ), + "/v1/quotes/{quote}/pdf".format(quote=sanitize_id(quote)), api_mode="V1", base_address="files", params=params, diff --git a/stripe/_refund.py b/stripe/_refund.py index df4aa7510..a96b1fe16 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -9,10 +8,9 @@ from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, Type, Unpack, TYPE_CHECKING -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction @@ -481,7 +479,7 @@ def _cls_cancel( cls._static_request( "post", "/v1/refunds/{refund}/cancel".format( - refund=_util.sanitize_id(refund) + refund=sanitize_id(refund) ), params=params, ), @@ -522,7 +520,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/refunds/{refund}/cancel".format( - refund=_util.sanitize_id(self.get("id")) + refund=sanitize_id(self.get("id")) ), params=params, ), @@ -548,7 +546,7 @@ def create(cls, **params: Unpack["Refund.CreateParams"]) -> "Refund": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -582,10 +580,14 @@ def modify( This request only accepts metadata as an argument. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Refund", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -614,7 +616,7 @@ def _cls_expire( cls._static_request( "post", "/v1/test_helpers/refunds/{refund}/expire".format( - refund=_util.sanitize_id(refund) + refund=sanitize_id(refund) ), params=params, ), @@ -649,7 +651,7 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/refunds/{refund}/expire".format( - refund=_util.sanitize_id(self.resource.get("id")) + refund=sanitize_id(self.resource.get("id")) ), params=params, ), diff --git a/stripe/_refund_service.py b/stripe/_refund_service.py index 9f74d74e1..20efee43e 100644 --- a/stripe/_refund_service.py +++ b/stripe/_refund_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._refund import Refund from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -191,9 +191,7 @@ def retrieve( Refund, self._requestor.request( "get", - "/v1/refunds/{refund}".format( - refund=_util.sanitize_id(refund) - ), + "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), api_mode="V1", base_address="api", params=params, @@ -216,9 +214,7 @@ def update( Refund, self._requestor.request( "post", - "/v1/refunds/{refund}".format( - refund=_util.sanitize_id(refund) - ), + "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), api_mode="V1", base_address="api", params=params, @@ -242,7 +238,7 @@ def cancel( self._requestor.request( "post", "/v1/refunds/{refund}/cancel".format( - refund=_util.sanitize_id(refund), + refund=sanitize_id(refund), ), api_mode="V1", base_address="api", diff --git a/stripe/_reversal.py b/stripe/_reversal.py index 5193235e4..3d8258ef4 100644 --- a/stripe/_reversal.py +++ b/stripe/_reversal.py @@ -3,9 +3,9 @@ from stripe._expandable_field import ExpandableField from stripe._transfer import Transfer from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, Dict, Optional from typing_extensions import Literal, TYPE_CHECKING -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction @@ -77,8 +77,8 @@ def instance_url(self): if isinstance(transfer, Transfer): transfer = transfer.id base = Transfer.class_url() - cust_extn = quote_plus(transfer) - extn = quote_plus(token) + cust_extn = sanitize_id(transfer) + extn = sanitize_id(token) return "%s/%s/reversals/%s" % (base, cust_extn, extn) @classmethod diff --git a/stripe/_review.py b/stripe/_review.py index e7983b2fa..3a55c51a5 100644 --- a/stripe/_review.py +++ b/stripe/_review.py @@ -1,12 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -193,7 +192,7 @@ def _cls_approve( cls._static_request( "post", "/v1/reviews/{review}/approve".format( - review=_util.sanitize_id(review) + review=sanitize_id(review) ), params=params, ), @@ -228,7 +227,7 @@ def approve( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/reviews/{review}/approve".format( - review=_util.sanitize_id(self.get("id")) + review=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/_review_service.py b/stripe/_review_service.py index 532e2c531..cbe1df15b 100644 --- a/stripe/_review_service.py +++ b/stripe/_review_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._review import Review from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -92,9 +92,7 @@ def retrieve( Review, self._requestor.request( "get", - "/v1/reviews/{review}".format( - review=_util.sanitize_id(review) - ), + "/v1/reviews/{review}".format(review=sanitize_id(review)), api_mode="V1", base_address="api", params=params, @@ -116,7 +114,7 @@ def approve( self._requestor.request( "post", "/v1/reviews/{review}/approve".format( - review=_util.sanitize_id(review), + review=sanitize_id(review), ), api_mode="V1", base_address="api", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index c1c4b3e6b..7584595e4 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -8,7 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import Any, ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import ( Literal, @@ -17,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._account import Account @@ -3481,7 +3479,7 @@ def _cls_cancel( cls._static_request( "post", "/v1/setup_intents/{intent}/cancel".format( - intent=_util.sanitize_id(intent) + intent=sanitize_id(intent) ), params=params, ), @@ -3524,7 +3522,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/setup_intents/{intent}/cancel".format( - intent=_util.sanitize_id(self.get("id")) + intent=sanitize_id(self.get("id")) ), params=params, ), @@ -3555,7 +3553,7 @@ def _cls_confirm( cls._static_request( "post", "/v1/setup_intents/{intent}/confirm".format( - intent=_util.sanitize_id(intent) + intent=sanitize_id(intent) ), params=params, ), @@ -3631,7 +3629,7 @@ def confirm( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/setup_intents/{intent}/confirm".format( - intent=_util.sanitize_id(self.get("id")) + intent=sanitize_id(self.get("id")) ), params=params, ), @@ -3652,7 +3650,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -3684,10 +3682,14 @@ def modify( """ Updates a SetupIntent object. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "SetupIntent", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -3719,7 +3721,7 @@ def _cls_verify_microdeposits( cls._static_request( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( - intent=_util.sanitize_id(intent) + intent=sanitize_id(intent) ), params=params, ), @@ -3756,7 +3758,7 @@ def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( - intent=_util.sanitize_id(self.get("id")) + intent=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index ff5762aec..066284096 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._setup_intent import SetupIntent from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -2908,7 +2908,7 @@ def retrieve( self._requestor.request( "get", "/v1/setup_intents/{intent}".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent) ), api_mode="V1", base_address="api", @@ -2931,7 +2931,7 @@ def update( self._requestor.request( "post", "/v1/setup_intents/{intent}".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent) ), api_mode="V1", base_address="api", @@ -2956,7 +2956,7 @@ def cancel( self._requestor.request( "post", "/v1/setup_intents/{intent}/cancel".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent), ), api_mode="V1", base_address="api", @@ -2992,7 +2992,7 @@ def confirm( self._requestor.request( "post", "/v1/setup_intents/{intent}/confirm".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent), ), api_mode="V1", base_address="api", @@ -3015,7 +3015,7 @@ def verify_microdeposits( self._requestor.request( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( - intent=_util.sanitize_id(intent), + intent=sanitize_id(intent), ), api_mode="V1", base_address="api", diff --git a/stripe/_shipping_rate.py b/stripe/_shipping_rate.py index d70367f08..a647e9610 100644 --- a/stripe/_shipping_rate.py +++ b/stripe/_shipping_rate.py @@ -7,6 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, @@ -15,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._tax_code import TaxCode @@ -346,7 +346,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -378,10 +378,14 @@ def modify( """ Updates an existing shipping rate object. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "ShippingRate", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_shipping_rate_service.py b/stripe/_shipping_rate_service.py index 564a21f82..3dd68e006 100644 --- a/stripe/_shipping_rate_service.py +++ b/stripe/_shipping_rate_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._shipping_rate import ShippingRate from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -266,7 +266,7 @@ def retrieve( self._requestor.request( "get", "/v1/shipping_rates/{shipping_rate_token}".format( - shipping_rate_token=_util.sanitize_id(shipping_rate_token), + shipping_rate_token=sanitize_id(shipping_rate_token), ), api_mode="V1", base_address="api", @@ -289,7 +289,7 @@ def update( self._requestor.request( "post", "/v1/shipping_rates/{shipping_rate_token}".format( - shipping_rate_token=_util.sanitize_id(shipping_rate_token), + shipping_rate_token=sanitize_id(shipping_rate_token), ), api_mode="V1", base_address="api", diff --git a/stripe/_source.py b/stripe/_source.py index ccc5a9b3e..58a49d5aa 100644 --- a/stripe/_source.py +++ b/stripe/_source.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._customer import Customer from stripe._error import InvalidRequestError @@ -8,7 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -17,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._source_transaction import SourceTransaction @@ -1121,7 +1119,7 @@ def create(cls, **params: Unpack["Source.CreateParams"]) -> "Source": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -1139,7 +1137,7 @@ def _cls_list_source_transactions( cls._static_request( "get", "/v1/sources/{source}/source_transactions".format( - source=_util.sanitize_id(source) + source=sanitize_id(source) ), params=params, ), @@ -1176,7 +1174,7 @@ def list_source_transactions( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/sources/{source}/source_transactions".format( - source=_util.sanitize_id(self.get("id")) + source=sanitize_id(self.get("id")) ), params=params, ), @@ -1191,10 +1189,14 @@ def modify( This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Source", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -1220,7 +1222,7 @@ def _cls_verify( cls._static_request( "post", "/v1/sources/{source}/verify".format( - source=_util.sanitize_id(source) + source=sanitize_id(source) ), params=params, ), @@ -1255,7 +1257,7 @@ def verify( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/sources/{source}/verify".format( - source=_util.sanitize_id(self.get("id")) + source=sanitize_id(self.get("id")) ), params=params, ), @@ -1265,10 +1267,10 @@ def detach(self, **params) -> "Source": token = self.id if hasattr(self, "customer") and self.customer: - extn = quote_plus(token) + extn = sanitize_id(token) customer = self.customer base = Customer.class_url() - owner_extn = quote_plus(customer) + owner_extn = sanitize_id(customer) url = "%s/%s/sources/%s" % (base, owner_extn, extn) self._request_and_refresh("delete", url, params) diff --git a/stripe/_source_service.py b/stripe/_source_service.py index 20975352f..047fc395f 100644 --- a/stripe/_source_service.py +++ b/stripe/_source_service.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._account import Account from stripe._bank_account import BankAccount from stripe._card import Card @@ -8,6 +7,7 @@ from stripe._source import Source from stripe._source_transaction_service import SourceTransactionService from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -548,8 +548,8 @@ def detach( self._requestor.request( "delete", "/v1/customers/{customer}/sources/{id}".format( - customer=_util.sanitize_id(customer), - id=_util.sanitize_id(id), + customer=sanitize_id(customer), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -571,9 +571,7 @@ def retrieve( Source, self._requestor.request( "get", - "/v1/sources/{source}".format( - source=_util.sanitize_id(source) - ), + "/v1/sources/{source}".format(source=sanitize_id(source)), api_mode="V1", base_address="api", params=params, @@ -596,9 +594,7 @@ def update( Source, self._requestor.request( "post", - "/v1/sources/{source}".format( - source=_util.sanitize_id(source) - ), + "/v1/sources/{source}".format(source=sanitize_id(source)), api_mode="V1", base_address="api", params=params, @@ -640,7 +636,7 @@ def verify( self._requestor.request( "post", "/v1/sources/{source}/verify".format( - source=_util.sanitize_id(source), + source=sanitize_id(source), ), api_mode="V1", base_address="api", diff --git a/stripe/_source_transaction_service.py b/stripe/_source_transaction_service.py index 1d7feb0e9..64488900b 100644 --- a/stripe/_source_transaction_service.py +++ b/stripe/_source_transaction_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._source_transaction import SourceTransaction from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -42,7 +42,7 @@ def list( self._requestor.request( "get", "/v1/sources/{source}/source_transactions".format( - source=_util.sanitize_id(source), + source=sanitize_id(source), ), api_mode="V1", base_address="api", diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 5ca8cd0ed..62ed5acf7 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField @@ -11,7 +10,7 @@ from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ( ClassVar, Dict, @@ -29,7 +28,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._account import Account @@ -1984,7 +1982,7 @@ def _cls_cancel( cls._static_request( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( - subscription_exposed_id=_util.sanitize_id( + subscription_exposed_id=sanitize_id( subscription_exposed_id ) ), @@ -2036,7 +2034,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( - subscription_exposed_id=_util.sanitize_id(self.get("id")) + subscription_exposed_id=sanitize_id(self.get("id")) ), params=params, ), @@ -2060,7 +2058,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -2078,7 +2076,7 @@ def _cls_delete_discount( cls._static_request( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( - subscription_exposed_id=_util.sanitize_id( + subscription_exposed_id=sanitize_id( subscription_exposed_id ) ), @@ -2118,7 +2116,7 @@ def delete_discount( # pyright: ignore[reportGeneralTypeIssues] self._request( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( - subscription_exposed_id=_util.sanitize_id(self.get("id")) + subscription_exposed_id=sanitize_id(self.get("id")) ), params=params, ), @@ -2172,10 +2170,14 @@ def modify( Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing](https://stripe.com/docs/rate-limits) instead. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Subscription", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -2190,7 +2192,7 @@ def _cls_resume( cls._static_request( "post", "/v1/subscriptions/{subscription}/resume".format( - subscription=_util.sanitize_id(subscription) + subscription=sanitize_id(subscription) ), params=params, ), @@ -2227,7 +2229,7 @@ def resume( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/subscriptions/{subscription}/resume".format( - subscription=_util.sanitize_id(self.get("id")) + subscription=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index e5ed7b97b..2b2e64ce4 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._list_object import ListObject @@ -9,7 +8,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -18,7 +17,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._plan import Plan @@ -410,7 +408,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -421,10 +419,14 @@ def _cls_delete( """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "SubscriptionItem", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -487,10 +489,14 @@ def modify( """ Updates the plan or quantity of an item on a current subscription. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "SubscriptionItem", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -524,7 +530,7 @@ def create_usage_record( cls._static_request( "post", "/v1/subscription_items/{subscription_item}/usage_records".format( - subscription_item=_util.sanitize_id(subscription_item) + subscription_item=sanitize_id(subscription_item) ), params=params, ), @@ -546,7 +552,7 @@ def list_usage_record_summaries( cls._static_request( "get", "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( - subscription_item=_util.sanitize_id(subscription_item) + subscription_item=sanitize_id(subscription_item) ), params=params, ), diff --git a/stripe/_subscription_item_service.py b/stripe/_subscription_item_service.py index 658ef686b..40cc68456 100644 --- a/stripe/_subscription_item_service.py +++ b/stripe/_subscription_item_service.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService @@ -11,6 +10,7 @@ from stripe._subscription_item_usage_record_summary_service import ( SubscriptionItemUsageRecordSummaryService, ) +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -300,9 +300,7 @@ def delete( SubscriptionItem, self._requestor.request( "delete", - "/v1/subscription_items/{item}".format( - item=_util.sanitize_id(item), - ), + "/v1/subscription_items/{item}".format(item=sanitize_id(item)), api_mode="V1", base_address="api", params=params, @@ -323,9 +321,7 @@ def retrieve( SubscriptionItem, self._requestor.request( "get", - "/v1/subscription_items/{item}".format( - item=_util.sanitize_id(item), - ), + "/v1/subscription_items/{item}".format(item=sanitize_id(item)), api_mode="V1", base_address="api", params=params, @@ -346,9 +342,7 @@ def update( SubscriptionItem, self._requestor.request( "post", - "/v1/subscription_items/{item}".format( - item=_util.sanitize_id(item), - ), + "/v1/subscription_items/{item}".format(item=sanitize_id(item)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_subscription_item_usage_record_service.py b/stripe/_subscription_item_usage_record_service.py index 3be9526a7..d7a803099 100644 --- a/stripe/_subscription_item_usage_record_service.py +++ b/stripe/_subscription_item_usage_record_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._usage_record import UsageRecord +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -47,7 +47,7 @@ def create( self._requestor.request( "post", "/v1/subscription_items/{subscription_item}/usage_records".format( - subscription_item=_util.sanitize_id(subscription_item), + subscription_item=sanitize_id(subscription_item), ), api_mode="V1", base_address="api", diff --git a/stripe/_subscription_item_usage_record_summary_service.py b/stripe/_subscription_item_usage_record_summary_service.py index 48412782c..986e17277 100644 --- a/stripe/_subscription_item_usage_record_summary_service.py +++ b/stripe/_subscription_item_usage_record_summary_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._usage_record_summary import UsageRecordSummary +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -44,7 +44,7 @@ def list( self._requestor.request( "get", "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( - subscription_item=_util.sanitize_id(subscription_item), + subscription_item=sanitize_id(subscription_item), ), api_mode="V1", base_address="api", diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index b0fc2d178..103216c64 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -8,7 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -17,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._account import Account @@ -1482,7 +1480,7 @@ def _cls_cancel( cls._static_request( "post", "/v1/subscription_schedules/{schedule}/cancel".format( - schedule=_util.sanitize_id(schedule) + schedule=sanitize_id(schedule) ), params=params, ), @@ -1519,7 +1517,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/subscription_schedules/{schedule}/cancel".format( - schedule=_util.sanitize_id(self.get("id")) + schedule=sanitize_id(self.get("id")) ), params=params, ), @@ -1537,7 +1535,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -1569,10 +1567,14 @@ def modify( """ Updates an existing subscription schedule. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "SubscriptionSchedule", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -1589,7 +1591,7 @@ def _cls_release( cls._static_request( "post", "/v1/subscription_schedules/{schedule}/release".format( - schedule=_util.sanitize_id(schedule) + schedule=sanitize_id(schedule) ), params=params, ), @@ -1626,7 +1628,7 @@ def release( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/subscription_schedules/{schedule}/release".format( - schedule=_util.sanitize_id(self.get("id")) + schedule=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index 72abf3dd5..fd3150325 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._subscription_schedule import SubscriptionSchedule +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -1106,7 +1106,7 @@ def retrieve( self._requestor.request( "get", "/v1/subscription_schedules/{schedule}".format( - schedule=_util.sanitize_id(schedule), + schedule=sanitize_id(schedule), ), api_mode="V1", base_address="api", @@ -1129,7 +1129,7 @@ def update( self._requestor.request( "post", "/v1/subscription_schedules/{schedule}".format( - schedule=_util.sanitize_id(schedule), + schedule=sanitize_id(schedule), ), api_mode="V1", base_address="api", @@ -1152,7 +1152,7 @@ def cancel( self._requestor.request( "post", "/v1/subscription_schedules/{schedule}/cancel".format( - schedule=_util.sanitize_id(schedule), + schedule=sanitize_id(schedule), ), api_mode="V1", base_address="api", @@ -1175,7 +1175,7 @@ def release( self._requestor.request( "post", "/v1/subscription_schedules/{schedule}/release".format( - schedule=_util.sanitize_id(schedule), + schedule=sanitize_id(schedule), ), api_mode="V1", base_address="api", diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 3373f3988..25fa2c7a9 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._discount import Discount from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService from stripe._subscription import Subscription +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -1408,7 +1408,7 @@ def cancel( self._requestor.request( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( - subscription_exposed_id=_util.sanitize_id( + subscription_exposed_id=sanitize_id( subscription_exposed_id ), ), @@ -1433,7 +1433,7 @@ def retrieve( self._requestor.request( "get", "/v1/subscriptions/{subscription_exposed_id}".format( - subscription_exposed_id=_util.sanitize_id( + subscription_exposed_id=sanitize_id( subscription_exposed_id ), ), @@ -1478,7 +1478,7 @@ def update( self._requestor.request( "post", "/v1/subscriptions/{subscription_exposed_id}".format( - subscription_exposed_id=_util.sanitize_id( + subscription_exposed_id=sanitize_id( subscription_exposed_id ), ), @@ -1503,7 +1503,7 @@ def delete_discount( self._requestor.request( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( - subscription_exposed_id=_util.sanitize_id( + subscription_exposed_id=sanitize_id( subscription_exposed_id ), ), @@ -1597,7 +1597,7 @@ def resume( self._requestor.request( "post", "/v1/subscriptions/{subscription}/resume".format( - subscription=_util.sanitize_id(subscription), + subscription=sanitize_id(subscription), ), api_mode="V1", base_address="api", diff --git a/stripe/_tax_code_service.py b/stripe/_tax_code_service.py index a766dbfae..a17abd06b 100644 --- a/stripe/_tax_code_service.py +++ b/stripe/_tax_code_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._tax_code import TaxCode +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -67,7 +67,7 @@ def retrieve( TaxCode, self._requestor.request( "get", - "/v1/tax_codes/{id}".format(id=_util.sanitize_id(id)), + "/v1/tax_codes/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index bf8dcbcc8..aab908670 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -4,9 +4,9 @@ from stripe._customer import Customer from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject +from stripe._util import sanitize_id from typing import ClassVar, Optional from typing_extensions import Literal -from urllib.parse import quote_plus class TaxId(APIResource["TaxId"]): @@ -149,8 +149,8 @@ def instance_url(self): assert customer is not None if isinstance(customer, Customer): customer = customer.id - cust_extn = quote_plus(customer) - extn = quote_plus(token) + cust_extn = sanitize_id(customer) + extn = sanitize_id(token) return "%s/%s/tax_ids/%s" % (base, cust_extn, extn) @classmethod diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index 6e5e20d04..d12dd9dee 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -5,9 +5,9 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack -from urllib.parse import quote_plus class TaxRate( @@ -254,7 +254,7 @@ def create(cls, **params: Unpack["TaxRate.CreateParams"]) -> "TaxRate": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -286,10 +286,14 @@ def modify( """ Updates an existing tax rate. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "TaxRate", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_tax_rate_service.py b/stripe/_tax_rate_service.py index 14c5d795d..9ef8c6e3c 100644 --- a/stripe/_tax_rate_service.py +++ b/stripe/_tax_rate_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._tax_rate import TaxRate +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -206,7 +206,7 @@ def retrieve( self._requestor.request( "get", "/v1/tax_rates/{tax_rate}".format( - tax_rate=_util.sanitize_id(tax_rate), + tax_rate=sanitize_id(tax_rate), ), api_mode="V1", base_address="api", @@ -229,7 +229,7 @@ def update( self._requestor.request( "post", "/v1/tax_rates/{tax_rate}".format( - tax_rate=_util.sanitize_id(tax_rate), + tax_rate=sanitize_id(tax_rate), ), api_mode="V1", base_address="api", diff --git a/stripe/_token.py b/stripe/_token.py index f44317428..708b75ff1 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -1078,7 +1078,7 @@ def create(cls, **params: Unpack["Token.CreateParams"]) -> "Token": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 1712402a2..82daddf15 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._token import Token +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -1014,7 +1014,7 @@ def retrieve( Token, self._requestor.request( "get", - "/v1/tokens/{token}".format(token=_util.sanitize_id(token)), + "/v1/tokens/{token}".format(token=sanitize_id(token)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_topup.py b/stripe/_topup.py index 9bd03cda1..b9edd5280 100644 --- a/stripe/_topup.py +++ b/stripe/_topup.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -16,7 +15,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction @@ -242,9 +240,7 @@ def _cls_cancel( "Topup", cls._static_request( "post", - "/v1/topups/{topup}/cancel".format( - topup=_util.sanitize_id(topup) - ), + "/v1/topups/{topup}/cancel".format(topup=sanitize_id(topup)), params=params, ), ) @@ -276,7 +272,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/topups/{topup}/cancel".format( - topup=_util.sanitize_id(self.get("id")) + topup=sanitize_id(self.get("id")) ), params=params, ), @@ -292,7 +288,7 @@ def create(cls, **params: Unpack["Topup.CreateParams"]) -> "Topup": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -322,10 +318,14 @@ def modify( """ Updates the metadata of a top-up. Other top-up details are not editable by design. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Topup", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_topup_service.py b/stripe/_topup_service.py index 89d3969a4..3a38727f4 100644 --- a/stripe/_topup_service.py +++ b/stripe/_topup_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._topup import Topup +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -189,7 +189,7 @@ def retrieve( Topup, self._requestor.request( "get", - "/v1/topups/{topup}".format(topup=_util.sanitize_id(topup)), + "/v1/topups/{topup}".format(topup=sanitize_id(topup)), api_mode="V1", base_address="api", params=params, @@ -210,7 +210,7 @@ def update( Topup, self._requestor.request( "post", - "/v1/topups/{topup}".format(topup=_util.sanitize_id(topup)), + "/v1/topups/{topup}".format(topup=sanitize_id(topup)), api_mode="V1", base_address="api", params=params, @@ -231,9 +231,7 @@ def cancel( Topup, self._requestor.request( "post", - "/v1/topups/{topup}/cancel".format( - topup=_util.sanitize_id(topup), - ), + "/v1/topups/{topup}/cancel".format(topup=sanitize_id(topup)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/_transfer.py b/stripe/_transfer.py index a26cfebc4..f9d2b2b9d 100644 --- a/stripe/_transfer.py +++ b/stripe/_transfer.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -8,6 +7,7 @@ from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, @@ -16,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._account import Account @@ -284,7 +283,7 @@ def create(cls, **params: Unpack["Transfer.CreateParams"]) -> "Transfer": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -318,10 +317,14 @@ def modify( This request accepts only metadata as an argument. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Transfer", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -350,9 +353,7 @@ def create_reversal( "Reversal", cls._static_request( "post", - "/v1/transfers/{id}/reversals".format( - id=_util.sanitize_id(id) - ), + "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), params=params, ), ) @@ -372,8 +373,7 @@ def retrieve_reversal( cls._static_request( "get", "/v1/transfers/{transfer}/reversals/{id}".format( - transfer=_util.sanitize_id(transfer), - id=_util.sanitize_id(id), + transfer=sanitize_id(transfer), id=sanitize_id(id) ), params=params, ), @@ -396,8 +396,7 @@ def modify_reversal( cls._static_request( "post", "/v1/transfers/{transfer}/reversals/{id}".format( - transfer=_util.sanitize_id(transfer), - id=_util.sanitize_id(id), + transfer=sanitize_id(transfer), id=sanitize_id(id) ), params=params, ), @@ -414,9 +413,7 @@ def list_reversals( ListObject["Reversal"], cls._static_request( "get", - "/v1/transfers/{id}/reversals".format( - id=_util.sanitize_id(id) - ), + "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), params=params, ), ) diff --git a/stripe/_transfer_reversal_service.py b/stripe/_transfer_reversal_service.py index 5a91b5e08..dd753a247 100644 --- a/stripe/_transfer_reversal_service.py +++ b/stripe/_transfer_reversal_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._reversal import Reversal from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -79,9 +79,7 @@ def list( ListObject[Reversal], self._requestor.request( "get", - "/v1/transfers/{id}/reversals".format( - id=_util.sanitize_id(id) - ), + "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, @@ -106,9 +104,7 @@ def create( Reversal, self._requestor.request( "post", - "/v1/transfers/{id}/reversals".format( - id=_util.sanitize_id(id) - ), + "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, @@ -131,8 +127,8 @@ def retrieve( self._requestor.request( "get", "/v1/transfers/{transfer}/reversals/{id}".format( - transfer=_util.sanitize_id(transfer), - id=_util.sanitize_id(id), + transfer=sanitize_id(transfer), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -158,8 +154,8 @@ def update( self._requestor.request( "post", "/v1/transfers/{transfer}/reversals/{id}".format( - transfer=_util.sanitize_id(transfer), - id=_util.sanitize_id(id), + transfer=sanitize_id(transfer), + id=sanitize_id(id), ), api_mode="V1", base_address="api", diff --git a/stripe/_transfer_service.py b/stripe/_transfer_service.py index ba54721fd..fab260f77 100644 --- a/stripe/_transfer_service.py +++ b/stripe/_transfer_service.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._transfer import Transfer from stripe._transfer_reversal_service import TransferReversalService +from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -172,7 +172,7 @@ def retrieve( self._requestor.request( "get", "/v1/transfers/{transfer}".format( - transfer=_util.sanitize_id(transfer), + transfer=sanitize_id(transfer), ), api_mode="V1", base_address="api", @@ -197,7 +197,7 @@ def update( self._requestor.request( "post", "/v1/transfers/{transfer}".format( - transfer=_util.sanitize_id(transfer), + transfer=sanitize_id(transfer), ), api_mode="V1", base_address="api", diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index adc1ce8b1..38fd66280 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -6,10 +6,9 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, Unpack -from urllib.parse import quote_plus class WebhookEndpoint( @@ -419,7 +418,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -430,10 +429,14 @@ def _cls_delete( """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "WebhookEndpoint", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -496,10 +499,14 @@ def modify( """ Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "WebhookEndpoint", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index af47d5ea3..b4f3385fb 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe._webhook_endpoint import WebhookEndpoint from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -348,7 +348,7 @@ def delete( self._requestor.request( "delete", "/v1/webhook_endpoints/{webhook_endpoint}".format( - webhook_endpoint=_util.sanitize_id(webhook_endpoint), + webhook_endpoint=sanitize_id(webhook_endpoint), ), api_mode="V1", base_address="api", @@ -371,7 +371,7 @@ def retrieve( self._requestor.request( "get", "/v1/webhook_endpoints/{webhook_endpoint}".format( - webhook_endpoint=_util.sanitize_id(webhook_endpoint), + webhook_endpoint=sanitize_id(webhook_endpoint), ), api_mode="V1", base_address="api", @@ -394,7 +394,7 @@ def update( self._requestor.request( "post", "/v1/webhook_endpoints/{webhook_endpoint}".format( - webhook_endpoint=_util.sanitize_id(webhook_endpoint), + webhook_endpoint=sanitize_id(webhook_endpoint), ), api_mode="V1", base_address="api", diff --git a/stripe/apps/_secret.py b/stripe/apps/_secret.py index 871eb46e2..f10d8797a 100644 --- a/stripe/apps/_secret.py +++ b/stripe/apps/_secret.py @@ -190,7 +190,7 @@ def create(cls, **params: Unpack["Secret.CreateParams"]) -> "Secret": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index 8022455c3..29b445e75 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -7,6 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast from typing_extensions import ( Literal, @@ -15,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._application import Application @@ -655,7 +655,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -687,10 +687,14 @@ def modify( """ Updates a configuration that describes the functionality of the customer portal. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Configuration", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/billing_portal/_configuration_service.py b/stripe/billing_portal/_configuration_service.py index a7a68b4f0..14dbe75c1 100644 --- a/stripe/billing_portal/_configuration_service.py +++ b/stripe/billing_portal/_configuration_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.billing_portal._configuration import Configuration from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -483,7 +483,7 @@ def retrieve( self._requestor.request( "get", "/v1/billing_portal/configurations/{configuration}".format( - configuration=_util.sanitize_id(configuration), + configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", @@ -506,7 +506,7 @@ def update( self._requestor.request( "post", "/v1/billing_portal/configurations/{configuration}".format( - configuration=_util.sanitize_id(configuration), + configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index 8484c9092..001041d1d 100644 --- a/stripe/billing_portal/_session.py +++ b/stripe/billing_portal/_session.py @@ -452,7 +452,7 @@ def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 641935a7a..2a9dcd5fa 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -3712,7 +3711,7 @@ def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -3730,7 +3729,7 @@ def _cls_expire( cls._static_request( "post", "/v1/checkout/sessions/{session}/expire".format( - session=_util.sanitize_id(session) + session=sanitize_id(session) ), params=params, ), @@ -3771,7 +3770,7 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/checkout/sessions/{session}/expire".format( - session=_util.sanitize_id(self.get("id")) + session=sanitize_id(self.get("id")) ), params=params, ), @@ -3810,7 +3809,7 @@ def _cls_list_line_items( cls._static_request( "get", "/v1/checkout/sessions/{session}/line_items".format( - session=_util.sanitize_id(session) + session=sanitize_id(session) ), params=params, ), @@ -3847,7 +3846,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/checkout/sessions/{session}/line_items".format( - session=_util.sanitize_id(self.get("id")) + session=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/checkout/_session_line_item_service.py b/stripe/checkout/_session_line_item_service.py index a4dd80969..4c1cc635c 100644 --- a/stripe/checkout/_session_line_item_service.py +++ b/stripe/checkout/_session_line_item_service.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._line_item import LineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -42,7 +42,7 @@ def list( self._requestor.request( "get", "/v1/checkout/sessions/{session}/line_items".format( - session=_util.sanitize_id(session), + session=sanitize_id(session), ), api_mode="V1", base_address="api", diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 232c7890a..d004ebecd 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.checkout._session import Session from stripe.checkout._session_line_item_service import SessionLineItemService from typing import Dict, List, cast @@ -2083,7 +2083,7 @@ def retrieve( self._requestor.request( "get", "/v1/checkout/sessions/{session}".format( - session=_util.sanitize_id(session), + session=sanitize_id(session), ), api_mode="V1", base_address="api", @@ -2108,7 +2108,7 @@ def expire( self._requestor.request( "post", "/v1/checkout/sessions/{session}/expire".format( - session=_util.sanitize_id(session), + session=sanitize_id(session), ), api_mode="V1", base_address="api", diff --git a/stripe/climate/_order.py b/stripe/climate/_order.py index fb258f9bb..be7330d6b 100644 --- a/stripe/climate/_order.py +++ b/stripe/climate/_order.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -8,7 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import ( Literal, @@ -17,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe.climate._product import Product @@ -278,7 +276,7 @@ def _cls_cancel( cls._static_request( "post", "/v1/climate/orders/{order}/cancel".format( - order=_util.sanitize_id(order) + order=sanitize_id(order) ), params=params, ), @@ -320,7 +318,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/climate/orders/{order}/cancel".format( - order=_util.sanitize_id(self.get("id")) + order=sanitize_id(self.get("id")) ), params=params, ), @@ -337,7 +335,7 @@ def create(cls, **params: Unpack["Order.CreateParams"]) -> "Order": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -368,10 +366,14 @@ def modify( """ Updates the specified order by setting the values of the parameters passed. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Order", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/climate/_order_service.py b/stripe/climate/_order_service.py index bf8a9df7c..0158947f1 100644 --- a/stripe/climate/_order_service.py +++ b/stripe/climate/_order_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.climate._order import Order from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -151,9 +151,7 @@ def retrieve( Order, self._requestor.request( "get", - "/v1/climate/orders/{order}".format( - order=_util.sanitize_id(order), - ), + "/v1/climate/orders/{order}".format(order=sanitize_id(order)), api_mode="V1", base_address="api", params=params, @@ -174,9 +172,7 @@ def update( Order, self._requestor.request( "post", - "/v1/climate/orders/{order}".format( - order=_util.sanitize_id(order), - ), + "/v1/climate/orders/{order}".format(order=sanitize_id(order)), api_mode="V1", base_address="api", params=params, @@ -201,7 +197,7 @@ def cancel( self._requestor.request( "post", "/v1/climate/orders/{order}/cancel".format( - order=_util.sanitize_id(order), + order=sanitize_id(order), ), api_mode="V1", base_address="api", diff --git a/stripe/climate/_product_service.py b/stripe/climate/_product_service.py index a6489d1be..7d0f01ad5 100644 --- a/stripe/climate/_product_service.py +++ b/stripe/climate/_product_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.climate._product import Product from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -68,7 +68,7 @@ def retrieve( self._requestor.request( "get", "/v1/climate/products/{product}".format( - product=_util.sanitize_id(product), + product=sanitize_id(product), ), api_mode="V1", base_address="api", diff --git a/stripe/climate/_supplier_service.py b/stripe/climate/_supplier_service.py index 74782c343..7e7e7bebf 100644 --- a/stripe/climate/_supplier_service.py +++ b/stripe/climate/_supplier_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.climate._supplier import Supplier from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -68,7 +68,7 @@ def retrieve( self._requestor.request( "get", "/v1/climate/suppliers/{supplier}".format( - supplier=_util.sanitize_id(supplier), + supplier=sanitize_id(supplier), ), api_mode="V1", base_address="api", diff --git a/stripe/financial_connections/_account.py b/stripe/financial_connections/_account.py index b85080834..f376ccf24 100644 --- a/stripe/financial_connections/_account.py +++ b/stripe/financial_connections/_account.py @@ -1,12 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -344,7 +343,7 @@ def _cls_disconnect( cls._static_request( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), @@ -381,7 +380,7 @@ def disconnect( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( - account=_util.sanitize_id(self.get("id")) + account=sanitize_id(self.get("id")) ), params=params, ), @@ -420,7 +419,7 @@ def _cls_list_owners( cls._static_request( "get", "/v1/financial_connections/accounts/{account}/owners".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), @@ -457,7 +456,7 @@ def list_owners( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/financial_connections/accounts/{account}/owners".format( - account=_util.sanitize_id(self.get("id")) + account=sanitize_id(self.get("id")) ), params=params, ), @@ -475,7 +474,7 @@ def _cls_refresh_account( cls._static_request( "post", "/v1/financial_connections/accounts/{account}/refresh".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), @@ -512,7 +511,7 @@ def refresh_account( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/financial_connections/accounts/{account}/refresh".format( - account=_util.sanitize_id(self.get("id")) + account=sanitize_id(self.get("id")) ), params=params, ), @@ -541,7 +540,7 @@ def _cls_subscribe( cls._static_request( "post", "/v1/financial_connections/accounts/{account}/subscribe".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), @@ -578,7 +577,7 @@ def subscribe( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/financial_connections/accounts/{account}/subscribe".format( - account=_util.sanitize_id(self.get("id")) + account=sanitize_id(self.get("id")) ), params=params, ), @@ -596,7 +595,7 @@ def _cls_unsubscribe( cls._static_request( "post", "/v1/financial_connections/accounts/{account}/unsubscribe".format( - account=_util.sanitize_id(account) + account=sanitize_id(account) ), params=params, ), @@ -633,7 +632,7 @@ def unsubscribe( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/financial_connections/accounts/{account}/unsubscribe".format( - account=_util.sanitize_id(self.get("id")) + account=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/financial_connections/_account_owner_service.py b/stripe/financial_connections/_account_owner_service.py index 27f56d6ee..fea9754ff 100644 --- a/stripe/financial_connections/_account_owner_service.py +++ b/stripe/financial_connections/_account_owner_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.financial_connections._account_owner import AccountOwner from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -46,7 +46,7 @@ def list( self._requestor.request( "get", "/v1/financial_connections/accounts/{account}/owners".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", diff --git a/stripe/financial_connections/_account_service.py b/stripe/financial_connections/_account_service.py index 4760d4408..30fd83183 100644 --- a/stripe/financial_connections/_account_service.py +++ b/stripe/financial_connections/_account_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.financial_connections._account import Account from stripe.financial_connections._account_owner_service import ( AccountOwnerService, @@ -129,7 +129,7 @@ def retrieve( self._requestor.request( "get", "/v1/financial_connections/accounts/{account}".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", @@ -152,7 +152,7 @@ def disconnect( self._requestor.request( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", @@ -175,7 +175,7 @@ def refresh( self._requestor.request( "post", "/v1/financial_connections/accounts/{account}/refresh".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", @@ -198,7 +198,7 @@ def subscribe( self._requestor.request( "post", "/v1/financial_connections/accounts/{account}/subscribe".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", @@ -221,7 +221,7 @@ def unsubscribe( self._requestor.request( "post", "/v1/financial_connections/accounts/{account}/unsubscribe".format( - account=_util.sanitize_id(account), + account=sanitize_id(account), ), api_mode="V1", base_address="api", diff --git a/stripe/financial_connections/_session.py b/stripe/financial_connections/_session.py index 95945b396..90298725a 100644 --- a/stripe/financial_connections/_session.py +++ b/stripe/financial_connections/_session.py @@ -159,7 +159,7 @@ def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) diff --git a/stripe/financial_connections/_session_service.py b/stripe/financial_connections/_session_service.py index 2ef4b32b5..3df1947f7 100644 --- a/stripe/financial_connections/_session_service.py +++ b/stripe/financial_connections/_session_service.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.financial_connections._session import Session from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -81,7 +81,7 @@ def retrieve( self._requestor.request( "get", "/v1/financial_connections/sessions/{session}".format( - session=_util.sanitize_id(session), + session=sanitize_id(session), ), api_mode="V1", base_address="api", diff --git a/stripe/financial_connections/_transaction_service.py b/stripe/financial_connections/_transaction_service.py index 0e55f28b7..1ec5484b8 100644 --- a/stripe/financial_connections/_transaction_service.py +++ b/stripe/financial_connections/_transaction_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.financial_connections._transaction import Transaction from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -108,7 +108,7 @@ def retrieve( self._requestor.request( "get", "/v1/financial_connections/transactions/{transaction}".format( - transaction=_util.sanitize_id(transaction), + transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", diff --git a/stripe/identity/_verification_report_service.py b/stripe/identity/_verification_report_service.py index beae3abad..d658b4e20 100644 --- a/stripe/identity/_verification_report_service.py +++ b/stripe/identity/_verification_report_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.identity._verification_report import VerificationReport from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -95,7 +95,7 @@ def retrieve( self._requestor.request( "get", "/v1/identity/verification_reports/{report}".format( - report=_util.sanitize_id(report), + report=sanitize_id(report), ), api_mode="V1", base_address="api", diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 4f3643c33..d668cefb1 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -8,7 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -17,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe.identity._verification_report import VerificationReport @@ -403,7 +401,7 @@ def _cls_cancel( cls._static_request( "post", "/v1/identity/verification_sessions/{session}/cancel".format( - session=_util.sanitize_id(session) + session=sanitize_id(session) ), params=params, ), @@ -446,7 +444,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/identity/verification_sessions/{session}/cancel".format( - session=_util.sanitize_id(self.get("id")) + session=sanitize_id(self.get("id")) ), params=params, ), @@ -470,7 +468,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -505,10 +503,14 @@ def modify( When the session status is requires_input, you can use this method to update the verification check and options. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "VerificationSession", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -541,7 +543,7 @@ def _cls_redact( cls._static_request( "post", "/v1/identity/verification_sessions/{session}/redact".format( - session=_util.sanitize_id(session) + session=sanitize_id(session) ), params=params, ), @@ -632,7 +634,7 @@ def redact( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/identity/verification_sessions/{session}/redact".format( - session=_util.sanitize_id(self.get("id")) + session=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index a3973adfe..67aa7093b 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.identity._verification_session import VerificationSession from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -232,7 +232,7 @@ def retrieve( self._requestor.request( "get", "/v1/identity/verification_sessions/{session}".format( - session=_util.sanitize_id(session), + session=sanitize_id(session), ), api_mode="V1", base_address="api", @@ -258,7 +258,7 @@ def update( self._requestor.request( "post", "/v1/identity/verification_sessions/{session}".format( - session=_util.sanitize_id(session), + session=sanitize_id(session), ), api_mode="V1", base_address="api", @@ -283,7 +283,7 @@ def cancel( self._requestor.request( "post", "/v1/identity/verification_sessions/{session}/cancel".format( - session=_util.sanitize_id(session), + session=sanitize_id(session), ), api_mode="V1", base_address="api", @@ -324,7 +324,7 @@ def redact( self._requestor.request( "post", "/v1/identity/verification_sessions/{session}/redact".format( - session=_util.sanitize_id(session), + session=sanitize_id(session), ), api_mode="V1", base_address="api", diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index ecc775b73..09b794fef 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource @@ -8,7 +7,7 @@ from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -18,7 +17,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction @@ -825,7 +823,7 @@ def _cls_approve( cls._static_request( "post", "/v1/issuing/authorizations/{authorization}/approve".format( - authorization=_util.sanitize_id(authorization) + authorization=sanitize_id(authorization) ), params=params, ), @@ -865,7 +863,7 @@ def approve( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/issuing/authorizations/{authorization}/approve".format( - authorization=_util.sanitize_id(self.get("id")) + authorization=sanitize_id(self.get("id")) ), params=params, ), @@ -886,7 +884,7 @@ def _cls_decline( cls._static_request( "post", "/v1/issuing/authorizations/{authorization}/decline".format( - authorization=_util.sanitize_id(authorization) + authorization=sanitize_id(authorization) ), params=params, ), @@ -926,7 +924,7 @@ def decline( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/issuing/authorizations/{authorization}/decline".format( - authorization=_util.sanitize_id(self.get("id")) + authorization=sanitize_id(self.get("id")) ), params=params, ), @@ -960,10 +958,14 @@ def modify( """ Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Authorization", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -994,7 +996,7 @@ def _cls_capture( cls._static_request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( - authorization=_util.sanitize_id(authorization) + authorization=sanitize_id(authorization) ), params=params, ), @@ -1031,9 +1033,7 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( - authorization=_util.sanitize_id( - self.resource.get("id") - ) + authorization=sanitize_id(self.resource.get("id")) ), params=params, ), @@ -1069,7 +1069,7 @@ def _cls_expire( cls._static_request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( - authorization=_util.sanitize_id(authorization) + authorization=sanitize_id(authorization) ), params=params, ), @@ -1106,9 +1106,7 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( - authorization=_util.sanitize_id( - self.resource.get("id") - ) + authorization=sanitize_id(self.resource.get("id")) ), params=params, ), @@ -1128,7 +1126,7 @@ def _cls_increment( cls._static_request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( - authorization=_util.sanitize_id(authorization) + authorization=sanitize_id(authorization) ), params=params, ), @@ -1166,9 +1164,7 @@ def increment( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( - authorization=_util.sanitize_id( - self.resource.get("id") - ) + authorization=sanitize_id(self.resource.get("id")) ), params=params, ), @@ -1188,7 +1184,7 @@ def _cls_reverse( cls._static_request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( - authorization=_util.sanitize_id(authorization) + authorization=sanitize_id(authorization) ), params=params, ), @@ -1225,9 +1221,7 @@ def reverse( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( - authorization=_util.sanitize_id( - self.resource.get("id") - ) + authorization=sanitize_id(self.resource.get("id")) ), params=params, ), diff --git a/stripe/issuing/_authorization_service.py b/stripe/issuing/_authorization_service.py index e54268cb0..aa33b9e8d 100644 --- a/stripe/issuing/_authorization_service.py +++ b/stripe/issuing/_authorization_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.issuing._authorization import Authorization from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -136,7 +136,7 @@ def retrieve( self._requestor.request( "get", "/v1/issuing/authorizations/{authorization}".format( - authorization=_util.sanitize_id(authorization), + authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", @@ -159,7 +159,7 @@ def update( self._requestor.request( "post", "/v1/issuing/authorizations/{authorization}".format( - authorization=_util.sanitize_id(authorization), + authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", @@ -183,7 +183,7 @@ def approve( self._requestor.request( "post", "/v1/issuing/authorizations/{authorization}/approve".format( - authorization=_util.sanitize_id(authorization), + authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", @@ -207,7 +207,7 @@ def decline( self._requestor.request( "post", "/v1/issuing/authorizations/{authorization}/decline".format( - authorization=_util.sanitize_id(authorization), + authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index 8bea47699..24b6f118f 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -9,7 +8,7 @@ from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -19,7 +18,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe.issuing._cardholder import Cardholder @@ -1539,7 +1537,7 @@ def create(cls, **params: Unpack["Card.CreateParams"]) -> "Card": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -1567,10 +1565,14 @@ def modify(cls, id: str, **params: Unpack["Card.ModifyParams"]) -> "Card": """ Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Card", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -1599,7 +1601,7 @@ def _cls_deliver_card( cls._static_request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( - card=_util.sanitize_id(card) + card=sanitize_id(card) ), params=params, ), @@ -1636,7 +1638,7 @@ def deliver_card( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( - card=_util.sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource.get("id")) ), params=params, ), @@ -1654,7 +1656,7 @@ def _cls_fail_card( cls._static_request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( - card=_util.sanitize_id(card) + card=sanitize_id(card) ), params=params, ), @@ -1689,7 +1691,7 @@ def fail_card( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( - card=_util.sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource.get("id")) ), params=params, ), @@ -1707,7 +1709,7 @@ def _cls_return_card( cls._static_request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( - card=_util.sanitize_id(card) + card=sanitize_id(card) ), params=params, ), @@ -1744,7 +1746,7 @@ def return_card( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( - card=_util.sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource.get("id")) ), params=params, ), @@ -1762,7 +1764,7 @@ def _cls_ship_card( cls._static_request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( - card=_util.sanitize_id(card) + card=sanitize_id(card) ), params=params, ), @@ -1797,7 +1799,7 @@ def ship_card( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( - card=_util.sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource.get("id")) ), params=params, ), diff --git a/stripe/issuing/_card_service.py b/stripe/issuing/_card_service.py index 0fea78f60..6a1d6008a 100644 --- a/stripe/issuing/_card_service.py +++ b/stripe/issuing/_card_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.issuing._card import Card from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -370,9 +370,7 @@ def retrieve( Card, self._requestor.request( "get", - "/v1/issuing/cards/{card}".format( - card=_util.sanitize_id(card) - ), + "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), api_mode="V1", base_address="api", params=params, @@ -393,9 +391,7 @@ def update( Card, self._requestor.request( "post", - "/v1/issuing/cards/{card}".format( - card=_util.sanitize_id(card) - ), + "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/issuing/_cardholder.py b/stripe/issuing/_cardholder.py index 31050af9e..1811fa9b3 100644 --- a/stripe/issuing/_cardholder.py +++ b/stripe/issuing/_cardholder.py @@ -7,6 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, @@ -15,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._file import File @@ -1686,7 +1686,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -1718,10 +1718,14 @@ def modify( """ Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Cardholder", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/issuing/_cardholder_service.py b/stripe/issuing/_cardholder_service.py index 15bfc467c..b0ea428de 100644 --- a/stripe/issuing/_cardholder_service.py +++ b/stripe/issuing/_cardholder_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.issuing._cardholder import Cardholder from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -558,7 +558,7 @@ def retrieve( self._requestor.request( "get", "/v1/issuing/cardholders/{cardholder}".format( - cardholder=_util.sanitize_id(cardholder), + cardholder=sanitize_id(cardholder), ), api_mode="V1", base_address="api", @@ -581,7 +581,7 @@ def update( self._requestor.request( "post", "/v1/issuing/cardholders/{cardholder}".format( - cardholder=_util.sanitize_id(cardholder), + cardholder=sanitize_id(cardholder), ), api_mode="V1", base_address="api", diff --git a/stripe/issuing/_dispute.py b/stripe/issuing/_dispute.py index 7f322d5c2..e51c3acf1 100644 --- a/stripe/issuing/_dispute.py +++ b/stripe/issuing/_dispute.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -8,7 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -17,7 +16,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction @@ -864,7 +862,7 @@ def create(cls, **params: Unpack["Dispute.CreateParams"]) -> "Dispute": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -896,10 +894,14 @@ def modify( """ Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Dispute", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -925,7 +927,7 @@ def _cls_submit( cls._static_request( "post", "/v1/issuing/disputes/{dispute}/submit".format( - dispute=_util.sanitize_id(dispute) + dispute=sanitize_id(dispute) ), params=params, ), @@ -960,7 +962,7 @@ def submit( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/issuing/disputes/{dispute}/submit".format( - dispute=_util.sanitize_id(self.get("id")) + dispute=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/issuing/_dispute_service.py b/stripe/issuing/_dispute_service.py index ed1d2c528..79b4d039c 100644 --- a/stripe/issuing/_dispute_service.py +++ b/stripe/issuing/_dispute_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.issuing._dispute import Dispute from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -632,7 +632,7 @@ def retrieve( self._requestor.request( "get", "/v1/issuing/disputes/{dispute}".format( - dispute=_util.sanitize_id(dispute), + dispute=sanitize_id(dispute), ), api_mode="V1", base_address="api", @@ -655,7 +655,7 @@ def update( self._requestor.request( "post", "/v1/issuing/disputes/{dispute}".format( - dispute=_util.sanitize_id(dispute), + dispute=sanitize_id(dispute), ), api_mode="V1", base_address="api", @@ -678,7 +678,7 @@ def submit( self._requestor.request( "post", "/v1/issuing/disputes/{dispute}/submit".format( - dispute=_util.sanitize_id(dispute), + dispute=sanitize_id(dispute), ), api_mode="V1", base_address="api", diff --git a/stripe/issuing/_token.py b/stripe/issuing/_token.py index 2f1336ef9..5ec5c7c58 100644 --- a/stripe/issuing/_token.py +++ b/stripe/issuing/_token.py @@ -6,6 +6,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, List, Optional, cast from typing_extensions import ( Literal, @@ -14,7 +15,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe.issuing._card import Card @@ -332,10 +332,14 @@ def modify( """ Attempts to update the specified Issuing Token object to the status specified. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Token", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/issuing/_token_service.py b/stripe/issuing/_token_service.py index a5cab97a1..c5aeb8595 100644 --- a/stripe/issuing/_token_service.py +++ b/stripe/issuing/_token_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.issuing._token import Token from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -107,9 +107,7 @@ def retrieve( Token, self._requestor.request( "get", - "/v1/issuing/tokens/{token}".format( - token=_util.sanitize_id(token), - ), + "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), api_mode="V1", base_address="api", params=params, @@ -130,9 +128,7 @@ def update( Token, self._requestor.request( "post", - "/v1/issuing/tokens/{token}".format( - token=_util.sanitize_id(token), - ), + "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index 63d56944e..36bd97f4d 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource @@ -8,7 +7,7 @@ from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -18,7 +17,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction @@ -808,10 +806,14 @@ def modify( """ Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Transaction", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -872,7 +874,7 @@ def _cls_refund( cls._static_request( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( - transaction=_util.sanitize_id(transaction) + transaction=sanitize_id(transaction) ), params=params, ), @@ -909,7 +911,7 @@ def refund( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( - transaction=_util.sanitize_id(self.resource.get("id")) + transaction=sanitize_id(self.resource.get("id")) ), params=params, ), diff --git a/stripe/issuing/_transaction_service.py b/stripe/issuing/_transaction_service.py index 8f6b5bdf8..f5eb4faf3 100644 --- a/stripe/issuing/_transaction_service.py +++ b/stripe/issuing/_transaction_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.issuing._transaction import Transaction from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -112,7 +112,7 @@ def retrieve( self._requestor.request( "get", "/v1/issuing/transactions/{transaction}".format( - transaction=_util.sanitize_id(transaction), + transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", @@ -135,7 +135,7 @@ def update( self._requestor.request( "post", "/v1/issuing/transactions/{transaction}".format( - transaction=_util.sanitize_id(transaction), + transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", diff --git a/stripe/radar/_early_fraud_warning_service.py b/stripe/radar/_early_fraud_warning_service.py index 2d4a2b0f7..ef16aaba3 100644 --- a/stripe/radar/_early_fraud_warning_service.py +++ b/stripe/radar/_early_fraud_warning_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.radar._early_fraud_warning import EarlyFraudWarning from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -100,7 +100,7 @@ def retrieve( self._requestor.request( "get", "/v1/radar/early_fraud_warnings/{early_fraud_warning}".format( - early_fraud_warning=_util.sanitize_id(early_fraud_warning), + early_fraud_warning=sanitize_id(early_fraud_warning), ), api_mode="V1", base_address="api", diff --git a/stripe/radar/_value_list.py b/stripe/radar/_value_list.py index 3ffe09d27..50191d016 100644 --- a/stripe/radar/_value_list.py +++ b/stripe/radar/_value_list.py @@ -6,7 +6,7 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -15,7 +15,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe.radar._value_list_item import ValueListItem @@ -197,7 +196,7 @@ def create(cls, **params: Unpack["ValueList.CreateParams"]) -> "ValueList": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -208,10 +207,14 @@ def _cls_delete( """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "ValueList", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -274,10 +277,14 @@ def modify( """ Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "ValueList", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/radar/_value_list_item.py b/stripe/radar/_value_list_item.py index f27bdf021..bcc0a9f15 100644 --- a/stripe/radar/_value_list_item.py +++ b/stripe/radar/_value_list_item.py @@ -5,10 +5,9 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, TypedDict, Unpack -from urllib.parse import quote_plus class ValueListItem( @@ -139,7 +138,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -150,10 +149,14 @@ def _cls_delete( """ Deletes a ValueListItem object, removing it from its parent value list. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "ValueListItem", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload diff --git a/stripe/radar/_value_list_item_service.py b/stripe/radar/_value_list_item_service.py index 26138f75f..b5bed3216 100644 --- a/stripe/radar/_value_list_item_service.py +++ b/stripe/radar/_value_list_item_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.radar._value_list_item import ValueListItem from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -92,7 +92,7 @@ def delete( self._requestor.request( "delete", "/v1/radar/value_list_items/{item}".format( - item=_util.sanitize_id(item), + item=sanitize_id(item), ), api_mode="V1", base_address="api", @@ -115,7 +115,7 @@ def retrieve( self._requestor.request( "get", "/v1/radar/value_list_items/{item}".format( - item=_util.sanitize_id(item), + item=sanitize_id(item), ), api_mode="V1", base_address="api", diff --git a/stripe/radar/_value_list_service.py b/stripe/radar/_value_list_service.py index b801935e9..c4d404aca 100644 --- a/stripe/radar/_value_list_service.py +++ b/stripe/radar/_value_list_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.radar._value_list import ValueList from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -120,7 +120,7 @@ def delete( self._requestor.request( "delete", "/v1/radar/value_lists/{value_list}".format( - value_list=_util.sanitize_id(value_list), + value_list=sanitize_id(value_list), ), api_mode="V1", base_address="api", @@ -143,7 +143,7 @@ def retrieve( self._requestor.request( "get", "/v1/radar/value_lists/{value_list}".format( - value_list=_util.sanitize_id(value_list), + value_list=sanitize_id(value_list), ), api_mode="V1", base_address="api", @@ -166,7 +166,7 @@ def update( self._requestor.request( "post", "/v1/radar/value_lists/{value_list}".format( - value_list=_util.sanitize_id(value_list), + value_list=sanitize_id(value_list), ), api_mode="V1", base_address="api", diff --git a/stripe/reporting/_report_run.py b/stripe/reporting/_report_run.py index bfbfda3b6..2dba14623 100644 --- a/stripe/reporting/_report_run.py +++ b/stripe/reporting/_report_run.py @@ -219,7 +219,7 @@ def create(cls, **params: Unpack["ReportRun.CreateParams"]) -> "ReportRun": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) diff --git a/stripe/reporting/_report_run_service.py b/stripe/reporting/_report_run_service.py index 3cfeca801..cd3245287 100644 --- a/stripe/reporting/_report_run_service.py +++ b/stripe/reporting/_report_run_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.reporting._report_run import ReportRun from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -159,7 +159,7 @@ def retrieve( self._requestor.request( "get", "/v1/reporting/report_runs/{report_run}".format( - report_run=_util.sanitize_id(report_run), + report_run=sanitize_id(report_run), ), api_mode="V1", base_address="api", diff --git a/stripe/reporting/_report_type_service.py b/stripe/reporting/_report_type_service.py index 9446f45c5..a782fe10c 100644 --- a/stripe/reporting/_report_type_service.py +++ b/stripe/reporting/_report_type_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.reporting._report_type import ReportType from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -56,7 +56,7 @@ def retrieve( self._requestor.request( "get", "/v1/reporting/report_types/{report_type}".format( - report_type=_util.sanitize_id(report_type), + report_type=sanitize_id(report_type), ), api_mode="V1", base_address="api", diff --git a/stripe/sigma/_scheduled_query_run_service.py b/stripe/sigma/_scheduled_query_run_service.py index 787135111..4be381d54 100644 --- a/stripe/sigma/_scheduled_query_run_service.py +++ b/stripe/sigma/_scheduled_query_run_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.sigma._scheduled_query_run import ScheduledQueryRun from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -68,7 +68,7 @@ def retrieve( self._requestor.request( "get", "/v1/sigma/scheduled_query_runs/{scheduled_query_run}".format( - scheduled_query_run=_util.sanitize_id(scheduled_query_run), + scheduled_query_run=sanitize_id(scheduled_query_run), ), api_mode="V1", base_address="api", diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index ac403a2f1..beabc7810 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -1,11 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -632,7 +631,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -650,7 +649,7 @@ def _cls_list_line_items( cls._static_request( "get", "/v1/tax/calculations/{calculation}/line_items".format( - calculation=_util.sanitize_id(calculation) + calculation=sanitize_id(calculation) ), params=params, ), @@ -687,7 +686,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/tax/calculations/{calculation}/line_items".format( - calculation=_util.sanitize_id(self.get("id")) + calculation=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/tax/_calculation_line_item_service.py b/stripe/tax/_calculation_line_item_service.py index 343771849..fbc49d800 100644 --- a/stripe/tax/_calculation_line_item_service.py +++ b/stripe/tax/_calculation_line_item_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.tax._calculation_line_item import CalculationLineItem from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -42,7 +42,7 @@ def list( self._requestor.request( "get", "/v1/tax/calculations/{calculation}/line_items".format( - calculation=_util.sanitize_id(calculation), + calculation=sanitize_id(calculation), ), api_mode="V1", base_address="api", diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index 208303771..c2e29d3c5 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -6,9 +6,9 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack -from urllib.parse import quote_plus class Registration( @@ -1646,7 +1646,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -1680,10 +1680,14 @@ def modify( A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Registration", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index ff939d779..e1b443c85 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.tax._registration import Registration from typing import List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -993,7 +993,7 @@ def retrieve( Registration, self._requestor.request( "get", - "/v1/tax/registrations/{id}".format(id=_util.sanitize_id(id)), + "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, @@ -1016,7 +1016,7 @@ def update( Registration, self._requestor.request( "post", - "/v1/tax/registrations/{id}".format(id=_util.sanitize_id(id)), + "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/tax/_settings.py b/stripe/tax/_settings.py index 44dd51e83..f7d7316a2 100644 --- a/stripe/tax/_settings.py +++ b/stripe/tax/_settings.py @@ -166,7 +166,11 @@ def modify(cls, **params: Unpack["Settings.ModifyParams"]) -> "Settings": """ return cast( "Settings", - cls._static_request("post", cls.class_url(), params=params), + cls._static_request( + "post", + cls.class_url(), + params=params, + ), ) @classmethod diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index c69fa69ab..acd676bcc 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -1,11 +1,10 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._api_resource import APIResource from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -496,7 +495,7 @@ def _cls_list_line_items( cls._static_request( "get", "/v1/tax/transactions/{transaction}/line_items".format( - transaction=_util.sanitize_id(transaction) + transaction=sanitize_id(transaction) ), params=params, ), @@ -533,7 +532,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/tax/transactions/{transaction}/line_items".format( - transaction=_util.sanitize_id(self.get("id")) + transaction=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/tax/_transaction_line_item_service.py b/stripe/tax/_transaction_line_item_service.py index a46c80dbf..05a47fea4 100644 --- a/stripe/tax/_transaction_line_item_service.py +++ b/stripe/tax/_transaction_line_item_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.tax._transaction_line_item import TransactionLineItem from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -42,7 +42,7 @@ def list( self._requestor.request( "get", "/v1/tax/transactions/{transaction}/line_items".format( - transaction=_util.sanitize_id(transaction), + transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", diff --git a/stripe/tax/_transaction_service.py b/stripe/tax/_transaction_service.py index 5ff77712f..a87844f39 100644 --- a/stripe/tax/_transaction_service.py +++ b/stripe/tax/_transaction_service.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.tax._transaction import Transaction from stripe.tax._transaction_line_item_service import ( TransactionLineItemService, @@ -128,7 +128,7 @@ def retrieve( self._requestor.request( "get", "/v1/tax/transactions/{transaction}".format( - transaction=_util.sanitize_id(transaction), + transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index 0dd910bfd..8814af346 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -8,7 +8,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -17,7 +17,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._file import File @@ -943,7 +942,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -954,10 +953,14 @@ def _cls_delete( """ Deletes a Configuration object. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Configuration", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -1020,10 +1023,14 @@ def modify( """ Updates a new Configuration object. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Configuration", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index 6442333c7..2f05f18be 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.terminal._configuration import Configuration from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -659,7 +659,7 @@ def delete( self._requestor.request( "delete", "/v1/terminal/configurations/{configuration}".format( - configuration=_util.sanitize_id(configuration), + configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", @@ -682,7 +682,7 @@ def retrieve( self._requestor.request( "get", "/v1/terminal/configurations/{configuration}".format( - configuration=_util.sanitize_id(configuration), + configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", @@ -705,7 +705,7 @@ def update( self._requestor.request( "post", "/v1/terminal/configurations/{configuration}".format( - configuration=_util.sanitize_id(configuration), + configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", diff --git a/stripe/terminal/_connection_token.py b/stripe/terminal/_connection_token.py index c0bb03e48..d564a6088 100644 --- a/stripe/terminal/_connection_token.py +++ b/stripe/terminal/_connection_token.py @@ -52,6 +52,6 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) diff --git a/stripe/terminal/_location.py b/stripe/terminal/_location.py index 186a53632..bb72c5baa 100644 --- a/stripe/terminal/_location.py +++ b/stripe/terminal/_location.py @@ -7,10 +7,9 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, TypedDict, Unpack -from urllib.parse import quote_plus class Location( @@ -217,7 +216,7 @@ def create(cls, **params: Unpack["Location.CreateParams"]) -> "Location": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -228,10 +227,14 @@ def _cls_delete( """ Deletes a Location object. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Location", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -292,10 +295,14 @@ def modify( """ Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Location", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod diff --git a/stripe/terminal/_location_service.py b/stripe/terminal/_location_service.py index 2ca5e9af0..853ea8a88 100644 --- a/stripe/terminal/_location_service.py +++ b/stripe/terminal/_location_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.terminal._location import Location from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -147,7 +147,7 @@ def delete( self._requestor.request( "delete", "/v1/terminal/locations/{location}".format( - location=_util.sanitize_id(location), + location=sanitize_id(location), ), api_mode="V1", base_address="api", @@ -170,7 +170,7 @@ def retrieve( self._requestor.request( "get", "/v1/terminal/locations/{location}".format( - location=_util.sanitize_id(location), + location=sanitize_id(location), ), api_mode="V1", base_address="api", @@ -193,7 +193,7 @@ def update( self._requestor.request( "post", "/v1/terminal/locations/{location}".format( - location=_util.sanitize_id(location), + location=sanitize_id(location), ), api_mode="V1", base_address="api", diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index a79a524d4..b8a7fb359 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField @@ -10,7 +9,7 @@ from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -20,7 +19,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe._charge import Charge @@ -545,7 +543,7 @@ def _cls_cancel_action( cls._static_request( "post", "/v1/terminal/readers/{reader}/cancel_action".format( - reader=_util.sanitize_id(reader) + reader=sanitize_id(reader) ), params=params, ), @@ -582,7 +580,7 @@ def cancel_action( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/cancel_action".format( - reader=_util.sanitize_id(self.get("id")) + reader=sanitize_id(self.get("id")) ), params=params, ), @@ -598,7 +596,7 @@ def create(cls, **params: Unpack["Reader.CreateParams"]) -> "Reader": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -609,10 +607,14 @@ def _cls_delete( """ Deletes a Reader object. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Reader", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload @@ -671,10 +673,14 @@ def modify( """ Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Reader", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -689,7 +695,7 @@ def _cls_process_payment_intent( cls._static_request( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( - reader=_util.sanitize_id(reader) + reader=sanitize_id(reader) ), params=params, ), @@ -726,7 +732,7 @@ def process_payment_intent( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( - reader=_util.sanitize_id(self.get("id")) + reader=sanitize_id(self.get("id")) ), params=params, ), @@ -744,7 +750,7 @@ def _cls_process_setup_intent( cls._static_request( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( - reader=_util.sanitize_id(reader) + reader=sanitize_id(reader) ), params=params, ), @@ -781,7 +787,7 @@ def process_setup_intent( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( - reader=_util.sanitize_id(self.get("id")) + reader=sanitize_id(self.get("id")) ), params=params, ), @@ -799,7 +805,7 @@ def _cls_refund_payment( cls._static_request( "post", "/v1/terminal/readers/{reader}/refund_payment".format( - reader=_util.sanitize_id(reader) + reader=sanitize_id(reader) ), params=params, ), @@ -836,7 +842,7 @@ def refund_payment( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/refund_payment".format( - reader=_util.sanitize_id(self.get("id")) + reader=sanitize_id(self.get("id")) ), params=params, ), @@ -865,7 +871,7 @@ def _cls_set_reader_display( cls._static_request( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( - reader=_util.sanitize_id(reader) + reader=sanitize_id(reader) ), params=params, ), @@ -902,7 +908,7 @@ def set_reader_display( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( - reader=_util.sanitize_id(self.get("id")) + reader=sanitize_id(self.get("id")) ), params=params, ), @@ -925,7 +931,7 @@ def _cls_present_payment_method( cls._static_request( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( - reader=_util.sanitize_id(reader) + reader=sanitize_id(reader) ), params=params, ), @@ -962,7 +968,7 @@ def present_payment_method( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( - reader=_util.sanitize_id(self.resource.get("id")) + reader=sanitize_id(self.resource.get("id")) ), params=params, ), diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 17d937976..fa85ec670 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.terminal._reader import Reader from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -244,7 +244,7 @@ def delete( self._requestor.request( "delete", "/v1/terminal/readers/{reader}".format( - reader=_util.sanitize_id(reader), + reader=sanitize_id(reader), ), api_mode="V1", base_address="api", @@ -267,7 +267,7 @@ def retrieve( self._requestor.request( "get", "/v1/terminal/readers/{reader}".format( - reader=_util.sanitize_id(reader), + reader=sanitize_id(reader), ), api_mode="V1", base_address="api", @@ -290,7 +290,7 @@ def update( self._requestor.request( "post", "/v1/terminal/readers/{reader}".format( - reader=_util.sanitize_id(reader), + reader=sanitize_id(reader), ), api_mode="V1", base_address="api", @@ -353,7 +353,7 @@ def cancel_action( self._requestor.request( "post", "/v1/terminal/readers/{reader}/cancel_action".format( - reader=_util.sanitize_id(reader), + reader=sanitize_id(reader), ), api_mode="V1", base_address="api", @@ -376,7 +376,7 @@ def process_payment_intent( self._requestor.request( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( - reader=_util.sanitize_id(reader), + reader=sanitize_id(reader), ), api_mode="V1", base_address="api", @@ -399,7 +399,7 @@ def process_setup_intent( self._requestor.request( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( - reader=_util.sanitize_id(reader), + reader=sanitize_id(reader), ), api_mode="V1", base_address="api", @@ -422,7 +422,7 @@ def refund_payment( self._requestor.request( "post", "/v1/terminal/readers/{reader}/refund_payment".format( - reader=_util.sanitize_id(reader), + reader=sanitize_id(reader), ), api_mode="V1", base_address="api", @@ -445,7 +445,7 @@ def set_reader_display( self._requestor.request( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( - reader=_util.sanitize_id(reader), + reader=sanitize_id(reader), ), api_mode="V1", base_address="api", diff --git a/stripe/test_helpers/_customer_service.py b/stripe/test_helpers/_customer_service.py index fbf3e8e63..747890f0e 100644 --- a/stripe/test_helpers/_customer_service.py +++ b/stripe/test_helpers/_customer_service.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._customer_cash_balance_transaction import ( CustomerCashBalanceTransaction, ) from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -43,7 +43,7 @@ def fund_cash_balance( self._requestor.request( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( - customer=_util.sanitize_id(customer), + customer=sanitize_id(customer), ), api_mode="V1", base_address="api", diff --git a/stripe/test_helpers/_refund_service.py b/stripe/test_helpers/_refund_service.py index 50ec1e28a..0a7b92fc3 100644 --- a/stripe/test_helpers/_refund_service.py +++ b/stripe/test_helpers/_refund_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._refund import Refund from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -29,7 +29,7 @@ def expire( self._requestor.request( "post", "/v1/test_helpers/refunds/{refund}/expire".format( - refund=_util.sanitize_id(refund), + refund=sanitize_id(refund), ), api_mode="V1", base_address="api", diff --git a/stripe/test_helpers/_test_clock.py b/stripe/test_helpers/_test_clock.py index c53508517..d1dc4e9ce 100644 --- a/stripe/test_helpers/_test_clock.py +++ b/stripe/test_helpers/_test_clock.py @@ -1,15 +1,13 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, Unpack -from urllib.parse import quote_plus class TestClock( @@ -127,7 +125,7 @@ def _cls_advance( cls._static_request( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( - test_clock=_util.sanitize_id(test_clock) + test_clock=sanitize_id(test_clock) ), params=params, ), @@ -164,7 +162,7 @@ def advance( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( - test_clock=_util.sanitize_id(self.get("id")) + test_clock=sanitize_id(self.get("id")) ), params=params, ), @@ -180,7 +178,7 @@ def create(cls, **params: Unpack["TestClock.CreateParams"]) -> "TestClock": cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -191,10 +189,14 @@ def _cls_delete( """ Deletes a test clock. """ - url = "%s/%s" % (cls.class_url(), quote_plus(sid)) + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "TestClock", - cls._static_request("delete", url, params=params), + cls._static_request( + "delete", + url, + params=params, + ), ) @overload diff --git a/stripe/test_helpers/_test_clock_service.py b/stripe/test_helpers/_test_clock_service.py index 4cb4bc8a9..f0d7f460e 100644 --- a/stripe/test_helpers/_test_clock_service.py +++ b/stripe/test_helpers/_test_clock_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.test_helpers._test_clock import TestClock from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -75,7 +75,7 @@ def delete( self._requestor.request( "delete", "/v1/test_helpers/test_clocks/{test_clock}".format( - test_clock=_util.sanitize_id(test_clock), + test_clock=sanitize_id(test_clock), ), api_mode="V1", base_address="api", @@ -98,7 +98,7 @@ def retrieve( self._requestor.request( "get", "/v1/test_helpers/test_clocks/{test_clock}".format( - test_clock=_util.sanitize_id(test_clock), + test_clock=sanitize_id(test_clock), ), api_mode="V1", base_address="api", @@ -161,7 +161,7 @@ def advance( self._requestor.request( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( - test_clock=_util.sanitize_id(test_clock), + test_clock=sanitize_id(test_clock), ), api_mode="V1", base_address="api", diff --git a/stripe/test_helpers/issuing/_authorization_service.py b/stripe/test_helpers/issuing/_authorization_service.py index 4f8c7e5b4..8cfa65dd4 100644 --- a/stripe/test_helpers/issuing/_authorization_service.py +++ b/stripe/test_helpers/issuing/_authorization_service.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.issuing._authorization import Authorization from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -379,7 +379,7 @@ def capture( self._requestor.request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( - authorization=_util.sanitize_id(authorization), + authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", @@ -402,7 +402,7 @@ def expire( self._requestor.request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( - authorization=_util.sanitize_id(authorization), + authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", @@ -425,7 +425,7 @@ def increment( self._requestor.request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( - authorization=_util.sanitize_id(authorization), + authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", @@ -448,7 +448,7 @@ def reverse( self._requestor.request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( - authorization=_util.sanitize_id(authorization), + authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", diff --git a/stripe/test_helpers/issuing/_card_service.py b/stripe/test_helpers/issuing/_card_service.py index 60015be02..20e44dfdd 100644 --- a/stripe/test_helpers/issuing/_card_service.py +++ b/stripe/test_helpers/issuing/_card_service.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.issuing._card import Card from typing import List, cast from typing_extensions import NotRequired, TypedDict @@ -47,7 +47,7 @@ def deliver_card( self._requestor.request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( - card=_util.sanitize_id(card), + card=sanitize_id(card), ), api_mode="V1", base_address="api", @@ -70,7 +70,7 @@ def fail_card( self._requestor.request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( - card=_util.sanitize_id(card), + card=sanitize_id(card), ), api_mode="V1", base_address="api", @@ -93,7 +93,7 @@ def return_card( self._requestor.request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( - card=_util.sanitize_id(card), + card=sanitize_id(card), ), api_mode="V1", base_address="api", @@ -116,7 +116,7 @@ def ship_card( self._requestor.request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( - card=_util.sanitize_id(card), + card=sanitize_id(card), ), api_mode="V1", base_address="api", diff --git a/stripe/test_helpers/issuing/_transaction_service.py b/stripe/test_helpers/issuing/_transaction_service.py index 1aed037c9..d3caba7cb 100644 --- a/stripe/test_helpers/issuing/_transaction_service.py +++ b/stripe/test_helpers/issuing/_transaction_service.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.issuing._transaction import Transaction from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -405,7 +405,7 @@ def refund( self._requestor.request( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( - transaction=_util.sanitize_id(transaction), + transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", diff --git a/stripe/test_helpers/terminal/_reader_service.py b/stripe/test_helpers/terminal/_reader_service.py index e7ab02b47..2c207341c 100644 --- a/stripe/test_helpers/terminal/_reader_service.py +++ b/stripe/test_helpers/terminal/_reader_service.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.terminal._reader import Reader from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -61,7 +61,7 @@ def present_payment_method( self._requestor.request( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( - reader=_util.sanitize_id(reader), + reader=sanitize_id(reader), ), api_mode="V1", base_address="api", diff --git a/stripe/test_helpers/treasury/_inbound_transfer_service.py b/stripe/test_helpers/treasury/_inbound_transfer_service.py index 606b6bec9..31b8316a3 100644 --- a/stripe/test_helpers/treasury/_inbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_inbound_transfer_service.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._inbound_transfer import InboundTransfer from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -55,7 +55,7 @@ def fail( self._requestor.request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( - id=_util.sanitize_id(id), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -78,7 +78,7 @@ def return_inbound_transfer( self._requestor.request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( - id=_util.sanitize_id(id), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -101,7 +101,7 @@ def succeed( self._requestor.request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( - id=_util.sanitize_id(id), + id=sanitize_id(id), ), api_mode="V1", base_address="api", diff --git a/stripe/test_helpers/treasury/_outbound_payment_service.py b/stripe/test_helpers/treasury/_outbound_payment_service.py index 372441623..d1e1a5c96 100644 --- a/stripe/test_helpers/treasury/_outbound_payment_service.py +++ b/stripe/test_helpers/treasury/_outbound_payment_service.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._outbound_payment import OutboundPayment from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -55,7 +55,7 @@ def fail( self._requestor.request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( - id=_util.sanitize_id(id), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -78,7 +78,7 @@ def post( self._requestor.request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( - id=_util.sanitize_id(id), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -101,7 +101,7 @@ def return_outbound_payment( self._requestor.request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( - id=_util.sanitize_id(id), + id=sanitize_id(id), ), api_mode="V1", base_address="api", diff --git a/stripe/test_helpers/treasury/_outbound_transfer_service.py b/stripe/test_helpers/treasury/_outbound_transfer_service.py index bd7e07319..356b1b270 100644 --- a/stripe/test_helpers/treasury/_outbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_outbound_transfer_service.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._outbound_transfer import OutboundTransfer from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -55,7 +55,7 @@ def fail( self._requestor.request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( - outbound_transfer=_util.sanitize_id(outbound_transfer), + outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", @@ -78,7 +78,7 @@ def post( self._requestor.request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( - outbound_transfer=_util.sanitize_id(outbound_transfer), + outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", @@ -101,7 +101,7 @@ def return_outbound_transfer( self._requestor.request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( - outbound_transfer=_util.sanitize_id(outbound_transfer), + outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", diff --git a/stripe/treasury/_credit_reversal.py b/stripe/treasury/_credit_reversal.py index 82aca7854..819b6ed02 100644 --- a/stripe/treasury/_credit_reversal.py +++ b/stripe/treasury/_credit_reversal.py @@ -147,7 +147,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) diff --git a/stripe/treasury/_credit_reversal_service.py b/stripe/treasury/_credit_reversal_service.py index 4601cd09e..425f61a28 100644 --- a/stripe/treasury/_credit_reversal_service.py +++ b/stripe/treasury/_credit_reversal_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._credit_reversal import CreditReversal from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -114,7 +114,7 @@ def retrieve( self._requestor.request( "get", "/v1/treasury/credit_reversals/{credit_reversal}".format( - credit_reversal=_util.sanitize_id(credit_reversal), + credit_reversal=sanitize_id(credit_reversal), ), api_mode="V1", base_address="api", diff --git a/stripe/treasury/_debit_reversal.py b/stripe/treasury/_debit_reversal.py index 4fad59850..6205ed1df 100644 --- a/stripe/treasury/_debit_reversal.py +++ b/stripe/treasury/_debit_reversal.py @@ -161,7 +161,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) diff --git a/stripe/treasury/_debit_reversal_service.py b/stripe/treasury/_debit_reversal_service.py index 6e6d81763..3cbe8c0f9 100644 --- a/stripe/treasury/_debit_reversal_service.py +++ b/stripe/treasury/_debit_reversal_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._debit_reversal import DebitReversal from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -118,7 +118,7 @@ def retrieve( self._requestor.request( "get", "/v1/treasury/debit_reversals/{debit_reversal}".format( - debit_reversal=_util.sanitize_id(debit_reversal), + debit_reversal=sanitize_id(debit_reversal), ), api_mode="V1", base_address="api", diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index 2bef0f742..98a44f87d 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -16,7 +15,6 @@ Unpack, TYPE_CHECKING, ) -from urllib.parse import quote_plus if TYPE_CHECKING: from stripe.treasury._financial_account_features import ( @@ -777,7 +775,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -809,10 +807,14 @@ def modify( """ Updates the details of a FinancialAccount. """ - url = "%s/%s" % (cls.class_url(), quote_plus(id)) + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "FinancialAccount", - cls._static_request("post", url, params=params), + cls._static_request( + "post", + url, + params=params, + ), ) @classmethod @@ -840,7 +842,7 @@ def _cls_retrieve_features( cls._static_request( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=_util.sanitize_id(financial_account) + financial_account=sanitize_id(financial_account) ), params=params, ), @@ -878,7 +880,7 @@ def retrieve_features( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=_util.sanitize_id(self.get("id")) + financial_account=sanitize_id(self.get("id")) ), params=params, ), @@ -898,7 +900,7 @@ def _cls_update_features( cls._static_request( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=_util.sanitize_id(financial_account) + financial_account=sanitize_id(financial_account) ), params=params, ), @@ -936,7 +938,7 @@ def update_features( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=_util.sanitize_id(self.get("id")) + financial_account=sanitize_id(self.get("id")) ), params=params, ), diff --git a/stripe/treasury/_financial_account_features_service.py b/stripe/treasury/_financial_account_features_service.py index 3a0ec8c3d..a7ed8d3c4 100644 --- a/stripe/treasury/_financial_account_features_service.py +++ b/stripe/treasury/_financial_account_features_service.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._financial_account_features import ( FinancialAccountFeatures, ) @@ -177,7 +177,7 @@ def create( self._requestor.request( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=_util.sanitize_id(financial_account), + financial_account=sanitize_id(financial_account), ), api_mode="V1", base_address="api", @@ -200,7 +200,7 @@ def list( self._requestor.request( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=_util.sanitize_id(financial_account), + financial_account=sanitize_id(financial_account), ), api_mode="V1", base_address="api", diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index 60ec8e7d3..e2a915910 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._financial_account import FinancialAccount from stripe.treasury._financial_account_features_service import ( FinancialAccountFeaturesService, @@ -462,7 +462,7 @@ def retrieve( self._requestor.request( "get", "/v1/treasury/financial_accounts/{financial_account}".format( - financial_account=_util.sanitize_id(financial_account), + financial_account=sanitize_id(financial_account), ), api_mode="V1", base_address="api", @@ -485,7 +485,7 @@ def update( self._requestor.request( "post", "/v1/treasury/financial_accounts/{financial_account}".format( - financial_account=_util.sanitize_id(financial_account), + financial_account=sanitize_id(financial_account), ), api_mode="V1", base_address="api", diff --git a/stripe/treasury/_inbound_transfer.py b/stripe/treasury/_inbound_transfer.py index 033bfb999..86aa6d66d 100644 --- a/stripe/treasury/_inbound_transfer.py +++ b/stripe/treasury/_inbound_transfer.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -8,7 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -350,7 +349,7 @@ def _cls_cancel( cls._static_request( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( - inbound_transfer=_util.sanitize_id(inbound_transfer) + inbound_transfer=sanitize_id(inbound_transfer) ), params=params, ), @@ -387,7 +386,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( - inbound_transfer=_util.sanitize_id(self.get("id")) + inbound_transfer=sanitize_id(self.get("id")) ), params=params, ), @@ -405,7 +404,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -456,7 +455,7 @@ def _cls_fail( cls._static_request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( - id=_util.sanitize_id(id) + id=sanitize_id(id) ), params=params, ), @@ -493,7 +492,7 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( - id=_util.sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource.get("id")) ), params=params, ), @@ -513,7 +512,7 @@ def _cls_return_inbound_transfer( cls._static_request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( - id=_util.sanitize_id(id) + id=sanitize_id(id) ), params=params, ), @@ -553,7 +552,7 @@ def return_inbound_transfer( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( - id=_util.sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource.get("id")) ), params=params, ), @@ -571,7 +570,7 @@ def _cls_succeed( cls._static_request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( - id=_util.sanitize_id(id) + id=sanitize_id(id) ), params=params, ), @@ -608,7 +607,7 @@ def succeed( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( - id=_util.sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource.get("id")) ), params=params, ), diff --git a/stripe/treasury/_inbound_transfer_service.py b/stripe/treasury/_inbound_transfer_service.py index 9b3459006..715869c2e 100644 --- a/stripe/treasury/_inbound_transfer_service.py +++ b/stripe/treasury/_inbound_transfer_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._inbound_transfer import InboundTransfer from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -138,7 +138,7 @@ def retrieve( self._requestor.request( "get", "/v1/treasury/inbound_transfers/{id}".format( - id=_util.sanitize_id(id), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -161,7 +161,7 @@ def cancel( self._requestor.request( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( - inbound_transfer=_util.sanitize_id(inbound_transfer), + inbound_transfer=sanitize_id(inbound_transfer), ), api_mode="V1", base_address="api", diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index 8ee13ed5a..0b0d60145 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -8,7 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -526,7 +525,7 @@ def _cls_cancel( cls._static_request( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( - id=_util.sanitize_id(id) + id=sanitize_id(id) ), params=params, ), @@ -563,7 +562,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( - id=_util.sanitize_id(self.get("id")) + id=sanitize_id(self.get("id")) ), params=params, ), @@ -581,7 +580,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -632,7 +631,7 @@ def _cls_fail( cls._static_request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( - id=_util.sanitize_id(id) + id=sanitize_id(id) ), params=params, ), @@ -669,7 +668,7 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( - id=_util.sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource.get("id")) ), params=params, ), @@ -687,7 +686,7 @@ def _cls_post( cls._static_request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( - id=_util.sanitize_id(id) + id=sanitize_id(id) ), params=params, ), @@ -724,7 +723,7 @@ def post( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( - id=_util.sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource.get("id")) ), params=params, ), @@ -744,7 +743,7 @@ def _cls_return_outbound_payment( cls._static_request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( - id=_util.sanitize_id(id) + id=sanitize_id(id) ), params=params, ), @@ -784,7 +783,7 @@ def return_outbound_payment( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( - id=_util.sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource.get("id")) ), params=params, ), diff --git a/stripe/treasury/_outbound_payment_service.py b/stripe/treasury/_outbound_payment_service.py index 4a0610d44..4c407e78c 100644 --- a/stripe/treasury/_outbound_payment_service.py +++ b/stripe/treasury/_outbound_payment_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._outbound_payment import OutboundPayment from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -284,7 +284,7 @@ def retrieve( self._requestor.request( "get", "/v1/treasury/outbound_payments/{id}".format( - id=_util.sanitize_id(id), + id=sanitize_id(id), ), api_mode="V1", base_address="api", @@ -307,7 +307,7 @@ def cancel( self._requestor.request( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( - id=_util.sanitize_id(id), + id=sanitize_id(id), ), api_mode="V1", base_address="api", diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index 24c31838e..02673bb47 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -8,7 +7,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers -from stripe._util import class_method_variant +from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, @@ -367,7 +366,7 @@ def _cls_cancel( cls._static_request( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( - outbound_transfer=_util.sanitize_id(outbound_transfer) + outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), @@ -405,7 +404,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( - outbound_transfer=_util.sanitize_id(self.get("id")) + outbound_transfer=sanitize_id(self.get("id")) ), params=params, ), @@ -423,7 +422,7 @@ def create( cls._static_request( "post", cls.class_url(), - params, + params=params, ), ) @@ -476,7 +475,7 @@ def _cls_fail( cls._static_request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( - outbound_transfer=_util.sanitize_id(outbound_transfer) + outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), @@ -514,9 +513,7 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( - outbound_transfer=_util.sanitize_id( - self.resource.get("id") - ) + outbound_transfer=sanitize_id(self.resource.get("id")) ), params=params, ), @@ -536,7 +533,7 @@ def _cls_post( cls._static_request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( - outbound_transfer=_util.sanitize_id(outbound_transfer) + outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), @@ -574,9 +571,7 @@ def post( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( - outbound_transfer=_util.sanitize_id( - self.resource.get("id") - ) + outbound_transfer=sanitize_id(self.resource.get("id")) ), params=params, ), @@ -596,7 +591,7 @@ def _cls_return_outbound_transfer( cls._static_request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( - outbound_transfer=_util.sanitize_id(outbound_transfer) + outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), @@ -636,9 +631,7 @@ def return_outbound_transfer( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( - outbound_transfer=_util.sanitize_id( - self.resource.get("id") - ) + outbound_transfer=sanitize_id(self.resource.get("id")) ), params=params, ), diff --git a/stripe/treasury/_outbound_transfer_service.py b/stripe/treasury/_outbound_transfer_service.py index d59014daa..9891948c6 100644 --- a/stripe/treasury/_outbound_transfer_service.py +++ b/stripe/treasury/_outbound_transfer_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._outbound_transfer import OutboundTransfer from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -158,7 +158,7 @@ def retrieve( self._requestor.request( "get", "/v1/treasury/outbound_transfers/{outbound_transfer}".format( - outbound_transfer=_util.sanitize_id(outbound_transfer), + outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", @@ -181,7 +181,7 @@ def cancel( self._requestor.request( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( - outbound_transfer=_util.sanitize_id(outbound_transfer), + outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", diff --git a/stripe/treasury/_received_credit_service.py b/stripe/treasury/_received_credit_service.py index f1668b350..3a3ac3e0f 100644 --- a/stripe/treasury/_received_credit_service.py +++ b/stripe/treasury/_received_credit_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._received_credit import ReceivedCredit from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -90,7 +90,7 @@ def retrieve( self._requestor.request( "get", "/v1/treasury/received_credits/{id}".format( - id=_util.sanitize_id(id), + id=sanitize_id(id) ), api_mode="V1", base_address="api", diff --git a/stripe/treasury/_received_debit_service.py b/stripe/treasury/_received_debit_service.py index d62cb6088..a2cfbc668 100644 --- a/stripe/treasury/_received_debit_service.py +++ b/stripe/treasury/_received_debit_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._received_debit import ReceivedDebit from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -75,9 +75,7 @@ def retrieve( ReceivedDebit, self._requestor.request( "get", - "/v1/treasury/received_debits/{id}".format( - id=_util.sanitize_id(id), - ), + "/v1/treasury/received_debits/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, diff --git a/stripe/treasury/_transaction_entry_service.py b/stripe/treasury/_transaction_entry_service.py index 5caf0f927..09993c11a 100644 --- a/stripe/treasury/_transaction_entry_service.py +++ b/stripe/treasury/_transaction_entry_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._transaction_entry import TransactionEntry from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -120,7 +120,7 @@ def retrieve( self._requestor.request( "get", "/v1/treasury/transaction_entries/{id}".format( - id=_util.sanitize_id(id), + id=sanitize_id(id), ), api_mode="V1", base_address="api", diff --git a/stripe/treasury/_transaction_service.py b/stripe/treasury/_transaction_service.py index 226d1c06d..41eb7acf6 100644 --- a/stripe/treasury/_transaction_service.py +++ b/stripe/treasury/_transaction_service.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe import _util from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.treasury._transaction import Transaction from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -130,9 +130,7 @@ def retrieve( Transaction, self._requestor.request( "get", - "/v1/treasury/transactions/{id}".format( - id=_util.sanitize_id(id), - ), + "/v1/treasury/transactions/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, From aec6d75e54d20f5178c1174c5774d62d986006fc Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 22:10:44 +0000 Subject: [PATCH 003/179] Update generated code (#1213) * Update generated code for v797 * Update generated code for v798 * Update generated code for v799 * Update generated code for v799 * Update generated code for v800 * Update generated code for v801 * Update generated code for v802 * Update generated code for v803 * Update generated code for v804 * Update generated code for v806 * Update generated code for v806 * Update generated code for v806 * Update generated code for v807 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 46 +- stripe/_account_service.py | 88 +- stripe/_charge.py | 16 + stripe/_customer.py | 2 +- stripe/_customer_payment_method_service.py | 2 +- stripe/_payment_intent.py | 136 + stripe/_payment_intent_service.py | 96 + stripe/_payment_link.py | 5 +- stripe/_payment_link_service.py | 4 +- stripe/_payment_method.py | 19 +- stripe/_payment_method_service.py | 11 +- stripe/_refund.py | 12 + stripe/_setup_intent.py | 24 + stripe/_setup_intent_service.py | 30 + stripe/_tax_rate.py | 6 + stripe/_token.py | 28 + stripe/_token_service.py | 28 + stripe/checkout/_session.py | 26 +- stripe/checkout/_session_service.py | 17 +- stripe/tax/_calculation.py | 16 +- stripe/tax/_calculation_line_item.py | 8 +- stripe/tax/_calculation_service.py | 4 +- stripe/tax/_transaction.py | 18 +- stripe/tax/_transaction_line_item.py | 4 +- stripe/tax/_transaction_service.py | 10 +- stripe/terminal/_reader.py | 2 +- tests/test_generated_examples.py | 10646 +++++++++---------- 28 files changed, 5916 insertions(+), 5390 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 55b7a77b1..70e65014b 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v793 \ No newline at end of file +v807 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 6c928934d..25af3088a 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -286,6 +286,10 @@ class Capabilities(StripeObject): """ The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. """ + swish_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the Swish capability of the account, or whether the account can directly process Swish payments. + """ tax_reporting_us_1099_k: Optional[ Literal["active", "inactive", "pending"] ] @@ -1174,9 +1178,7 @@ class CreateParams(RequestOptions): """ A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. - By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. - - Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. """ individual: NotRequired["Account.CreateParamsIndividual"] """ @@ -1515,6 +1517,12 @@ class CreateParamsCapabilities(TypedDict): """ The sofort_payments capability. """ + swish_payments: NotRequired[ + "Account.CreateParamsCapabilitiesSwishPayments" + ] + """ + The swish_payments capability. + """ tax_reporting_us_1099_k: NotRequired[ "Account.CreateParamsCapabilitiesTaxReportingUs1099K" ] @@ -1734,6 +1742,12 @@ class CreateParamsCapabilitiesSofortPayments(TypedDict): 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 CreateParamsCapabilitiesSwishPayments(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 CreateParamsCapabilitiesTaxReportingUs1099K(TypedDict): requested: NotRequired["bool"] """ @@ -2166,6 +2180,10 @@ class CreateParamsIndividual(TypedDict): """ The individual's registered address. """ + relationship: NotRequired["Account.CreateParamsIndividualRelationship"] + """ + Describes the person's relationship to the account. + """ ssn_last_4: NotRequired["str"] """ The last four digits of the individual's Social Security Number (U.S. only). @@ -2301,6 +2319,28 @@ class CreateParamsIndividualRegisteredAddress(TypedDict): State, county, province, or region. """ + class CreateParamsIndividualRelationship(TypedDict): + director: NotRequired["bool"] + """ + Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + """ + executive: NotRequired["bool"] + """ + Whether the person has significant responsibility to control, manage, or direct the organization. + """ + owner: NotRequired["bool"] + """ + Whether the person is an owner of the account's legal entity. + """ + percent_ownership: NotRequired["Literal['']|float"] + """ + The percent owned by the person of the account's legal entity. + """ + title: NotRequired["str"] + """ + The person's title (e.g., CEO, Support Engineer). + """ + class CreateParamsIndividualVerification(TypedDict): additional_document: NotRequired[ "Account.CreateParamsIndividualVerificationAdditionalDocument" diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 670fb96bd..f0e3d61e3 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -74,9 +74,7 @@ class CreateParams(TypedDict): """ A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. - By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. - - Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. """ individual: NotRequired["AccountService.CreateParamsIndividual"] """ @@ -415,6 +413,12 @@ class CreateParamsCapabilities(TypedDict): """ The sofort_payments capability. """ + swish_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesSwishPayments" + ] + """ + The swish_payments capability. + """ tax_reporting_us_1099_k: NotRequired[ "AccountService.CreateParamsCapabilitiesTaxReportingUs1099K" ] @@ -638,6 +642,12 @@ class CreateParamsCapabilitiesSofortPayments(TypedDict): 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 CreateParamsCapabilitiesSwishPayments(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 CreateParamsCapabilitiesTaxReportingUs1099K(TypedDict): requested: NotRequired["bool"] """ @@ -1080,6 +1090,12 @@ class CreateParamsIndividual(TypedDict): """ The individual's registered address. """ + relationship: NotRequired[ + "AccountService.CreateParamsIndividualRelationship" + ] + """ + Describes the person's relationship to the account. + """ ssn_last_4: NotRequired["str"] """ The last four digits of the individual's Social Security Number (U.S. only). @@ -1217,6 +1233,28 @@ class CreateParamsIndividualRegisteredAddress(TypedDict): State, county, province, or region. """ + class CreateParamsIndividualRelationship(TypedDict): + director: NotRequired["bool"] + """ + Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + """ + executive: NotRequired["bool"] + """ + Whether the person has significant responsibility to control, manage, or direct the organization. + """ + owner: NotRequired["bool"] + """ + Whether the person is an owner of the account's legal entity. + """ + percent_ownership: NotRequired["Literal['']|float"] + """ + The percent owned by the person of the account's legal entity. + """ + title: NotRequired["str"] + """ + The person's title (e.g., CEO, Support Engineer). + """ + class CreateParamsIndividualVerification(TypedDict): additional_document: NotRequired[ "AccountService.CreateParamsIndividualVerificationAdditionalDocument" @@ -1564,9 +1602,7 @@ class UpdateParams(TypedDict): """ A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. - By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. - - Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. """ individual: NotRequired["AccountService.UpdateParamsIndividual"] """ @@ -1901,6 +1937,12 @@ class UpdateParamsCapabilities(TypedDict): """ The sofort_payments capability. """ + swish_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesSwishPayments" + ] + """ + The swish_payments capability. + """ tax_reporting_us_1099_k: NotRequired[ "AccountService.UpdateParamsCapabilitiesTaxReportingUs1099K" ] @@ -2124,6 +2166,12 @@ class UpdateParamsCapabilitiesSofortPayments(TypedDict): 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 UpdateParamsCapabilitiesSwishPayments(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 UpdateParamsCapabilitiesTaxReportingUs1099K(TypedDict): requested: NotRequired["bool"] """ @@ -2566,6 +2614,12 @@ class UpdateParamsIndividual(TypedDict): """ The individual's registered address. """ + relationship: NotRequired[ + "AccountService.UpdateParamsIndividualRelationship" + ] + """ + Describes the person's relationship to the account. + """ ssn_last_4: NotRequired["str"] """ The last four digits of the individual's Social Security Number (U.S. only). @@ -2703,6 +2757,28 @@ class UpdateParamsIndividualRegisteredAddress(TypedDict): State, county, province, or region. """ + class UpdateParamsIndividualRelationship(TypedDict): + director: NotRequired["bool"] + """ + Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + """ + executive: NotRequired["bool"] + """ + Whether the person has significant responsibility to control, manage, or direct the organization. + """ + owner: NotRequired["bool"] + """ + Whether the person is an owner of the account's legal entity. + """ + percent_ownership: NotRequired["Literal['']|float"] + """ + The percent owned by the person of the account's legal entity. + """ + title: NotRequired["str"] + """ + The person's title (e.g., CEO, Support Engineer). + """ + class UpdateParamsIndividualVerification(TypedDict): additional_document: NotRequired[ "AccountService.UpdateParamsIndividualVerificationAdditionalDocument" diff --git a/stripe/_charge.py b/stripe/_charge.py index d16d37dea..f0e830fff 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1475,6 +1475,20 @@ class Sofort(StripeObject): class StripeAccount(StripeObject): pass + class Swish(StripeObject): + fingerprint: Optional[str] + """ + Uniquely identifies the payer's Swish account. You can use this attribute to check whether two Swish transactions were paid for by the same payer + """ + payment_reference: Optional[str] + """ + Payer bank reference number for the payment + """ + verified_phone_last4: Optional[str] + """ + The last four digits of the Swish account phone number + """ + class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ @@ -1553,6 +1567,7 @@ class Zip(StripeObject): sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] stripe_account: Optional[StripeAccount] + swish: Optional[Swish] type: str """ The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`. @@ -1600,6 +1615,7 @@ class Zip(StripeObject): "sepa_debit": SepaDebit, "sofort": Sofort, "stripe_account": StripeAccount, + "swish": Swish, "us_bank_account": UsBankAccount, "wechat": Wechat, "wechat_pay": WechatPay, diff --git a/stripe/_customer.py b/stripe/_customer.py index ebedbfb26..aa49494f8 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -807,7 +807,7 @@ class ListPaymentMethodsParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay', 'zip']" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 956db7238..0d5d3c644 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -28,7 +28,7 @@ class ListParams(TypedDict): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay', 'zip']" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 66cd2b673..ec4bde097 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -770,6 +770,32 @@ class RedirectToUrl(StripeObject): The URL you must redirect your customer to in order to authenticate the payment. """ + class SwishHandleRedirectOrDisplayQrCode(StripeObject): + class QrCode(StripeObject): + data: Optional[str] + """ + The raw data string used to generate QR code, it should be used together with QR code library. + """ + image_url_png: Optional[str] + """ + The image_url_png string used to render QR code + """ + image_url_svg: Optional[str] + """ + The image_url_svg string used to render QR code + """ + + hosted_instructions_url: Optional[str] + """ + The URL to the hosted Swish instructions page, which allows customers to view the QR code. + """ + mobile_auth_url: Optional[str] + """ + The url for mobile redirect based auth + """ + qr_code: Optional[QrCode] + _inner_class_types = {"qr_code": QrCode} + class VerifyWithMicrodeposits(StripeObject): arrival_date: int """ @@ -857,6 +883,9 @@ class WechatPayRedirectToIosApp(StripeObject): pix_display_qr_code: Optional[PixDisplayQrCode] promptpay_display_qr_code: Optional[PromptpayDisplayQrCode] redirect_to_url: Optional[RedirectToUrl] + swish_handle_redirect_or_display_qr_code: Optional[ + SwishHandleRedirectOrDisplayQrCode + ] type: str """ Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. @@ -883,6 +912,7 @@ class WechatPayRedirectToIosApp(StripeObject): "pix_display_qr_code": PixDisplayQrCode, "promptpay_display_qr_code": PromptpayDisplayQrCode, "redirect_to_url": RedirectToUrl, + "swish_handle_redirect_or_display_qr_code": SwishHandleRedirectOrDisplayQrCode, "verify_with_microdeposits": VerifyWithMicrodeposits, "wechat_pay_display_qr_code": WechatPayDisplayQrCode, "wechat_pay_redirect_to_android_app": WechatPayRedirectToAndroidApp, @@ -1529,6 +1559,20 @@ class Sofort(StripeObject): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class Swish(StripeObject): + reference: Optional[str] + """ + The order ID displayed in the Swish app after the payment is authorized. + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): permissions: Optional[ @@ -1647,6 +1691,7 @@ class Zip(StripeObject): revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] + swish: Optional[Swish] us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] @@ -1682,6 +1727,7 @@ class Zip(StripeObject): "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "sofort": Sofort, + "swish": Swish, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, @@ -2141,6 +2187,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataSwish"] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -2170,6 +2220,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -2431,6 +2482,9 @@ class ConfirmParamsPaymentMethodDataSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class ConfirmParamsPaymentMethodDataSwish(TypedDict): + pass + class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -2646,6 +2700,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ + swish: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSwish" + ] + """ + If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccount" ] @@ -3491,6 +3551,22 @@ class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): + reference: NotRequired["Literal['']|str"] + """ + The order ID displayed in the Swish app after the payment is authorized. + """ + setup_future_usage: NotRequired["Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -4030,6 +4106,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataSwish"] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -4059,6 +4139,7 @@ class CreateParamsPaymentMethodData(TypedDict): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -4320,6 +4401,9 @@ class CreateParamsPaymentMethodDataSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class CreateParamsPaymentMethodDataSwish(TypedDict): + pass + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -4535,6 +4619,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ + swish: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSwish" + ] + """ + If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccount" ] @@ -5380,6 +5470,22 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsSwish(TypedDict): + reference: NotRequired["Literal['']|str"] + """ + The order ID displayed in the Swish app after the payment is authorized. + """ + setup_future_usage: NotRequired["Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -5921,6 +6027,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataSwish"] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -5950,6 +6060,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -6211,6 +6322,9 @@ class ModifyParamsPaymentMethodDataSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class ModifyParamsPaymentMethodDataSwish(TypedDict): + pass + class ModifyParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -6426,6 +6540,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ + swish: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsSwish" + ] + """ + If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccount" ] @@ -7271,6 +7391,22 @@ class ModifyParamsPaymentMethodOptionsSofort(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsSwish(TypedDict): + reference: NotRequired["Literal['']|str"] + """ + The order ID displayed in the Swish app after the payment is authorized. + """ + setup_future_usage: NotRequired["Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections" diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index d51a928e3..dd39a3a6d 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -403,6 +403,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataSwish" + ] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -432,6 +438,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -695,6 +702,9 @@ class ConfirmParamsPaymentMethodDataSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class ConfirmParamsPaymentMethodDataSwish(TypedDict): + pass + class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -910,6 +920,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ + swish: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSwish" + ] + """ + If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccount" ] @@ -1755,6 +1771,22 @@ class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): + reference: NotRequired["Literal['']|str"] + """ + The order ID displayed in the Swish app after the payment is authorized. + """ + setup_future_usage: NotRequired["Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -2314,6 +2346,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataSwish" + ] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -2343,6 +2381,7 @@ class CreateParamsPaymentMethodData(TypedDict): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -2606,6 +2645,9 @@ class CreateParamsPaymentMethodDataSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class CreateParamsPaymentMethodDataSwish(TypedDict): + pass + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -2821,6 +2863,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ + swish: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSwish" + ] + """ + If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccount" ] @@ -3666,6 +3714,22 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsSwish(TypedDict): + reference: NotRequired["Literal['']|str"] + """ + The order ID displayed in the Swish app after the payment is authorized. + """ + setup_future_usage: NotRequired["Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -4255,6 +4319,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataSwish" + ] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -4284,6 +4354,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -4547,6 +4618,9 @@ class UpdateParamsPaymentMethodDataSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class UpdateParamsPaymentMethodDataSwish(TypedDict): + pass + class UpdateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -4762,6 +4836,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ + swish: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsSwish" + ] + """ + If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsUsBankAccount" ] @@ -5607,6 +5687,22 @@ class UpdateParamsPaymentMethodOptionsSofort(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsSwish(TypedDict): + reference: NotRequired["Literal['']|str"] + """ + The order ID displayed in the Swish app after the payment is authorized. + """ + setup_future_usage: NotRequired["Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 16d2d3c4a..7cfb0d096 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -769,7 +769,7 @@ class CreateParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). @@ -1631,7 +1631,7 @@ class ModifyParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ 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). @@ -2384,6 +2384,7 @@ class RetrieveParams(RequestOptions): "promptpay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", ] diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index f77c89f9f..375745d58 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -111,7 +111,7 @@ class CreateParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). @@ -977,7 +977,7 @@ class UpdateParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ 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/_payment_method.py b/stripe/_payment_method.py index 416cb573c..230ad569a 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -176,7 +176,7 @@ class Networks(StripeObject): """ preferred: Optional[str] """ - The preferred network for the card. + The preferred network for the card. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. """ class ThreeDSecureUsage(StripeObject): @@ -882,6 +882,9 @@ class Sofort(StripeObject): Two-letter ISO code representing the country the bank account is located in. """ + class Swish(StripeObject): + pass + class UsBankAccount(StripeObject): class Networks(StripeObject): preferred: Optional[str] @@ -1141,8 +1144,12 @@ class CreateParams(RequestOptions): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired["PaymentMethod.CreateParamsSwish"] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay', 'zip']" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" ] """ 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. @@ -1417,6 +1424,9 @@ class CreateParamsSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class CreateParamsSwish(TypedDict): + pass + class CreateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -1473,7 +1483,7 @@ class ListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay', 'zip']" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. @@ -1642,6 +1652,7 @@ class RetrieveParams(RequestOptions): revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] + swish: Optional[Swish] type: Literal[ "acss_debit", "affirm", @@ -1674,6 +1685,7 @@ class RetrieveParams(RequestOptions): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -1948,6 +1960,7 @@ def retrieve( "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "sofort": Sofort, + "swish": Swish, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index e6c8cfaf5..77abf171d 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -177,8 +177,12 @@ class CreateParams(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired["PaymentMethodService.CreateParamsSwish"] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay', 'zip']" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" ] """ 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. @@ -455,6 +459,9 @@ class CreateParamsSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class CreateParamsSwish(TypedDict): + pass + class CreateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -511,7 +518,7 @@ class ListParams(TypedDict): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay', 'zip']" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. diff --git a/stripe/_refund.py b/stripe/_refund.py index a96b1fe16..f06a4df91 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -168,6 +168,16 @@ class Revolut(StripeObject): class Sofort(StripeObject): pass + class Swish(StripeObject): + reference: Optional[str] + """ + The reference assigned to the refund. + """ + reference_status: Optional[str] + """ + Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + """ + class ThBankTransfer(StripeObject): reference: Optional[str] """ @@ -217,6 +227,7 @@ class Zip(StripeObject): pix: Optional[Pix] revolut: Optional[Revolut] sofort: Optional[Sofort] + swish: Optional[Swish] th_bank_transfer: Optional[ThBankTransfer] type: str """ @@ -249,6 +260,7 @@ class Zip(StripeObject): "pix": Pix, "revolut": Revolut, "sofort": Sofort, + "swish": Swish, "th_bank_transfer": ThBankTransfer, "us_bank_transfer": UsBankTransfer, "wechat_pay": WechatPay, diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 7584595e4..fc7708e70 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -852,6 +852,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataSwish"] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -881,6 +885,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -1140,6 +1145,9 @@ class ConfirmParamsPaymentMethodDataSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class ConfirmParamsPaymentMethodDataSwish(TypedDict): + pass + class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -1785,6 +1793,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired["SetupIntent.CreateParamsPaymentMethodDataSwish"] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -1814,6 +1826,7 @@ class CreateParamsPaymentMethodData(TypedDict): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -2073,6 +2086,9 @@ class CreateParamsPaymentMethodDataSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class CreateParamsPaymentMethodDataSwish(TypedDict): + pass + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -2693,6 +2709,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataSwish"] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -2722,6 +2742,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -2981,6 +3002,9 @@ class ModifyParamsPaymentMethodDataSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class ModifyParamsPaymentMethodDataSwish(TypedDict): + pass + class ModifyParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 066284096..898956001 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -292,6 +292,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataSwish" + ] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -321,6 +327,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -584,6 +591,9 @@ class ConfirmParamsPaymentMethodDataSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class ConfirmParamsPaymentMethodDataSwish(TypedDict): + pass + class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -1255,6 +1265,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataSwish" + ] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -1284,6 +1300,7 @@ class CreateParamsPaymentMethodData(TypedDict): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -1545,6 +1562,9 @@ class CreateParamsPaymentMethodDataSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class CreateParamsPaymentMethodDataSwish(TypedDict): + pass + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -2201,6 +2221,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + swish: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataSwish" + ] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -2230,6 +2256,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "revolut_pay", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", "zip", @@ -2491,6 +2518,9 @@ class UpdateParamsPaymentMethodDataSofort(TypedDict): Two-letter ISO code representing the country the bank account is located in. """ + class UpdateParamsPaymentMethodDataSwish(TypedDict): + pass + class UpdateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']"] """ diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index d12dd9dee..8bcebeeb8 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -203,6 +203,12 @@ class RetrieveParams(RequestOptions): """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ + jurisdiction_level: Optional[ + Literal["city", "country", "county", "district", "multiple", "state"] + ] + """ + The level of the jurisdiction that imposes this tax rate. Will be `null` for manually defined tax rates. + """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. diff --git a/stripe/_token.py b/stripe/_token.py index 708b75ff1..9ee9d3caf 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -393,6 +393,12 @@ class CreateParamsAccountIndividual(TypedDict): """ The individual's registered address. """ + relationship: NotRequired[ + "Token.CreateParamsAccountIndividualRelationship" + ] + """ + Describes the person's relationship to the account. + """ ssn_last_4: NotRequired["str"] """ The last four digits of the individual's Social Security Number (U.S. only). @@ -530,6 +536,28 @@ class CreateParamsAccountIndividualRegisteredAddress(TypedDict): State, county, province, or region. """ + class CreateParamsAccountIndividualRelationship(TypedDict): + director: NotRequired["bool"] + """ + Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + """ + executive: NotRequired["bool"] + """ + Whether the person has significant responsibility to control, manage, or direct the organization. + """ + owner: NotRequired["bool"] + """ + Whether the person is an owner of the account's legal entity. + """ + percent_ownership: NotRequired["Literal['']|float"] + """ + The percent owned by the person of the account's legal entity. + """ + title: NotRequired["str"] + """ + The person's title (e.g., CEO, Support Engineer). + """ + class CreateParamsAccountIndividualVerification(TypedDict): additional_document: NotRequired[ "Token.CreateParamsAccountIndividualVerificationAdditionalDocument" diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 82daddf15..c2718d708 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -364,6 +364,12 @@ class CreateParamsAccountIndividual(TypedDict): """ The individual's registered address. """ + relationship: NotRequired[ + "TokenService.CreateParamsAccountIndividualRelationship" + ] + """ + Describes the person's relationship to the account. + """ ssn_last_4: NotRequired["str"] """ The last four digits of the individual's Social Security Number (U.S. only). @@ -501,6 +507,28 @@ class CreateParamsAccountIndividualRegisteredAddress(TypedDict): State, county, province, or region. """ + class CreateParamsAccountIndividualRelationship(TypedDict): + director: NotRequired["bool"] + """ + Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + """ + executive: NotRequired["bool"] + """ + Whether the person has significant responsibility to control, manage, or direct the organization. + """ + owner: NotRequired["bool"] + """ + Whether the person is an owner of the account's legal entity. + """ + percent_ownership: NotRequired["Literal['']|float"] + """ + The percent owned by the person of the account's legal entity. + """ + title: NotRequired["str"] + """ + The person's title (e.g., CEO, Support Engineer). + """ + class CreateParamsAccountIndividualVerification(TypedDict): additional_document: NotRequired[ "TokenService.CreateParamsAccountIndividualVerificationAdditionalDocument" diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 2a9dcd5fa..90317a716 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -899,6 +899,12 @@ class Sofort(StripeObject): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class Swish(StripeObject): + reference: Optional[str] + """ + The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent. + """ + class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): permissions: Optional[ @@ -969,6 +975,7 @@ class FinancialConnections(StripeObject): revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] + swish: Optional[Swish] us_bank_account: Optional[UsBankAccount] _inner_class_types = { "acss_debit": AcssDebit, @@ -998,6 +1005,7 @@ class FinancialConnections(StripeObject): "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "sofort": Sofort, + "swish": Swish, "us_bank_account": UsBankAccount, } @@ -1604,7 +1612,7 @@ class CreateParams(RequestOptions): Payment-method-specific configuration. """ payment_method_types: NotRequired[ - "List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay', 'zip']]" + "List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. @@ -1660,8 +1668,7 @@ class CreateParams(RequestOptions): """ Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. `submit_type` can only be - specified on Checkout Sessions in `payment` mode, but not Checkout Sessions - in `subscription` or `setup` mode. Possible values are `auto`, `pay`, `book`, `donate`. If blank or `auto`, `pay` is used. + specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. """ subscription_data: NotRequired["Session.CreateParamsSubscriptionData"] """ @@ -2349,6 +2356,10 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Sofort payment method options. """ + swish: NotRequired["Session.CreateParamsPaymentMethodOptionsSwish"] + """ + contains details about the Swish payment method options. + """ us_bank_account: NotRequired[ "Session.CreateParamsPaymentMethodOptionsUsBankAccount" ] @@ -2785,6 +2796,12 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsSwish(TypedDict): + reference: NotRequired["Literal['']|str"] + """ + The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent. + """ + class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "Session.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -3674,8 +3691,7 @@ class RetrieveParams(RequestOptions): """ Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. `submit_type` can only be - specified on Checkout Sessions in `payment` mode, but not Checkout Sessions - in `subscription` or `setup` mode. Possible values are `auto`, `pay`, `book`, `donate`. If blank or `auto`, `pay` is used. + specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. """ subscription: Optional[ExpandableField["Subscription"]] """ diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index d004ebecd..713f150d7 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -172,7 +172,7 @@ class CreateParams(TypedDict): Payment-method-specific configuration. """ payment_method_types: NotRequired[ - "List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay', 'zip']]" + "List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. @@ -230,8 +230,7 @@ class CreateParams(TypedDict): """ Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. `submit_type` can only be - specified on Checkout Sessions in `payment` mode, but not Checkout Sessions - in `subscription` or `setup` mode. Possible values are `auto`, `pay`, `book`, `donate`. If blank or `auto`, `pay` is used. + specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. """ subscription_data: NotRequired[ "SessionService.CreateParamsSubscriptionData" @@ -961,6 +960,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Sofort payment method options. """ + swish: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsSwish" + ] + """ + contains details about the Swish payment method options. + """ us_bank_account: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsUsBankAccount" ] @@ -1397,6 +1402,12 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsSwish(TypedDict): + reference: NotRequired["Literal['']|str"] + """ + The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent. + """ + class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index beabc7810..005077c5e 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -207,7 +207,7 @@ class TaxRateDetails(StripeObject): amount: int """ - The amount of tax, in integer cents. + The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ jurisdiction: Jurisdiction sourcing: Literal["destination", "origin"] @@ -240,7 +240,7 @@ class TaxRateDetails(StripeObject): """ taxable_amount: int """ - The amount on which tax is calculated, in integer cents. + The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ _inner_class_types = { "jurisdiction": Jurisdiction, @@ -249,11 +249,11 @@ class TaxRateDetails(StripeObject): amount: int """ - The shipping amount in integer cents. 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://stripe.com/docs/currencies#zero-decimal). 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 integer cents. + The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ shipping_rate: Optional[str] """ @@ -309,7 +309,7 @@ class TaxRateDetails(StripeObject): amount: int """ - The amount of tax, in integer cents. + The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ inclusive: bool """ @@ -338,7 +338,7 @@ class TaxRateDetails(StripeObject): """ taxable_amount: int """ - The amount on which tax is calculated, in integer cents. + The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ _inner_class_types = {"tax_rate_details": TaxRateDetails} @@ -506,7 +506,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): class CreateParamsLineItem(TypedDict): amount: int """ - A positive integer in cents representing the line item's total price. 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://stripe.com/docs/currencies#zero-decimal) representing the line item's total price. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ product: NotRequired["str"] """ @@ -532,7 +532,7 @@ class CreateParamsLineItem(TypedDict): class CreateParamsShippingCost(TypedDict): amount: NotRequired["int"] """ - A positive integer in cents 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://stripe.com/docs/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. """ shipping_rate: NotRequired["str"] """ diff --git a/stripe/tax/_calculation_line_item.py b/stripe/tax/_calculation_line_item.py index e2afdfde8..e33257168 100644 --- a/stripe/tax/_calculation_line_item.py +++ b/stripe/tax/_calculation_line_item.py @@ -58,7 +58,7 @@ class TaxRateDetails(StripeObject): amount: int """ - The amount of tax, in integer cents. + The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ jurisdiction: Jurisdiction sourcing: Literal["destination", "origin"] @@ -91,7 +91,7 @@ class TaxRateDetails(StripeObject): """ taxable_amount: int """ - The amount on which tax is calculated, in integer cents. + The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ _inner_class_types = { "jurisdiction": Jurisdiction, @@ -100,11 +100,11 @@ class TaxRateDetails(StripeObject): amount: int """ - The line item amount in integer cents. 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://stripe.com/docs/currencies#zero-decimal). 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 integer cents. + The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ id: str """ diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index e7cfcb2cb..ab72d0457 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -183,7 +183,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): class CreateParamsLineItem(TypedDict): amount: int """ - A positive integer in cents representing the line item's total price. 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://stripe.com/docs/currencies#zero-decimal) representing the line item's total price. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ product: NotRequired["str"] """ @@ -209,7 +209,7 @@ class CreateParamsLineItem(TypedDict): class CreateParamsShippingCost(TypedDict): amount: NotRequired["int"] """ - A positive integer in cents 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://stripe.com/docs/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. """ shipping_rate: NotRequired["str"] """ diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index acd676bcc..26ef1583c 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -213,7 +213,7 @@ class TaxRateDetails(StripeObject): amount: int """ - The amount of tax, in integer cents. + The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ jurisdiction: Jurisdiction sourcing: Literal["destination", "origin"] @@ -246,7 +246,7 @@ class TaxRateDetails(StripeObject): """ taxable_amount: int """ - The amount on which tax is calculated, in integer cents. + The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ _inner_class_types = { "jurisdiction": Jurisdiction, @@ -255,11 +255,11 @@ class TaxRateDetails(StripeObject): amount: int """ - The shipping amount in integer cents. 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://stripe.com/docs/currencies#zero-decimal). 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 integer cents. + The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ shipping_rate: Optional[str] """ @@ -304,7 +304,7 @@ class CreateReversalParams(RequestOptions): """ flat_amount: NotRequired["int"] """ - A flat amount to reverse across the entire transaction, in negative integer cents. 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://stripe.com/docs/currencies#zero-decimal) in negative. This value represents the total amount to refund from the transaction, including taxes. """ line_items: NotRequired[ "List[Transaction.CreateReversalParamsLineItem]" @@ -338,11 +338,11 @@ class CreateReversalParams(RequestOptions): class CreateReversalParamsLineItem(TypedDict): amount: int """ - The amount to reverse, in negative integer cents. + The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ amount_tax: int """ - The amount of tax to reverse, in negative integer cents. + The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ metadata: NotRequired["Dict[str, str]"] """ @@ -364,11 +364,11 @@ class CreateReversalParamsLineItem(TypedDict): class CreateReversalParamsShippingCost(TypedDict): amount: int """ - The amount to reverse, in negative integer cents. + The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ amount_tax: int """ - The amount of tax to reverse, in negative integer cents. + The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ class ListLineItemsParams(RequestOptions): diff --git a/stripe/tax/_transaction_line_item.py b/stripe/tax/_transaction_line_item.py index b98eb4ed7..659ae9423 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 integer cents. 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://stripe.com/docs/currencies#zero-decimal). 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 integer cents. + The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ id: str """ diff --git a/stripe/tax/_transaction_service.py b/stripe/tax/_transaction_service.py index a87844f39..d24984265 100644 --- a/stripe/tax/_transaction_service.py +++ b/stripe/tax/_transaction_service.py @@ -41,7 +41,7 @@ class CreateReversalParams(TypedDict): """ flat_amount: NotRequired["int"] """ - A flat amount to reverse across the entire transaction, in negative integer cents. 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://stripe.com/docs/currencies#zero-decimal) in negative. This value represents the total amount to refund from the transaction, including taxes. """ line_items: NotRequired[ "List[TransactionService.CreateReversalParamsLineItem]" @@ -75,11 +75,11 @@ class CreateReversalParams(TypedDict): class CreateReversalParamsLineItem(TypedDict): amount: int """ - The amount to reverse, in negative integer cents. + The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ amount_tax: int """ - The amount of tax to reverse, in negative integer cents. + The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ metadata: NotRequired["Dict[str, str]"] """ @@ -101,11 +101,11 @@ class CreateReversalParamsLineItem(TypedDict): class CreateReversalParamsShippingCost(TypedDict): amount: int """ - The amount to reverse, in negative integer cents. + The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ amount_tax: int """ - The amount of tax to reverse, in negative integer cents. + The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ class RetrieveParams(TypedDict): diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index b8a7fb359..f13a1fe65 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -522,7 +522,7 @@ class SetReaderDisplayParamsCartLineItem(TypedDict): """ Serial number of the reader. """ - status: Optional[str] + status: Optional[Literal["offline", "online"]] """ The networking status of the reader. """ diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index d82519e35..19c0bfd23 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -25,5276 +25,6 @@ def test_account_links_post( post_data="account=acct_xxxxxxxxxxxxx&refresh_url=https%3A%2F%2Fexample.com%2Freauth&return_url=https%3A%2F%2Fexample.com%2Freturn&type=account_onboarding", ) - def test_accounts_capabilities_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.list_capabilities("acct_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", - query_string="", - ) - - def test_accounts_capabilities_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.retrieve_capability( - "acct_xxxxxxxxxxxxx", - "card_payments", - ) - http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", - query_string="", - ) - - def test_accounts_capabilities_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.modify_capability( - "acct_xxxxxxxxxxxxx", - "card_payments", - requested=True, - ) - http_client_mock.assert_requested( - "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", - query_string="", - post_data="requested=True", - ) - - def test_accounts_delete(self, http_client_mock: HTTPClientMock) -> None: - stripe.Account.delete("acct_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/accounts/acct_xxxxxxxxxxxxx", - query_string="", - ) - - def test_accounts_external_accounts_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.delete_external_account( - "acct_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "delete", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", - query_string="", - ) - - def test_accounts_external_accounts_delete_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.delete_external_account( - "acct_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "delete", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", - query_string="", - ) - - def test_accounts_external_accounts_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.list_external_accounts( - "acct_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - query_string="limit=3", - ) - - def test_accounts_external_accounts_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.list_external_accounts( - "acct_xxxxxxxxxxxxx", - object="bank_account", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - query_string="object=bank_account&limit=3", - ) - - def test_accounts_external_accounts_get_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.list_external_accounts( - "acct_xxxxxxxxxxxxx", - object="card", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - query_string="object=card&limit=3", - ) - - def test_accounts_external_accounts_get_4( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.retrieve_external_account( - "acct_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", - query_string="", - ) - - def test_accounts_external_accounts_get_5( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.retrieve_external_account( - "acct_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", - query_string="", - ) - - def test_accounts_external_accounts_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.create_external_account( - "acct_xxxxxxxxxxxxx", - external_account="btok_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - query_string="", - post_data="external_account=btok_xxxxxxxxxxxxx", - ) - - def test_accounts_external_accounts_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.create_external_account( - "acct_xxxxxxxxxxxxx", - external_account="tok_xxxx_debit", - ) - http_client_mock.assert_requested( - "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - query_string="", - post_data="external_account=tok_xxxx_debit", - ) - - def test_accounts_external_accounts_post_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.modify_external_account( - "acct_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_accounts_external_accounts_post_4( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.modify_external_account( - "acct_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_accounts_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Account.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/accounts", - query_string="limit=3", - ) - - def test_accounts_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Account.retrieve("acct_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx", - query_string="", - ) - - def test_accounts_login_links_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.create_login_link("acct_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", - query_string="", - ) - - def test_accounts_persons_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.delete_person( - "acct_xxxxxxxxxxxxx", - "person_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "delete", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", - query_string="", - ) - - def test_accounts_persons_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.list_persons( - "acct_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", - query_string="limit=3", - ) - - def test_accounts_persons_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.retrieve_person( - "acct_xxxxxxxxxxxxx", - "person_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", - query_string="", - ) - - def test_accounts_persons_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.create_person( - "acct_xxxxxxxxxxxxx", - first_name="Jane", - last_name="Diaz", - ) - http_client_mock.assert_requested( - "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", - query_string="", - post_data="first_name=Jane&last_name=Diaz", - ) - - def test_accounts_persons_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.modify_person( - "acct_xxxxxxxxxxxxx", - "person_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_accounts_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Account.create( - type="custom", - country="US", - email="jenny.rosen@example.com", - capabilities={ - "card_payments": {"requested": True}, - "transfers": {"requested": True}, - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/accounts", - query_string="", - post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", - ) - - def test_accounts_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Account.modify( - "acct_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_accounts_reject_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Account.reject( - "acct_xxxxxxxxxxxxx", - reason="fraud", - ) - http_client_mock.assert_requested( - "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/reject", - query_string="", - post_data="reason=fraud", - ) - - def test_application_fees_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ApplicationFee.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/application_fees", - query_string="limit=3", - ) - - def test_application_fees_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ApplicationFee.retrieve("fee_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/application_fees/fee_xxxxxxxxxxxxx", - query_string="", - ) - - def test_application_fees_refunds_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ApplicationFee.list_refunds( - "fee_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", - query_string="limit=3", - ) - - def test_application_fees_refunds_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ApplicationFee.retrieve_refund( - "fee_xxxxxxxxxxxxx", - "fr_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "get", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", - query_string="", - ) - - def test_application_fees_refunds_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ApplicationFee.create_refund("fee_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", - query_string="", - ) - - def test_application_fees_refunds_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ApplicationFee.modify_refund( - "fee_xxxxxxxxxxxxx", - "fr_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_apps_secrets_delete_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.apps.Secret.delete_where( - name="my-api-key", - scope={"type": "account"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/apps/secrets/delete", - query_string="", - post_data="name=my-api-key&scope[type]=account", - ) - - def test_apps_secrets_find_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.apps.Secret.find( - name="sec_123", - scope={"type": "account"}, - ) - http_client_mock.assert_requested( - "get", - path="/v1/apps/secrets/find", - query_string="name=sec_123&scope[type]=account", - ) - - def test_apps_secrets_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.apps.Secret.list( - scope={"type": "account"}, - limit=2, - ) - http_client_mock.assert_requested( - "get", - path="/v1/apps/secrets", - query_string="scope[type]=account&limit=2", - ) - - def test_apps_secrets_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.apps.Secret.list( - scope={"type": "account"}, - limit=2, - ) - http_client_mock.assert_requested( - "get", - path="/v1/apps/secrets", - query_string="scope[type]=account&limit=2", - ) - - def test_apps_secrets_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.apps.Secret.create( - name="sec_123", - payload="very secret string", - scope={"type": "account"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/apps/secrets", - query_string="", - post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", - ) - - def test_apps_secrets_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.apps.Secret.create( - name="my-api-key", - payload="secret_key_xxxxxx", - scope={"type": "account"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/apps/secrets", - query_string="", - post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", - ) - - def test_balance_transactions_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.BalanceTransaction.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/balance_transactions", - query_string="limit=3", - ) - - def test_balance_transactions_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.BalanceTransaction.retrieve("txn_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", - query_string="", - ) - - def test_billing_portal_configurations_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.billing_portal.Configuration.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/billing_portal/configurations", - query_string="limit=3", - ) - - def test_billing_portal_configurations_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.billing_portal.Configuration.retrieve("bpc_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", - query_string="", - ) - - def test_billing_portal_configurations_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.billing_portal.Configuration.create( - features={ - "customer_update": { - "allowed_updates": ["email", "tax_id"], - "enabled": True, - }, - "invoice_history": {"enabled": True}, - }, - business_profile={ - "privacy_policy_url": "https://example.com/privacy", - "terms_of_service_url": "https://example.com/terms", - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/billing_portal/configurations", - query_string="", - post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", - ) - - def test_billing_portal_configurations_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.billing_portal.Configuration.modify( - "bpc_xxxxxxxxxxxxx", - business_profile={ - "privacy_policy_url": "https://example.com/privacy", - "terms_of_service_url": "https://example.com/terms", - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", - query_string="", - post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", - ) - - def test_billing_portal_sessions_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.billing_portal.Session.create( - customer="cus_xxxxxxxxxxxxx", - return_url="https://example.com/account", - ) - http_client_mock.assert_requested( - "post", - path="/v1/billing_portal/sessions", - query_string="", - post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", - ) - - def test_charges_capture_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Charge.capture("ch_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/charges/ch_xxxxxxxxxxxxx/capture", - query_string="", - ) - - def test_charges_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Charge.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/charges", - query_string="limit=3", - ) - - def test_charges_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Charge.retrieve("ch_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/charges/ch_xxxxxxxxxxxxx", - query_string="", - ) - - def test_charges_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Charge.create( - amount=2000, - currency="usd", - source="tok_xxxx", - description="My First Test Charge (created for API docs at https://www.stripe.com/docs/api)", - ) - http_client_mock.assert_requested( - "post", - path="/v1/charges", - query_string="", - post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", - ) - - def test_charges_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Charge.modify( - "ch_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/charges/ch_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_charges_search_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Charge.search( - query="amount>999 AND metadata['order_id']:'6735'" - ) - http_client_mock.assert_requested( - "get", - path="/v1/charges/search", - query_string="query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", - ) - - def test_checkout_sessions_expire_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.checkout.Session.expire("sess_xyz") - http_client_mock.assert_requested( - "post", - path="/v1/checkout/sessions/sess_xyz/expire", - query_string="", - ) - - def test_checkout_sessions_expire_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.checkout.Session.expire("cs_test_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", - query_string="", - ) - - def test_checkout_sessions_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.checkout.Session.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/checkout/sessions", - query_string="limit=3", - ) - - def test_checkout_sessions_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.checkout.Session.retrieve("cs_test_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", - query_string="", - ) - - def test_checkout_sessions_line_items_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.checkout.Session.list_line_items("sess_xyz") - http_client_mock.assert_requested( - "get", - path="/v1/checkout/sessions/sess_xyz/line_items", - query_string="", - ) - - def test_checkout_sessions_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.checkout.Session.create( - success_url="https://example.com/success", - cancel_url="https://example.com/cancel", - mode="payment", - shipping_options=[ - {"shipping_rate": "shr_standard"}, - { - "shipping_rate_data": { - "display_name": "Standard", - "delivery_estimate": { - "minimum": {"unit": "day", "value": 5}, - "maximum": {"unit": "day", "value": 7}, - }, - }, - }, - ], - ) - http_client_mock.assert_requested( - "post", - path="/v1/checkout/sessions", - query_string="", - post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", - ) - - def test_checkout_sessions_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.checkout.Session.create( - success_url="https://example.com/success", - line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], - mode="payment", - ) - http_client_mock.assert_requested( - "post", - path="/v1/checkout/sessions", - query_string="", - post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", - ) - - def test_country_specs_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.CountrySpec.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/country_specs", - query_string="limit=3", - ) - - def test_country_specs_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.CountrySpec.retrieve("US") - http_client_mock.assert_requested( - "get", - path="/v1/country_specs/US", - query_string="", - ) - - def test_coupons_delete(self, http_client_mock: HTTPClientMock) -> None: - stripe.Coupon.delete("Z4OV52SU") - http_client_mock.assert_requested( - "delete", - path="/v1/coupons/Z4OV52SU", - query_string="", - ) - - def test_coupons_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Coupon.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/coupons", - query_string="limit=3", - ) - - def test_coupons_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Coupon.retrieve("Z4OV52SU") - http_client_mock.assert_requested( - "get", - path="/v1/coupons/Z4OV52SU", - query_string="", - ) - - def test_coupons_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Coupon.create( - percent_off=25.5, - duration="repeating", - duration_in_months=3, - ) - http_client_mock.assert_requested( - "post", - path="/v1/coupons", - query_string="", - post_data="percent_off=25.5&duration=repeating&duration_in_months=3", - ) - - def test_coupons_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Coupon.modify( - "Z4OV52SU", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/coupons/Z4OV52SU", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_credit_notes_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.CreditNote.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/credit_notes", - query_string="limit=3", - ) - - def test_credit_notes_lines_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.CreditNote.list_lines( - "cn_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", - query_string="limit=3", - ) - - def test_credit_notes_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.CreditNote.create( - invoice="in_xxxxxxxxxxxxx", - lines=[ - { - "type": "invoice_line_item", - "invoice_line_item": "il_xxxxxxxxxxxxx", - "quantity": 1, - }, - ], - ) - http_client_mock.assert_requested( - "post", - path="/v1/credit_notes", - query_string="", - post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", - ) - - def test_credit_notes_preview_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.CreditNote.preview( - invoice="in_xxxxxxxxxxxxx", - lines=[ - { - "type": "invoice_line_item", - "invoice_line_item": "il_xxxxxxxxxxxxx", - "quantity": 1, - }, - ], - ) - http_client_mock.assert_requested( - "get", - path="/v1/credit_notes/preview", - query_string="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", - ) - - def test_credit_notes_preview_lines_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.CreditNote.preview_lines( - limit=3, - invoice="in_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "get", - path="/v1/credit_notes/preview/lines", - query_string="limit=3&invoice=in_xxxxxxxxxxxxx", - ) - - def test_credit_notes_void_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.CreditNote.void_credit_note("cn_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", - query_string="", - ) - - def test_customer_sessions_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.CustomerSession.create( - customer="cus_123", - components={"buy_button": {"enabled": True}}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/customer_sessions", - query_string="", - post_data="customer=cus_123&components[buy_button][enabled]=True", - ) - - def test_customers_balance_transactions_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.list_balance_transactions( - "cus_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", - query_string="limit=3", - ) - - def test_customers_balance_transactions_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.retrieve_balance_transaction( - "cus_xxxxxxxxxxxxx", - "cbtxn_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", - query_string="", - ) - - def test_customers_balance_transactions_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.create_balance_transaction( - "cus_xxxxxxxxxxxxx", - amount=-500, - currency="usd", - ) - http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", - query_string="", - post_data="amount=-500¤cy=usd", - ) - - def test_customers_balance_transactions_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.modify_balance_transaction( - "cus_xxxxxxxxxxxxx", - "cbtxn_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_customers_cash_balance_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.retrieve_cash_balance("cus_123") - http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_123/cash_balance", - query_string="", - ) - - def test_customers_cash_balance_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.modify_cash_balance( - "cus_123", - settings={"reconciliation_mode": "manual"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_123/cash_balance", - query_string="", - post_data="settings[reconciliation_mode]=manual", - ) - - def test_customers_delete(self, http_client_mock: HTTPClientMock) -> None: - stripe.Customer.delete("cus_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx", - query_string="", - ) - - def test_customers_funding_instructions_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.create_funding_instructions( - "cus_123", - bank_transfer={ - "requested_address_types": ["zengin"], - "type": "jp_bank_transfer", - }, - currency="usd", - funding_type="bank_transfer", - ) - http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_123/funding_instructions", - query_string="", - post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", - ) - - def test_customers_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Customer.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/customers", - query_string="limit=3", - ) - - def test_customers_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Customer.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/customers", - query_string="limit=3", - ) - - def test_customers_get_3(self, http_client_mock: HTTPClientMock) -> None: - stripe.Customer.retrieve("cus_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx", - query_string="", - ) - - def test_customers_payment_methods_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.list_payment_methods( - "cus_xyz", - type="card", - ) - http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xyz/payment_methods", - query_string="type=card", - ) - - def test_customers_payment_methods_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.list_payment_methods( - "cus_xxxxxxxxxxxxx", - type="card", - ) - http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", - query_string="type=card", - ) - - def test_customers_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Customer.create( - description="My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", - ) - http_client_mock.assert_requested( - "post", - path="/v1/customers", - query_string="", - post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", - ) - - def test_customers_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Customer.modify( - "cus_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_customers_search_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.search( - query="name:'fakename' AND metadata['foo']:'bar'", - ) - http_client_mock.assert_requested( - "get", - path="/v1/customers/search", - query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", - ) - - def test_customers_search_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.search( - query="name:'fakename' AND metadata['foo']:'bar'", - ) - http_client_mock.assert_requested( - "get", - path="/v1/customers/search", - query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", - ) - - def test_customers_sources_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.delete_source( - "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", - query_string="", - ) - - def test_customers_sources_delete_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.delete_source( - "cus_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", - query_string="", - ) - - def test_customers_sources_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.list_sources( - "cus_xxxxxxxxxxxxx", - object="bank_account", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources", - query_string="object=bank_account&limit=3", - ) - - def test_customers_sources_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.list_sources( - "cus_xxxxxxxxxxxxx", - object="card", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources", - query_string="object=card&limit=3", - ) - - def test_customers_sources_get_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.retrieve_source( - "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", - query_string="", - ) - - def test_customers_sources_get_4( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.retrieve_source( - "cus_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", - query_string="", - ) - - def test_customers_sources_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.modify_source( - "cus_123", - "card_123", - account_holder_name="Kamil", - ) - http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_123/sources/card_123", - query_string="", - post_data="account_holder_name=Kamil", - ) - - def test_customers_sources_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.create_source( - "cus_xxxxxxxxxxxxx", - source="btok_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources", - query_string="", - post_data="source=btok_xxxxxxxxxxxxx", - ) - - def test_customers_sources_post_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.create_source( - "cus_xxxxxxxxxxxxx", - source="tok_xxxx", - ) - http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources", - query_string="", - post_data="source=tok_xxxx", - ) - - def test_customers_sources_post_4( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.modify_source( - "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_customers_sources_post_5( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.modify_source( - "cus_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", - name="Jenny Rosen", - ) - http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", - query_string="", - post_data="name=Jenny%20Rosen", - ) - - def test_customers_tax_ids_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.delete_tax_id( - "cus_xxxxxxxxxxxxx", - "txi_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", - query_string="", - ) - - def test_customers_tax_ids_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.list_tax_ids( - "cus_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", - query_string="limit=3", - ) - - def test_customers_tax_ids_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.retrieve_tax_id( - "cus_xxxxxxxxxxxxx", - "txi_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", - query_string="", - ) - - def test_customers_tax_ids_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.create_tax_id( - "cus_xxxxxxxxxxxxx", - type="eu_vat", - value="DE123456789", - ) - http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", - query_string="", - post_data="type=eu_vat&value=DE123456789", - ) - - def test_disputes_close_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Dispute.close("dp_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/disputes/dp_xxxxxxxxxxxxx/close", - query_string="", - ) - - def test_disputes_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Dispute.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/disputes", - query_string="limit=3", - ) - - def test_disputes_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Dispute.retrieve("dp_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/disputes/dp_xxxxxxxxxxxxx", - query_string="", - ) - - def test_disputes_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Dispute.modify( - "dp_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/disputes/dp_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_events_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Event.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/events", - query_string="limit=3", - ) - - def test_events_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Event.retrieve("evt_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/events/evt_xxxxxxxxxxxxx", - query_string="", - ) - - def test_file_links_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.FileLink.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/file_links", - query_string="limit=3", - ) - - def test_file_links_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.FileLink.retrieve("link_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/file_links/link_xxxxxxxxxxxxx", - query_string="", - ) - - def test_file_links_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.FileLink.create(file="file_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/file_links", - query_string="", - post_data="file=file_xxxxxxxxxxxxx", - ) - - def test_file_links_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.FileLink.modify( - "link_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/file_links/link_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_files_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.File.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/files", - query_string="limit=3", - ) - - def test_files_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.File.retrieve("file_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/files/file_xxxxxxxxxxxxx", - query_string="", - ) - - def test_financial_connections_accounts_disconnect_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.disconnect("fca_xyz") - http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/accounts/fca_xyz/disconnect", - query_string="", - ) - - def test_financial_connections_accounts_disconnect_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.disconnect("fca_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", - query_string="", - ) - - def test_financial_connections_accounts_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.list() - http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/accounts", - query_string="", - ) - - def test_financial_connections_accounts_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.retrieve("fca_xyz") - http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/accounts/fca_xyz", - query_string="", - ) - - def test_financial_connections_accounts_get_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.list( - account_holder={"customer": "cus_xxxxxxxxxxxxx"}, - ) - http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/accounts", - query_string="account_holder[customer]=cus_xxxxxxxxxxxxx", - ) - - def test_financial_connections_accounts_get_4( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.retrieve("fca_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", - query_string="", - ) - - def test_financial_connections_accounts_owners_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.list_owners( - "fca_xyz", - ownership="fcaowns_xyz", - ) - http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/accounts/fca_xyz/owners", - query_string="ownership=fcaowns_xyz", - ) - - def test_financial_connections_accounts_owners_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.list_owners( - "fca_xxxxxxxxxxxxx", - limit=3, - ownership="fcaowns_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", - query_string="limit=3&ownership=fcaowns_xxxxxxxxxxxxx", - ) - - def test_financial_connections_accounts_refresh_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.refresh_account( - "fca_xyz", - features=["balance"], - ) - http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/accounts/fca_xyz/refresh", - query_string="", - post_data="features[0]=balance", - ) - - def test_financial_connections_accounts_subscribe_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.subscribe( - "fa_123", - features=["transactions"], - ) - http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/accounts/fa_123/subscribe", - query_string="", - post_data="features[0]=transactions", - ) - - def test_financial_connections_accounts_unsubscribe_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.unsubscribe( - "fa_123", - features=["transactions"], - ) - http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/accounts/fa_123/unsubscribe", - query_string="", - post_data="features[0]=transactions", - ) - - def test_financial_connections_sessions_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Session.retrieve("fcsess_xyz") - http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/sessions/fcsess_xyz", - query_string="", - ) - - def test_financial_connections_sessions_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Session.retrieve("fcsess_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", - query_string="", - ) - - def test_financial_connections_sessions_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Session.create( - account_holder={"type": "customer", "customer": "cus_123"}, - permissions=["balances"], - ) - http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/sessions", - query_string="", - post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", - ) - - def test_financial_connections_sessions_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Session.create( - account_holder={ - "type": "customer", - "customer": "cus_xxxxxxxxxxxxx", - }, - permissions=["payment_method", "balances"], - filters={"countries": ["US"]}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/sessions", - query_string="", - post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", - ) - - def test_financial_connections_transactions_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Transaction.retrieve("tr_123") - http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/transactions/tr_123", - query_string="", - ) - - def test_financial_connections_transactions_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Transaction.list(account="fca_xyz") - http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/transactions", - query_string="account=fca_xyz", - ) - - def test_identity_verification_reports_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.identity.VerificationReport.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/identity/verification_reports", - query_string="limit=3", - ) - - def test_identity_verification_reports_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.identity.VerificationReport.retrieve("vr_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", - query_string="", - ) - - def test_identity_verification_sessions_cancel_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.identity.VerificationSession.cancel("vs_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", - query_string="", - ) - - def test_identity_verification_sessions_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.identity.VerificationSession.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/identity/verification_sessions", - query_string="limit=3", - ) - - def test_identity_verification_sessions_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.identity.VerificationSession.retrieve("vs_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", - query_string="", - ) - - def test_identity_verification_sessions_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.identity.VerificationSession.create(type="document") - http_client_mock.assert_requested( - "post", - path="/v1/identity/verification_sessions", - query_string="", - post_data="type=document", - ) - - def test_identity_verification_sessions_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.identity.VerificationSession.modify( - "vs_xxxxxxxxxxxxx", - type="id_number", - ) - http_client_mock.assert_requested( - "post", - path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", - query_string="", - post_data="type=id_number", - ) - - def test_identity_verification_sessions_redact_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.identity.VerificationSession.redact("vs_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", - query_string="", - ) - - def test_invoiceitems_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.InvoiceItem.delete("ii_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", - query_string="", - ) - - def test_invoiceitems_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.InvoiceItem.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/invoiceitems", - query_string="limit=3", - ) - - def test_invoiceitems_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.InvoiceItem.retrieve("ii_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", - query_string="", - ) - - def test_invoiceitems_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.InvoiceItem.create( - customer="cus_xxxxxxxxxxxxx", - price="price_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "post", - path="/v1/invoiceitems", - query_string="", - post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", - ) - - def test_invoiceitems_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.InvoiceItem.modify( - "ii_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_invoices_delete(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.delete("in_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/invoices/in_xxxxxxxxxxxxx", - query_string="", - ) - - def test_invoices_finalize_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Invoice.finalize_invoice("in_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", - query_string="", - ) - - def test_invoices_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/invoices", - query_string="limit=3", - ) - - def test_invoices_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.retrieve("in_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/invoices/in_xxxxxxxxxxxxx", - query_string="", - ) - - def test_invoices_get_3(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.retrieve( - "in_xxxxxxxxxxxxx", - expand=["customer"], - ) - http_client_mock.assert_requested( - "get", - path="/v1/invoices/in_xxxxxxxxxxxxx", - query_string="expand[0]=customer", - ) - - def test_invoices_mark_uncollectible_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Invoice.mark_uncollectible("in_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", - query_string="", - ) - - def test_invoices_pay_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.pay("in_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/pay", - query_string="", - ) - - def test_invoices_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.create(customer="cus_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/invoices", - query_string="", - post_data="customer=cus_xxxxxxxxxxxxx", - ) - - def test_invoices_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.modify( - "in_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/invoices/in_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_invoices_search_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Invoice.search( - query="total>999 AND metadata['order_id']:'6735'" - ) - http_client_mock.assert_requested( - "get", - path="/v1/invoices/search", - query_string="query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", - ) - - def test_invoices_send_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Invoice.send_invoice("in_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/send", - query_string="", - ) - - def test_invoices_upcoming_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Invoice.upcoming(customer="cus_9utnxg47pWjV1e") - http_client_mock.assert_requested( - "get", - path="/v1/invoices/upcoming", - query_string="customer=cus_9utnxg47pWjV1e", - ) - - def test_invoices_void_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Invoice.void_invoice("in_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/void", - query_string="", - ) - - def test_issuing_authorizations_approve_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Authorization.approve("iauth_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", - query_string="", - ) - - def test_issuing_authorizations_decline_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Authorization.decline("iauth_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", - query_string="", - ) - - def test_issuing_authorizations_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Authorization.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/issuing/authorizations", - query_string="limit=3", - ) - - def test_issuing_authorizations_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Authorization.retrieve("iauth_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", - query_string="", - ) - - def test_issuing_authorizations_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Authorization.modify( - "iauth_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_issuing_cardholders_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Cardholder.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/issuing/cardholders", - query_string="limit=3", - ) - - def test_issuing_cardholders_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Cardholder.retrieve("ich_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", - query_string="", - ) - - def test_issuing_cardholders_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Cardholder.create( - type="individual", - name="Jenny Rosen", - email="jenny.rosen@example.com", - phone_number="+18888675309", - billing={ - "address": { - "line1": "1234 Main Street", - "city": "San Francisco", - "state": "CA", - "country": "US", - "postal_code": "94111", - }, - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/issuing/cardholders", - query_string="", - post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", - ) - - def test_issuing_cardholders_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Cardholder.modify( - "ich_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_issuing_cards_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.issuing.Card.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/issuing/cards", - query_string="limit=3", - ) - - def test_issuing_cards_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Card.retrieve("ic_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", - query_string="", - ) - - def test_issuing_cards_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Card.create( - cardholder="ich_xxxxxxxxxxxxx", - currency="usd", - type="virtual", - ) - http_client_mock.assert_requested( - "post", - path="/v1/issuing/cards", - query_string="", - post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", - ) - - def test_issuing_cards_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Card.modify( - "ic_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_issuing_disputes_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Dispute.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/issuing/disputes", - query_string="limit=3", - ) - - def test_issuing_disputes_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Dispute.retrieve("idp_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", - query_string="", - ) - - def test_issuing_disputes_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Dispute.create( - transaction="ipi_xxxxxxxxxxxxx", - evidence={ - "reason": "fraudulent", - "fraudulent": {"explanation": "Purchase was unrecognized."}, - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/issuing/disputes", - query_string="", - post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", - ) - - def test_issuing_disputes_submit_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Dispute.submit("idp_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", - query_string="", - ) - - def test_issuing_transactions_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Transaction.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/issuing/transactions", - query_string="limit=3", - ) - - def test_issuing_transactions_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Transaction.retrieve("ipi_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", - query_string="", - ) - - def test_issuing_transactions_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Transaction.modify( - "ipi_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_mandates_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Mandate.retrieve("mandate_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/mandates/mandate_xxxxxxxxxxxxx", - query_string="", - ) - - def test_payment_intents_apply_customer_balance_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.apply_customer_balance("pi_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", - query_string="", - ) - - def test_payment_intents_cancel_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.cancel("pi_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", - query_string="", - ) - - def test_payment_intents_capture_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.capture("pi_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", - query_string="", - ) - - def test_payment_intents_confirm_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.confirm( - "pi_xxxxxxxxxxxxx", - payment_method="pm_card_visa", - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", - query_string="", - post_data="payment_method=pm_card_visa", - ) - - def test_payment_intents_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/payment_intents", - query_string="limit=3", - ) - - def test_payment_intents_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.retrieve("pi_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx", - query_string="", - ) - - def test_payment_intents_increment_authorization_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.increment_authorization( - "pi_xxxxxxxxxxxxx", - amount=2099, - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", - query_string="", - post_data="amount=2099", - ) - - def test_payment_intents_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.create( - amount=1099, - currency="eur", - automatic_payment_methods={"enabled": True}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_intents", - query_string="", - post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", - ) - - def test_payment_intents_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.create( - amount=2000, - currency="usd", - automatic_payment_methods={"enabled": True}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_intents", - query_string="", - post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", - ) - - def test_payment_intents_post_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.modify( - "pi_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_payment_intents_post_4( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.create( - amount=200, - currency="usd", - payment_method_data={"type": "p24", "p24": {"bank": "blik"}}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_intents", - query_string="", - post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", - ) - - def test_payment_intents_search_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.search( - query="status:'succeeded' AND metadata['order_id']:'6735'", - ) - http_client_mock.assert_requested( - "get", - path="/v1/payment_intents/search", - query_string="query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", - ) - - def test_payment_intents_verify_microdeposits_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.verify_microdeposits("pi_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", - query_string="", - ) - - def test_payment_intents_verify_microdeposits_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentIntent.verify_microdeposits( - "pi_xxxxxxxxxxxxx", - amounts=[32, 45], - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", - query_string="", - post_data="amounts[0]=32&amounts[1]=45", - ) - - def test_payment_links_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.PaymentLink.retrieve("pl_xyz") - http_client_mock.assert_requested( - "get", - path="/v1/payment_links/pl_xyz", - query_string="", - ) - - def test_payment_links_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentLink.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/payment_links", - query_string="limit=3", - ) - - def test_payment_links_get_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentLink.retrieve("plink_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/payment_links/plink_xxxxxxxxxxxxx", - query_string="", - ) - - def test_payment_links_line_items_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentLink.list_line_items("pl_xyz") - http_client_mock.assert_requested( - "get", - path="/v1/payment_links/pl_xyz/line_items", - query_string="", - ) - - def test_payment_links_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentLink.create( - line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_links", - query_string="", - post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", - ) - - def test_payment_links_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentLink.create( - line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_links", - query_string="", - post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", - ) - - def test_payment_links_post_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentLink.modify( - "plink_xxxxxxxxxxxxx", - active=False, - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_links/plink_xxxxxxxxxxxxx", - query_string="", - post_data="active=False", - ) - - def test_payment_method_configurations_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethodConfiguration.list(application="foo") - http_client_mock.assert_requested( - "get", - path="/v1/payment_method_configurations", - query_string="application=foo", - ) - - def test_payment_method_configurations_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethodConfiguration.retrieve("foo") - http_client_mock.assert_requested( - "get", - path="/v1/payment_method_configurations/foo", - query_string="", - ) - - def test_payment_method_configurations_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethodConfiguration.create( - acss_debit={"display_preference": {"preference": "none"}}, - affirm={"display_preference": {"preference": "none"}}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_method_configurations", - query_string="", - post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", - ) - - def test_payment_method_configurations_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethodConfiguration.modify( - "foo", - acss_debit={"display_preference": {"preference": "on"}}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_method_configurations/foo", - query_string="", - post_data="acss_debit[display_preference][preference]=on", - ) - - def test_payment_methods_attach_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethod.attach( - "pm_xxxxxxxxxxxxx", - customer="cus_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", - query_string="", - post_data="customer=cus_xxxxxxxxxxxxx", - ) - - def test_payment_methods_detach_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethod.detach("pm_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", - query_string="", - ) - - def test_payment_methods_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethod.list( - customer="cus_xxxxxxxxxxxxx", - type="card", - ) - http_client_mock.assert_requested( - "get", - path="/v1/payment_methods", - query_string="customer=cus_xxxxxxxxxxxxx&type=card", - ) - - def test_payment_methods_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethod.retrieve("pm_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/payment_methods/pm_xxxxxxxxxxxxx", - query_string="", - ) - - def test_payment_methods_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethod.create( - type="card", - card={ - "number": "4242424242424242", - "exp_month": 8, - "exp_year": 2024, - "cvc": "314", - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_methods", - query_string="", - post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", - ) - - def test_payment_methods_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethod.modify( - "pm_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/payment_methods/pm_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_payouts_cancel_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Payout.cancel("po_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", - query_string="", - ) - - def test_payouts_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Payout.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/payouts", - query_string="limit=3", - ) - - def test_payouts_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Payout.retrieve("po_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/payouts/po_xxxxxxxxxxxxx", - query_string="", - ) - - def test_payouts_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Payout.create( - amount=1100, - currency="usd", - ) - http_client_mock.assert_requested( - "post", - path="/v1/payouts", - query_string="", - post_data="amount=1100¤cy=usd", - ) - - def test_payouts_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Payout.modify( - "po_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/payouts/po_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_payouts_reverse_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Payout.reverse("po_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", - query_string="", - ) - - def test_plans_delete(self, http_client_mock: HTTPClientMock) -> None: - stripe.Plan.delete("price_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/plans/price_xxxxxxxxxxxxx", - query_string="", - ) - - def test_plans_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Plan.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/plans", - query_string="limit=3", - ) - - def test_plans_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Plan.retrieve("price_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/plans/price_xxxxxxxxxxxxx", - query_string="", - ) - - def test_plans_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Plan.create( - amount=2000, - currency="usd", - interval="month", - product="prod_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "post", - path="/v1/plans", - query_string="", - post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", - ) - - def test_plans_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Plan.create( - amount=2000, - currency="usd", - interval="month", - product={"name": "My product"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/plans", - query_string="", - post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", - ) - - def test_plans_post_3(self, http_client_mock: HTTPClientMock) -> None: - stripe.Plan.modify( - "price_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/plans/price_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_prices_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Price.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/prices", - query_string="limit=3", - ) - - def test_prices_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Price.retrieve("price_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/prices/price_xxxxxxxxxxxxx", - query_string="", - ) - - def test_prices_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Price.create( - unit_amount=2000, - currency="usd", - currency_options={ - "uah": {"unit_amount": 5000}, - "eur": {"unit_amount": 1800}, - }, - recurring={"interval": "month"}, - product="prod_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "post", - path="/v1/prices", - query_string="", - post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", - ) - - def test_prices_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Price.create( - unit_amount=2000, - currency="usd", - recurring={"interval": "month"}, - product="prod_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "post", - path="/v1/prices", - query_string="", - post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", - ) - - def test_prices_post_3(self, http_client_mock: HTTPClientMock) -> None: - stripe.Price.modify( - "price_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/prices/price_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_prices_search_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Price.search( - query="active:'true' AND metadata['order_id']:'6735'", - ) - http_client_mock.assert_requested( - "get", - path="/v1/prices/search", - query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", - ) - - def test_products_delete(self, http_client_mock: HTTPClientMock) -> None: - stripe.Product.delete("prod_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/products/prod_xxxxxxxxxxxxx", - query_string="", - ) - - def test_products_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Product.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/products", - query_string="limit=3", - ) - - def test_products_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Product.retrieve("prod_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/products/prod_xxxxxxxxxxxxx", - query_string="", - ) - - def test_products_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Product.create(name="Gold Special") - http_client_mock.assert_requested( - "post", - path="/v1/products", - query_string="", - post_data="name=Gold%20Special", - ) - - def test_products_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Product.modify( - "prod_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/products/prod_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_products_search_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Product.search( - query="active:'true' AND metadata['order_id']:'6735'", - ) - http_client_mock.assert_requested( - "get", - path="/v1/products/search", - query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", - ) - - def test_promotion_codes_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PromotionCode.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/promotion_codes", - query_string="limit=3", - ) - - def test_promotion_codes_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PromotionCode.retrieve("promo_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", - query_string="", - ) - - def test_promotion_codes_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PromotionCode.create(coupon="Z4OV52SU") - http_client_mock.assert_requested( - "post", - path="/v1/promotion_codes", - query_string="", - post_data="coupon=Z4OV52SU", - ) - - def test_promotion_codes_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PromotionCode.modify( - "promo_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_quotes_accept_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Quote.accept("qt_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", - query_string="", - ) - - def test_quotes_cancel_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Quote.cancel("qt_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", - query_string="", - ) - - def test_quotes_finalize_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Quote.finalize_quote("qt_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", - query_string="", - ) - - def test_quotes_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Quote.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/quotes", - query_string="limit=3", - ) - - def test_quotes_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Quote.retrieve("qt_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/quotes/qt_xxxxxxxxxxxxx", - query_string="", - ) - - def test_quotes_line_items_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Quote.list_line_items("qt_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", - query_string="", - ) - - def test_quotes_pdf_get( - self, http_client_mock_streaming: HTTPClientMock - ) -> None: - stripe.Quote.pdf("qt_xxxxxxxxxxxxx") - http_client_mock_streaming.assert_requested( - "get", - path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", - query_string="", - ) - - def test_quotes_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Quote.create( - customer="cus_xxxxxxxxxxxxx", - line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], - ) - http_client_mock.assert_requested( - "post", - path="/v1/quotes", - query_string="", - post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", - ) - - def test_quotes_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Quote.modify( - "qt_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/quotes/qt_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_radar_early_fraud_warnings_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.radar.EarlyFraudWarning.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/radar/early_fraud_warnings", - query_string="limit=3", - ) - - def test_radar_early_fraud_warnings_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.radar.EarlyFraudWarning.retrieve("issfr_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", - query_string="", - ) - - def test_radar_value_list_items_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.radar.ValueListItem.delete("rsli_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", - query_string="", - ) - - def test_radar_value_list_items_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.radar.ValueListItem.list( - limit=3, - value_list="rsl_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "get", - path="/v1/radar/value_list_items", - query_string="limit=3&value_list=rsl_xxxxxxxxxxxxx", - ) - - def test_radar_value_list_items_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.radar.ValueListItem.retrieve("rsli_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", - query_string="", - ) - - def test_radar_value_list_items_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.radar.ValueListItem.create( - value_list="rsl_xxxxxxxxxxxxx", - value="1.2.3.4", - ) - http_client_mock.assert_requested( - "post", - path="/v1/radar/value_list_items", - query_string="", - post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", - ) - - def test_radar_value_lists_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.radar.ValueList.delete("rsl_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", - query_string="", - ) - - def test_radar_value_lists_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.radar.ValueList.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/radar/value_lists", - query_string="limit=3", - ) - - def test_radar_value_lists_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.radar.ValueList.retrieve("rsl_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", - query_string="", - ) - - def test_radar_value_lists_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.radar.ValueList.create( - alias="custom_ip_xxxxxxxxxxxxx", - name="Custom IP Blocklist", - item_type="ip_address", - ) - http_client_mock.assert_requested( - "post", - path="/v1/radar/value_lists", - query_string="", - post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", - ) - - def test_radar_value_lists_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.radar.ValueList.modify( - "rsl_xxxxxxxxxxxxx", - name="Updated IP Block List", - ) - http_client_mock.assert_requested( - "post", - path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", - query_string="", - post_data="name=Updated%20IP%20Block%20List", - ) - - def test_refunds_cancel_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Refund.cancel("re_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", - query_string="", - ) - - def test_refunds_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Refund.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/refunds", - query_string="limit=3", - ) - - def test_refunds_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Refund.retrieve("re_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/refunds/re_xxxxxxxxxxxxx", - query_string="", - ) - - def test_refunds_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Refund.create(charge="ch_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/refunds", - query_string="", - post_data="charge=ch_xxxxxxxxxxxxx", - ) - - def test_refunds_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Refund.modify( - "re_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/refunds/re_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_reporting_report_runs_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.reporting.ReportRun.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/reporting/report_runs", - query_string="limit=3", - ) - - def test_reporting_report_runs_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.reporting.ReportRun.retrieve("frr_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", - query_string="", - ) - - def test_reporting_report_runs_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.reporting.ReportRun.create( - report_type="balance.summary.1", - parameters={ - "interval_start": 1522540800, - "interval_end": 1525132800, - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/reporting/report_runs", - query_string="", - post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", - ) - - def test_reporting_report_types_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.reporting.ReportType.list() - http_client_mock.assert_requested( - "get", - path="/v1/reporting/report_types", - query_string="", - ) - - def test_reporting_report_types_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.reporting.ReportType.retrieve("balance.summary.1") - http_client_mock.assert_requested( - "get", - path="/v1/reporting/report_types/balance.summary.1", - query_string="", - ) - - def test_reviews_approve_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Review.approve("prv_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", - query_string="", - ) - - def test_reviews_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Review.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/reviews", - query_string="limit=3", - ) - - def test_reviews_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Review.retrieve("prv_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/reviews/prv_xxxxxxxxxxxxx", - query_string="", - ) - - def test_setup_attempts_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SetupAttempt.list( - limit=3, - setup_intent="si_xyz", - ) - http_client_mock.assert_requested( - "get", - path="/v1/setup_attempts", - query_string="limit=3&setup_intent=si_xyz", - ) - - def test_setup_intents_cancel_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SetupIntent.cancel("seti_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", - query_string="", - ) - - def test_setup_intents_confirm_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SetupIntent.confirm( - "seti_xxxxxxxxxxxxx", - payment_method="pm_card_visa", - ) - http_client_mock.assert_requested( - "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", - query_string="", - post_data="payment_method=pm_card_visa", - ) - - def test_setup_intents_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.SetupIntent.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/setup_intents", - query_string="limit=3", - ) - - def test_setup_intents_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SetupIntent.retrieve("seti_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx", - query_string="", - ) - - def test_setup_intents_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SetupIntent.create(payment_method_types=["card"]) - http_client_mock.assert_requested( - "post", - path="/v1/setup_intents", - query_string="", - post_data="payment_method_types[0]=card", - ) - - def test_setup_intents_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SetupIntent.modify( - "seti_xxxxxxxxxxxxx", - metadata={"user_id": "3435453"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[user_id]=3435453", - ) - - def test_setup_intents_verify_microdeposits_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SetupIntent.verify_microdeposits("seti_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", - query_string="", - ) - - def test_setup_intents_verify_microdeposits_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SetupIntent.verify_microdeposits( - "seti_xxxxxxxxxxxxx", - amounts=[32, 45], - ) - http_client_mock.assert_requested( - "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", - query_string="", - post_data="amounts[0]=32&amounts[1]=45", - ) - - def test_shipping_rates_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ShippingRate.list() - http_client_mock.assert_requested( - "get", - path="/v1/shipping_rates", - query_string="", - ) - - def test_shipping_rates_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ShippingRate.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/shipping_rates", - query_string="limit=3", - ) - - def test_shipping_rates_get_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ShippingRate.retrieve("shr_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", - query_string="", - ) - - def test_shipping_rates_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ShippingRate.create( - display_name="Sample Shipper", - fixed_amount={"currency": "usd", "amount": 400}, - type="fixed_amount", - ) - http_client_mock.assert_requested( - "post", - path="/v1/shipping_rates", - query_string="", - post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", - ) - - def test_shipping_rates_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ShippingRate.create( - display_name="Ground shipping", - type="fixed_amount", - fixed_amount={"amount": 500, "currency": "usd"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/shipping_rates", - query_string="", - post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", - ) - - def test_shipping_rates_post_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ShippingRate.modify( - "shr_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_sigma_scheduled_query_runs_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.sigma.ScheduledQueryRun.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/sigma/scheduled_query_runs", - query_string="limit=3", - ) - - def test_sigma_scheduled_query_runs_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.sigma.ScheduledQueryRun.retrieve("sqr_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", - query_string="", - ) - - def test_sources_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Source.retrieve("src_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/sources/src_xxxxxxxxxxxxx", - query_string="", - ) - - def test_sources_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Source.retrieve("src_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/sources/src_xxxxxxxxxxxxx", - query_string="", - ) - - def test_sources_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Source.modify( - "src_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/sources/src_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_subscription_items_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionItem.delete("si_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/subscription_items/si_xxxxxxxxxxxxx", - query_string="", - ) - - def test_subscription_items_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionItem.list(subscription="sub_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/subscription_items", - query_string="subscription=sub_xxxxxxxxxxxxx", - ) - - def test_subscription_items_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionItem.retrieve("si_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/subscription_items/si_xxxxxxxxxxxxx", - query_string="", - ) - - def test_subscription_items_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionItem.create( - subscription="sub_xxxxxxxxxxxxx", - price="price_xxxxxxxxxxxxx", - quantity=2, - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscription_items", - query_string="", - post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", - ) - - def test_subscription_items_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionItem.modify( - "si_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscription_items/si_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_subscription_items_usage_record_summaries_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionItem.list_usage_record_summaries( - "si_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", - query_string="limit=3", - ) - - def test_subscription_items_usage_records_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionItem.create_usage_record( - "si_xxxxxxxxxxxxx", - quantity=100, - timestamp=1571252444, - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", - query_string="", - post_data="quantity=100×tamp=1571252444", - ) - - def test_subscription_schedules_cancel_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionSchedule.cancel("sub_sched_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", - query_string="", - ) - - def test_subscription_schedules_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionSchedule.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/subscription_schedules", - query_string="limit=3", - ) - - def test_subscription_schedules_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionSchedule.retrieve("sub_sched_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", - query_string="", - ) - - def test_subscription_schedules_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionSchedule.create( - customer="cus_xxxxxxxxxxxxx", - start_date=1676070661, - end_behavior="release", - phases=[ - { - "items": [{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], - "iterations": 12, - }, - ], - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscription_schedules", - query_string="", - post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", - ) - - def test_subscription_schedules_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionSchedule.modify( - "sub_sched_xxxxxxxxxxxxx", - end_behavior="release", - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", - query_string="", - post_data="end_behavior=release", - ) - - def test_subscription_schedules_release_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionSchedule.release("sub_sched_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", - query_string="", - ) - - def test_subscriptions_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Subscription.cancel("sub_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/subscriptions/sub_xxxxxxxxxxxxx", - query_string="", - ) - - def test_subscriptions_discount_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Subscription.delete_discount("sub_xyz") - http_client_mock.assert_requested( - "delete", - path="/v1/subscriptions/sub_xyz/discount", - query_string="", - ) - - def test_subscriptions_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Subscription.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/subscriptions", - query_string="limit=3", - ) - - def test_subscriptions_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Subscription.retrieve("sub_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/subscriptions/sub_xxxxxxxxxxxxx", - query_string="", - ) - - def test_subscriptions_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Subscription.create( - customer="cus_xxxxxxxxxxxxx", - items=[{"price": "price_xxxxxxxxxxxxx"}], - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscriptions", - query_string="", - post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", - ) - - def test_subscriptions_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Subscription.modify( - "sub_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscriptions/sub_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_subscriptions_search_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Subscription.search( - query="status:'active' AND metadata['order_id']:'6735'", - ) - http_client_mock.assert_requested( - "get", - path="/v1/subscriptions/search", - query_string="query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", - ) - - def test_tax_calculations_line_items_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.tax.Calculation.list_line_items("xxx") - http_client_mock.assert_requested( - "get", - path="/v1/tax/calculations/xxx/line_items", - query_string="", - ) - - def test_tax_calculations_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.tax.Calculation.create( - currency="usd", - line_items=[{"amount": 1000, "reference": "L1"}], - customer_details={ - "address": { - "line1": "354 Oyster Point Blvd", - "city": "South San Francisco", - "state": "CA", - "postal_code": "94080", - "country": "US", - }, - "address_source": "shipping", - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/tax/calculations", - query_string="", - post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", - ) - - def test_tax_codes_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxCode.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/tax_codes", - query_string="limit=3", - ) - - def test_tax_codes_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxCode.retrieve("txcd_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", - query_string="", - ) - - def test_tax_rates_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxRate.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/tax_rates", - query_string="limit=3", - ) - - def test_tax_rates_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxRate.retrieve("txr_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/tax_rates/txr_xxxxxxxxxxxxx", - query_string="", - ) - - def test_tax_rates_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxRate.create( - display_name="VAT", - description="VAT Germany", - jurisdiction="DE", - percentage=16, - inclusive=False, - ) - http_client_mock.assert_requested( - "post", - path="/v1/tax_rates", - query_string="", - post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", - ) - - def test_tax_rates_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxRate.modify( - "txr_xxxxxxxxxxxxx", - active=False, - ) - http_client_mock.assert_requested( - "post", - path="/v1/tax_rates/txr_xxxxxxxxxxxxx", - query_string="", - post_data="active=False", - ) - - def test_tax_registrations_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.tax.Registration.list(status="all") - http_client_mock.assert_requested( - "get", - path="/v1/tax/registrations", - query_string="status=all", - ) - - def test_tax_registrations_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.tax.Registration.create( - country="IE", - country_options={"ie": {"type": "oss_union"}}, - active_from="now", - ) - http_client_mock.assert_requested( - "post", - path="/v1/tax/registrations", - query_string="", - post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", - ) - - def test_tax_registrations_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.tax.Registration.modify( - "taxreg_xxxxxxxxxxxxx", - expires_at="now", - ) - http_client_mock.assert_requested( - "post", - path="/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", - query_string="", - post_data="expires_at=now", - ) - - def test_tax_settings_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.tax.Settings.retrieve() - http_client_mock.assert_requested( - "get", - path="/v1/tax/settings", - query_string="", - ) - - def test_tax_settings_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.tax.Settings.modify(defaults={"tax_code": "txcd_10000000"}) - http_client_mock.assert_requested( - "post", - path="/v1/tax/settings", - query_string="", - post_data="defaults[tax_code]=txcd_10000000", - ) - - def test_tax_transactions_create_from_calculation_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.tax.Transaction.create_from_calculation( - calculation="xxx", - reference="yyy", - ) - http_client_mock.assert_requested( - "post", - path="/v1/tax/transactions/create_from_calculation", - query_string="", - post_data="calculation=xxx&reference=yyy", - ) - - def test_terminal_configurations_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Configuration.delete("uc_123") - http_client_mock.assert_requested( - "delete", - path="/v1/terminal/configurations/uc_123", - query_string="", - ) - - def test_terminal_configurations_delete_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Configuration.delete("tmc_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", - query_string="", - ) - - def test_terminal_configurations_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Configuration.list() - http_client_mock.assert_requested( - "get", - path="/v1/terminal/configurations", - query_string="", - ) - - def test_terminal_configurations_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Configuration.retrieve("uc_123") - http_client_mock.assert_requested( - "get", - path="/v1/terminal/configurations/uc_123", - query_string="", - ) - - def test_terminal_configurations_get_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Configuration.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/terminal/configurations", - query_string="limit=3", - ) - - def test_terminal_configurations_get_4( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Configuration.retrieve("tmc_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", - query_string="", - ) - - def test_terminal_configurations_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Configuration.create() - http_client_mock.assert_requested( - "post", - path="/v1/terminal/configurations", - query_string="", - ) - - def test_terminal_configurations_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Configuration.modify( - "uc_123", - tipping={"usd": {"fixed_amounts": [10]}}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/configurations/uc_123", - query_string="", - post_data="tipping[usd][fixed_amounts][0]=10", - ) - - def test_terminal_configurations_post_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Configuration.create( - bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/configurations", - query_string="", - post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", - ) - - def test_terminal_configurations_post_4( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Configuration.modify( - "tmc_xxxxxxxxxxxxx", - bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", - query_string="", - post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", - ) - - def test_terminal_connection_tokens_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.ConnectionToken.create() - http_client_mock.assert_requested( - "post", - path="/v1/terminal/connection_tokens", - query_string="", - ) - - def test_terminal_locations_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Location.delete("tml_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", - query_string="", - ) - - def test_terminal_locations_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Location.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/terminal/locations", - query_string="limit=3", - ) - - def test_terminal_locations_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Location.retrieve("tml_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", - query_string="", - ) - - def test_terminal_locations_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Location.create( - display_name="My First Store", - address={ - "line1": "1234 Main Street", - "city": "San Francisco", - "postal_code": "94111", - "state": "CA", - "country": "US", - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/locations", - query_string="", - post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", - ) - - def test_terminal_locations_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Location.modify( - "tml_xxxxxxxxxxxxx", - display_name="My First Store", - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", - query_string="", - post_data="display_name=My%20First%20Store", - ) - - def test_terminal_readers_cancel_action_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Reader.cancel_action("tmr_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", - query_string="", - ) - - def test_terminal_readers_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Reader.delete("tmr_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", - query_string="", - ) - - def test_terminal_readers_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Reader.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/terminal/readers", - query_string="limit=3", - ) - - def test_terminal_readers_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Reader.retrieve("tmr_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", - query_string="", - ) - - def test_terminal_readers_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Reader.create( - registration_code="puppies-plug-could", - label="Blue Rabbit", - location="tml_1234", - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers", - query_string="", - post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", - ) - - def test_terminal_readers_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Reader.modify( - "tmr_xxxxxxxxxxxxx", - label="Blue Rabbit", - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", - query_string="", - post_data="label=Blue%20Rabbit", - ) - - def test_terminal_readers_process_payment_intent_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Reader.process_payment_intent( - "tmr_xxxxxxxxxxxxx", - payment_intent="pi_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", - query_string="", - post_data="payment_intent=pi_xxxxxxxxxxxxx", - ) - - def test_terminal_readers_process_setup_intent_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Reader.process_setup_intent( - "tmr_xxxxxxxxxxxxx", - setup_intent="seti_xxxxxxxxxxxxx", - customer_consent_collected=True, - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", - query_string="", - post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", - ) - - def test_test_helpers_customers_fund_cash_balance_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.TestHelpers.fund_cash_balance( - "cus_123", - amount=30, - currency="eur", - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/customers/cus_123/fund_cash_balance", - query_string="", - post_data="amount=30¤cy=eur", - ) - - def test_test_helpers_issuing_authorizations_capture_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Authorization.TestHelpers.capture( - "example_authorization", - capture_amount=100, - close_authorization=True, - purchase_details={ - "flight": { - "departure_at": 1633651200, - "passenger_name": "John Doe", - "refundable": True, - "segments": [ - { - "arrival_airport_code": "SFO", - "carrier": "Delta", - "departure_airport_code": "LAX", - "flight_number": "DL100", - "service_class": "Economy", - "stopover_allowed": True, - }, - ], - "travel_agency": "Orbitz", - }, - "fuel": { - "type": "diesel", - "unit": "liter", - "unit_cost_decimal": "3.5", - "volume_decimal": "10", - }, - "lodging": {"check_in_at": 1633651200, "nights": 2}, - "receipt": [ - { - "description": "Room charge", - "quantity": "1", - "total": 200, - "unit_cost": 200, - }, - ], - "reference": "foo", - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", - query_string="", - post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", - ) - - def test_test_helpers_issuing_authorizations_expire_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Authorization.TestHelpers.expire( - "example_authorization" - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations/example_authorization/expire", - query_string="", - ) - - def test_test_helpers_issuing_authorizations_increment_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Authorization.TestHelpers.increment( - "example_authorization", - increment_amount=50, - is_amount_controllable=True, - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations/example_authorization/increment", - query_string="", - post_data="increment_amount=50&is_amount_controllable=True", - ) - - def test_test_helpers_issuing_authorizations_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Authorization.TestHelpers.create( - amount=100, - amount_details={"atm_fee": 10, "cashback_amount": 5}, - authorization_method="chip", - card="foo", - currency="usd", - is_amount_controllable=True, - merchant_data={ - "category": "ac_refrigeration_repair", - "city": "foo", - "country": "bar", - "name": "foo", - "network_id": "bar", - "postal_code": "foo", - "state": "bar", - "terminal_id": "foo", - }, - network_data={"acquiring_institution_id": "foo"}, - verification_data={ - "address_line1_check": "mismatch", - "address_postal_code_check": "match", - "cvc_check": "match", - "expiry_check": "mismatch", - }, - wallet="apple_pay", - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations", - query_string="", - post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", - ) - - def test_test_helpers_issuing_authorizations_reverse_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Authorization.TestHelpers.reverse( - "example_authorization", - reverse_amount=20, - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations/example_authorization/reverse", - query_string="", - post_data="reverse_amount=20", - ) - - def test_test_helpers_issuing_cards_shipping_deliver_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Card.TestHelpers.deliver_card("card_123") - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", - query_string="", - ) - - def test_test_helpers_issuing_cards_shipping_fail_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Card.TestHelpers.fail_card("card_123") - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", - query_string="", - ) - - def test_test_helpers_issuing_cards_shipping_return_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Card.TestHelpers.return_card("card_123") - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/return", - query_string="", - ) - - def test_test_helpers_issuing_cards_shipping_ship_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Card.TestHelpers.ship_card("card_123") - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", - query_string="", - ) - - def test_test_helpers_issuing_transactions_create_force_capture_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Transaction.TestHelpers.create_force_capture( - amount=100, - card="foo", - currency="usd", - merchant_data={ - "category": "ac_refrigeration_repair", - "city": "foo", - "country": "US", - "name": "foo", - "network_id": "bar", - "postal_code": "10001", - "state": "NY", - "terminal_id": "foo", - }, - purchase_details={ - "flight": { - "departure_at": 1633651200, - "passenger_name": "John Doe", - "refundable": True, - "segments": [ - { - "arrival_airport_code": "SFO", - "carrier": "Delta", - "departure_airport_code": "LAX", - "flight_number": "DL100", - "service_class": "Economy", - "stopover_allowed": True, - }, - ], - "travel_agency": "Orbitz", - }, - "fuel": { - "type": "diesel", - "unit": "liter", - "unit_cost_decimal": "3.5", - "volume_decimal": "10", - }, - "lodging": {"check_in_at": 1533651200, "nights": 2}, - "receipt": [ - { - "description": "Room charge", - "quantity": "1", - "total": 200, - "unit_cost": 200, - }, - ], - "reference": "foo", - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/transactions/create_force_capture", - query_string="", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", - ) - - def test_test_helpers_issuing_transactions_create_unlinked_refund_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Transaction.TestHelpers.create_unlinked_refund( - amount=100, - card="foo", - currency="usd", - merchant_data={ - "category": "ac_refrigeration_repair", - "city": "foo", - "country": "bar", - "name": "foo", - "network_id": "bar", - "postal_code": "foo", - "state": "bar", - "terminal_id": "foo", - }, - purchase_details={ - "flight": { - "departure_at": 1533651200, - "passenger_name": "John Doe", - "refundable": True, - "segments": [ - { - "arrival_airport_code": "SFO", - "carrier": "Delta", - "departure_airport_code": "LAX", - "flight_number": "DL100", - "service_class": "Economy", - "stopover_allowed": True, - }, - ], - "travel_agency": "Orbitz", - }, - "fuel": { - "type": "diesel", - "unit": "liter", - "unit_cost_decimal": "3.5", - "volume_decimal": "10", - }, - "lodging": {"check_in_at": 1533651200, "nights": 2}, - "receipt": [ - { - "description": "Room charge", - "quantity": "1", - "total": 200, - "unit_cost": 200, - }, - ], - "reference": "foo", - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", - query_string="", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", - ) - - def test_test_helpers_issuing_transactions_refund_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Transaction.TestHelpers.refund( - "example_transaction", - refund_amount=50, - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/transactions/example_transaction/refund", - query_string="", - post_data="refund_amount=50", - ) - - def test_test_helpers_refunds_expire_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Refund.TestHelpers.expire("re_123") - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/refunds/re_123/expire", - query_string="", - ) - - def test_test_helpers_test_clocks_advance_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.test_helpers.TestClock.advance( - "clock_xyz", - frozen_time=142, - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/test_clocks/clock_xyz/advance", - query_string="", - post_data="frozen_time=142", - ) - - def test_test_helpers_test_clocks_advance_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.test_helpers.TestClock.advance( - "clock_xxxxxxxxxxxxx", - frozen_time=1675552261, - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", - query_string="", - post_data="frozen_time=1675552261", - ) - - def test_test_helpers_test_clocks_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.test_helpers.TestClock.delete("clock_xyz") - http_client_mock.assert_requested( - "delete", - path="/v1/test_helpers/test_clocks/clock_xyz", - query_string="", - ) - - def test_test_helpers_test_clocks_delete_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.test_helpers.TestClock.delete("clock_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", - query_string="", - ) - - def test_test_helpers_test_clocks_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.test_helpers.TestClock.list() - http_client_mock.assert_requested( - "get", - path="/v1/test_helpers/test_clocks", - query_string="", - ) - - def test_test_helpers_test_clocks_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.test_helpers.TestClock.retrieve("clock_xyz") - http_client_mock.assert_requested( - "get", - path="/v1/test_helpers/test_clocks/clock_xyz", - query_string="", - ) - - def test_test_helpers_test_clocks_get_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.test_helpers.TestClock.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/test_helpers/test_clocks", - query_string="limit=3", - ) - - def test_test_helpers_test_clocks_get_4( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.test_helpers.TestClock.retrieve("clock_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", - query_string="", - ) - - def test_test_helpers_test_clocks_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.test_helpers.TestClock.create( - frozen_time=123, - name="cogsworth", - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/test_clocks", - query_string="", - post_data="frozen_time=123&name=cogsworth", - ) - - def test_test_helpers_test_clocks_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.test_helpers.TestClock.create(frozen_time=1577836800) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/test_clocks", - query_string="", - post_data="frozen_time=1577836800", - ) - - def test_test_helpers_treasury_inbound_transfers_fail_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.InboundTransfer.TestHelpers.fail( - "ibt_123", - failure_details={"code": "account_closed"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", - query_string="", - post_data="failure_details[code]=account_closed", - ) - - def test_test_helpers_treasury_inbound_transfers_return_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.InboundTransfer.TestHelpers.return_inbound_transfer( - "ibt_123", - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", - query_string="", - ) - - def test_test_helpers_treasury_inbound_transfers_succeed_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.InboundTransfer.TestHelpers.succeed("ibt_123") - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", - query_string="", - ) - - def test_test_helpers_treasury_outbound_transfers_fail_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.OutboundTransfer.TestHelpers.fail("obt_123") - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", - query_string="", - ) - - def test_test_helpers_treasury_outbound_transfers_post_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.OutboundTransfer.TestHelpers.post("obt_123") - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", - query_string="", - ) - - def test_test_helpers_treasury_outbound_transfers_return_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.OutboundTransfer.TestHelpers.return_outbound_transfer( - "obt_123", - returned_details={"code": "account_closed"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/outbound_transfers/obt_123/return", - query_string="", - post_data="returned_details[code]=account_closed", - ) - - def test_test_helpers_treasury_received_credits_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.ReceivedCredit.TestHelpers.create( - financial_account="fa_123", - network="ach", - amount=1234, - currency="usd", - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/received_credits", - query_string="", - post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", - ) - - def test_test_helpers_treasury_received_debits_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.ReceivedDebit.TestHelpers.create( - financial_account="fa_123", - network="ach", - amount=1234, - currency="usd", - ) - http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/received_debits", - query_string="", - post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", - ) - - def test_tokens_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.retrieve("tok_xxxx") - http_client_mock.assert_requested( - "get", - path="/v1/tokens/tok_xxxx", - query_string="", - ) - - def test_tokens_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.create( - card={ - "number": "4242424242424242", - "exp_month": "5", - "exp_year": "2023", - "cvc": "314", - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/tokens", - query_string="", - post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", - ) - - def test_tokens_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.create( - bank_account={ - "country": "US", - "currency": "usd", - "account_holder_name": "Jenny Rosen", - "account_holder_type": "individual", - "routing_number": "110000000", - "account_number": "000123456789", - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/tokens", - query_string="", - post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", - ) - - def test_tokens_post_3(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.create(pii={"id_number": "000000000"}) - http_client_mock.assert_requested( - "post", - path="/v1/tokens", - query_string="", - post_data="pii[id_number]=000000000", - ) - - def test_tokens_post_4(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.create( - account={ - "individual": {"first_name": "Jane", "last_name": "Doe"}, - "tos_shown_and_accepted": True, - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/tokens", - query_string="", - post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", - ) - - def test_tokens_post_5(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.create( - person={ - "first_name": "Jane", - "last_name": "Doe", - "relationship": {"owner": True}, - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/tokens", - query_string="", - post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", - ) - - def test_tokens_post_6(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.create(cvc_update={"cvc": "123"}) - http_client_mock.assert_requested( - "post", - path="/v1/tokens", - query_string="", - post_data="cvc_update[cvc]=123", - ) - - def test_topups_cancel_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Topup.cancel("tu_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", - query_string="", - ) - - def test_topups_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Topup.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/topups", - query_string="limit=3", - ) - - def test_topups_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Topup.retrieve("tu_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/topups/tu_xxxxxxxxxxxxx", - query_string="", - ) - - def test_topups_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Topup.create( - amount=2000, - currency="usd", - description="Top-up for Jenny Rosen", - statement_descriptor="Top-up", - ) - http_client_mock.assert_requested( - "post", - path="/v1/topups", - query_string="", - post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", - ) - - def test_topups_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Topup.modify( - "tu_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/topups/tu_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_transfers_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Transfer.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/transfers", - query_string="limit=3", - ) - - def test_transfers_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Transfer.retrieve("tr_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/transfers/tr_xxxxxxxxxxxxx", - query_string="", - ) - - def test_transfers_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Transfer.create( - amount=400, - currency="usd", - destination="acct_xxxxxxxxxxxxx", - transfer_group="ORDER_95", - ) - http_client_mock.assert_requested( - "post", - path="/v1/transfers", - query_string="", - post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", - ) - - def test_transfers_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Transfer.modify( - "tr_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/transfers/tr_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_transfers_reversals_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Transfer.list_reversals( - "tr_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", - query_string="limit=3", - ) - - def test_transfers_reversals_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Transfer.retrieve_reversal( - "tr_xxxxxxxxxxxxx", - "trr_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "get", - path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", - query_string="", - ) - - def test_transfers_reversals_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Transfer.create_reversal( - "tr_xxxxxxxxxxxxx", - amount=100, - ) - http_client_mock.assert_requested( - "post", - path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", - query_string="", - post_data="amount=100", - ) - - def test_transfers_reversals_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Transfer.modify_reversal( - "tr_xxxxxxxxxxxxx", - "trr_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_treasury_credit_reversals_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.CreditReversal.list( - financial_account="fa_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/treasury/credit_reversals", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", - ) - - def test_treasury_credit_reversals_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.CreditReversal.retrieve("credrev_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", - query_string="", - ) - - def test_treasury_credit_reversals_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.CreditReversal.create( - received_credit="rc_xxxxxxxxxxxxx", - ) - http_client_mock.assert_requested( - "post", - path="/v1/treasury/credit_reversals", - query_string="", - post_data="received_credit=rc_xxxxxxxxxxxxx", - ) - - def test_treasury_debit_reversals_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.DebitReversal.list( - financial_account="fa_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/treasury/debit_reversals", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", - ) - - def test_treasury_debit_reversals_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.DebitReversal.retrieve("debrev_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", - query_string="", - ) - - def test_treasury_debit_reversals_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.DebitReversal.create(received_debit="rd_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/treasury/debit_reversals", - query_string="", - post_data="received_debit=rd_xxxxxxxxxxxxx", - ) - - def test_treasury_financial_accounts_features_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.FinancialAccount.retrieve_features("fa_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", - query_string="", - ) - - def test_treasury_financial_accounts_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.FinancialAccount.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/treasury/financial_accounts", - query_string="limit=3", - ) - - def test_treasury_financial_accounts_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.FinancialAccount.retrieve("fa_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", - query_string="", - ) - - def test_treasury_financial_accounts_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.FinancialAccount.create( - supported_currencies=["usd"], - features={}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/treasury/financial_accounts", - query_string="", - post_data="supported_currencies[0]=usd", - ) - - def test_treasury_financial_accounts_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.FinancialAccount.modify( - "fa_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", - ) - - def test_treasury_inbound_transfers_cancel_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.InboundTransfer.cancel("ibt_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", - query_string="", - ) - - def test_treasury_inbound_transfers_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.InboundTransfer.list( - financial_account="fa_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/treasury/inbound_transfers", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", - ) - - def test_treasury_inbound_transfers_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.InboundTransfer.retrieve("ibt_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", - query_string="", - ) - - def test_treasury_inbound_transfers_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.InboundTransfer.create( - financial_account="fa_xxxxxxxxxxxxx", - amount=10000, - currency="usd", - origin_payment_method="pm_xxxxxxxxxxxxx", - description="InboundTransfer from my bank account", - ) - http_client_mock.assert_requested( - "post", - path="/v1/treasury/inbound_transfers", - query_string="", - post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", - ) - - def test_treasury_outbound_payments_cancel_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.OutboundPayment.cancel("bot_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", - query_string="", - ) - - def test_treasury_outbound_payments_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.OutboundPayment.list( - financial_account="fa_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/treasury/outbound_payments", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", - ) - - def test_treasury_outbound_payments_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.OutboundPayment.retrieve("bot_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", - query_string="", - ) - - def test_treasury_outbound_payments_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.OutboundPayment.create( - financial_account="fa_xxxxxxxxxxxxx", - amount=10000, - currency="usd", - customer="cus_xxxxxxxxxxxxx", - destination_payment_method="pm_xxxxxxxxxxxxx", - description="OutboundPayment to a 3rd party", - ) - http_client_mock.assert_requested( - "post", - path="/v1/treasury/outbound_payments", - query_string="", - post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", - ) - - def test_treasury_outbound_transfers_cancel_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.OutboundTransfer.cancel("obt_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", - query_string="", - ) - - def test_treasury_outbound_transfers_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.OutboundTransfer.list( - financial_account="fa_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/treasury/outbound_transfers", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", - ) - - def test_treasury_outbound_transfers_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.OutboundTransfer.retrieve("obt_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", - query_string="", - ) - - def test_treasury_outbound_transfers_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.OutboundTransfer.create( - financial_account="fa_xxxxxxxxxxxxx", - destination_payment_method="pm_xxxxxxxxxxxxx", - amount=500, - currency="usd", - description="OutboundTransfer to my external bank account", - ) - http_client_mock.assert_requested( - "post", - path="/v1/treasury/outbound_transfers", - query_string="", - post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", - ) - - def test_treasury_received_credits_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.ReceivedCredit.list( - financial_account="fa_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/treasury/received_credits", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", - ) - - def test_treasury_received_credits_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.ReceivedCredit.retrieve("rc_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", - query_string="", - ) - - def test_treasury_received_debits_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.ReceivedDebit.list( - financial_account="fa_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/treasury/received_debits", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", - ) - - def test_treasury_received_debits_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.ReceivedDebit.retrieve("rd_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", - query_string="", - ) - - def test_treasury_transaction_entries_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.TransactionEntry.list( - financial_account="fa_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/treasury/transaction_entries", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", - ) - - def test_treasury_transaction_entries_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.TransactionEntry.retrieve("trxne_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", - query_string="", - ) - - def test_treasury_transactions_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.Transaction.list( - financial_account="fa_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/treasury/transactions", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", - ) - - def test_treasury_transactions_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.Transaction.retrieve("trxn_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", - query_string="", - ) - - def test_webhook_endpoints_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.WebhookEndpoint.delete("we_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", - query_string="", - ) - - def test_webhook_endpoints_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.WebhookEndpoint.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/webhook_endpoints", - query_string="limit=3", - ) - - def test_webhook_endpoints_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.WebhookEndpoint.retrieve("we_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", - query_string="", - ) - - def test_webhook_endpoints_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.WebhookEndpoint.create( - url="https://example.com/my/webhook/endpoint", - enabled_events=["charge.failed", "charge.succeeded"], - ) - http_client_mock.assert_requested( - "post", - path="/v1/webhook_endpoints", - query_string="", - post_data="url=https%3A%2F%2Fexample.com%2Fmy%2Fwebhook%2Fendpoint&enabled_events[0]=charge.failed&enabled_events[1]=charge.succeeded", - ) - - def test_webhook_endpoints_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.WebhookEndpoint.modify( - "we_xxxxxxxxxxxxx", - url="https://example.com/new_endpoint", - ) - http_client_mock.assert_requested( - "post", - path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", - query_string="", - post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", - ) - def test_account_links_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5323,6 +53,16 @@ def test_account_links_post_service( post_data="account=acct_xxxxxxxxxxxxx&refresh_url=https%3A%2F%2Fexample.com%2Freauth&return_url=https%3A%2F%2Fexample.com%2Freturn&type=account_onboarding", ) + def test_accounts_capabilities_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.list_capabilities("acct_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", + query_string="", + ) + def test_accounts_capabilities_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5343,6 +83,19 @@ def test_accounts_capabilities_get_service( api_base="https://api.stripe.com", ) + def test_accounts_capabilities_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.retrieve_capability( + "acct_xxxxxxxxxxxxx", + "card_payments", + ) + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", + query_string="", + ) + def test_accounts_capabilities_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5366,6 +119,21 @@ def test_accounts_capabilities_get_2_service( api_base="https://api.stripe.com", ) + def test_accounts_capabilities_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.modify_capability( + "acct_xxxxxxxxxxxxx", + "card_payments", + requested=True, + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", + query_string="", + post_data="requested=True", + ) + def test_accounts_capabilities_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5391,6 +159,14 @@ def test_accounts_capabilities_post_service( post_data="requested=True", ) + def test_accounts_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.Account.delete("acct_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx", + query_string="", + ) + def test_accounts_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5411,6 +187,19 @@ def test_accounts_delete_service( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.delete_external_account( + "acct_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", + query_string="", + ) + def test_accounts_external_accounts_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5434,6 +223,19 @@ def test_accounts_external_accounts_delete_service( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_delete_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.delete_external_account( + "acct_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", + query_string="", + ) + def test_accounts_external_accounts_delete_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5457,6 +259,19 @@ def test_accounts_external_accounts_delete_2_service( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.list_external_accounts( + "acct_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + query_string="limit=3", + ) + def test_accounts_external_accounts_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5481,6 +296,20 @@ def test_accounts_external_accounts_get_service( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.list_external_accounts( + "acct_xxxxxxxxxxxxx", + object="bank_account", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + query_string="object=bank_account&limit=3", + ) + def test_accounts_external_accounts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5505,6 +334,20 @@ def test_accounts_external_accounts_get_2_service( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_get_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.list_external_accounts( + "acct_xxxxxxxxxxxxx", + object="card", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + query_string="object=card&limit=3", + ) + def test_accounts_external_accounts_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5529,6 +372,19 @@ def test_accounts_external_accounts_get_3_service( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_get_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.retrieve_external_account( + "acct_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", + query_string="", + ) + def test_accounts_external_accounts_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5552,6 +408,19 @@ def test_accounts_external_accounts_get_4_service( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_get_5( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.retrieve_external_account( + "acct_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", + query_string="", + ) + def test_accounts_external_accounts_get_5_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5575,6 +444,20 @@ def test_accounts_external_accounts_get_5_service( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.create_external_account( + "acct_xxxxxxxxxxxxx", + external_account="btok_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + query_string="", + post_data="external_account=btok_xxxxxxxxxxxxx", + ) + def test_accounts_external_accounts_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5599,6 +482,20 @@ def test_accounts_external_accounts_post_service( post_data="external_account=btok_xxxxxxxxxxxxx", ) + def test_accounts_external_accounts_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.create_external_account( + "acct_xxxxxxxxxxxxx", + external_account="tok_xxxx_debit", + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + query_string="", + post_data="external_account=tok_xxxx_debit", + ) + def test_accounts_external_accounts_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5623,6 +520,21 @@ def test_accounts_external_accounts_post_2_service( post_data="external_account=tok_xxxx_debit", ) + def test_accounts_external_accounts_post_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.modify_external_account( + "acct_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_accounts_external_accounts_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5648,6 +560,21 @@ def test_accounts_external_accounts_post_3_service( post_data="metadata[order_id]=6735", ) + def test_accounts_external_accounts_post_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.modify_external_account( + "acct_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_accounts_external_accounts_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5673,6 +600,14 @@ def test_accounts_external_accounts_post_4_service( post_data="metadata[order_id]=6735", ) + def test_accounts_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Account.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/accounts", + query_string="limit=3", + ) + def test_accounts_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5694,6 +629,14 @@ def test_accounts_get_service( api_base="https://api.stripe.com", ) + def test_accounts_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Account.retrieve("acct_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx", + query_string="", + ) + def test_accounts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5714,6 +657,16 @@ def test_accounts_get_2_service( api_base="https://api.stripe.com", ) + def test_accounts_login_links_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.create_login_link("acct_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", + query_string="", + ) + def test_accounts_login_links_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5734,6 +687,19 @@ def test_accounts_login_links_post_service( api_base="https://api.stripe.com", ) + def test_accounts_persons_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.delete_person( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + query_string="", + ) + def test_accounts_persons_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5748,13 +714,26 @@ def test_accounts_persons_delete_service( client.accounts.persons.delete( "acct_xxxxxxxxxxxxx", - "person_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_accounts_persons_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.list_persons( + "acct_xxxxxxxxxxxxx", + limit=3, ) http_client_mock.assert_requested( - "delete", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", - query_string="", - api_base="https://api.stripe.com", + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", + query_string="limit=3", ) def test_accounts_persons_get_service( @@ -5781,6 +760,19 @@ def test_accounts_persons_get_service( api_base="https://api.stripe.com", ) + def test_accounts_persons_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.retrieve_person( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + query_string="", + ) + def test_accounts_persons_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5804,6 +796,21 @@ def test_accounts_persons_get_2_service( api_base="https://api.stripe.com", ) + def test_accounts_persons_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.create_person( + "acct_xxxxxxxxxxxxx", + first_name="Jane", + last_name="Diaz", + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", + query_string="", + post_data="first_name=Jane&last_name=Diaz", + ) + def test_accounts_persons_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5828,6 +835,21 @@ def test_accounts_persons_post_service( post_data="first_name=Jane&last_name=Diaz", ) + def test_accounts_persons_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.modify_person( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_accounts_persons_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5853,6 +875,23 @@ def test_accounts_persons_post_2_service( post_data="metadata[order_id]=6735", ) + def test_accounts_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Account.create( + type="custom", + country="US", + email="jenny.rosen@example.com", + capabilities={ + "card_payments": {"requested": True}, + "transfers": {"requested": True}, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts", + query_string="", + post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", + ) + def test_accounts_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5884,6 +923,18 @@ def test_accounts_post_service( post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", ) + def test_accounts_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Account.modify( + "acct_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_accounts_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5908,6 +959,20 @@ def test_accounts_post_2_service( post_data="metadata[order_id]=6735", ) + def test_accounts_reject_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.reject( + "acct_xxxxxxxxxxxxx", + reason="fraud", + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/reject", + query_string="", + post_data="reason=fraud", + ) + def test_accounts_reject_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5932,6 +997,16 @@ def test_accounts_reject_post_service( post_data="reason=fraud", ) + def test_application_fees_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ApplicationFee.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/application_fees", + query_string="limit=3", + ) + def test_application_fees_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5953,6 +1028,16 @@ def test_application_fees_get_service( api_base="https://api.stripe.com", ) + def test_application_fees_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ApplicationFee.retrieve("fee_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/application_fees/fee_xxxxxxxxxxxxx", + query_string="", + ) + def test_application_fees_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5973,6 +1058,19 @@ def test_application_fees_get_2_service( api_base="https://api.stripe.com", ) + def test_application_fees_refunds_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ApplicationFee.list_refunds( + "fee_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", + query_string="limit=3", + ) + def test_application_fees_refunds_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -5997,6 +1095,19 @@ def test_application_fees_refunds_get_service( api_base="https://api.stripe.com", ) + def test_application_fees_refunds_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ApplicationFee.retrieve_refund( + "fee_xxxxxxxxxxxxx", + "fr_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", + query_string="", + ) + def test_application_fees_refunds_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6020,6 +1131,16 @@ def test_application_fees_refunds_get_2_service( api_base="https://api.stripe.com", ) + def test_application_fees_refunds_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ApplicationFee.create_refund("fee_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", + query_string="", + ) + def test_application_fees_refunds_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6040,6 +1161,21 @@ def test_application_fees_refunds_post_service( api_base="https://api.stripe.com", ) + def test_application_fees_refunds_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ApplicationFee.modify_refund( + "fee_xxxxxxxxxxxxx", + "fr_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_application_fees_refunds_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6065,6 +1201,20 @@ def test_application_fees_refunds_post_2_service( post_data="metadata[order_id]=6735", ) + def test_apps_secrets_delete_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.apps.Secret.delete_where( + name="my-api-key", + scope={"type": "account"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/apps/secrets/delete", + query_string="", + post_data="name=my-api-key&scope[type]=account", + ) + def test_apps_secrets_delete_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6091,6 +1241,19 @@ def test_apps_secrets_delete_post_service( post_data="name=my-api-key&scope[type]=account", ) + def test_apps_secrets_find_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.apps.Secret.find( + name="sec_123", + scope={"type": "account"}, + ) + http_client_mock.assert_requested( + "get", + path="/v1/apps/secrets/find", + query_string="name=sec_123&scope[type]=account", + ) + def test_apps_secrets_find_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6117,6 +1280,17 @@ def test_apps_secrets_find_get_service( api_base="https://api.stripe.com", ) + def test_apps_secrets_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.apps.Secret.list( + scope={"type": "account"}, + limit=2, + ) + http_client_mock.assert_requested( + "get", + path="/v1/apps/secrets", + query_string="scope[type]=account&limit=2", + ) + def test_apps_secrets_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6138,6 +1312,19 @@ def test_apps_secrets_get_service( api_base="https://api.stripe.com", ) + def test_apps_secrets_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.apps.Secret.list( + scope={"type": "account"}, + limit=2, + ) + http_client_mock.assert_requested( + "get", + path="/v1/apps/secrets", + query_string="scope[type]=account&limit=2", + ) + def test_apps_secrets_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6159,6 +1346,19 @@ def test_apps_secrets_get_2_service( api_base="https://api.stripe.com", ) + def test_apps_secrets_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.apps.Secret.create( + name="sec_123", + payload="very secret string", + scope={"type": "account"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/apps/secrets", + query_string="", + post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", + ) + def test_apps_secrets_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6186,6 +1386,21 @@ def test_apps_secrets_post_service( post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) + def test_apps_secrets_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.apps.Secret.create( + name="my-api-key", + payload="secret_key_xxxxxx", + scope={"type": "account"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/apps/secrets", + query_string="", + post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", + ) + def test_apps_secrets_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6213,6 +1428,16 @@ def test_apps_secrets_post_2_service( post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) + def test_balance_transactions_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.BalanceTransaction.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/balance_transactions", + query_string="limit=3", + ) + def test_balance_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6234,6 +1459,16 @@ def test_balance_transactions_get_service( api_base="https://api.stripe.com", ) + def test_balance_transactions_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.BalanceTransaction.retrieve("txn_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", + query_string="", + ) + def test_balance_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6254,6 +1489,16 @@ def test_balance_transactions_get_2_service( api_base="https://api.stripe.com", ) + def test_billing_portal_configurations_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.billing_portal.Configuration.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/billing_portal/configurations", + query_string="limit=3", + ) + def test_billing_portal_configurations_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6275,6 +1520,16 @@ def test_billing_portal_configurations_get_service( api_base="https://api.stripe.com", ) + def test_billing_portal_configurations_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.billing_portal.Configuration.retrieve("bpc_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", + query_string="", + ) + def test_billing_portal_configurations_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6295,6 +1550,29 @@ def test_billing_portal_configurations_get_2_service( api_base="https://api.stripe.com", ) + def test_billing_portal_configurations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.billing_portal.Configuration.create( + features={ + "customer_update": { + "allowed_updates": ["email", "tax_id"], + "enabled": True, + }, + "invoice_history": {"enabled": True}, + }, + business_profile={ + "privacy_policy_url": "https://example.com/privacy", + "terms_of_service_url": "https://example.com/terms", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/billing_portal/configurations", + query_string="", + post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", + ) + def test_billing_portal_configurations_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6330,6 +1608,23 @@ def test_billing_portal_configurations_post_service( post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) + def test_billing_portal_configurations_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.billing_portal.Configuration.modify( + "bpc_xxxxxxxxxxxxx", + business_profile={ + "privacy_policy_url": "https://example.com/privacy", + "terms_of_service_url": "https://example.com/terms", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", + query_string="", + post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", + ) + def test_billing_portal_configurations_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6359,6 +1654,20 @@ def test_billing_portal_configurations_post_2_service( post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) + def test_billing_portal_sessions_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.billing_portal.Session.create( + customer="cus_xxxxxxxxxxxxx", + return_url="https://example.com/account", + ) + http_client_mock.assert_requested( + "post", + path="/v1/billing_portal/sessions", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", + ) + def test_billing_portal_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6385,6 +1694,16 @@ def test_billing_portal_sessions_post_service( post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", ) + def test_charges_capture_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Charge.capture("ch_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/charges/ch_xxxxxxxxxxxxx/capture", + query_string="", + ) + def test_charges_capture_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6405,6 +1724,14 @@ def test_charges_capture_post_service( api_base="https://api.stripe.com", ) + def test_charges_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Charge.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/charges", + query_string="limit=3", + ) + def test_charges_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6426,6 +1753,14 @@ def test_charges_get_service( api_base="https://api.stripe.com", ) + def test_charges_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Charge.retrieve("ch_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/charges/ch_xxxxxxxxxxxxx", + query_string="", + ) + def test_charges_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6446,6 +1781,20 @@ def test_charges_get_2_service( api_base="https://api.stripe.com", ) + def test_charges_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Charge.create( + amount=2000, + currency="usd", + source="tok_xxxx", + description="My First Test Charge (created for API docs at https://www.stripe.com/docs/api)", + ) + http_client_mock.assert_requested( + "post", + path="/v1/charges", + query_string="", + post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", + ) + def test_charges_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6474,6 +1823,18 @@ def test_charges_post_service( post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) + def test_charges_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Charge.modify( + "ch_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/charges/ch_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_charges_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6498,6 +1859,18 @@ def test_charges_post_2_service( post_data="metadata[order_id]=6735", ) + def test_charges_search_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Charge.search( + query="amount>999 AND metadata['order_id']:'6735'" + ) + http_client_mock.assert_requested( + "get", + path="/v1/charges/search", + query_string="query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + def test_charges_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6523,6 +1896,16 @@ def test_charges_search_get_service( api_base="https://api.stripe.com", ) + def test_checkout_sessions_expire_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.checkout.Session.expire("sess_xyz") + http_client_mock.assert_requested( + "post", + path="/v1/checkout/sessions/sess_xyz/expire", + query_string="", + ) + def test_checkout_sessions_expire_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6543,6 +1926,16 @@ def test_checkout_sessions_expire_post_service( api_base="https://api.stripe.com", ) + def test_checkout_sessions_expire_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.checkout.Session.expire("cs_test_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", + query_string="", + ) + def test_checkout_sessions_expire_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6563,6 +1956,16 @@ def test_checkout_sessions_expire_post_2_service( api_base="https://api.stripe.com", ) + def test_checkout_sessions_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.checkout.Session.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/checkout/sessions", + query_string="limit=3", + ) + def test_checkout_sessions_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6584,6 +1987,16 @@ def test_checkout_sessions_get_service( api_base="https://api.stripe.com", ) + def test_checkout_sessions_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.checkout.Session.retrieve("cs_test_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", + query_string="", + ) + def test_checkout_sessions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6604,6 +2017,16 @@ def test_checkout_sessions_get_2_service( api_base="https://api.stripe.com", ) + def test_checkout_sessions_line_items_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.checkout.Session.list_line_items("sess_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/checkout/sessions/sess_xyz/line_items", + query_string="", + ) + def test_checkout_sessions_line_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6624,6 +2047,33 @@ def test_checkout_sessions_line_items_get_service( api_base="https://api.stripe.com", ) + def test_checkout_sessions_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.checkout.Session.create( + success_url="https://example.com/success", + cancel_url="https://example.com/cancel", + mode="payment", + shipping_options=[ + {"shipping_rate": "shr_standard"}, + { + "shipping_rate_data": { + "display_name": "Standard", + "delivery_estimate": { + "minimum": {"unit": "day", "value": 5}, + "maximum": {"unit": "day", "value": 7}, + }, + }, + }, + ], + ) + http_client_mock.assert_requested( + "post", + path="/v1/checkout/sessions", + query_string="", + post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", + ) + def test_checkout_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6663,6 +2113,21 @@ def test_checkout_sessions_post_service( post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", ) + def test_checkout_sessions_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.checkout.Session.create( + success_url="https://example.com/success", + line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], + mode="payment", + ) + http_client_mock.assert_requested( + "post", + path="/v1/checkout/sessions", + query_string="", + post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", + ) + def test_checkout_sessions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6692,6 +2157,14 @@ def test_checkout_sessions_post_2_service( post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", ) + def test_country_specs_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.CountrySpec.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/country_specs", + query_string="limit=3", + ) + def test_country_specs_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6713,6 +2186,16 @@ def test_country_specs_get_service( api_base="https://api.stripe.com", ) + def test_country_specs_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.CountrySpec.retrieve("US") + http_client_mock.assert_requested( + "get", + path="/v1/country_specs/US", + query_string="", + ) + def test_country_specs_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6733,6 +2216,14 @@ def test_country_specs_get_2_service( api_base="https://api.stripe.com", ) + def test_coupons_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.Coupon.delete("Z4OV52SU") + http_client_mock.assert_requested( + "delete", + path="/v1/coupons/Z4OV52SU", + query_string="", + ) + def test_coupons_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6753,6 +2244,14 @@ def test_coupons_delete_service( api_base="https://api.stripe.com", ) + def test_coupons_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Coupon.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/coupons", + query_string="limit=3", + ) + def test_coupons_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6774,6 +2273,14 @@ def test_coupons_get_service( api_base="https://api.stripe.com", ) + def test_coupons_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Coupon.retrieve("Z4OV52SU") + http_client_mock.assert_requested( + "get", + path="/v1/coupons/Z4OV52SU", + query_string="", + ) + def test_coupons_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6794,6 +2301,19 @@ def test_coupons_get_2_service( api_base="https://api.stripe.com", ) + def test_coupons_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Coupon.create( + percent_off=25.5, + duration="repeating", + duration_in_months=3, + ) + http_client_mock.assert_requested( + "post", + path="/v1/coupons", + query_string="", + post_data="percent_off=25.5&duration=repeating&duration_in_months=3", + ) + def test_coupons_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6821,6 +2341,18 @@ def test_coupons_post_service( post_data="percent_off=25.5&duration=repeating&duration_in_months=3", ) + def test_coupons_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Coupon.modify( + "Z4OV52SU", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/coupons/Z4OV52SU", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_coupons_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6845,6 +2377,14 @@ def test_coupons_post_2_service( post_data="metadata[order_id]=6735", ) + def test_credit_notes_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.CreditNote.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/credit_notes", + query_string="limit=3", + ) + def test_credit_notes_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6866,6 +2406,19 @@ def test_credit_notes_get_service( api_base="https://api.stripe.com", ) + def test_credit_notes_lines_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.CreditNote.list_lines( + "cn_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", + query_string="limit=3", + ) + def test_credit_notes_lines_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6890,6 +2443,24 @@ def test_credit_notes_lines_get_service( api_base="https://api.stripe.com", ) + def test_credit_notes_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.CreditNote.create( + invoice="in_xxxxxxxxxxxxx", + lines=[ + { + "type": "invoice_line_item", + "invoice_line_item": "il_xxxxxxxxxxxxx", + "quantity": 1, + }, + ], + ) + http_client_mock.assert_requested( + "post", + path="/v1/credit_notes", + query_string="", + post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", + ) + def test_credit_notes_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6922,6 +2493,25 @@ def test_credit_notes_post_service( post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) + def test_credit_notes_preview_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.CreditNote.preview( + invoice="in_xxxxxxxxxxxxx", + lines=[ + { + "type": "invoice_line_item", + "invoice_line_item": "il_xxxxxxxxxxxxx", + "quantity": 1, + }, + ], + ) + http_client_mock.assert_requested( + "get", + path="/v1/credit_notes/preview", + query_string="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", + ) + def test_credit_notes_preview_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6954,6 +2544,19 @@ def test_credit_notes_preview_get_service( api_base="https://api.stripe.com", ) + def test_credit_notes_preview_lines_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.CreditNote.preview_lines( + limit=3, + invoice="in_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/credit_notes/preview/lines", + query_string="limit=3&invoice=in_xxxxxxxxxxxxx", + ) + def test_credit_notes_preview_lines_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -6980,6 +2583,16 @@ def test_credit_notes_preview_lines_get_service( api_base="https://api.stripe.com", ) + def test_credit_notes_void_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.CreditNote.void_credit_note("cn_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", + query_string="", + ) + def test_credit_notes_void_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7000,6 +2613,20 @@ def test_credit_notes_void_post_service( api_base="https://api.stripe.com", ) + def test_customer_sessions_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.CustomerSession.create( + customer="cus_123", + components={"buy_button": {"enabled": True}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/customer_sessions", + query_string="", + post_data="customer=cus_123&components[buy_button][enabled]=True", + ) + def test_customer_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7026,6 +2653,19 @@ def test_customer_sessions_post_service( post_data="customer=cus_123&components[buy_button][enabled]=True", ) + def test_customers_balance_transactions_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.list_balance_transactions( + "cus_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + query_string="limit=3", + ) + def test_customers_balance_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7050,6 +2690,19 @@ def test_customers_balance_transactions_get_service( api_base="https://api.stripe.com", ) + def test_customers_balance_transactions_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.retrieve_balance_transaction( + "cus_xxxxxxxxxxxxx", + "cbtxn_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", + query_string="", + ) + def test_customers_balance_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7073,6 +2726,21 @@ def test_customers_balance_transactions_get_2_service( api_base="https://api.stripe.com", ) + def test_customers_balance_transactions_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.create_balance_transaction( + "cus_xxxxxxxxxxxxx", + amount=-500, + currency="usd", + ) + http_client_mock.assert_requested( + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + query_string="", + post_data="amount=-500¤cy=usd", + ) + def test_customers_balance_transactions_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7097,6 +2765,21 @@ def test_customers_balance_transactions_post_service( post_data="amount=-500¤cy=usd", ) + def test_customers_balance_transactions_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.modify_balance_transaction( + "cus_xxxxxxxxxxxxx", + "cbtxn_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_customers_balance_transactions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7122,6 +2805,16 @@ def test_customers_balance_transactions_post_2_service( post_data="metadata[order_id]=6735", ) + def test_customers_cash_balance_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.retrieve_cash_balance("cus_123") + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_123/cash_balance", + query_string="", + ) + def test_customers_cash_balance_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7142,6 +2835,20 @@ def test_customers_cash_balance_get_service( api_base="https://api.stripe.com", ) + def test_customers_cash_balance_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.modify_cash_balance( + "cus_123", + settings={"reconciliation_mode": "manual"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/customers/cus_123/cash_balance", + query_string="", + post_data="settings[reconciliation_mode]=manual", + ) + def test_customers_cash_balance_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7166,6 +2873,14 @@ def test_customers_cash_balance_post_service( post_data="settings[reconciliation_mode]=manual", ) + def test_customers_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.Customer.delete("cus_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx", + query_string="", + ) + def test_customers_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7177,13 +2892,32 @@ def test_customers_delete_service( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - - client.customers.delete("cus_xxxxxxxxxxxxx") + + client.customers.delete("cus_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_customers_funding_instructions_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.create_funding_instructions( + "cus_123", + bank_transfer={ + "requested_address_types": ["zengin"], + "type": "jp_bank_transfer", + }, + currency="usd", + funding_type="bank_transfer", + ) http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx", + "post", + path="/v1/customers/cus_123/funding_instructions", query_string="", - api_base="https://api.stripe.com", + post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", ) def test_customers_funding_instructions_post_service( @@ -7217,6 +2951,14 @@ def test_customers_funding_instructions_post_service( post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", ) + def test_customers_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Customer.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/customers", + query_string="limit=3", + ) + def test_customers_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7238,6 +2980,14 @@ def test_customers_get_service( api_base="https://api.stripe.com", ) + def test_customers_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Customer.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/customers", + query_string="limit=3", + ) + def test_customers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7259,6 +3009,14 @@ def test_customers_get_2_service( api_base="https://api.stripe.com", ) + def test_customers_get_3(self, http_client_mock: HTTPClientMock) -> None: + stripe.Customer.retrieve("cus_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx", + query_string="", + ) + def test_customers_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7279,6 +3037,19 @@ def test_customers_get_3_service( api_base="https://api.stripe.com", ) + def test_customers_payment_methods_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.list_payment_methods( + "cus_xyz", + type="card", + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_xyz/payment_methods", + query_string="type=card", + ) + def test_customers_payment_methods_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7303,6 +3074,19 @@ def test_customers_payment_methods_get_service( api_base="https://api.stripe.com", ) + def test_customers_payment_methods_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.list_payment_methods( + "cus_xxxxxxxxxxxxx", + type="card", + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", + query_string="type=card", + ) + def test_customers_payment_methods_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7327,6 +3111,17 @@ def test_customers_payment_methods_get_2_service( api_base="https://api.stripe.com", ) + def test_customers_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Customer.create( + description="My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", + ) + http_client_mock.assert_requested( + "post", + path="/v1/customers", + query_string="", + post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", + ) + def test_customers_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7352,6 +3147,18 @@ def test_customers_post_service( post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) + def test_customers_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Customer.modify( + "cus_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_customers_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7376,6 +3183,18 @@ def test_customers_post_2_service( post_data="metadata[order_id]=6735", ) + def test_customers_search_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.search( + query="name:'fakename' AND metadata['foo']:'bar'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/search", + query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", + ) + def test_customers_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7401,6 +3220,18 @@ def test_customers_search_get_service( api_base="https://api.stripe.com", ) + def test_customers_search_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.search( + query="name:'fakename' AND metadata['foo']:'bar'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/search", + query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", + ) + def test_customers_search_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7426,6 +3257,19 @@ def test_customers_search_get_2_service( api_base="https://api.stripe.com", ) + def test_customers_sources_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.delete_source( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + query_string="", + ) + def test_customers_sources_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7449,6 +3293,19 @@ def test_customers_sources_delete_service( api_base="https://api.stripe.com", ) + def test_customers_sources_delete_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.delete_source( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + query_string="", + ) + def test_customers_sources_delete_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7472,6 +3329,20 @@ def test_customers_sources_delete_2_service( api_base="https://api.stripe.com", ) + def test_customers_sources_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.list_sources( + "cus_xxxxxxxxxxxxx", + object="bank_account", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="object=bank_account&limit=3", + ) + def test_customers_sources_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7496,6 +3367,20 @@ def test_customers_sources_get_service( api_base="https://api.stripe.com", ) + def test_customers_sources_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.list_sources( + "cus_xxxxxxxxxxxxx", + object="card", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="object=card&limit=3", + ) + def test_customers_sources_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7520,6 +3405,19 @@ def test_customers_sources_get_2_service( api_base="https://api.stripe.com", ) + def test_customers_sources_get_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.retrieve_source( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + query_string="", + ) + def test_customers_sources_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7543,6 +3441,19 @@ def test_customers_sources_get_3_service( api_base="https://api.stripe.com", ) + def test_customers_sources_get_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.retrieve_source( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + query_string="", + ) + def test_customers_sources_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7566,6 +3477,21 @@ def test_customers_sources_get_4_service( api_base="https://api.stripe.com", ) + def test_customers_sources_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.modify_source( + "cus_123", + "card_123", + account_holder_name="Kamil", + ) + http_client_mock.assert_requested( + "post", + path="/v1/customers/cus_123/sources/card_123", + query_string="", + post_data="account_holder_name=Kamil", + ) + def test_customers_sources_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7591,6 +3517,20 @@ def test_customers_sources_post_service( post_data="account_holder_name=Kamil", ) + def test_customers_sources_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.create_source( + "cus_xxxxxxxxxxxxx", + source="btok_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="", + post_data="source=btok_xxxxxxxxxxxxx", + ) + def test_customers_sources_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7615,6 +3555,20 @@ def test_customers_sources_post_2_service( post_data="source=btok_xxxxxxxxxxxxx", ) + def test_customers_sources_post_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.create_source( + "cus_xxxxxxxxxxxxx", + source="tok_xxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="", + post_data="source=tok_xxxx", + ) + def test_customers_sources_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7639,6 +3593,21 @@ def test_customers_sources_post_3_service( post_data="source=tok_xxxx", ) + def test_customers_sources_post_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.modify_source( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_customers_sources_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7653,15 +3622,30 @@ def test_customers_sources_post_4_service( client.customers.payment_sources.update( "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + "ba_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_customers_sources_post_5( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.modify_source( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + name="Jenny Rosen", ) http_client_mock.assert_requested( "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", - api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", + post_data="name=Jenny%20Rosen", ) def test_customers_sources_post_5_service( @@ -7689,29 +3673,17 @@ def test_customers_sources_post_5_service( post_data="name=Jenny%20Rosen", ) - def test_customers_sources_verify_post_service( + def test_customers_tax_ids_delete( self, http_client_mock: HTTPClientMock ) -> None: - http_client_mock.stub_request( - "post", - "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx/verify", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.customers.payment_sources.verify( + stripe.Customer.delete_tax_id( "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - {"amounts": [32, 45]}, + "txi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx/verify", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", - api_base="https://api.stripe.com", - post_data="amounts[0]=32&amounts[1]=45", ) def test_customers_tax_ids_delete_service( @@ -7737,6 +3709,19 @@ def test_customers_tax_ids_delete_service( api_base="https://api.stripe.com", ) + def test_customers_tax_ids_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.list_tax_ids( + "cus_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", + query_string="limit=3", + ) + def test_customers_tax_ids_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7761,6 +3746,19 @@ def test_customers_tax_ids_get_service( api_base="https://api.stripe.com", ) + def test_customers_tax_ids_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.retrieve_tax_id( + "cus_xxxxxxxxxxxxx", + "txi_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", + query_string="", + ) + def test_customers_tax_ids_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7784,6 +3782,21 @@ def test_customers_tax_ids_get_2_service( api_base="https://api.stripe.com", ) + def test_customers_tax_ids_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.create_tax_id( + "cus_xxxxxxxxxxxxx", + type="eu_vat", + value="DE123456789", + ) + http_client_mock.assert_requested( + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", + query_string="", + post_data="type=eu_vat&value=DE123456789", + ) + def test_customers_tax_ids_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7808,6 +3821,16 @@ def test_customers_tax_ids_post_service( post_data="type=eu_vat&value=DE123456789", ) + def test_disputes_close_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Dispute.close("dp_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/disputes/dp_xxxxxxxxxxxxx/close", + query_string="", + ) + def test_disputes_close_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7828,6 +3851,14 @@ def test_disputes_close_post_service( api_base="https://api.stripe.com", ) + def test_disputes_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Dispute.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/disputes", + query_string="limit=3", + ) + def test_disputes_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7849,6 +3880,14 @@ def test_disputes_get_service( api_base="https://api.stripe.com", ) + def test_disputes_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Dispute.retrieve("dp_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/disputes/dp_xxxxxxxxxxxxx", + query_string="", + ) + def test_disputes_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7869,6 +3908,18 @@ def test_disputes_get_2_service( api_base="https://api.stripe.com", ) + def test_disputes_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Dispute.modify( + "dp_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/disputes/dp_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_disputes_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7893,6 +3944,14 @@ def test_disputes_post_service( post_data="metadata[order_id]=6735", ) + def test_events_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Event.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/events", + query_string="limit=3", + ) + def test_events_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7914,6 +3973,14 @@ def test_events_get_service( api_base="https://api.stripe.com", ) + def test_events_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Event.retrieve("evt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/events/evt_xxxxxxxxxxxxx", + query_string="", + ) + def test_events_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7934,6 +4001,14 @@ def test_events_get_2_service( api_base="https://api.stripe.com", ) + def test_file_links_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.FileLink.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/file_links", + query_string="limit=3", + ) + def test_file_links_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7955,6 +4030,14 @@ def test_file_links_get_service( api_base="https://api.stripe.com", ) + def test_file_links_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.FileLink.retrieve("link_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/file_links/link_xxxxxxxxxxxxx", + query_string="", + ) + def test_file_links_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7975,6 +4058,15 @@ def test_file_links_get_2_service( api_base="https://api.stripe.com", ) + def test_file_links_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.FileLink.create(file="file_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/file_links", + query_string="", + post_data="file=file_xxxxxxxxxxxxx", + ) + def test_file_links_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -7996,6 +4088,18 @@ def test_file_links_post_service( post_data="file=file_xxxxxxxxxxxxx", ) + def test_file_links_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.FileLink.modify( + "link_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/file_links/link_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_file_links_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8020,6 +4124,14 @@ def test_file_links_post_2_service( post_data="metadata[order_id]=6735", ) + def test_files_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.File.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/files", + query_string="limit=3", + ) + def test_files_get_service(self, http_client_mock: HTTPClientMock) -> None: http_client_mock.stub_request( "get", @@ -8039,6 +4151,14 @@ def test_files_get_service(self, http_client_mock: HTTPClientMock) -> None: api_base="https://api.stripe.com", ) + def test_files_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.File.retrieve("file_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/files/file_xxxxxxxxxxxxx", + query_string="", + ) + def test_files_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8059,6 +4179,17 @@ def test_files_get_2_service( api_base="https://api.stripe.com", ) + def test_files_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.File.create( + purpose="account_requirement", + file=io.StringIO("foo"), + ) + http_client_mock.assert_requested( + "post", + path="/v1/files", + query_string="", + ) + def test_files_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8084,6 +4215,16 @@ def test_files_post_service( api_base="https://files.stripe.com", ) + def test_financial_connections_accounts_disconnect_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.disconnect("fca_xyz") + http_client_mock.assert_requested( + "post", + path="/v1/financial_connections/accounts/fca_xyz/disconnect", + query_string="", + ) + def test_financial_connections_accounts_disconnect_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8104,6 +4245,16 @@ def test_financial_connections_accounts_disconnect_post_service( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_disconnect_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.disconnect("fca_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", + query_string="", + ) + def test_financial_connections_accounts_disconnect_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8124,6 +4275,16 @@ def test_financial_connections_accounts_disconnect_post_2_service( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.list() + http_client_mock.assert_requested( + "get", + path="/v1/financial_connections/accounts", + query_string="", + ) + def test_financial_connections_accounts_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8144,6 +4305,16 @@ def test_financial_connections_accounts_get_service( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.retrieve("fca_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/financial_connections/accounts/fca_xyz", + query_string="", + ) + def test_financial_connections_accounts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8164,6 +4335,18 @@ def test_financial_connections_accounts_get_2_service( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_get_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.list( + account_holder={"customer": "cus_xxxxxxxxxxxxx"}, + ) + http_client_mock.assert_requested( + "get", + path="/v1/financial_connections/accounts", + query_string="account_holder[customer]=cus_xxxxxxxxxxxxx", + ) + def test_financial_connections_accounts_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8189,6 +4372,16 @@ def test_financial_connections_accounts_get_3_service( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_get_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.retrieve("fca_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", + query_string="", + ) + def test_financial_connections_accounts_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8209,6 +4402,19 @@ def test_financial_connections_accounts_get_4_service( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_owners_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.list_owners( + "fca_xyz", + ownership="fcaowns_xyz", + ) + http_client_mock.assert_requested( + "get", + path="/v1/financial_connections/accounts/fca_xyz/owners", + query_string="ownership=fcaowns_xyz", + ) + def test_financial_connections_accounts_owners_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8233,6 +4439,20 @@ def test_financial_connections_accounts_owners_get_service( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_owners_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.list_owners( + "fca_xxxxxxxxxxxxx", + limit=3, + ownership="fcaowns_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", + query_string="limit=3&ownership=fcaowns_xxxxxxxxxxxxx", + ) + def test_financial_connections_accounts_owners_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8257,6 +4477,20 @@ def test_financial_connections_accounts_owners_get_2_service( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_refresh_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.refresh_account( + "fca_xyz", + features=["balance"], + ) + http_client_mock.assert_requested( + "post", + path="/v1/financial_connections/accounts/fca_xyz/refresh", + query_string="", + post_data="features[0]=balance", + ) + def test_financial_connections_accounts_refresh_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8281,6 +4515,20 @@ def test_financial_connections_accounts_refresh_post_service( post_data="features[0]=balance", ) + def test_financial_connections_accounts_subscribe_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.subscribe( + "fa_123", + features=["transactions"], + ) + http_client_mock.assert_requested( + "post", + path="/v1/financial_connections/accounts/fa_123/subscribe", + query_string="", + post_data="features[0]=transactions", + ) + def test_financial_connections_accounts_subscribe_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8305,6 +4553,20 @@ def test_financial_connections_accounts_subscribe_post_service( post_data="features[0]=transactions", ) + def test_financial_connections_accounts_unsubscribe_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.unsubscribe( + "fa_123", + features=["transactions"], + ) + http_client_mock.assert_requested( + "post", + path="/v1/financial_connections/accounts/fa_123/unsubscribe", + query_string="", + post_data="features[0]=transactions", + ) + def test_financial_connections_accounts_unsubscribe_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8329,6 +4591,16 @@ def test_financial_connections_accounts_unsubscribe_post_service( post_data="features[0]=transactions", ) + def test_financial_connections_sessions_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Session.retrieve("fcsess_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/financial_connections/sessions/fcsess_xyz", + query_string="", + ) + def test_financial_connections_sessions_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8349,6 +4621,16 @@ def test_financial_connections_sessions_get_service( api_base="https://api.stripe.com", ) + def test_financial_connections_sessions_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Session.retrieve("fcsess_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", + query_string="", + ) + def test_financial_connections_sessions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8369,6 +4651,20 @@ def test_financial_connections_sessions_get_2_service( api_base="https://api.stripe.com", ) + def test_financial_connections_sessions_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Session.create( + account_holder={"type": "customer", "customer": "cus_123"}, + permissions=["balances"], + ) + http_client_mock.assert_requested( + "post", + path="/v1/financial_connections/sessions", + query_string="", + post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", + ) + def test_financial_connections_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8395,6 +4691,24 @@ def test_financial_connections_sessions_post_service( post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", ) + def test_financial_connections_sessions_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Session.create( + account_holder={ + "type": "customer", + "customer": "cus_xxxxxxxxxxxxx", + }, + permissions=["payment_method", "balances"], + filters={"countries": ["US"]}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/financial_connections/sessions", + query_string="", + post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", + ) + def test_financial_connections_sessions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8425,6 +4739,16 @@ def test_financial_connections_sessions_post_2_service( post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", ) + def test_financial_connections_transactions_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Transaction.retrieve("tr_123") + http_client_mock.assert_requested( + "get", + path="/v1/financial_connections/transactions/tr_123", + query_string="", + ) + def test_financial_connections_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8445,6 +4769,16 @@ def test_financial_connections_transactions_get_service( api_base="https://api.stripe.com", ) + def test_financial_connections_transactions_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Transaction.list(account="fca_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/financial_connections/transactions", + query_string="account=fca_xyz", + ) + def test_financial_connections_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8466,6 +4800,16 @@ def test_financial_connections_transactions_get_2_service( api_base="https://api.stripe.com", ) + def test_identity_verification_reports_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.identity.VerificationReport.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/identity/verification_reports", + query_string="limit=3", + ) + def test_identity_verification_reports_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8487,6 +4831,16 @@ def test_identity_verification_reports_get_service( api_base="https://api.stripe.com", ) + def test_identity_verification_reports_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.identity.VerificationReport.retrieve("vr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", + query_string="", + ) + def test_identity_verification_reports_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8507,6 +4861,16 @@ def test_identity_verification_reports_get_2_service( api_base="https://api.stripe.com", ) + def test_identity_verification_sessions_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.identity.VerificationSession.cancel("vs_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", + query_string="", + ) + def test_identity_verification_sessions_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8527,6 +4891,16 @@ def test_identity_verification_sessions_cancel_post_service( api_base="https://api.stripe.com", ) + def test_identity_verification_sessions_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.identity.VerificationSession.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/identity/verification_sessions", + query_string="limit=3", + ) + def test_identity_verification_sessions_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8548,6 +4922,16 @@ def test_identity_verification_sessions_get_service( api_base="https://api.stripe.com", ) + def test_identity_verification_sessions_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.identity.VerificationSession.retrieve("vs_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", + query_string="", + ) + def test_identity_verification_sessions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8568,6 +4952,17 @@ def test_identity_verification_sessions_get_2_service( api_base="https://api.stripe.com", ) + def test_identity_verification_sessions_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.identity.VerificationSession.create(type="document") + http_client_mock.assert_requested( + "post", + path="/v1/identity/verification_sessions", + query_string="", + post_data="type=document", + ) + def test_identity_verification_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8589,6 +4984,20 @@ def test_identity_verification_sessions_post_service( post_data="type=document", ) + def test_identity_verification_sessions_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.identity.VerificationSession.modify( + "vs_xxxxxxxxxxxxx", + type="id_number", + ) + http_client_mock.assert_requested( + "post", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", + query_string="", + post_data="type=id_number", + ) + def test_identity_verification_sessions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8613,6 +5022,16 @@ def test_identity_verification_sessions_post_2_service( post_data="type=id_number", ) + def test_identity_verification_sessions_redact_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.identity.VerificationSession.redact("vs_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", + query_string="", + ) + def test_identity_verification_sessions_redact_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8633,6 +5052,16 @@ def test_identity_verification_sessions_redact_post_service( api_base="https://api.stripe.com", ) + def test_invoiceitems_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.InvoiceItem.delete("ii_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", + query_string="", + ) + def test_invoiceitems_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8653,6 +5082,14 @@ def test_invoiceitems_delete_service( api_base="https://api.stripe.com", ) + def test_invoiceitems_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.InvoiceItem.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/invoiceitems", + query_string="limit=3", + ) + def test_invoiceitems_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8674,6 +5111,16 @@ def test_invoiceitems_get_service( api_base="https://api.stripe.com", ) + def test_invoiceitems_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.InvoiceItem.retrieve("ii_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", + query_string="", + ) + def test_invoiceitems_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8694,6 +5141,18 @@ def test_invoiceitems_get_2_service( api_base="https://api.stripe.com", ) + def test_invoiceitems_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.InvoiceItem.create( + customer="cus_xxxxxxxxxxxxx", + price="price_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/invoiceitems", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", + ) + def test_invoiceitems_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8720,6 +5179,20 @@ def test_invoiceitems_post_service( post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", ) + def test_invoiceitems_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.InvoiceItem.modify( + "ii_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_invoiceitems_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8744,6 +5217,14 @@ def test_invoiceitems_post_2_service( post_data="metadata[order_id]=6735", ) + def test_invoices_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.delete("in_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/invoices/in_xxxxxxxxxxxxx", + query_string="", + ) + def test_invoices_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8764,6 +5245,16 @@ def test_invoices_delete_service( api_base="https://api.stripe.com", ) + def test_invoices_finalize_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Invoice.finalize_invoice("in_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", + query_string="", + ) + def test_invoices_finalize_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8784,6 +5275,14 @@ def test_invoices_finalize_post_service( api_base="https://api.stripe.com", ) + def test_invoices_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/invoices", + query_string="limit=3", + ) + def test_invoices_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8805,6 +5304,14 @@ def test_invoices_get_service( api_base="https://api.stripe.com", ) + def test_invoices_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.retrieve("in_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/invoices/in_xxxxxxxxxxxxx", + query_string="", + ) + def test_invoices_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8825,6 +5332,17 @@ def test_invoices_get_2_service( api_base="https://api.stripe.com", ) + def test_invoices_get_3(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.retrieve( + "in_xxxxxxxxxxxxx", + expand=["customer"], + ) + http_client_mock.assert_requested( + "get", + path="/v1/invoices/in_xxxxxxxxxxxxx", + query_string="expand[0]=customer", + ) + def test_invoices_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8849,6 +5367,16 @@ def test_invoices_get_3_service( api_base="https://api.stripe.com", ) + def test_invoices_mark_uncollectible_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Invoice.mark_uncollectible("in_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", + query_string="", + ) + def test_invoices_mark_uncollectible_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8869,6 +5397,14 @@ def test_invoices_mark_uncollectible_post_service( api_base="https://api.stripe.com", ) + def test_invoices_pay_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.pay("in_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/pay", + query_string="", + ) + def test_invoices_pay_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8889,6 +5425,15 @@ def test_invoices_pay_post_service( api_base="https://api.stripe.com", ) + def test_invoices_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.create(customer="cus_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/invoices", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx", + ) + def test_invoices_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8910,6 +5455,18 @@ def test_invoices_post_service( post_data="customer=cus_xxxxxxxxxxxxx", ) + def test_invoices_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.modify( + "in_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_invoices_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8934,6 +5491,18 @@ def test_invoices_post_2_service( post_data="metadata[order_id]=6735", ) + def test_invoices_search_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Invoice.search( + query="total>999 AND metadata['order_id']:'6735'" + ) + http_client_mock.assert_requested( + "get", + path="/v1/invoices/search", + query_string="query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + def test_invoices_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8959,6 +5528,16 @@ def test_invoices_search_get_service( api_base="https://api.stripe.com", ) + def test_invoices_send_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Invoice.send_invoice("in_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/send", + query_string="", + ) + def test_invoices_send_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -8979,6 +5558,16 @@ def test_invoices_send_post_service( api_base="https://api.stripe.com", ) + def test_invoices_upcoming_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Invoice.upcoming(customer="cus_9utnxg47pWjV1e") + http_client_mock.assert_requested( + "get", + path="/v1/invoices/upcoming", + query_string="customer=cus_9utnxg47pWjV1e", + ) + def test_invoices_upcoming_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9000,6 +5589,16 @@ def test_invoices_upcoming_get_service( api_base="https://api.stripe.com", ) + def test_invoices_void_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Invoice.void_invoice("in_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/void", + query_string="", + ) + def test_invoices_void_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9020,6 +5619,16 @@ def test_invoices_void_post_service( api_base="https://api.stripe.com", ) + def test_issuing_authorizations_approve_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.approve("iauth_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", + query_string="", + ) + def test_issuing_authorizations_approve_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9040,6 +5649,16 @@ def test_issuing_authorizations_approve_post_service( api_base="https://api.stripe.com", ) + def test_issuing_authorizations_decline_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.decline("iauth_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", + query_string="", + ) + def test_issuing_authorizations_decline_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9060,6 +5679,16 @@ def test_issuing_authorizations_decline_post_service( api_base="https://api.stripe.com", ) + def test_issuing_authorizations_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/issuing/authorizations", + query_string="limit=3", + ) + def test_issuing_authorizations_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9081,6 +5710,16 @@ def test_issuing_authorizations_get_service( api_base="https://api.stripe.com", ) + def test_issuing_authorizations_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.retrieve("iauth_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", + query_string="", + ) + def test_issuing_authorizations_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9101,6 +5740,20 @@ def test_issuing_authorizations_get_2_service( api_base="https://api.stripe.com", ) + def test_issuing_authorizations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.modify( + "iauth_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_issuing_authorizations_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9125,6 +5778,16 @@ def test_issuing_authorizations_post_service( post_data="metadata[order_id]=6735", ) + def test_issuing_cardholders_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Cardholder.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/issuing/cardholders", + query_string="limit=3", + ) + def test_issuing_cardholders_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9146,6 +5809,16 @@ def test_issuing_cardholders_get_service( api_base="https://api.stripe.com", ) + def test_issuing_cardholders_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Cardholder.retrieve("ich_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", + query_string="", + ) + def test_issuing_cardholders_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9166,6 +5839,31 @@ def test_issuing_cardholders_get_2_service( api_base="https://api.stripe.com", ) + def test_issuing_cardholders_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Cardholder.create( + type="individual", + name="Jenny Rosen", + email="jenny.rosen@example.com", + phone_number="+18888675309", + billing={ + "address": { + "line1": "1234 Main Street", + "city": "San Francisco", + "state": "CA", + "country": "US", + "postal_code": "94111", + }, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/issuing/cardholders", + query_string="", + post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", + ) + def test_issuing_cardholders_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9203,6 +5901,20 @@ def test_issuing_cardholders_post_service( post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", ) + def test_issuing_cardholders_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Cardholder.modify( + "ich_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_issuing_cardholders_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9227,6 +5939,14 @@ def test_issuing_cardholders_post_2_service( post_data="metadata[order_id]=6735", ) + def test_issuing_cards_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.issuing.Card.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/issuing/cards", + query_string="limit=3", + ) + def test_issuing_cards_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9248,6 +5968,16 @@ def test_issuing_cards_get_service( api_base="https://api.stripe.com", ) + def test_issuing_cards_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Card.retrieve("ic_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", + query_string="", + ) + def test_issuing_cards_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9268,6 +5998,21 @@ def test_issuing_cards_get_2_service( api_base="https://api.stripe.com", ) + def test_issuing_cards_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Card.create( + cardholder="ich_xxxxxxxxxxxxx", + currency="usd", + type="virtual", + ) + http_client_mock.assert_requested( + "post", + path="/v1/issuing/cards", + query_string="", + post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", + ) + def test_issuing_cards_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9295,6 +6040,20 @@ def test_issuing_cards_post_service( post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", ) + def test_issuing_cards_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Card.modify( + "ic_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_issuing_cards_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9319,6 +6078,16 @@ def test_issuing_cards_post_2_service( post_data="metadata[order_id]=6735", ) + def test_issuing_disputes_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Dispute.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/issuing/disputes", + query_string="limit=3", + ) + def test_issuing_disputes_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9340,6 +6109,16 @@ def test_issuing_disputes_get_service( api_base="https://api.stripe.com", ) + def test_issuing_disputes_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Dispute.retrieve("idp_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", + query_string="", + ) + def test_issuing_disputes_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9360,6 +6139,23 @@ def test_issuing_disputes_get_2_service( api_base="https://api.stripe.com", ) + def test_issuing_disputes_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Dispute.create( + transaction="ipi_xxxxxxxxxxxxx", + evidence={ + "reason": "fraudulent", + "fraudulent": {"explanation": "Purchase was unrecognized."}, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/issuing/disputes", + query_string="", + post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", + ) + def test_issuing_disputes_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9391,6 +6187,16 @@ def test_issuing_disputes_post_service( post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", ) + def test_issuing_disputes_submit_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Dispute.submit("idp_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", + query_string="", + ) + def test_issuing_disputes_submit_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9411,6 +6217,16 @@ def test_issuing_disputes_submit_post_service( api_base="https://api.stripe.com", ) + def test_issuing_transactions_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Transaction.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/issuing/transactions", + query_string="limit=3", + ) + def test_issuing_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9432,6 +6248,16 @@ def test_issuing_transactions_get_service( api_base="https://api.stripe.com", ) + def test_issuing_transactions_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Transaction.retrieve("ipi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", + query_string="", + ) + def test_issuing_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9452,6 +6278,20 @@ def test_issuing_transactions_get_2_service( api_base="https://api.stripe.com", ) + def test_issuing_transactions_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Transaction.modify( + "ipi_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_issuing_transactions_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9476,6 +6316,14 @@ def test_issuing_transactions_post_service( post_data="metadata[order_id]=6735", ) + def test_mandates_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Mandate.retrieve("mandate_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/mandates/mandate_xxxxxxxxxxxxx", + query_string="", + ) + def test_mandates_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9496,6 +6344,16 @@ def test_mandates_get_service( api_base="https://api.stripe.com", ) + def test_payment_intents_apply_customer_balance_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.apply_customer_balance("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", + query_string="", + ) + def test_payment_intents_apply_customer_balance_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9516,6 +6374,16 @@ def test_payment_intents_apply_customer_balance_post_service( api_base="https://api.stripe.com", ) + def test_payment_intents_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.cancel("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", + query_string="", + ) + def test_payment_intents_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9536,6 +6404,16 @@ def test_payment_intents_cancel_post_service( api_base="https://api.stripe.com", ) + def test_payment_intents_capture_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.capture("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", + query_string="", + ) + def test_payment_intents_capture_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9556,6 +6434,20 @@ def test_payment_intents_capture_post_service( api_base="https://api.stripe.com", ) + def test_payment_intents_confirm_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.confirm( + "pi_xxxxxxxxxxxxx", + payment_method="pm_card_visa", + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", + query_string="", + post_data="payment_method=pm_card_visa", + ) + def test_payment_intents_confirm_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9580,6 +6472,16 @@ def test_payment_intents_confirm_post_service( post_data="payment_method=pm_card_visa", ) + def test_payment_intents_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents", + query_string="limit=3", + ) + def test_payment_intents_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9601,6 +6503,16 @@ def test_payment_intents_get_service( api_base="https://api.stripe.com", ) + def test_payment_intents_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.retrieve("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + query_string="", + ) + def test_payment_intents_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9621,6 +6533,20 @@ def test_payment_intents_get_2_service( api_base="https://api.stripe.com", ) + def test_payment_intents_increment_authorization_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.increment_authorization( + "pi_xxxxxxxxxxxxx", + amount=2099, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", + query_string="", + post_data="amount=2099", + ) + def test_payment_intents_increment_authorization_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9645,6 +6571,21 @@ def test_payment_intents_increment_authorization_post_service( post_data="amount=2099", ) + def test_payment_intents_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.create( + amount=1099, + currency="eur", + automatic_payment_methods={"enabled": True}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", + ) + def test_payment_intents_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9672,6 +6613,21 @@ def test_payment_intents_post_service( post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", ) + def test_payment_intents_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.create( + amount=2000, + currency="usd", + automatic_payment_methods={"enabled": True}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", + ) + def test_payment_intents_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9699,6 +6655,20 @@ def test_payment_intents_post_2_service( post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", ) + def test_payment_intents_post_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.modify( + "pi_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_payment_intents_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9723,6 +6693,21 @@ def test_payment_intents_post_3_service( post_data="metadata[order_id]=6735", ) + def test_payment_intents_post_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.create( + amount=200, + currency="usd", + payment_method_data={"type": "p24", "p24": {"bank": "blik"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", + ) + def test_payment_intents_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9753,6 +6738,18 @@ def test_payment_intents_post_4_service( post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", ) + def test_payment_intents_search_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.search( + query="status:'succeeded' AND metadata['order_id']:'6735'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents/search", + query_string="query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + def test_payment_intents_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9778,6 +6775,16 @@ def test_payment_intents_search_get_service( api_base="https://api.stripe.com", ) + def test_payment_intents_verify_microdeposits_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.verify_microdeposits("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + ) + def test_payment_intents_verify_microdeposits_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9798,6 +6805,20 @@ def test_payment_intents_verify_microdeposits_post_service( api_base="https://api.stripe.com", ) + def test_payment_intents_verify_microdeposits_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.verify_microdeposits( + "pi_xxxxxxxxxxxxx", + amounts=[32, 45], + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + post_data="amounts[0]=32&amounts[1]=45", + ) + def test_payment_intents_verify_microdeposits_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9822,6 +6843,14 @@ def test_payment_intents_verify_microdeposits_post_2_service( post_data="amounts[0]=32&amounts[1]=45", ) + def test_payment_links_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.PaymentLink.retrieve("pl_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/pl_xyz", + query_string="", + ) + def test_payment_links_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9842,6 +6871,16 @@ def test_payment_links_get_service( api_base="https://api.stripe.com", ) + def test_payment_links_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentLink.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/payment_links", + query_string="limit=3", + ) + def test_payment_links_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9863,6 +6902,16 @@ def test_payment_links_get_2_service( api_base="https://api.stripe.com", ) + def test_payment_links_get_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentLink.retrieve("plink_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/plink_xxxxxxxxxxxxx", + query_string="", + ) + def test_payment_links_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9883,6 +6932,16 @@ def test_payment_links_get_3_service( api_base="https://api.stripe.com", ) + def test_payment_links_line_items_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentLink.list_line_items("pl_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/pl_xyz/line_items", + query_string="", + ) + def test_payment_links_line_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9903,6 +6962,19 @@ def test_payment_links_line_items_get_service( api_base="https://api.stripe.com", ) + def test_payment_links_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentLink.create( + line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links", + query_string="", + post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + ) + def test_payment_links_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9930,6 +7002,19 @@ def test_payment_links_post_service( post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) + def test_payment_links_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentLink.create( + line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links", + query_string="", + post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + ) + def test_payment_links_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9957,6 +7042,20 @@ def test_payment_links_post_2_service( post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) + def test_payment_links_post_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentLink.modify( + "plink_xxxxxxxxxxxxx", + active=False, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links/plink_xxxxxxxxxxxxx", + query_string="", + post_data="active=False", + ) + def test_payment_links_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -9981,6 +7080,16 @@ def test_payment_links_post_3_service( post_data="active=False", ) + def test_payment_method_configurations_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethodConfiguration.list(application="foo") + http_client_mock.assert_requested( + "get", + path="/v1/payment_method_configurations", + query_string="application=foo", + ) + def test_payment_method_configurations_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10002,6 +7111,16 @@ def test_payment_method_configurations_get_service( api_base="https://api.stripe.com", ) + def test_payment_method_configurations_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethodConfiguration.retrieve("foo") + http_client_mock.assert_requested( + "get", + path="/v1/payment_method_configurations/foo", + query_string="", + ) + def test_payment_method_configurations_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10022,6 +7141,20 @@ def test_payment_method_configurations_get_2_service( api_base="https://api.stripe.com", ) + def test_payment_method_configurations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethodConfiguration.create( + acss_debit={"display_preference": {"preference": "none"}}, + affirm={"display_preference": {"preference": "none"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_method_configurations", + query_string="", + post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", + ) + def test_payment_method_configurations_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10048,6 +7181,20 @@ def test_payment_method_configurations_post_service( post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", ) + def test_payment_method_configurations_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethodConfiguration.modify( + "foo", + acss_debit={"display_preference": {"preference": "on"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_method_configurations/foo", + query_string="", + post_data="acss_debit[display_preference][preference]=on", + ) + def test_payment_method_configurations_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10072,6 +7219,20 @@ def test_payment_method_configurations_post_2_service( post_data="acss_debit[display_preference][preference]=on", ) + def test_payment_methods_attach_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethod.attach( + "pm_xxxxxxxxxxxxx", + customer="cus_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx", + ) + def test_payment_methods_attach_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10096,6 +7257,16 @@ def test_payment_methods_attach_post_service( post_data="customer=cus_xxxxxxxxxxxxx", ) + def test_payment_methods_detach_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethod.detach("pm_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", + query_string="", + ) + def test_payment_methods_detach_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10116,6 +7287,19 @@ def test_payment_methods_detach_post_service( api_base="https://api.stripe.com", ) + def test_payment_methods_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethod.list( + customer="cus_xxxxxxxxxxxxx", + type="card", + ) + http_client_mock.assert_requested( + "get", + path="/v1/payment_methods", + query_string="customer=cus_xxxxxxxxxxxxx&type=card", + ) + def test_payment_methods_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10142,6 +7326,16 @@ def test_payment_methods_get_service( api_base="https://api.stripe.com", ) + def test_payment_methods_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethod.retrieve("pm_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx", + query_string="", + ) + def test_payment_methods_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10162,6 +7356,25 @@ def test_payment_methods_get_2_service( api_base="https://api.stripe.com", ) + def test_payment_methods_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethod.create( + type="card", + card={ + "number": "4242424242424242", + "exp_month": 8, + "exp_year": 2024, + "cvc": "314", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods", + query_string="", + post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", + ) + def test_payment_methods_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10187,10 +7400,24 @@ def test_payment_methods_post_service( ) http_client_mock.assert_requested( "post", - path="/v1/payment_methods", + path="/v1/payment_methods", + query_string="", + api_base="https://api.stripe.com", + post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", + ) + + def test_payment_methods_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethod.modify( + "pm_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx", query_string="", - api_base="https://api.stripe.com", - post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", + post_data="metadata[order_id]=6735", ) def test_payment_methods_post_2_service( @@ -10217,6 +7444,16 @@ def test_payment_methods_post_2_service( post_data="metadata[order_id]=6735", ) + def test_payouts_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Payout.cancel("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", + query_string="", + ) + def test_payouts_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10237,6 +7474,14 @@ def test_payouts_cancel_post_service( api_base="https://api.stripe.com", ) + def test_payouts_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Payout.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/payouts", + query_string="limit=3", + ) + def test_payouts_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10258,6 +7503,14 @@ def test_payouts_get_service( api_base="https://api.stripe.com", ) + def test_payouts_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Payout.retrieve("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payouts/po_xxxxxxxxxxxxx", + query_string="", + ) + def test_payouts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10278,6 +7531,18 @@ def test_payouts_get_2_service( api_base="https://api.stripe.com", ) + def test_payouts_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Payout.create( + amount=1100, + currency="usd", + ) + http_client_mock.assert_requested( + "post", + path="/v1/payouts", + query_string="", + post_data="amount=1100¤cy=usd", + ) + def test_payouts_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10299,6 +7564,18 @@ def test_payouts_post_service( post_data="amount=1100¤cy=usd", ) + def test_payouts_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Payout.modify( + "po_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_payouts_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10323,6 +7600,16 @@ def test_payouts_post_2_service( post_data="metadata[order_id]=6735", ) + def test_payouts_reverse_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Payout.reverse("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", + query_string="", + ) + def test_payouts_reverse_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10343,6 +7630,14 @@ def test_payouts_reverse_post_service( api_base="https://api.stripe.com", ) + def test_plans_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.Plan.delete("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + ) + def test_plans_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10363,6 +7658,14 @@ def test_plans_delete_service( api_base="https://api.stripe.com", ) + def test_plans_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Plan.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/plans", + query_string="limit=3", + ) + def test_plans_get_service(self, http_client_mock: HTTPClientMock) -> None: http_client_mock.stub_request( "get", @@ -10382,6 +7685,14 @@ def test_plans_get_service(self, http_client_mock: HTTPClientMock) -> None: api_base="https://api.stripe.com", ) + def test_plans_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Plan.retrieve("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + ) + def test_plans_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10402,6 +7713,20 @@ def test_plans_get_2_service( api_base="https://api.stripe.com", ) + def test_plans_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Plan.create( + amount=2000, + currency="usd", + interval="month", + product="prod_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans", + query_string="", + post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", + ) + def test_plans_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10430,6 +7755,20 @@ def test_plans_post_service( post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", ) + def test_plans_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Plan.create( + amount=2000, + currency="usd", + interval="month", + product={"name": "My product"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans", + query_string="", + post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", + ) + def test_plans_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10458,6 +7797,18 @@ def test_plans_post_2_service( post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", ) + def test_plans_post_3(self, http_client_mock: HTTPClientMock) -> None: + stripe.Plan.modify( + "price_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_plans_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10482,6 +7833,14 @@ def test_plans_post_3_service( post_data="metadata[order_id]=6735", ) + def test_prices_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Price.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/prices", + query_string="limit=3", + ) + def test_prices_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10503,6 +7862,14 @@ def test_prices_get_service( api_base="https://api.stripe.com", ) + def test_prices_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Price.retrieve("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/prices/price_xxxxxxxxxxxxx", + query_string="", + ) + def test_prices_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10523,6 +7890,24 @@ def test_prices_get_2_service( api_base="https://api.stripe.com", ) + def test_prices_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Price.create( + unit_amount=2000, + currency="usd", + currency_options={ + "uah": {"unit_amount": 5000}, + "eur": {"unit_amount": 1800}, + }, + recurring={"interval": "month"}, + product="prod_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices", + query_string="", + post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", + ) + def test_prices_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10555,6 +7940,20 @@ def test_prices_post_service( post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) + def test_prices_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Price.create( + unit_amount=2000, + currency="usd", + recurring={"interval": "month"}, + product="prod_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices", + query_string="", + post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", + ) + def test_prices_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10583,6 +7982,18 @@ def test_prices_post_2_service( post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) + def test_prices_post_3(self, http_client_mock: HTTPClientMock) -> None: + stripe.Price.modify( + "price_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices/price_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_prices_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10607,6 +8018,16 @@ def test_prices_post_3_service( post_data="metadata[order_id]=6735", ) + def test_prices_search_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Price.search( + query="active:'true' AND metadata['order_id']:'6735'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/prices/search", + query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + def test_prices_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10632,6 +8053,14 @@ def test_prices_search_get_service( api_base="https://api.stripe.com", ) + def test_products_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.Product.delete("prod_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + ) + def test_products_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10652,6 +8081,14 @@ def test_products_delete_service( api_base="https://api.stripe.com", ) + def test_products_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Product.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/products", + query_string="limit=3", + ) + def test_products_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10673,6 +8110,14 @@ def test_products_get_service( api_base="https://api.stripe.com", ) + def test_products_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Product.retrieve("prod_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + ) + def test_products_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10693,6 +8138,15 @@ def test_products_get_2_service( api_base="https://api.stripe.com", ) + def test_products_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Product.create(name="Gold Special") + http_client_mock.assert_requested( + "post", + path="/v1/products", + query_string="", + post_data="name=Gold%20Special", + ) + def test_products_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10714,6 +8168,18 @@ def test_products_post_service( post_data="name=Gold%20Special", ) + def test_products_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Product.modify( + "prod_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_products_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10738,6 +8204,18 @@ def test_products_post_2_service( post_data="metadata[order_id]=6735", ) + def test_products_search_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Product.search( + query="active:'true' AND metadata['order_id']:'6735'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/products/search", + query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + def test_products_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10763,6 +8241,16 @@ def test_products_search_get_service( api_base="https://api.stripe.com", ) + def test_promotion_codes_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PromotionCode.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/promotion_codes", + query_string="limit=3", + ) + def test_promotion_codes_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10784,6 +8272,16 @@ def test_promotion_codes_get_service( api_base="https://api.stripe.com", ) + def test_promotion_codes_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PromotionCode.retrieve("promo_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", + query_string="", + ) + def test_promotion_codes_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10804,6 +8302,17 @@ def test_promotion_codes_get_2_service( api_base="https://api.stripe.com", ) + def test_promotion_codes_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PromotionCode.create(coupon="Z4OV52SU") + http_client_mock.assert_requested( + "post", + path="/v1/promotion_codes", + query_string="", + post_data="coupon=Z4OV52SU", + ) + def test_promotion_codes_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10825,6 +8334,20 @@ def test_promotion_codes_post_service( post_data="coupon=Z4OV52SU", ) + def test_promotion_codes_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PromotionCode.modify( + "promo_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_promotion_codes_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10849,6 +8372,16 @@ def test_promotion_codes_post_2_service( post_data="metadata[order_id]=6735", ) + def test_quotes_accept_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Quote.accept("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", + query_string="", + ) + def test_quotes_accept_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10869,6 +8402,16 @@ def test_quotes_accept_post_service( api_base="https://api.stripe.com", ) + def test_quotes_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Quote.cancel("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", + query_string="", + ) + def test_quotes_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10889,6 +8432,16 @@ def test_quotes_cancel_post_service( api_base="https://api.stripe.com", ) + def test_quotes_finalize_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Quote.finalize_quote("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", + query_string="", + ) + def test_quotes_finalize_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10909,6 +8462,14 @@ def test_quotes_finalize_post_service( api_base="https://api.stripe.com", ) + def test_quotes_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Quote.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/quotes", + query_string="limit=3", + ) + def test_quotes_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10930,6 +8491,14 @@ def test_quotes_get_service( api_base="https://api.stripe.com", ) + def test_quotes_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Quote.retrieve("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx", + query_string="", + ) + def test_quotes_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10950,6 +8519,16 @@ def test_quotes_get_2_service( api_base="https://api.stripe.com", ) + def test_quotes_line_items_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Quote.list_line_items("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", + query_string="", + ) + def test_quotes_line_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -10970,6 +8549,16 @@ def test_quotes_line_items_get_service( api_base="https://api.stripe.com", ) + def test_quotes_pdf_get( + self, http_client_mock_streaming: HTTPClientMock + ) -> None: + stripe.Quote.pdf("qt_xxxxxxxxxxxxx") + http_client_mock_streaming.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", + query_string="", + ) + def test_quotes_pdf_get_service( self, http_client_mock_streaming: HTTPClientMock ) -> None: @@ -10990,6 +8579,18 @@ def test_quotes_pdf_get_service( api_base="https://files.stripe.com", ) + def test_quotes_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Quote.create( + customer="cus_xxxxxxxxxxxxx", + line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], + ) + http_client_mock.assert_requested( + "post", + path="/v1/quotes", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", + ) + def test_quotes_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11018,6 +8619,18 @@ def test_quotes_post_service( post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", ) + def test_quotes_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Quote.modify( + "qt_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_quotes_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11042,6 +8655,16 @@ def test_quotes_post_2_service( post_data="metadata[order_id]=6735", ) + def test_radar_early_fraud_warnings_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.EarlyFraudWarning.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/radar/early_fraud_warnings", + query_string="limit=3", + ) + def test_radar_early_fraud_warnings_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11063,6 +8686,16 @@ def test_radar_early_fraud_warnings_get_service( api_base="https://api.stripe.com", ) + def test_radar_early_fraud_warnings_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.EarlyFraudWarning.retrieve("issfr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", + query_string="", + ) + def test_radar_early_fraud_warnings_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11083,6 +8716,16 @@ def test_radar_early_fraud_warnings_get_2_service( api_base="https://api.stripe.com", ) + def test_radar_value_list_items_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueListItem.delete("rsli_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + query_string="", + ) + def test_radar_value_list_items_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11103,6 +8746,19 @@ def test_radar_value_list_items_delete_service( api_base="https://api.stripe.com", ) + def test_radar_value_list_items_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueListItem.list( + limit=3, + value_list="rsl_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_list_items", + query_string="limit=3&value_list=rsl_xxxxxxxxxxxxx", + ) + def test_radar_value_list_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11129,6 +8785,16 @@ def test_radar_value_list_items_get_service( api_base="https://api.stripe.com", ) + def test_radar_value_list_items_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueListItem.retrieve("rsli_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + query_string="", + ) + def test_radar_value_list_items_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11149,6 +8815,20 @@ def test_radar_value_list_items_get_2_service( api_base="https://api.stripe.com", ) + def test_radar_value_list_items_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueListItem.create( + value_list="rsl_xxxxxxxxxxxxx", + value="1.2.3.4", + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_list_items", + query_string="", + post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", + ) + def test_radar_value_list_items_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11175,6 +8855,16 @@ def test_radar_value_list_items_post_service( post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", ) + def test_radar_value_lists_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueList.delete("rsl_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + ) + def test_radar_value_lists_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11195,6 +8885,16 @@ def test_radar_value_lists_delete_service( api_base="https://api.stripe.com", ) + def test_radar_value_lists_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueList.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_lists", + query_string="limit=3", + ) + def test_radar_value_lists_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11216,6 +8916,16 @@ def test_radar_value_lists_get_service( api_base="https://api.stripe.com", ) + def test_radar_value_lists_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueList.retrieve("rsl_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + ) + def test_radar_value_lists_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11236,6 +8946,21 @@ def test_radar_value_lists_get_2_service( api_base="https://api.stripe.com", ) + def test_radar_value_lists_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueList.create( + alias="custom_ip_xxxxxxxxxxxxx", + name="Custom IP Blocklist", + item_type="ip_address", + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_lists", + query_string="", + post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", + ) + def test_radar_value_lists_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11257,10 +8982,24 @@ def test_radar_value_lists_post_service( ) http_client_mock.assert_requested( "post", - path="/v1/radar/value_lists", + path="/v1/radar/value_lists", + query_string="", + api_base="https://api.stripe.com", + post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", + ) + + def test_radar_value_lists_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueList.modify( + "rsl_xxxxxxxxxxxxx", + name="Updated IP Block List", + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", - api_base="https://api.stripe.com", - post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", + post_data="name=Updated%20IP%20Block%20List", ) def test_radar_value_lists_post_2_service( @@ -11287,6 +9026,16 @@ def test_radar_value_lists_post_2_service( post_data="name=Updated%20IP%20Block%20List", ) + def test_refunds_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Refund.cancel("re_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", + query_string="", + ) + def test_refunds_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11307,6 +9056,14 @@ def test_refunds_cancel_post_service( api_base="https://api.stripe.com", ) + def test_refunds_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Refund.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/refunds", + query_string="limit=3", + ) + def test_refunds_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11328,6 +9085,14 @@ def test_refunds_get_service( api_base="https://api.stripe.com", ) + def test_refunds_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Refund.retrieve("re_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/refunds/re_xxxxxxxxxxxxx", + query_string="", + ) + def test_refunds_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11348,6 +9113,15 @@ def test_refunds_get_2_service( api_base="https://api.stripe.com", ) + def test_refunds_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Refund.create(charge="ch_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/refunds", + query_string="", + post_data="charge=ch_xxxxxxxxxxxxx", + ) + def test_refunds_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11369,6 +9143,18 @@ def test_refunds_post_service( post_data="charge=ch_xxxxxxxxxxxxx", ) + def test_refunds_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Refund.modify( + "re_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/refunds/re_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_refunds_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11393,6 +9179,16 @@ def test_refunds_post_2_service( post_data="metadata[order_id]=6735", ) + def test_reporting_report_runs_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.reporting.ReportRun.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_runs", + query_string="limit=3", + ) + def test_reporting_report_runs_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11414,6 +9210,16 @@ def test_reporting_report_runs_get_service( api_base="https://api.stripe.com", ) + def test_reporting_report_runs_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.reporting.ReportRun.retrieve("frr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", + query_string="", + ) + def test_reporting_report_runs_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11434,6 +9240,23 @@ def test_reporting_report_runs_get_2_service( api_base="https://api.stripe.com", ) + def test_reporting_report_runs_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.reporting.ReportRun.create( + report_type="balance.summary.1", + parameters={ + "interval_start": 1522540800, + "interval_end": 1525132800, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/reporting/report_runs", + query_string="", + post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", + ) + def test_reporting_report_runs_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11463,6 +9286,16 @@ def test_reporting_report_runs_post_service( post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", ) + def test_reporting_report_types_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.reporting.ReportType.list() + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_types", + query_string="", + ) + def test_reporting_report_types_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11483,6 +9316,16 @@ def test_reporting_report_types_get_service( api_base="https://api.stripe.com", ) + def test_reporting_report_types_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.reporting.ReportType.retrieve("balance.summary.1") + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_types/balance.summary.1", + query_string="", + ) + def test_reporting_report_types_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11503,6 +9346,16 @@ def test_reporting_report_types_get_2_service( api_base="https://api.stripe.com", ) + def test_reviews_approve_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Review.approve("prv_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", + query_string="", + ) + def test_reviews_approve_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11523,6 +9376,14 @@ def test_reviews_approve_post_service( api_base="https://api.stripe.com", ) + def test_reviews_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Review.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/reviews", + query_string="limit=3", + ) + def test_reviews_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11544,6 +9405,14 @@ def test_reviews_get_service( api_base="https://api.stripe.com", ) + def test_reviews_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Review.retrieve("prv_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/reviews/prv_xxxxxxxxxxxxx", + query_string="", + ) + def test_reviews_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11564,6 +9433,19 @@ def test_reviews_get_2_service( api_base="https://api.stripe.com", ) + def test_setup_attempts_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupAttempt.list( + limit=3, + setup_intent="si_xyz", + ) + http_client_mock.assert_requested( + "get", + path="/v1/setup_attempts", + query_string="limit=3&setup_intent=si_xyz", + ) + def test_setup_attempts_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11585,6 +9467,16 @@ def test_setup_attempts_get_service( api_base="https://api.stripe.com", ) + def test_setup_intents_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.cancel("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", + query_string="", + ) + def test_setup_intents_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11605,6 +9497,20 @@ def test_setup_intents_cancel_post_service( api_base="https://api.stripe.com", ) + def test_setup_intents_confirm_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.confirm( + "seti_xxxxxxxxxxxxx", + payment_method="pm_card_visa", + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", + query_string="", + post_data="payment_method=pm_card_visa", + ) + def test_setup_intents_confirm_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11629,6 +9535,14 @@ def test_setup_intents_confirm_post_service( post_data="payment_method=pm_card_visa", ) + def test_setup_intents_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.SetupIntent.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/setup_intents", + query_string="limit=3", + ) + def test_setup_intents_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11650,6 +9564,16 @@ def test_setup_intents_get_service( api_base="https://api.stripe.com", ) + def test_setup_intents_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.retrieve("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + query_string="", + ) + def test_setup_intents_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11670,6 +9594,17 @@ def test_setup_intents_get_2_service( api_base="https://api.stripe.com", ) + def test_setup_intents_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.create(payment_method_types=["card"]) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents", + query_string="", + post_data="payment_method_types[0]=card", + ) + def test_setup_intents_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11691,6 +9626,20 @@ def test_setup_intents_post_service( post_data="payment_method_types[0]=card", ) + def test_setup_intents_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.modify( + "seti_xxxxxxxxxxxxx", + metadata={"user_id": "3435453"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[user_id]=3435453", + ) + def test_setup_intents_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11715,6 +9664,16 @@ def test_setup_intents_post_2_service( post_data="metadata[user_id]=3435453", ) + def test_setup_intents_verify_microdeposits_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.verify_microdeposits("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + ) + def test_setup_intents_verify_microdeposits_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11735,6 +9694,20 @@ def test_setup_intents_verify_microdeposits_post_service( api_base="https://api.stripe.com", ) + def test_setup_intents_verify_microdeposits_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.verify_microdeposits( + "seti_xxxxxxxxxxxxx", + amounts=[32, 45], + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + post_data="amounts[0]=32&amounts[1]=45", + ) + def test_setup_intents_verify_microdeposits_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11752,11 +9725,21 @@ def test_setup_intents_verify_microdeposits_post_2_service( {"amounts": [32, 45]}, ) http_client_mock.assert_requested( - "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + api_base="https://api.stripe.com", + post_data="amounts[0]=32&amounts[1]=45", + ) + + def test_shipping_rates_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ShippingRate.list() + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates", query_string="", - api_base="https://api.stripe.com", - post_data="amounts[0]=32&amounts[1]=45", ) def test_shipping_rates_get_service( @@ -11779,6 +9762,16 @@ def test_shipping_rates_get_service( api_base="https://api.stripe.com", ) + def test_shipping_rates_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ShippingRate.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates", + query_string="limit=3", + ) + def test_shipping_rates_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11800,6 +9793,16 @@ def test_shipping_rates_get_2_service( api_base="https://api.stripe.com", ) + def test_shipping_rates_get_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ShippingRate.retrieve("shr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + query_string="", + ) + def test_shipping_rates_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11820,6 +9823,21 @@ def test_shipping_rates_get_3_service( api_base="https://api.stripe.com", ) + def test_shipping_rates_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ShippingRate.create( + display_name="Sample Shipper", + fixed_amount={"currency": "usd", "amount": 400}, + type="fixed_amount", + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates", + query_string="", + post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", + ) + def test_shipping_rates_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11847,6 +9865,21 @@ def test_shipping_rates_post_service( post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", ) + def test_shipping_rates_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ShippingRate.create( + display_name="Ground shipping", + type="fixed_amount", + fixed_amount={"amount": 500, "currency": "usd"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates", + query_string="", + post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", + ) + def test_shipping_rates_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11874,6 +9907,20 @@ def test_shipping_rates_post_2_service( post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", ) + def test_shipping_rates_post_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ShippingRate.modify( + "shr_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_shipping_rates_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11898,6 +9945,16 @@ def test_shipping_rates_post_3_service( post_data="metadata[order_id]=6735", ) + def test_sigma_scheduled_query_runs_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.sigma.ScheduledQueryRun.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/sigma/scheduled_query_runs", + query_string="limit=3", + ) + def test_sigma_scheduled_query_runs_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11919,6 +9976,16 @@ def test_sigma_scheduled_query_runs_get_service( api_base="https://api.stripe.com", ) + def test_sigma_scheduled_query_runs_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.sigma.ScheduledQueryRun.retrieve("sqr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", + query_string="", + ) + def test_sigma_scheduled_query_runs_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11939,6 +10006,14 @@ def test_sigma_scheduled_query_runs_get_2_service( api_base="https://api.stripe.com", ) + def test_sources_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Source.retrieve("src_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + ) + def test_sources_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11959,6 +10034,14 @@ def test_sources_get_service( api_base="https://api.stripe.com", ) + def test_sources_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Source.retrieve("src_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + ) + def test_sources_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -11979,6 +10062,18 @@ def test_sources_get_2_service( api_base="https://api.stripe.com", ) + def test_sources_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Source.modify( + "src_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_sources_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12003,6 +10098,16 @@ def test_sources_post_service( post_data="metadata[order_id]=6735", ) + def test_subscription_items_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.delete("si_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + ) + def test_subscription_items_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12023,6 +10128,16 @@ def test_subscription_items_delete_service( api_base="https://api.stripe.com", ) + def test_subscription_items_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.list(subscription="sub_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items", + query_string="subscription=sub_xxxxxxxxxxxxx", + ) + def test_subscription_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12044,6 +10159,16 @@ def test_subscription_items_get_service( api_base="https://api.stripe.com", ) + def test_subscription_items_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.retrieve("si_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + ) + def test_subscription_items_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12064,6 +10189,21 @@ def test_subscription_items_get_2_service( api_base="https://api.stripe.com", ) + def test_subscription_items_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.create( + subscription="sub_xxxxxxxxxxxxx", + price="price_xxxxxxxxxxxxx", + quantity=2, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items", + query_string="", + post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", + ) + def test_subscription_items_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12091,6 +10231,20 @@ def test_subscription_items_post_service( post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", ) + def test_subscription_items_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.modify( + "si_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_subscription_items_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12115,6 +10269,19 @@ def test_subscription_items_post_2_service( post_data="metadata[order_id]=6735", ) + def test_subscription_items_usage_record_summaries_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.list_usage_record_summaries( + "si_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", + query_string="limit=3", + ) + def test_subscription_items_usage_record_summaries_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12139,6 +10306,21 @@ def test_subscription_items_usage_record_summaries_get_service( api_base="https://api.stripe.com", ) + def test_subscription_items_usage_records_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.create_usage_record( + "si_xxxxxxxxxxxxx", + quantity=100, + timestamp=1571252444, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", + query_string="", + post_data="quantity=100×tamp=1571252444", + ) + def test_subscription_items_usage_records_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12163,6 +10345,16 @@ def test_subscription_items_usage_records_post_service( post_data="quantity=100×tamp=1571252444", ) + def test_subscription_schedules_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionSchedule.cancel("sub_sched_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", + query_string="", + ) + def test_subscription_schedules_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12183,6 +10375,16 @@ def test_subscription_schedules_cancel_post_service( api_base="https://api.stripe.com", ) + def test_subscription_schedules_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionSchedule.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_schedules", + query_string="limit=3", + ) + def test_subscription_schedules_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12204,6 +10406,16 @@ def test_subscription_schedules_get_service( api_base="https://api.stripe.com", ) + def test_subscription_schedules_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionSchedule.retrieve("sub_sched_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + query_string="", + ) + def test_subscription_schedules_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12221,7 +10433,28 @@ def test_subscription_schedules_get_2_service( "get", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", query_string="", - api_base="https://api.stripe.com", + api_base="https://api.stripe.com", + ) + + def test_subscription_schedules_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionSchedule.create( + customer="cus_xxxxxxxxxxxxx", + start_date=1676070661, + end_behavior="release", + phases=[ + { + "items": [{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], + "iterations": 12, + }, + ], + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", ) def test_subscription_schedules_post_service( @@ -12259,6 +10492,20 @@ def test_subscription_schedules_post_service( post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", ) + def test_subscription_schedules_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionSchedule.modify( + "sub_sched_xxxxxxxxxxxxx", + end_behavior="release", + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + query_string="", + post_data="end_behavior=release", + ) + def test_subscription_schedules_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12283,6 +10530,16 @@ def test_subscription_schedules_post_2_service( post_data="end_behavior=release", ) + def test_subscription_schedules_release_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionSchedule.release("sub_sched_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", + query_string="", + ) + def test_subscription_schedules_release_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12303,6 +10560,16 @@ def test_subscription_schedules_release_post_service( api_base="https://api.stripe.com", ) + def test_subscriptions_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Subscription.cancel("sub_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + ) + def test_subscriptions_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12323,6 +10590,16 @@ def test_subscriptions_delete_service( api_base="https://api.stripe.com", ) + def test_subscriptions_discount_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Subscription.delete_discount("sub_xyz") + http_client_mock.assert_requested( + "delete", + path="/v1/subscriptions/sub_xyz/discount", + query_string="", + ) + def test_subscriptions_discount_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12343,6 +10620,14 @@ def test_subscriptions_discount_delete_service( api_base="https://api.stripe.com", ) + def test_subscriptions_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Subscription.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions", + query_string="limit=3", + ) + def test_subscriptions_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12364,6 +10649,16 @@ def test_subscriptions_get_service( api_base="https://api.stripe.com", ) + def test_subscriptions_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Subscription.retrieve("sub_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + ) + def test_subscriptions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12384,6 +10679,20 @@ def test_subscriptions_get_2_service( api_base="https://api.stripe.com", ) + def test_subscriptions_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Subscription.create( + customer="cus_xxxxxxxxxxxxx", + items=[{"price": "price_xxxxxxxxxxxxx"}], + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscriptions", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", + ) + def test_subscriptions_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12410,6 +10719,20 @@ def test_subscriptions_post_service( post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", ) + def test_subscriptions_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Subscription.modify( + "sub_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_subscriptions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12434,6 +10757,18 @@ def test_subscriptions_post_2_service( post_data="metadata[order_id]=6735", ) + def test_subscriptions_search_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Subscription.search( + query="status:'active' AND metadata['order_id']:'6735'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions/search", + query_string="query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + def test_subscriptions_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12459,6 +10794,16 @@ def test_subscriptions_search_get_service( api_base="https://api.stripe.com", ) + def test_tax_calculations_line_items_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.tax.Calculation.list_line_items("xxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax/calculations/xxx/line_items", + query_string="", + ) + def test_tax_calculations_line_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12479,6 +10824,30 @@ def test_tax_calculations_line_items_get_service( api_base="https://api.stripe.com", ) + def test_tax_calculations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.tax.Calculation.create( + currency="usd", + line_items=[{"amount": 1000, "reference": "L1"}], + customer_details={ + "address": { + "line1": "354 Oyster Point Blvd", + "city": "South San Francisco", + "state": "CA", + "postal_code": "94080", + "country": "US", + }, + "address_source": "shipping", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/calculations", + query_string="", + post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", + ) + def test_tax_calculations_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12515,6 +10884,14 @@ def test_tax_calculations_post_service( post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", ) + def test_tax_codes_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxCode.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/tax_codes", + query_string="limit=3", + ) + def test_tax_codes_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12536,6 +10913,14 @@ def test_tax_codes_get_service( api_base="https://api.stripe.com", ) + def test_tax_codes_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxCode.retrieve("txcd_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", + query_string="", + ) + def test_tax_codes_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12556,6 +10941,14 @@ def test_tax_codes_get_2_service( api_base="https://api.stripe.com", ) + def test_tax_rates_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxRate.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/tax_rates", + query_string="limit=3", + ) + def test_tax_rates_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12577,6 +10970,14 @@ def test_tax_rates_get_service( api_base="https://api.stripe.com", ) + def test_tax_rates_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxRate.retrieve("txr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + query_string="", + ) + def test_tax_rates_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12597,6 +10998,21 @@ def test_tax_rates_get_2_service( api_base="https://api.stripe.com", ) + def test_tax_rates_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxRate.create( + display_name="VAT", + description="VAT Germany", + jurisdiction="DE", + percentage=16, + inclusive=False, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_rates", + query_string="", + post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", + ) + def test_tax_rates_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12626,6 +11042,18 @@ def test_tax_rates_post_service( post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", ) + def test_tax_rates_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxRate.modify( + "txr_xxxxxxxxxxxxx", + active=False, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + query_string="", + post_data="active=False", + ) + def test_tax_rates_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12650,6 +11078,16 @@ def test_tax_rates_post_2_service( post_data="active=False", ) + def test_tax_registrations_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.tax.Registration.list(status="all") + http_client_mock.assert_requested( + "get", + path="/v1/tax/registrations", + query_string="status=all", + ) + def test_tax_registrations_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12671,6 +11109,21 @@ def test_tax_registrations_get_service( api_base="https://api.stripe.com", ) + def test_tax_registrations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.tax.Registration.create( + country="IE", + country_options={"ie": {"type": "oss_union"}}, + active_from="now", + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/registrations", + query_string="", + post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", + ) + def test_tax_registrations_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12698,6 +11151,20 @@ def test_tax_registrations_post_service( post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", ) + def test_tax_registrations_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.tax.Registration.modify( + "taxreg_xxxxxxxxxxxxx", + expires_at="now", + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", + query_string="", + post_data="expires_at=now", + ) + def test_tax_registrations_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12722,6 +11189,14 @@ def test_tax_registrations_post_2_service( post_data="expires_at=now", ) + def test_tax_settings_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.tax.Settings.retrieve() + http_client_mock.assert_requested( + "get", + path="/v1/tax/settings", + query_string="", + ) + def test_tax_settings_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12736,10 +11211,19 @@ def test_tax_settings_get_service( client.tax.settings.retrieve() http_client_mock.assert_requested( - "get", + "get", + path="/v1/tax/settings", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_tax_settings_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.tax.Settings.modify(defaults={"tax_code": "txcd_10000000"}) + http_client_mock.assert_requested( + "post", path="/v1/tax/settings", query_string="", - api_base="https://api.stripe.com", + post_data="defaults[tax_code]=txcd_10000000", ) def test_tax_settings_post_service( @@ -12763,6 +11247,20 @@ def test_tax_settings_post_service( post_data="defaults[tax_code]=txcd_10000000", ) + def test_tax_transactions_create_from_calculation_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.tax.Transaction.create_from_calculation( + calculation="xxx", + reference="yyy", + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/transactions/create_from_calculation", + query_string="", + post_data="calculation=xxx&reference=yyy", + ) + def test_tax_transactions_create_from_calculation_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12789,6 +11287,16 @@ def test_tax_transactions_create_from_calculation_post_service( post_data="calculation=xxx&reference=yyy", ) + def test_terminal_configurations_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.delete("uc_123") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/configurations/uc_123", + query_string="", + ) + def test_terminal_configurations_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12809,6 +11317,16 @@ def test_terminal_configurations_delete_service( api_base="https://api.stripe.com", ) + def test_terminal_configurations_delete_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.delete("tmc_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + ) + def test_terminal_configurations_delete_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12829,6 +11347,16 @@ def test_terminal_configurations_delete_2_service( api_base="https://api.stripe.com", ) + def test_terminal_configurations_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.list() + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations", + query_string="", + ) + def test_terminal_configurations_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12849,6 +11377,16 @@ def test_terminal_configurations_get_service( api_base="https://api.stripe.com", ) + def test_terminal_configurations_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.retrieve("uc_123") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations/uc_123", + query_string="", + ) + def test_terminal_configurations_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12869,6 +11407,16 @@ def test_terminal_configurations_get_2_service( api_base="https://api.stripe.com", ) + def test_terminal_configurations_get_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations", + query_string="limit=3", + ) + def test_terminal_configurations_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12890,6 +11438,16 @@ def test_terminal_configurations_get_3_service( api_base="https://api.stripe.com", ) + def test_terminal_configurations_get_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.retrieve("tmc_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + ) + def test_terminal_configurations_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12910,6 +11468,16 @@ def test_terminal_configurations_get_4_service( api_base="https://api.stripe.com", ) + def test_terminal_configurations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.create() + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations", + query_string="", + ) + def test_terminal_configurations_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12930,6 +11498,20 @@ def test_terminal_configurations_post_service( api_base="https://api.stripe.com", ) + def test_terminal_configurations_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.modify( + "uc_123", + tipping={"usd": {"fixed_amounts": [10]}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations/uc_123", + query_string="", + post_data="tipping[usd][fixed_amounts][0]=10", + ) + def test_terminal_configurations_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12954,6 +11536,19 @@ def test_terminal_configurations_post_2_service( post_data="tipping[usd][fixed_amounts][0]=10", ) + def test_terminal_configurations_post_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.create( + bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations", + query_string="", + post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + ) + def test_terminal_configurations_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -12979,6 +11574,20 @@ def test_terminal_configurations_post_3_service( post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) + def test_terminal_configurations_post_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.modify( + "tmc_xxxxxxxxxxxxx", + bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + ) + def test_terminal_configurations_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13003,6 +11612,16 @@ def test_terminal_configurations_post_4_service( post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) + def test_terminal_connection_tokens_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.ConnectionToken.create() + http_client_mock.assert_requested( + "post", + path="/v1/terminal/connection_tokens", + query_string="", + ) + def test_terminal_connection_tokens_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13023,6 +11642,16 @@ def test_terminal_connection_tokens_post_service( api_base="https://api.stripe.com", ) + def test_terminal_locations_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Location.delete("tml_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + ) + def test_terminal_locations_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13043,6 +11672,16 @@ def test_terminal_locations_delete_service( api_base="https://api.stripe.com", ) + def test_terminal_locations_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Location.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/locations", + query_string="limit=3", + ) + def test_terminal_locations_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13064,6 +11703,16 @@ def test_terminal_locations_get_service( api_base="https://api.stripe.com", ) + def test_terminal_locations_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Location.retrieve("tml_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + ) + def test_terminal_locations_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13084,6 +11733,26 @@ def test_terminal_locations_get_2_service( api_base="https://api.stripe.com", ) + def test_terminal_locations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Location.create( + display_name="My First Store", + address={ + "line1": "1234 Main Street", + "city": "San Francisco", + "postal_code": "94111", + "state": "CA", + "country": "US", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/locations", + query_string="", + post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", + ) + def test_terminal_locations_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13116,6 +11785,20 @@ def test_terminal_locations_post_service( post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", ) + def test_terminal_locations_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Location.modify( + "tml_xxxxxxxxxxxxx", + display_name="My First Store", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + post_data="display_name=My%20First%20Store", + ) + def test_terminal_locations_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13140,6 +11823,16 @@ def test_terminal_locations_post_2_service( post_data="display_name=My%20First%20Store", ) + def test_terminal_readers_cancel_action_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.cancel_action("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", + query_string="", + ) + def test_terminal_readers_cancel_action_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13160,6 +11853,16 @@ def test_terminal_readers_cancel_action_post_service( api_base="https://api.stripe.com", ) + def test_terminal_readers_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.delete("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + ) + def test_terminal_readers_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13180,6 +11883,16 @@ def test_terminal_readers_delete_service( api_base="https://api.stripe.com", ) + def test_terminal_readers_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/readers", + query_string="limit=3", + ) + def test_terminal_readers_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13201,6 +11914,16 @@ def test_terminal_readers_get_service( api_base="https://api.stripe.com", ) + def test_terminal_readers_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.retrieve("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + ) + def test_terminal_readers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13212,13 +11935,28 @@ def test_terminal_readers_get_2_service( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - - client.terminal.readers.retrieve("tmr_xxxxxxxxxxxxx") + + client.terminal.readers.retrieve("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_readers_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.create( + registration_code="puppies-plug-could", + label="Blue Rabbit", + location="tml_1234", + ) http_client_mock.assert_requested( - "get", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + "post", + path="/v1/terminal/readers", query_string="", - api_base="https://api.stripe.com", + post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", ) def test_terminal_readers_post_service( @@ -13248,6 +11986,20 @@ def test_terminal_readers_post_service( post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", ) + def test_terminal_readers_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.modify( + "tmr_xxxxxxxxxxxxx", + label="Blue Rabbit", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + post_data="label=Blue%20Rabbit", + ) + def test_terminal_readers_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13272,6 +12024,20 @@ def test_terminal_readers_post_2_service( post_data="label=Blue%20Rabbit", ) + def test_terminal_readers_process_payment_intent_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.process_payment_intent( + "tmr_xxxxxxxxxxxxx", + payment_intent="pi_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", + query_string="", + post_data="payment_intent=pi_xxxxxxxxxxxxx", + ) + def test_terminal_readers_process_payment_intent_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13296,6 +12062,21 @@ def test_terminal_readers_process_payment_intent_post_service( post_data="payment_intent=pi_xxxxxxxxxxxxx", ) + def test_terminal_readers_process_setup_intent_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.process_setup_intent( + "tmr_xxxxxxxxxxxxx", + setup_intent="seti_xxxxxxxxxxxxx", + customer_consent_collected=True, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + query_string="", + post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", + ) + def test_terminal_readers_process_setup_intent_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13323,6 +12104,21 @@ def test_terminal_readers_process_setup_intent_post_service( post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", ) + def test_test_helpers_customers_fund_cash_balance_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.TestHelpers.fund_cash_balance( + "cus_123", + amount=30, + currency="eur", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/customers/cus_123/fund_cash_balance", + query_string="", + post_data="amount=30¤cy=eur", + ) + def test_test_helpers_customers_fund_cash_balance_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13347,6 +12143,55 @@ def test_test_helpers_customers_fund_cash_balance_post_service( post_data="amount=30¤cy=eur", ) + def test_test_helpers_issuing_authorizations_capture_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.TestHelpers.capture( + "example_authorization", + capture_amount=100, + close_authorization=True, + purchase_details={ + "flight": { + "departure_at": 1633651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1633651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", + query_string="", + post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + def test_test_helpers_issuing_authorizations_capture_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13408,6 +12253,18 @@ def test_test_helpers_issuing_authorizations_capture_post_service( post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) + def test_test_helpers_issuing_authorizations_expire_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.TestHelpers.expire( + "example_authorization" + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/expire", + query_string="", + ) + def test_test_helpers_issuing_authorizations_expire_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13430,6 +12287,21 @@ def test_test_helpers_issuing_authorizations_expire_post_service( api_base="https://api.stripe.com", ) + def test_test_helpers_issuing_authorizations_increment_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.TestHelpers.increment( + "example_authorization", + increment_amount=50, + is_amount_controllable=True, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/increment", + query_string="", + post_data="increment_amount=50&is_amount_controllable=True", + ) + def test_test_helpers_issuing_authorizations_increment_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13454,6 +12326,42 @@ def test_test_helpers_issuing_authorizations_increment_post_service( post_data="increment_amount=50&is_amount_controllable=True", ) + def test_test_helpers_issuing_authorizations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.TestHelpers.create( + amount=100, + amount_details={"atm_fee": 10, "cashback_amount": 5}, + authorization_method="chip", + card="foo", + currency="usd", + is_amount_controllable=True, + merchant_data={ + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "bar", + "name": "foo", + "network_id": "bar", + "postal_code": "foo", + "state": "bar", + "terminal_id": "foo", + }, + network_data={"acquiring_institution_id": "foo"}, + verification_data={ + "address_line1_check": "mismatch", + "address_postal_code_check": "match", + "cvc_check": "match", + "expiry_check": "mismatch", + }, + wallet="apple_pay", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations", + query_string="", + post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", + ) + def test_test_helpers_issuing_authorizations_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13502,6 +12410,20 @@ def test_test_helpers_issuing_authorizations_post_service( post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", ) + def test_test_helpers_issuing_authorizations_reverse_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.TestHelpers.reverse( + "example_authorization", + reverse_amount=20, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/reverse", + query_string="", + post_data="reverse_amount=20", + ) + def test_test_helpers_issuing_authorizations_reverse_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13526,6 +12448,16 @@ def test_test_helpers_issuing_authorizations_reverse_post_service( post_data="reverse_amount=20", ) + def test_test_helpers_issuing_cards_shipping_deliver_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Card.TestHelpers.deliver_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", + query_string="", + ) + def test_test_helpers_issuing_cards_shipping_deliver_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13546,6 +12478,16 @@ def test_test_helpers_issuing_cards_shipping_deliver_post_service( api_base="https://api.stripe.com", ) + def test_test_helpers_issuing_cards_shipping_fail_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Card.TestHelpers.fail_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", + query_string="", + ) + def test_test_helpers_issuing_cards_shipping_fail_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13566,6 +12508,16 @@ def test_test_helpers_issuing_cards_shipping_fail_post_service( api_base="https://api.stripe.com", ) + def test_test_helpers_issuing_cards_shipping_return_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Card.TestHelpers.return_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/return", + query_string="", + ) + def test_test_helpers_issuing_cards_shipping_return_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13586,6 +12538,16 @@ def test_test_helpers_issuing_cards_shipping_return_post_service( api_base="https://api.stripe.com", ) + def test_test_helpers_issuing_cards_shipping_ship_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Card.TestHelpers.ship_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", + query_string="", + ) + def test_test_helpers_issuing_cards_shipping_ship_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13597,13 +12559,72 @@ def test_test_helpers_issuing_cards_shipping_ship_post_service( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - - client.test_helpers.issuing.cards.ship_card("card_123") + + client.test_helpers.issuing.cards.ship_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_issuing_transactions_create_force_capture_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Transaction.TestHelpers.create_force_capture( + amount=100, + card="foo", + currency="usd", + merchant_data={ + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "US", + "name": "foo", + "network_id": "bar", + "postal_code": "10001", + "state": "NY", + "terminal_id": "foo", + }, + purchase_details={ + "flight": { + "departure_at": 1633651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1533651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", + path="/v1/test_helpers/issuing/transactions/create_force_capture", query_string="", - api_base="https://api.stripe.com", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_transactions_create_force_capture_post_service( @@ -13677,6 +12698,65 @@ def test_test_helpers_issuing_transactions_create_force_capture_post_service( post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) + def test_test_helpers_issuing_transactions_create_unlinked_refund_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Transaction.TestHelpers.create_unlinked_refund( + amount=100, + card="foo", + currency="usd", + merchant_data={ + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "bar", + "name": "foo", + "network_id": "bar", + "postal_code": "foo", + "state": "bar", + "terminal_id": "foo", + }, + purchase_details={ + "flight": { + "departure_at": 1533651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1533651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", + query_string="", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13748,6 +12828,20 @@ def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service( post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) + def test_test_helpers_issuing_transactions_refund_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Transaction.TestHelpers.refund( + "example_transaction", + refund_amount=50, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/example_transaction/refund", + query_string="", + post_data="refund_amount=50", + ) + def test_test_helpers_issuing_transactions_refund_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13772,6 +12866,16 @@ def test_test_helpers_issuing_transactions_refund_post_service( post_data="refund_amount=50", ) + def test_test_helpers_refunds_expire_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Refund.TestHelpers.expire("re_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/refunds/re_123/expire", + query_string="", + ) + def test_test_helpers_refunds_expire_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13792,6 +12896,20 @@ def test_test_helpers_refunds_expire_post_service( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_advance_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.advance( + "clock_xyz", + frozen_time=142, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks/clock_xyz/advance", + query_string="", + post_data="frozen_time=142", + ) + def test_test_helpers_test_clocks_advance_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13816,6 +12934,20 @@ def test_test_helpers_test_clocks_advance_post_service( post_data="frozen_time=142", ) + def test_test_helpers_test_clocks_advance_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.advance( + "clock_xxxxxxxxxxxxx", + frozen_time=1675552261, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", + query_string="", + post_data="frozen_time=1675552261", + ) + def test_test_helpers_test_clocks_advance_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13840,6 +12972,16 @@ def test_test_helpers_test_clocks_advance_post_2_service( post_data="frozen_time=1675552261", ) + def test_test_helpers_test_clocks_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.delete("clock_xyz") + http_client_mock.assert_requested( + "delete", + path="/v1/test_helpers/test_clocks/clock_xyz", + query_string="", + ) + def test_test_helpers_test_clocks_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13860,6 +13002,16 @@ def test_test_helpers_test_clocks_delete_service( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_delete_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.delete("clock_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + query_string="", + ) + def test_test_helpers_test_clocks_delete_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13880,6 +13032,16 @@ def test_test_helpers_test_clocks_delete_2_service( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.list() + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks", + query_string="", + ) + def test_test_helpers_test_clocks_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13900,6 +13062,16 @@ def test_test_helpers_test_clocks_get_service( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.retrieve("clock_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks/clock_xyz", + query_string="", + ) + def test_test_helpers_test_clocks_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13920,6 +13092,16 @@ def test_test_helpers_test_clocks_get_2_service( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_get_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks", + query_string="limit=3", + ) + def test_test_helpers_test_clocks_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13941,6 +13123,16 @@ def test_test_helpers_test_clocks_get_3_service( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_get_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.retrieve("clock_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + query_string="", + ) + def test_test_helpers_test_clocks_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13961,6 +13153,20 @@ def test_test_helpers_test_clocks_get_4_service( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.create( + frozen_time=123, + name="cogsworth", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks", + query_string="", + post_data="frozen_time=123&name=cogsworth", + ) + def test_test_helpers_test_clocks_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13987,6 +13193,17 @@ def test_test_helpers_test_clocks_post_service( post_data="frozen_time=123&name=cogsworth", ) + def test_test_helpers_test_clocks_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.create(frozen_time=1577836800) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks", + query_string="", + post_data="frozen_time=1577836800", + ) + def test_test_helpers_test_clocks_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -13998,14 +13215,28 @@ def test_test_helpers_test_clocks_post_2_service( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - - client.test_helpers.test_clocks.create({"frozen_time": 1577836800}) + + client.test_helpers.test_clocks.create({"frozen_time": 1577836800}) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks", + query_string="", + api_base="https://api.stripe.com", + post_data="frozen_time=1577836800", + ) + + def test_test_helpers_treasury_inbound_transfers_fail_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.InboundTransfer.TestHelpers.fail( + "ibt_123", + failure_details={"code": "account_closed"}, + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/test_clocks", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", query_string="", - api_base="https://api.stripe.com", - post_data="frozen_time=1577836800", + post_data="failure_details[code]=account_closed", ) def test_test_helpers_treasury_inbound_transfers_fail_post_service( @@ -14032,6 +13263,18 @@ def test_test_helpers_treasury_inbound_transfers_fail_post_service( post_data="failure_details[code]=account_closed", ) + def test_test_helpers_treasury_inbound_transfers_return_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.InboundTransfer.TestHelpers.return_inbound_transfer( + "ibt_123", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", + query_string="", + ) + def test_test_helpers_treasury_inbound_transfers_return_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14054,6 +13297,16 @@ def test_test_helpers_treasury_inbound_transfers_return_post_service( api_base="https://api.stripe.com", ) + def test_test_helpers_treasury_inbound_transfers_succeed_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.InboundTransfer.TestHelpers.succeed("ibt_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", + query_string="", + ) + def test_test_helpers_treasury_inbound_transfers_succeed_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14074,6 +13327,16 @@ def test_test_helpers_treasury_inbound_transfers_succeed_post_service( api_base="https://api.stripe.com", ) + def test_test_helpers_treasury_outbound_transfers_fail_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundTransfer.TestHelpers.fail("obt_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", + query_string="", + ) + def test_test_helpers_treasury_outbound_transfers_fail_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14094,6 +13357,16 @@ def test_test_helpers_treasury_outbound_transfers_fail_post_service( api_base="https://api.stripe.com", ) + def test_test_helpers_treasury_outbound_transfers_post_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundTransfer.TestHelpers.post("obt_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", + query_string="", + ) + def test_test_helpers_treasury_outbound_transfers_post_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14114,6 +13387,20 @@ def test_test_helpers_treasury_outbound_transfers_post_post_service( api_base="https://api.stripe.com", ) + def test_test_helpers_treasury_outbound_transfers_return_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundTransfer.TestHelpers.return_outbound_transfer( + "obt_123", + returned_details={"code": "account_closed"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/return", + query_string="", + post_data="returned_details[code]=account_closed", + ) + def test_test_helpers_treasury_outbound_transfers_return_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14138,6 +13425,22 @@ def test_test_helpers_treasury_outbound_transfers_return_post_service( post_data="returned_details[code]=account_closed", ) + def test_test_helpers_treasury_received_credits_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.ReceivedCredit.TestHelpers.create( + financial_account="fa_123", + network="ach", + amount=1234, + currency="usd", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/received_credits", + query_string="", + post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", + ) + def test_test_helpers_treasury_received_credits_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14166,6 +13469,22 @@ def test_test_helpers_treasury_received_credits_post_service( post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) + def test_test_helpers_treasury_received_debits_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.ReceivedDebit.TestHelpers.create( + financial_account="fa_123", + network="ach", + amount=1234, + currency="usd", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/received_debits", + query_string="", + post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", + ) + def test_test_helpers_treasury_received_debits_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14194,6 +13513,14 @@ def test_test_helpers_treasury_received_debits_post_service( post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) + def test_tokens_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.retrieve("tok_xxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tokens/tok_xxxx", + query_string="", + ) + def test_tokens_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14214,6 +13541,22 @@ def test_tokens_get_service( api_base="https://api.stripe.com", ) + def test_tokens_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.create( + card={ + "number": "4242424242424242", + "exp_month": "5", + "exp_year": "2023", + "cvc": "314", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", + ) + def test_tokens_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14244,6 +13587,24 @@ def test_tokens_post_service( post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", ) + def test_tokens_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.create( + bank_account={ + "country": "US", + "currency": "usd", + "account_holder_name": "Jenny Rosen", + "account_holder_type": "individual", + "routing_number": "110000000", + "account_number": "000123456789", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", + ) + def test_tokens_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14276,6 +13637,15 @@ def test_tokens_post_2_service( post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", ) + def test_tokens_post_3(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.create(pii={"id_number": "000000000"}) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="pii[id_number]=000000000", + ) + def test_tokens_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14297,6 +13667,20 @@ def test_tokens_post_3_service( post_data="pii[id_number]=000000000", ) + def test_tokens_post_4(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.create( + account={ + "individual": {"first_name": "Jane", "last_name": "Doe"}, + "tos_shown_and_accepted": True, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", + ) + def test_tokens_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14325,6 +13709,21 @@ def test_tokens_post_4_service( post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", ) + def test_tokens_post_5(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.create( + person={ + "first_name": "Jane", + "last_name": "Doe", + "relationship": {"owner": True}, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", + ) + def test_tokens_post_5_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14354,6 +13753,15 @@ def test_tokens_post_5_service( post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", ) + def test_tokens_post_6(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.create(cvc_update={"cvc": "123"}) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="cvc_update[cvc]=123", + ) + def test_tokens_post_6_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14375,6 +13783,16 @@ def test_tokens_post_6_service( post_data="cvc_update[cvc]=123", ) + def test_topups_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Topup.cancel("tu_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", + query_string="", + ) + def test_topups_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14395,6 +13813,14 @@ def test_topups_cancel_post_service( api_base="https://api.stripe.com", ) + def test_topups_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Topup.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/topups", + query_string="limit=3", + ) + def test_topups_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14416,6 +13842,14 @@ def test_topups_get_service( api_base="https://api.stripe.com", ) + def test_topups_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Topup.retrieve("tu_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/topups/tu_xxxxxxxxxxxxx", + query_string="", + ) + def test_topups_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14436,6 +13870,20 @@ def test_topups_get_2_service( api_base="https://api.stripe.com", ) + def test_topups_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Topup.create( + amount=2000, + currency="usd", + description="Top-up for Jenny Rosen", + statement_descriptor="Top-up", + ) + http_client_mock.assert_requested( + "post", + path="/v1/topups", + query_string="", + post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", + ) + def test_topups_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14464,6 +13912,18 @@ def test_topups_post_service( post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", ) + def test_topups_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Topup.modify( + "tu_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/topups/tu_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_topups_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14488,6 +13948,14 @@ def test_topups_post_2_service( post_data="metadata[order_id]=6735", ) + def test_transfers_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Transfer.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/transfers", + query_string="limit=3", + ) + def test_transfers_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14509,6 +13977,14 @@ def test_transfers_get_service( api_base="https://api.stripe.com", ) + def test_transfers_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Transfer.retrieve("tr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx", + query_string="", + ) + def test_transfers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14529,6 +14005,20 @@ def test_transfers_get_2_service( api_base="https://api.stripe.com", ) + def test_transfers_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Transfer.create( + amount=400, + currency="usd", + destination="acct_xxxxxxxxxxxxx", + transfer_group="ORDER_95", + ) + http_client_mock.assert_requested( + "post", + path="/v1/transfers", + query_string="", + post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", + ) + def test_transfers_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14557,6 +14047,18 @@ def test_transfers_post_service( post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) + def test_transfers_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Transfer.modify( + "tr_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/transfers/tr_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_transfers_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14581,6 +14083,19 @@ def test_transfers_post_2_service( post_data="metadata[order_id]=6735", ) + def test_transfers_reversals_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Transfer.list_reversals( + "tr_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + query_string="limit=3", + ) + def test_transfers_reversals_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14605,6 +14120,19 @@ def test_transfers_reversals_get_service( api_base="https://api.stripe.com", ) + def test_transfers_reversals_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Transfer.retrieve_reversal( + "tr_xxxxxxxxxxxxx", + "trr_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", + query_string="", + ) + def test_transfers_reversals_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14628,6 +14156,20 @@ def test_transfers_reversals_get_2_service( api_base="https://api.stripe.com", ) + def test_transfers_reversals_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Transfer.create_reversal( + "tr_xxxxxxxxxxxxx", + amount=100, + ) + http_client_mock.assert_requested( + "post", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + query_string="", + post_data="amount=100", + ) + def test_transfers_reversals_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14652,6 +14194,21 @@ def test_transfers_reversals_post_service( post_data="amount=100", ) + def test_transfers_reversals_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Transfer.modify_reversal( + "tr_xxxxxxxxxxxxx", + "trr_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_transfers_reversals_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14677,6 +14234,19 @@ def test_transfers_reversals_post_2_service( post_data="metadata[order_id]=6735", ) + def test_treasury_credit_reversals_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.CreditReversal.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/credit_reversals", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + ) + def test_treasury_credit_reversals_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14703,6 +14273,16 @@ def test_treasury_credit_reversals_get_service( api_base="https://api.stripe.com", ) + def test_treasury_credit_reversals_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.CreditReversal.retrieve("credrev_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", + query_string="", + ) + def test_treasury_credit_reversals_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14723,6 +14303,19 @@ def test_treasury_credit_reversals_get_2_service( api_base="https://api.stripe.com", ) + def test_treasury_credit_reversals_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.CreditReversal.create( + received_credit="rc_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/treasury/credit_reversals", + query_string="", + post_data="received_credit=rc_xxxxxxxxxxxxx", + ) + def test_treasury_credit_reversals_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14748,6 +14341,19 @@ def test_treasury_credit_reversals_post_service( post_data="received_credit=rc_xxxxxxxxxxxxx", ) + def test_treasury_debit_reversals_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.DebitReversal.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/debit_reversals", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + ) + def test_treasury_debit_reversals_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14774,6 +14380,16 @@ def test_treasury_debit_reversals_get_service( api_base="https://api.stripe.com", ) + def test_treasury_debit_reversals_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.DebitReversal.retrieve("debrev_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", + query_string="", + ) + def test_treasury_debit_reversals_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14794,6 +14410,17 @@ def test_treasury_debit_reversals_get_2_service( api_base="https://api.stripe.com", ) + def test_treasury_debit_reversals_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.DebitReversal.create(received_debit="rd_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/treasury/debit_reversals", + query_string="", + post_data="received_debit=rd_xxxxxxxxxxxxx", + ) + def test_treasury_debit_reversals_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14819,6 +14446,16 @@ def test_treasury_debit_reversals_post_service( post_data="received_debit=rd_xxxxxxxxxxxxx", ) + def test_treasury_financial_accounts_features_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.FinancialAccount.retrieve_features("fa_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", + query_string="", + ) + def test_treasury_financial_accounts_features_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14839,6 +14476,16 @@ def test_treasury_financial_accounts_features_get_service( api_base="https://api.stripe.com", ) + def test_treasury_financial_accounts_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.FinancialAccount.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/financial_accounts", + query_string="limit=3", + ) + def test_treasury_financial_accounts_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14860,6 +14507,16 @@ def test_treasury_financial_accounts_get_service( api_base="https://api.stripe.com", ) + def test_treasury_financial_accounts_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.FinancialAccount.retrieve("fa_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", + query_string="", + ) + def test_treasury_financial_accounts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14880,6 +14537,20 @@ def test_treasury_financial_accounts_get_2_service( api_base="https://api.stripe.com", ) + def test_treasury_financial_accounts_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.FinancialAccount.create( + supported_currencies=["usd"], + features={}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/treasury/financial_accounts", + query_string="", + post_data="supported_currencies[0]=usd", + ) + def test_treasury_financial_accounts_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14906,6 +14577,20 @@ def test_treasury_financial_accounts_post_service( post_data="supported_currencies[0]=usd", ) + def test_treasury_financial_accounts_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.FinancialAccount.modify( + "fa_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + def test_treasury_financial_accounts_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14930,6 +14615,16 @@ def test_treasury_financial_accounts_post_2_service( post_data="metadata[order_id]=6735", ) + def test_treasury_inbound_transfers_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.InboundTransfer.cancel("ibt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", + query_string="", + ) + def test_treasury_inbound_transfers_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14950,6 +14645,19 @@ def test_treasury_inbound_transfers_cancel_post_service( api_base="https://api.stripe.com", ) + def test_treasury_inbound_transfers_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.InboundTransfer.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/inbound_transfers", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + ) + def test_treasury_inbound_transfers_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14976,6 +14684,16 @@ def test_treasury_inbound_transfers_get_service( api_base="https://api.stripe.com", ) + def test_treasury_inbound_transfers_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.InboundTransfer.retrieve("ibt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", + query_string="", + ) + def test_treasury_inbound_transfers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -14993,7 +14711,24 @@ def test_treasury_inbound_transfers_get_2_service( "get", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", query_string="", - api_base="https://api.stripe.com", + api_base="https://api.stripe.com", + ) + + def test_treasury_inbound_transfers_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.InboundTransfer.create( + financial_account="fa_xxxxxxxxxxxxx", + amount=10000, + currency="usd", + origin_payment_method="pm_xxxxxxxxxxxxx", + description="InboundTransfer from my bank account", + ) + http_client_mock.assert_requested( + "post", + path="/v1/treasury/inbound_transfers", + query_string="", + post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", ) def test_treasury_inbound_transfers_post_service( @@ -15025,6 +14760,16 @@ def test_treasury_inbound_transfers_post_service( post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", ) + def test_treasury_outbound_payments_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundPayment.cancel("bot_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", + query_string="", + ) + def test_treasury_outbound_payments_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15045,6 +14790,19 @@ def test_treasury_outbound_payments_cancel_post_service( api_base="https://api.stripe.com", ) + def test_treasury_outbound_payments_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundPayment.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/outbound_payments", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + ) + def test_treasury_outbound_payments_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15071,6 +14829,16 @@ def test_treasury_outbound_payments_get_service( api_base="https://api.stripe.com", ) + def test_treasury_outbound_payments_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundPayment.retrieve("bot_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", + query_string="", + ) + def test_treasury_outbound_payments_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15091,6 +14859,24 @@ def test_treasury_outbound_payments_get_2_service( api_base="https://api.stripe.com", ) + def test_treasury_outbound_payments_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundPayment.create( + financial_account="fa_xxxxxxxxxxxxx", + amount=10000, + currency="usd", + customer="cus_xxxxxxxxxxxxx", + destination_payment_method="pm_xxxxxxxxxxxxx", + description="OutboundPayment to a 3rd party", + ) + http_client_mock.assert_requested( + "post", + path="/v1/treasury/outbound_payments", + query_string="", + post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", + ) + def test_treasury_outbound_payments_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15121,6 +14907,16 @@ def test_treasury_outbound_payments_post_service( post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", ) + def test_treasury_outbound_transfers_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundTransfer.cancel("obt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", + query_string="", + ) + def test_treasury_outbound_transfers_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15141,6 +14937,19 @@ def test_treasury_outbound_transfers_cancel_post_service( api_base="https://api.stripe.com", ) + def test_treasury_outbound_transfers_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundTransfer.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/outbound_transfers", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + ) + def test_treasury_outbound_transfers_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15167,6 +14976,16 @@ def test_treasury_outbound_transfers_get_service( api_base="https://api.stripe.com", ) + def test_treasury_outbound_transfers_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundTransfer.retrieve("obt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", + query_string="", + ) + def test_treasury_outbound_transfers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15187,6 +15006,23 @@ def test_treasury_outbound_transfers_get_2_service( api_base="https://api.stripe.com", ) + def test_treasury_outbound_transfers_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundTransfer.create( + financial_account="fa_xxxxxxxxxxxxx", + destination_payment_method="pm_xxxxxxxxxxxxx", + amount=500, + currency="usd", + description="OutboundTransfer to my external bank account", + ) + http_client_mock.assert_requested( + "post", + path="/v1/treasury/outbound_transfers", + query_string="", + post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", + ) + def test_treasury_outbound_transfers_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15216,6 +15052,19 @@ def test_treasury_outbound_transfers_post_service( post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", ) + def test_treasury_received_credits_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.ReceivedCredit.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/received_credits", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + ) + def test_treasury_received_credits_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15242,6 +15091,16 @@ def test_treasury_received_credits_get_service( api_base="https://api.stripe.com", ) + def test_treasury_received_credits_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.ReceivedCredit.retrieve("rc_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", + query_string="", + ) + def test_treasury_received_credits_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15262,6 +15121,19 @@ def test_treasury_received_credits_get_2_service( api_base="https://api.stripe.com", ) + def test_treasury_received_debits_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.ReceivedDebit.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/received_debits", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + ) + def test_treasury_received_debits_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15288,6 +15160,16 @@ def test_treasury_received_debits_get_service( api_base="https://api.stripe.com", ) + def test_treasury_received_debits_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.ReceivedDebit.retrieve("rd_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", + query_string="", + ) + def test_treasury_received_debits_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15308,6 +15190,19 @@ def test_treasury_received_debits_get_2_service( api_base="https://api.stripe.com", ) + def test_treasury_transaction_entries_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.TransactionEntry.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/transaction_entries", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + ) + def test_treasury_transaction_entries_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15334,6 +15229,16 @@ def test_treasury_transaction_entries_get_service( api_base="https://api.stripe.com", ) + def test_treasury_transaction_entries_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.TransactionEntry.retrieve("trxne_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", + query_string="", + ) + def test_treasury_transaction_entries_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15354,6 +15259,19 @@ def test_treasury_transaction_entries_get_2_service( api_base="https://api.stripe.com", ) + def test_treasury_transactions_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.Transaction.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/transactions", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + ) + def test_treasury_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15380,6 +15298,16 @@ def test_treasury_transactions_get_service( api_base="https://api.stripe.com", ) + def test_treasury_transactions_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.Transaction.retrieve("trxn_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", + query_string="", + ) + def test_treasury_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15400,6 +15328,16 @@ def test_treasury_transactions_get_2_service( api_base="https://api.stripe.com", ) + def test_webhook_endpoints_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.WebhookEndpoint.delete("we_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", + query_string="", + ) + def test_webhook_endpoints_delete_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15420,6 +15358,16 @@ def test_webhook_endpoints_delete_service( api_base="https://api.stripe.com", ) + def test_webhook_endpoints_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.WebhookEndpoint.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/webhook_endpoints", + query_string="limit=3", + ) + def test_webhook_endpoints_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15441,6 +15389,16 @@ def test_webhook_endpoints_get_service( api_base="https://api.stripe.com", ) + def test_webhook_endpoints_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.WebhookEndpoint.retrieve("we_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", + query_string="", + ) + def test_webhook_endpoints_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15461,6 +15419,20 @@ def test_webhook_endpoints_get_2_service( api_base="https://api.stripe.com", ) + def test_webhook_endpoints_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.WebhookEndpoint.create( + url="https://example.com/my/webhook/endpoint", + enabled_events=["charge.failed", "charge.succeeded"], + ) + http_client_mock.assert_requested( + "post", + path="/v1/webhook_endpoints", + query_string="", + post_data="url=https%3A%2F%2Fexample.com%2Fmy%2Fwebhook%2Fendpoint&enabled_events[0]=charge.failed&enabled_events[1]=charge.succeeded", + ) + def test_webhook_endpoints_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -15487,6 +15459,20 @@ def test_webhook_endpoints_post_service( post_data="url=https%3A%2F%2Fexample.com%2Fmy%2Fwebhook%2Fendpoint&enabled_events[0]=charge.failed&enabled_events[1]=charge.succeeded", ) + def test_webhook_endpoints_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.WebhookEndpoint.modify( + "we_xxxxxxxxxxxxx", + url="https://example.com/new_endpoint", + ) + http_client_mock.assert_requested( + "post", + path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", + query_string="", + post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", + ) + def test_webhook_endpoints_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: From 48e0bf6cc1a1e131e77d9f028dfb6e6340622802 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 1 Feb 2024 14:22:20 -0800 Subject: [PATCH 004/179] Bump version to 8.1.0 --- CHANGELOG.md | 7 +++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f2bf79bd..9bd6f4e1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 8.1.0 - 2024-02-01 +* [#1213](https://github.com/stripe/stripe-python/pull/1213) Update generated code + * Add support for `swish` payment method throughout the API + * Add support for `relationship` on parameter classes `Account.CreateParamsIndividual` and `Token.CreateParamsAccountIndividual` + * Add support for `jurisdiction_level` on resource `TaxRate` + * Change type from `str` to `Literal["offline", "online"]` of `status` on field `terminal.Reader` + ## 8.0.0 - 2024-01-25 * [#1206](https://github.com/stripe/stripe-python/pull/1206) stripe-python v8 release This release introduces `StripeClient` and a service-based call pattern. This new interface allows you to easily call Stripe APIs and has several benefits over the existing resource-based pattern: diff --git a/VERSION b/VERSION index ae9a76b92..8104cabd3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.0.0 +8.1.0 diff --git a/stripe/_version.py b/stripe/_version.py index 35ba86ee0..3bbed43f6 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "8.0.0" +VERSION = "8.1.0" From 66c96bfb6813959237635bb0d73d18bc560b127a Mon Sep 17 00:00:00 2001 From: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> Date: Fri, 2 Feb 2024 11:40:32 -0800 Subject: [PATCH 005/179] Measure StripeClient usage (#1220) --- stripe/_api_requestor.py | 4 +++- stripe/_stripe_client.py | 1 + tests/test_integration.py | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index 6dd202478..df95d31cd 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -60,9 +60,11 @@ def __init__( self, options: RequestorOptions = RequestorOptions(), client: Optional[HTTPClient] = None, + usage: Optional[List[str]] = None, ): self._options = options self._client = client + self._usage = usage or [] # In the case of client=None, we should use the current value of stripe.default_http_client # or lazily initialize it. Since stripe.default_http_client can change throughout the lifetime of @@ -171,7 +173,7 @@ def request( api_mode=api_mode, base_address=base_address, options=options, - _usage=_usage, + _usage=self._usage + (_usage or []), ) resp = requestor._interpret_response(rbody, rcode, rheaders) diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 7def5bcd8..e69cde46d 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -148,6 +148,7 @@ def __init__( self._requestor = _APIRequestor( options=requestor_options, client=http_client, + usage=["stripe_client"], ) self._options = _ClientOptions( diff --git a/tests/test_integration.py b/tests/test_integration.py index 74e44a4c4..7080b4556 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -291,3 +291,38 @@ def work(): assert MockServerRequestHandler.num_requests == 20 assert len(MockServerRequestHandler.seen_metrics) == 10 + + def test_measures_stripe_client_telemetry(self): + class MockServerRequestHandler(MyTestHandler): + def do_request(self, req_num): + return [ + 200, + { + "Content-Type": "application/json; charset=utf-8", + "Request-Id": "req_%s" % (req_num + 1), + }, + None, + ] + + self.setup_mock_server(MockServerRequestHandler) + stripe.enable_telemetry = True + + client = stripe.StripeClient( + "sk_test_123", + base_addresses={ + "api": "http://localhost:%s" % self.mock_server_port + }, + ) + client.customers.create() + client.customers.create() + + reqs = MockServerRequestHandler.get_requests(2) + + telemetry_raw = reqs[1].headers.get("x-stripe-client-telemetry") + + assert telemetry_raw is not None + telemetry = json.loads(telemetry_raw) + assert "last_request_metrics" in telemetry + + usage = telemetry["last_request_metrics"]["usage"] + assert usage == ["stripe_client"] From bd1c58726ebcfd32fe3a3ab62c92b8565d190a4f Mon Sep 17 00:00:00 2001 From: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:32:32 -0800 Subject: [PATCH 006/179] Move StripeClient usage collection onto StripeService (#1223) --- stripe/_account_capability_service.py | 6 +- stripe/_account_external_account_service.py | 10 +-- stripe/_account_link_service.py | 2 +- stripe/_account_login_link_service.py | 2 +- stripe/_account_person_service.py | 10 +-- stripe/_account_service.py | 14 ++--- stripe/_account_session_service.py | 2 +- stripe/_api_requestor.py | 4 +- stripe/_apple_pay_domain_service.py | 8 +-- stripe/_application_fee_refund_service.py | 8 +-- stripe/_application_fee_service.py | 4 +- stripe/_balance_service.py | 2 +- stripe/_balance_transaction_service.py | 4 +- stripe/_charge_service.py | 12 ++-- stripe/_country_spec_service.py | 4 +- stripe/_coupon_service.py | 10 +-- stripe/_credit_note_line_item_service.py | 2 +- stripe/_credit_note_preview_lines_service.py | 2 +- stripe/_credit_note_service.py | 12 ++-- .../_customer_balance_transaction_service.py | 8 +-- stripe/_customer_cash_balance_service.py | 4 +- ...stomer_cash_balance_transaction_service.py | 4 +- .../_customer_funding_instructions_service.py | 2 +- stripe/_customer_payment_method_service.py | 4 +- stripe/_customer_payment_source_service.py | 12 ++-- stripe/_customer_service.py | 14 ++--- stripe/_customer_session_service.py | 2 +- stripe/_customer_tax_id_service.py | 8 +-- stripe/_dispute_service.py | 8 +-- stripe/_ephemeral_key_service.py | 4 +- stripe/_event_service.py | 4 +- stripe/_exchange_rate_service.py | 4 +- stripe/_file_link_service.py | 8 +-- stripe/_file_service.py | 6 +- stripe/_invoice_item_service.py | 10 +-- stripe/_invoice_line_item_service.py | 2 +- stripe/_invoice_service.py | 24 +++---- stripe/_invoice_upcoming_lines_service.py | 2 +- stripe/_mandate_service.py | 2 +- stripe/_payment_intent_service.py | 22 +++---- stripe/_payment_link_line_item_service.py | 2 +- stripe/_payment_link_service.py | 8 +-- .../_payment_method_configuration_service.py | 8 +-- stripe/_payment_method_domain_service.py | 10 +-- stripe/_payment_method_service.py | 12 ++-- stripe/_payout_service.py | 12 ++-- stripe/_plan_service.py | 10 +-- stripe/_price_service.py | 10 +-- stripe/_product_service.py | 12 ++-- stripe/_promotion_code_service.py | 8 +-- ...ote_computed_upfront_line_items_service.py | 2 +- stripe/_quote_line_item_service.py | 2 +- stripe/_quote_service.py | 16 ++--- stripe/_refund_service.py | 10 +-- stripe/_review_service.py | 6 +- stripe/_setup_attempt_service.py | 2 +- stripe/_setup_intent_service.py | 14 ++--- stripe/_shipping_rate_service.py | 8 +-- stripe/_source_service.py | 10 +-- stripe/_source_transaction_service.py | 2 +- stripe/_stripe_client.py | 1 - stripe/_stripe_service.py | 48 +++++++++++++- stripe/_subscription_item_service.py | 10 +-- ..._subscription_item_usage_record_service.py | 2 +- ...ption_item_usage_record_summary_service.py | 2 +- stripe/_subscription_schedule_service.py | 12 ++-- stripe/_subscription_service.py | 16 ++--- stripe/_tax_code_service.py | 4 +- stripe/_tax_rate_service.py | 8 +-- stripe/_token_service.py | 4 +- stripe/_topup_service.py | 10 +-- stripe/_transfer_reversal_service.py | 8 +-- stripe/_transfer_service.py | 8 +-- stripe/_webhook_endpoint_service.py | 10 +-- stripe/apps/_secret_service.py | 8 +-- .../billing_portal/_configuration_service.py | 8 +-- stripe/billing_portal/_session_service.py | 2 +- stripe/checkout/_session_line_item_service.py | 2 +- stripe/checkout/_session_service.py | 8 +-- stripe/climate/_order_service.py | 10 +-- stripe/climate/_product_service.py | 4 +- stripe/climate/_supplier_service.py | 4 +- .../_account_owner_service.py | 2 +- .../financial_connections/_account_service.py | 12 ++-- .../financial_connections/_session_service.py | 4 +- .../_transaction_service.py | 4 +- .../identity/_verification_report_service.py | 4 +- .../identity/_verification_session_service.py | 12 ++-- stripe/issuing/_authorization_service.py | 10 +-- stripe/issuing/_card_service.py | 8 +-- stripe/issuing/_cardholder_service.py | 8 +-- stripe/issuing/_dispute_service.py | 10 +-- stripe/issuing/_token_service.py | 6 +- stripe/issuing/_transaction_service.py | 6 +- stripe/radar/_early_fraud_warning_service.py | 4 +- stripe/radar/_value_list_item_service.py | 8 +-- stripe/radar/_value_list_service.py | 10 +-- stripe/reporting/_report_run_service.py | 6 +- stripe/reporting/_report_type_service.py | 4 +- stripe/sigma/_scheduled_query_run_service.py | 4 +- stripe/tax/_calculation_line_item_service.py | 2 +- stripe/tax/_calculation_service.py | 2 +- stripe/tax/_registration_service.py | 8 +-- stripe/tax/_settings_service.py | 4 +- stripe/tax/_transaction_line_item_service.py | 2 +- stripe/tax/_transaction_service.py | 6 +- stripe/terminal/_configuration_service.py | 10 +-- stripe/terminal/_connection_token_service.py | 2 +- stripe/terminal/_location_service.py | 10 +-- stripe/terminal/_reader_service.py | 20 +++--- stripe/test_helpers/_customer_service.py | 2 +- stripe/test_helpers/_refund_service.py | 2 +- stripe/test_helpers/_test_clock_service.py | 10 +-- .../issuing/_authorization_service.py | 10 +-- stripe/test_helpers/issuing/_card_service.py | 8 +-- .../issuing/_transaction_service.py | 6 +- .../test_helpers/terminal/_reader_service.py | 2 +- .../treasury/_inbound_transfer_service.py | 6 +- .../treasury/_outbound_payment_service.py | 6 +- .../treasury/_outbound_transfer_service.py | 6 +- .../treasury/_received_credit_service.py | 2 +- .../treasury/_received_debit_service.py | 2 +- stripe/treasury/_credit_reversal_service.py | 6 +- stripe/treasury/_debit_reversal_service.py | 6 +- .../_financial_account_features_service.py | 4 +- stripe/treasury/_financial_account_service.py | 8 +-- stripe/treasury/_inbound_transfer_service.py | 8 +-- stripe/treasury/_outbound_payment_service.py | 8 +-- stripe/treasury/_outbound_transfer_service.py | 8 +-- stripe/treasury/_received_credit_service.py | 4 +- stripe/treasury/_received_debit_service.py | 4 +- stripe/treasury/_transaction_entry_service.py | 4 +- stripe/treasury/_transaction_service.py | 4 +- tests/http_client_mock.py | 63 ++++++++++++++----- tests/test_stripe_client.py | 31 +++++++++ 135 files changed, 569 insertions(+), 464 deletions(-) diff --git a/stripe/_account_capability_service.py b/stripe/_account_capability_service.py index fc7365adb..1142bb1e2 100644 --- a/stripe/_account_capability_service.py +++ b/stripe/_account_capability_service.py @@ -45,7 +45,7 @@ def list( """ return cast( ListObject[Capability], - self._requestor.request( + self._request( "get", "/v1/accounts/{account}/capabilities".format( account=sanitize_id(account), @@ -69,7 +69,7 @@ def retrieve( """ return cast( Capability, - self._requestor.request( + self._request( "get", "/v1/accounts/{account}/capabilities/{capability}".format( account=sanitize_id(account), @@ -94,7 +94,7 @@ def update( """ return cast( Capability, - self._requestor.request( + self._request( "post", "/v1/accounts/{account}/capabilities/{capability}".format( account=sanitize_id(account), diff --git a/stripe/_account_external_account_service.py b/stripe/_account_external_account_service.py index 817793e2e..2466c487f 100644 --- a/stripe/_account_external_account_service.py +++ b/stripe/_account_external_account_service.py @@ -214,7 +214,7 @@ def delete( """ return cast( Union[BankAccount, Card], - self._requestor.request( + self._request( "delete", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), @@ -239,7 +239,7 @@ def retrieve( """ return cast( Union[BankAccount, Card], - self._requestor.request( + self._request( "get", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), @@ -266,7 +266,7 @@ def update( """ return cast( Union[BankAccount, Card], - self._requestor.request( + self._request( "post", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), @@ -290,7 +290,7 @@ def list( """ return cast( ListObject[Union[BankAccount, Card]], - self._requestor.request( + self._request( "get", "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account), @@ -313,7 +313,7 @@ def create( """ return cast( Union[BankAccount, Card], - self._requestor.request( + self._request( "post", "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account), diff --git a/stripe/_account_link_service.py b/stripe/_account_link_service.py index 2e007050a..f03d5ce74 100644 --- a/stripe/_account_link_service.py +++ b/stripe/_account_link_service.py @@ -60,7 +60,7 @@ def create( """ return cast( AccountLink, - self._requestor.request( + self._request( "post", "/v1/account_links", api_mode="V1", diff --git a/stripe/_account_login_link_service.py b/stripe/_account_login_link_service.py index b5e02f25b..88250da44 100644 --- a/stripe/_account_login_link_service.py +++ b/stripe/_account_login_link_service.py @@ -28,7 +28,7 @@ def create( """ return cast( LoginLink, - self._requestor.request( + self._request( "post", "/v1/accounts/{account}/login_links".format( account=sanitize_id(account), diff --git a/stripe/_account_person_service.py b/stripe/_account_person_service.py index 233c66972..d000a9407 100644 --- a/stripe/_account_person_service.py +++ b/stripe/_account_person_service.py @@ -825,7 +825,7 @@ def delete( """ return cast( Person, - self._requestor.request( + self._request( "delete", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), @@ -850,7 +850,7 @@ def retrieve( """ return cast( Person, - self._requestor.request( + self._request( "get", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), @@ -875,7 +875,7 @@ def update( """ return cast( Person, - self._requestor.request( + self._request( "post", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), @@ -899,7 +899,7 @@ def list( """ return cast( ListObject[Person], - self._requestor.request( + self._request( "get", "/v1/accounts/{account}/persons".format( account=sanitize_id(account), @@ -922,7 +922,7 @@ def create( """ return cast( Person, - self._requestor.request( + self._request( "post", "/v1/accounts/{account}/persons".format( account=sanitize_id(account), diff --git a/stripe/_account_service.py b/stripe/_account_service.py index f0e3d61e3..cf555557d 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -3032,7 +3032,7 @@ def delete( """ return cast( Account, - self._requestor.request( + self._request( "delete", "/v1/accounts/{account}".format(account=sanitize_id(account)), api_mode="V1", @@ -3053,7 +3053,7 @@ def retrieve( """ return cast( Account, - self._requestor.request( + self._request( "get", "/v1/accounts/{account}".format(account=sanitize_id(account)), api_mode="V1", @@ -3082,7 +3082,7 @@ def update( """ return cast( Account, - self._requestor.request( + self._request( "post", "/v1/accounts/{account}".format(account=sanitize_id(account)), api_mode="V1", @@ -3102,7 +3102,7 @@ def retrieve_current( """ return cast( Account, - self._requestor.request( + self._request( "get", "/v1/account", api_mode="V1", @@ -3122,7 +3122,7 @@ def list( """ return cast( ListObject[Account], - self._requestor.request( + self._request( "get", "/v1/accounts", api_mode="V1", @@ -3147,7 +3147,7 @@ def create( """ return cast( Account, - self._requestor.request( + self._request( "post", "/v1/accounts", api_mode="V1", @@ -3170,7 +3170,7 @@ def reject( """ return cast( Account, - self._requestor.request( + self._request( "post", "/v1/accounts/{account}/reject".format( account=sanitize_id(account), diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 3eb209daf..4a0e9b447 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -151,7 +151,7 @@ def create( """ return cast( AccountSession, - self._requestor.request( + self._request( "post", "/v1/account_sessions", api_mode="V1", diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index df95d31cd..6dd202478 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -60,11 +60,9 @@ def __init__( self, options: RequestorOptions = RequestorOptions(), client: Optional[HTTPClient] = None, - usage: Optional[List[str]] = None, ): self._options = options self._client = client - self._usage = usage or [] # In the case of client=None, we should use the current value of stripe.default_http_client # or lazily initialize it. Since stripe.default_http_client can change throughout the lifetime of @@ -173,7 +171,7 @@ def request( api_mode=api_mode, base_address=base_address, options=options, - _usage=self._usage + (_usage or []), + _usage=_usage, ) resp = requestor._interpret_response(rbody, rcode, rheaders) diff --git a/stripe/_apple_pay_domain_service.py b/stripe/_apple_pay_domain_service.py index 7380a09e2..bf413cf6e 100644 --- a/stripe/_apple_pay_domain_service.py +++ b/stripe/_apple_pay_domain_service.py @@ -56,7 +56,7 @@ def delete( """ return cast( ApplePayDomain, - self._requestor.request( + self._request( "delete", "/v1/apple_pay/domains/{domain}".format( domain=sanitize_id(domain), @@ -79,7 +79,7 @@ def retrieve( """ return cast( ApplePayDomain, - self._requestor.request( + self._request( "get", "/v1/apple_pay/domains/{domain}".format( domain=sanitize_id(domain), @@ -101,7 +101,7 @@ def list( """ return cast( ListObject[ApplePayDomain], - self._requestor.request( + self._request( "get", "/v1/apple_pay/domains", api_mode="V1", @@ -121,7 +121,7 @@ def create( """ return cast( ApplePayDomain, - self._requestor.request( + self._request( "post", "/v1/apple_pay/domains", api_mode="V1", diff --git a/stripe/_application_fee_refund_service.py b/stripe/_application_fee_refund_service.py index dc1c14502..c1cb6c10e 100644 --- a/stripe/_application_fee_refund_service.py +++ b/stripe/_application_fee_refund_service.py @@ -70,7 +70,7 @@ def retrieve( """ return cast( ApplicationFeeRefund, - self._requestor.request( + self._request( "get", "/v1/application_fees/{fee}/refunds/{id}".format( fee=sanitize_id(fee), @@ -97,7 +97,7 @@ def update( """ return cast( ApplicationFeeRefund, - self._requestor.request( + self._request( "post", "/v1/application_fees/{fee}/refunds/{id}".format( fee=sanitize_id(fee), @@ -121,7 +121,7 @@ def list( """ return cast( ListObject[ApplicationFeeRefund], - self._requestor.request( + self._request( "get", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), api_mode="V1", @@ -150,7 +150,7 @@ def create( """ return cast( ApplicationFeeRefund, - self._requestor.request( + self._request( "post", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), api_mode="V1", diff --git a/stripe/_application_fee_service.py b/stripe/_application_fee_service.py index 4a18f132b..7553c1f96 100644 --- a/stripe/_application_fee_service.py +++ b/stripe/_application_fee_service.py @@ -72,7 +72,7 @@ def list( """ return cast( ListObject[ApplicationFee], - self._requestor.request( + self._request( "get", "/v1/application_fees", api_mode="V1", @@ -93,7 +93,7 @@ def retrieve( """ return cast( ApplicationFee, - self._requestor.request( + self._request( "get", "/v1/application_fees/{id}".format(id=sanitize_id(id)), api_mode="V1", diff --git a/stripe/_balance_service.py b/stripe/_balance_service.py index f9967fdf9..18c7cc7b0 100644 --- a/stripe/_balance_service.py +++ b/stripe/_balance_service.py @@ -25,7 +25,7 @@ def retrieve( """ return cast( Balance, - self._requestor.request( + self._request( "get", "/v1/balance", api_mode="V1", diff --git a/stripe/_balance_transaction_service.py b/stripe/_balance_transaction_service.py index 281a37a15..3ee27421a 100644 --- a/stripe/_balance_transaction_service.py +++ b/stripe/_balance_transaction_service.py @@ -81,7 +81,7 @@ def list( """ return cast( ListObject[BalanceTransaction], - self._requestor.request( + self._request( "get", "/v1/balance_transactions", api_mode="V1", @@ -104,7 +104,7 @@ def retrieve( """ return cast( BalanceTransaction, - self._requestor.request( + self._request( "get", "/v1/balance_transactions/{id}".format(id=sanitize_id(id)), api_mode="V1", diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index 8a3e5b2eb..923b6cb1b 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -372,7 +372,7 @@ def list( """ return cast( ListObject[Charge], - self._requestor.request( + self._request( "get", "/v1/charges", api_mode="V1", @@ -394,7 +394,7 @@ def create( """ return cast( Charge, - self._requestor.request( + self._request( "post", "/v1/charges", api_mode="V1", @@ -415,7 +415,7 @@ def retrieve( """ return cast( Charge, - self._requestor.request( + self._request( "get", "/v1/charges/{charge}".format(charge=sanitize_id(charge)), api_mode="V1", @@ -436,7 +436,7 @@ def update( """ return cast( Charge, - self._requestor.request( + self._request( "post", "/v1/charges/{charge}".format(charge=sanitize_id(charge)), api_mode="V1", @@ -459,7 +459,7 @@ def search( """ return cast( SearchResultObject[Charge], - self._requestor.request( + self._request( "get", "/v1/charges/search", api_mode="V1", @@ -484,7 +484,7 @@ def capture( """ return cast( Charge, - self._requestor.request( + self._request( "post", "/v1/charges/{charge}/capture".format( charge=sanitize_id(charge), diff --git a/stripe/_country_spec_service.py b/stripe/_country_spec_service.py index 95629ddb9..ecd6bf8a4 100644 --- a/stripe/_country_spec_service.py +++ b/stripe/_country_spec_service.py @@ -44,7 +44,7 @@ def list( """ return cast( ListObject[CountrySpec], - self._requestor.request( + self._request( "get", "/v1/country_specs", api_mode="V1", @@ -65,7 +65,7 @@ def retrieve( """ return cast( CountrySpec, - self._requestor.request( + self._request( "get", "/v1/country_specs/{country}".format( country=sanitize_id(country), diff --git a/stripe/_coupon_service.py b/stripe/_coupon_service.py index 29aa7c295..4e9c79e73 100644 --- a/stripe/_coupon_service.py +++ b/stripe/_coupon_service.py @@ -164,7 +164,7 @@ def delete( """ return cast( Coupon, - self._requestor.request( + self._request( "delete", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), api_mode="V1", @@ -185,7 +185,7 @@ def retrieve( """ return cast( Coupon, - self._requestor.request( + self._request( "get", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), api_mode="V1", @@ -206,7 +206,7 @@ def update( """ return cast( Coupon, - self._requestor.request( + self._request( "post", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), api_mode="V1", @@ -226,7 +226,7 @@ def list( """ return cast( ListObject[Coupon], - self._requestor.request( + self._request( "get", "/v1/coupons", api_mode="V1", @@ -248,7 +248,7 @@ def create( """ return cast( Coupon, - self._requestor.request( + self._request( "post", "/v1/coupons", api_mode="V1", diff --git a/stripe/_credit_note_line_item_service.py b/stripe/_credit_note_line_item_service.py index 90636ad9b..375a08746 100644 --- a/stripe/_credit_note_line_item_service.py +++ b/stripe/_credit_note_line_item_service.py @@ -39,7 +39,7 @@ def list( """ return cast( ListObject[CreditNoteLineItem], - self._requestor.request( + self._request( "get", "/v1/credit_notes/{credit_note}/lines".format( credit_note=sanitize_id(credit_note), diff --git a/stripe/_credit_note_preview_lines_service.py b/stripe/_credit_note_preview_lines_service.py index ce0633f92..463a8238c 100644 --- a/stripe/_credit_note_preview_lines_service.py +++ b/stripe/_credit_note_preview_lines_service.py @@ -151,7 +151,7 @@ def list( """ return cast( ListObject[CreditNoteLineItem], - self._requestor.request( + self._request( "get", "/v1/credit_notes/preview/lines", api_mode="V1", diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index 23b7133c0..cbe4e251d 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -317,7 +317,7 @@ def list( """ return cast( ListObject[CreditNote], - self._requestor.request( + self._request( "get", "/v1/credit_notes", api_mode="V1", @@ -350,7 +350,7 @@ def create( """ return cast( CreditNote, - self._requestor.request( + self._request( "post", "/v1/credit_notes", api_mode="V1", @@ -371,7 +371,7 @@ def retrieve( """ return cast( CreditNote, - self._requestor.request( + self._request( "get", "/v1/credit_notes/{id}".format(id=sanitize_id(id)), api_mode="V1", @@ -392,7 +392,7 @@ def update( """ return cast( CreditNote, - self._requestor.request( + self._request( "post", "/v1/credit_notes/{id}".format(id=sanitize_id(id)), api_mode="V1", @@ -412,7 +412,7 @@ def preview( """ return cast( CreditNote, - self._requestor.request( + self._request( "get", "/v1/credit_notes/preview", api_mode="V1", @@ -433,7 +433,7 @@ def void_credit_note( """ return cast( CreditNote, - self._requestor.request( + self._request( "post", "/v1/credit_notes/{id}/void".format(id=sanitize_id(id)), api_mode="V1", diff --git a/stripe/_customer_balance_transaction_service.py b/stripe/_customer_balance_transaction_service.py index aed9f57e1..ce8948daf 100644 --- a/stripe/_customer_balance_transaction_service.py +++ b/stripe/_customer_balance_transaction_service.py @@ -81,7 +81,7 @@ def list( """ return cast( ListObject[CustomerBalanceTransaction], - self._requestor.request( + self._request( "get", "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer), @@ -104,7 +104,7 @@ def create( """ return cast( CustomerBalanceTransaction, - self._requestor.request( + self._request( "post", "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer), @@ -128,7 +128,7 @@ def retrieve( """ return cast( CustomerBalanceTransaction, - self._requestor.request( + self._request( "get", "/v1/customers/{customer}/balance_transactions/{transaction}".format( customer=sanitize_id(customer), @@ -153,7 +153,7 @@ def update( """ return cast( CustomerBalanceTransaction, - self._requestor.request( + self._request( "post", "/v1/customers/{customer}/balance_transactions/{transaction}".format( customer=sanitize_id(customer), diff --git a/stripe/_customer_cash_balance_service.py b/stripe/_customer_cash_balance_service.py index d4bb7a080..86c73a7f9 100644 --- a/stripe/_customer_cash_balance_service.py +++ b/stripe/_customer_cash_balance_service.py @@ -46,7 +46,7 @@ def retrieve( """ return cast( CashBalance, - self._requestor.request( + self._request( "get", "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer), @@ -69,7 +69,7 @@ def update( """ return cast( CashBalance, - self._requestor.request( + self._request( "post", "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer), diff --git a/stripe/_customer_cash_balance_transaction_service.py b/stripe/_customer_cash_balance_transaction_service.py index 4ec8aec65..a7dcb76c3 100644 --- a/stripe/_customer_cash_balance_transaction_service.py +++ b/stripe/_customer_cash_balance_transaction_service.py @@ -47,7 +47,7 @@ def list( """ return cast( ListObject[CustomerCashBalanceTransaction], - self._requestor.request( + self._request( "get", "/v1/customers/{customer}/cash_balance_transactions".format( customer=sanitize_id(customer), @@ -71,7 +71,7 @@ def retrieve( """ return cast( CustomerCashBalanceTransaction, - self._requestor.request( + self._request( "get", "/v1/customers/{customer}/cash_balance_transactions/{transaction}".format( customer=sanitize_id(customer), diff --git a/stripe/_customer_funding_instructions_service.py b/stripe/_customer_funding_instructions_service.py index adee88a69..9a59012f7 100644 --- a/stripe/_customer_funding_instructions_service.py +++ b/stripe/_customer_funding_instructions_service.py @@ -72,7 +72,7 @@ def create( """ return cast( FundingInstructions, - self._requestor.request( + self._request( "post", "/v1/customers/{customer}/funding_instructions".format( customer=sanitize_id(customer), diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 0d5d3c644..55b24945a 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -51,7 +51,7 @@ def list( """ return cast( ListObject[PaymentMethod], - self._requestor.request( + self._request( "get", "/v1/customers/{customer}/payment_methods".format( customer=sanitize_id(customer), @@ -75,7 +75,7 @@ def retrieve( """ return cast( PaymentMethod, - self._requestor.request( + self._request( "get", "/v1/customers/{customer}/payment_methods/{payment_method}".format( customer=sanitize_id(customer), diff --git a/stripe/_customer_payment_source_service.py b/stripe/_customer_payment_source_service.py index 7c1f759bf..99f1bce29 100644 --- a/stripe/_customer_payment_source_service.py +++ b/stripe/_customer_payment_source_service.py @@ -184,7 +184,7 @@ def list( """ return cast( ListObject[Union[Account, BankAccount, Card, Source]], - self._requestor.request( + self._request( "get", "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer), @@ -211,7 +211,7 @@ def create( """ return cast( Union[Account, BankAccount, Card, Source], - self._requestor.request( + self._request( "post", "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer), @@ -235,7 +235,7 @@ def retrieve( """ return cast( Union[Account, BankAccount, Card, Source], - self._requestor.request( + self._request( "get", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), @@ -260,7 +260,7 @@ def update( """ return cast( Union[Account, BankAccount, Card, Source], - self._requestor.request( + self._request( "post", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), @@ -285,7 +285,7 @@ def delete( """ return cast( Union[Account, BankAccount, Card, Source], - self._requestor.request( + self._request( "delete", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), @@ -310,7 +310,7 @@ def verify( """ return cast( BankAccount, - self._requestor.request( + self._request( "post", "/v1/customers/{customer}/sources/{id}/verify".format( customer=sanitize_id(customer), diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 4dacf5b52..1a04f38a6 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -651,7 +651,7 @@ def delete( """ return cast( Customer, - self._requestor.request( + self._request( "delete", "/v1/customers/{customer}".format( customer=sanitize_id(customer), @@ -674,7 +674,7 @@ def retrieve( """ return cast( Customer, - self._requestor.request( + self._request( "get", "/v1/customers/{customer}".format( customer=sanitize_id(customer), @@ -699,7 +699,7 @@ def update( """ return cast( Customer, - self._requestor.request( + self._request( "post", "/v1/customers/{customer}".format( customer=sanitize_id(customer), @@ -722,7 +722,7 @@ def delete_discount( """ return cast( Discount, - self._requestor.request( + self._request( "delete", "/v1/customers/{customer}/discount".format( customer=sanitize_id(customer), @@ -744,7 +744,7 @@ def list( """ return cast( ListObject[Customer], - self._requestor.request( + self._request( "get", "/v1/customers", api_mode="V1", @@ -764,7 +764,7 @@ def create( """ return cast( Customer, - self._requestor.request( + self._request( "post", "/v1/customers", api_mode="V1", @@ -787,7 +787,7 @@ def search( """ return cast( SearchResultObject[Customer], - self._requestor.request( + self._request( "get", "/v1/customers/search", api_mode="V1", diff --git a/stripe/_customer_session_service.py b/stripe/_customer_session_service.py index 80cd7ba74..a9ee4bd50 100644 --- a/stripe/_customer_session_service.py +++ b/stripe/_customer_session_service.py @@ -58,7 +58,7 @@ def create( """ return cast( CustomerSession, - self._requestor.request( + self._request( "post", "/v1/customer_sessions", api_mode="V1", diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index d41fd7278..6e4a6b22e 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -130,7 +130,7 @@ def delete( """ return cast( TaxId, - self._requestor.request( + self._request( "delete", "/v1/customers/{customer}/tax_ids/{id}".format( customer=sanitize_id(customer), @@ -155,7 +155,7 @@ def retrieve( """ return cast( TaxId, - self._requestor.request( + self._request( "get", "/v1/customers/{customer}/tax_ids/{id}".format( customer=sanitize_id(customer), @@ -179,7 +179,7 @@ def list( """ return cast( ListObject[TaxId], - self._requestor.request( + self._request( "get", "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer), @@ -202,7 +202,7 @@ def create( """ return cast( TaxId, - self._requestor.request( + self._request( "post", "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer), diff --git a/stripe/_dispute_service.py b/stripe/_dispute_service.py index a2dafc16b..991a04d61 100644 --- a/stripe/_dispute_service.py +++ b/stripe/_dispute_service.py @@ -205,7 +205,7 @@ def list( """ return cast( ListObject[Dispute], - self._requestor.request( + self._request( "get", "/v1/disputes", api_mode="V1", @@ -226,7 +226,7 @@ def retrieve( """ return cast( Dispute, - self._requestor.request( + self._request( "get", "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), api_mode="V1", @@ -249,7 +249,7 @@ def update( """ return cast( Dispute, - self._requestor.request( + self._request( "post", "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), api_mode="V1", @@ -272,7 +272,7 @@ def close( """ return cast( Dispute, - self._requestor.request( + self._request( "post", "/v1/disputes/{dispute}/close".format( dispute=sanitize_id(dispute), diff --git a/stripe/_ephemeral_key_service.py b/stripe/_ephemeral_key_service.py index 4bcb45a83..451ff03e0 100644 --- a/stripe/_ephemeral_key_service.py +++ b/stripe/_ephemeral_key_service.py @@ -48,7 +48,7 @@ def delete( """ return cast( EphemeralKey, - self._requestor.request( + self._request( "delete", "/v1/ephemeral_keys/{key}".format(key=sanitize_id(key)), api_mode="V1", @@ -68,7 +68,7 @@ def create( """ return cast( EphemeralKey, - self._requestor.request( + self._request( "post", "/v1/ephemeral_keys", api_mode="V1", diff --git a/stripe/_event_service.py b/stripe/_event_service.py index fdf30b619..e2e3a8438 100644 --- a/stripe/_event_service.py +++ b/stripe/_event_service.py @@ -75,7 +75,7 @@ def list( """ return cast( ListObject[Event], - self._requestor.request( + self._request( "get", "/v1/events", api_mode="V1", @@ -96,7 +96,7 @@ def retrieve( """ return cast( Event, - self._requestor.request( + self._request( "get", "/v1/events/{id}".format(id=sanitize_id(id)), api_mode="V1", diff --git a/stripe/_exchange_rate_service.py b/stripe/_exchange_rate_service.py index a4378d6aa..2927df40b 100644 --- a/stripe/_exchange_rate_service.py +++ b/stripe/_exchange_rate_service.py @@ -44,7 +44,7 @@ def list( """ return cast( ListObject[ExchangeRate], - self._requestor.request( + self._request( "get", "/v1/exchange_rates", api_mode="V1", @@ -65,7 +65,7 @@ def retrieve( """ return cast( ExchangeRate, - self._requestor.request( + self._request( "get", "/v1/exchange_rates/{rate_id}".format( rate_id=sanitize_id(rate_id), diff --git a/stripe/_file_link_service.py b/stripe/_file_link_service.py index e83134337..3579ac429 100644 --- a/stripe/_file_link_service.py +++ b/stripe/_file_link_service.py @@ -103,7 +103,7 @@ def list( """ return cast( ListObject[FileLink], - self._requestor.request( + self._request( "get", "/v1/file_links", api_mode="V1", @@ -123,7 +123,7 @@ def create( """ return cast( FileLink, - self._requestor.request( + self._request( "post", "/v1/file_links", api_mode="V1", @@ -144,7 +144,7 @@ def retrieve( """ return cast( FileLink, - self._requestor.request( + self._request( "get", "/v1/file_links/{link}".format(link=sanitize_id(link)), api_mode="V1", @@ -165,7 +165,7 @@ def update( """ return cast( FileLink, - self._requestor.request( + self._request( "post", "/v1/file_links/{link}".format(link=sanitize_id(link)), api_mode="V1", diff --git a/stripe/_file_service.py b/stripe/_file_service.py index e59b71686..a5ab0060a 100644 --- a/stripe/_file_service.py +++ b/stripe/_file_service.py @@ -112,7 +112,7 @@ def list( """ return cast( ListObject[File], - self._requestor.request( + self._request( "get", "/v1/files", api_mode="V1", @@ -132,7 +132,7 @@ def create( """ return cast( File, - self._requestor.request( + self._request( "post", "/v1/files", api_mode="V1FILES", @@ -153,7 +153,7 @@ def retrieve( """ return cast( File, - self._requestor.request( + self._request( "get", "/v1/files/{file}".format(file=sanitize_id(file)), api_mode="V1", diff --git a/stripe/_invoice_item_service.py b/stripe/_invoice_item_service.py index 51fb3376f..6c3b4c86b 100644 --- a/stripe/_invoice_item_service.py +++ b/stripe/_invoice_item_service.py @@ -315,7 +315,7 @@ def delete( """ return cast( InvoiceItem, - self._requestor.request( + self._request( "delete", "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), @@ -338,7 +338,7 @@ def retrieve( """ return cast( InvoiceItem, - self._requestor.request( + self._request( "get", "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), @@ -361,7 +361,7 @@ def update( """ return cast( InvoiceItem, - self._requestor.request( + self._request( "post", "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), @@ -383,7 +383,7 @@ def list( """ return cast( ListObject[InvoiceItem], - self._requestor.request( + self._request( "get", "/v1/invoiceitems", api_mode="V1", @@ -403,7 +403,7 @@ def create( """ return cast( InvoiceItem, - self._requestor.request( + self._request( "post", "/v1/invoiceitems", api_mode="V1", diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index 1c0333993..37fca43f4 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -39,7 +39,7 @@ def list( """ return cast( ListObject[InvoiceLineItem], - self._requestor.request( + self._request( "get", "/v1/invoices/{invoice}/lines".format( invoice=sanitize_id(invoice), diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index b5b454899..f86a8f879 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -1903,7 +1903,7 @@ def delete( """ return cast( Invoice, - self._requestor.request( + self._request( "delete", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), api_mode="V1", @@ -1924,7 +1924,7 @@ def retrieve( """ return cast( Invoice, - self._requestor.request( + self._request( "get", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), api_mode="V1", @@ -1950,7 +1950,7 @@ def update( """ return cast( Invoice, - self._requestor.request( + self._request( "post", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), api_mode="V1", @@ -1970,7 +1970,7 @@ def list( """ return cast( ListObject[Invoice], - self._requestor.request( + self._request( "get", "/v1/invoices", api_mode="V1", @@ -1990,7 +1990,7 @@ def create( """ return cast( Invoice, - self._requestor.request( + self._request( "post", "/v1/invoices", api_mode="V1", @@ -2013,7 +2013,7 @@ def search( """ return cast( SearchResultObject[Invoice], - self._requestor.request( + self._request( "get", "/v1/invoices/search", api_mode="V1", @@ -2037,7 +2037,7 @@ def upcoming( """ return cast( Invoice, - self._requestor.request( + self._request( "get", "/v1/invoices/upcoming", api_mode="V1", @@ -2058,7 +2058,7 @@ def finalize_invoice( """ return cast( Invoice, - self._requestor.request( + self._request( "post", "/v1/invoices/{invoice}/finalize".format( invoice=sanitize_id(invoice), @@ -2081,7 +2081,7 @@ def mark_uncollectible( """ return cast( Invoice, - self._requestor.request( + self._request( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( invoice=sanitize_id(invoice), @@ -2104,7 +2104,7 @@ def pay( """ return cast( Invoice, - self._requestor.request( + self._request( "post", "/v1/invoices/{invoice}/pay".format( invoice=sanitize_id(invoice), @@ -2129,7 +2129,7 @@ def send_invoice( """ return cast( Invoice, - self._requestor.request( + self._request( "post", "/v1/invoices/{invoice}/send".format( invoice=sanitize_id(invoice), @@ -2152,7 +2152,7 @@ def void_invoice( """ return cast( Invoice, - self._requestor.request( + self._request( "post", "/v1/invoices/{invoice}/void".format( invoice=sanitize_id(invoice), diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index 3af980986..44e8be6e6 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -582,7 +582,7 @@ def list( """ return cast( ListObject[InvoiceLineItem], - self._requestor.request( + self._request( "get", "/v1/invoices/upcoming/lines", api_mode="V1", diff --git a/stripe/_mandate_service.py b/stripe/_mandate_service.py index 2d77a1626..f19beb1c2 100644 --- a/stripe/_mandate_service.py +++ b/stripe/_mandate_service.py @@ -26,7 +26,7 @@ def retrieve( """ return cast( Mandate, - self._requestor.request( + self._request( "get", "/v1/mandates/{mandate}".format(mandate=sanitize_id(mandate)), api_mode="V1", diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index dd39a3a6d..003f98755 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -5889,7 +5889,7 @@ def list( """ return cast( ListObject[PaymentIntent], - self._requestor.request( + self._request( "get", "/v1/payment_intents", api_mode="V1", @@ -5918,7 +5918,7 @@ def create( """ return cast( PaymentIntent, - self._requestor.request( + self._request( "post", "/v1/payment_intents", api_mode="V1", @@ -5943,7 +5943,7 @@ def retrieve( """ return cast( PaymentIntent, - self._requestor.request( + self._request( "get", "/v1/payment_intents/{intent}".format( intent=sanitize_id(intent), @@ -5972,7 +5972,7 @@ def update( """ return cast( PaymentIntent, - self._requestor.request( + self._request( "post", "/v1/payment_intents/{intent}".format( intent=sanitize_id(intent), @@ -5997,7 +5997,7 @@ def search( """ return cast( SearchResultObject[PaymentIntent], - self._requestor.request( + self._request( "get", "/v1/payment_intents/search", api_mode="V1", @@ -6018,7 +6018,7 @@ def apply_customer_balance( """ return cast( PaymentIntent, - self._requestor.request( + self._request( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( intent=sanitize_id(intent), @@ -6045,7 +6045,7 @@ def cancel( """ return cast( PaymentIntent, - self._requestor.request( + self._request( "post", "/v1/payment_intents/{intent}/cancel".format( intent=sanitize_id(intent), @@ -6072,7 +6072,7 @@ def capture( """ return cast( PaymentIntent, - self._requestor.request( + self._request( "post", "/v1/payment_intents/{intent}/capture".format( intent=sanitize_id(intent), @@ -6117,7 +6117,7 @@ def confirm( """ return cast( PaymentIntent, - self._requestor.request( + self._request( "post", "/v1/payment_intents/{intent}/confirm".format( intent=sanitize_id(intent), @@ -6163,7 +6163,7 @@ def increment_authorization( """ return cast( PaymentIntent, - self._requestor.request( + self._request( "post", "/v1/payment_intents/{intent}/increment_authorization".format( intent=sanitize_id(intent), @@ -6186,7 +6186,7 @@ def verify_microdeposits( """ return cast( PaymentIntent, - self._requestor.request( + self._request( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent), diff --git a/stripe/_payment_link_line_item_service.py b/stripe/_payment_link_line_item_service.py index c6692f46e..cd98827a4 100644 --- a/stripe/_payment_link_line_item_service.py +++ b/stripe/_payment_link_line_item_service.py @@ -39,7 +39,7 @@ def list( """ return cast( ListObject[LineItem], - self._requestor.request( + self._request( "get", "/v1/payment_links/{payment_link}/line_items".format( payment_link=sanitize_id(payment_link), diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 375745d58..7794ba179 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -1630,7 +1630,7 @@ def list( """ return cast( ListObject[PaymentLink], - self._requestor.request( + self._request( "get", "/v1/payment_links", api_mode="V1", @@ -1650,7 +1650,7 @@ def create( """ return cast( PaymentLink, - self._requestor.request( + self._request( "post", "/v1/payment_links", api_mode="V1", @@ -1671,7 +1671,7 @@ def retrieve( """ return cast( PaymentLink, - self._requestor.request( + self._request( "get", "/v1/payment_links/{payment_link}".format( payment_link=sanitize_id(payment_link), @@ -1694,7 +1694,7 @@ def update( """ return cast( PaymentLink, - self._requestor.request( + self._request( "post", "/v1/payment_links/{payment_link}".format( payment_link=sanitize_id(payment_link), diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index 5f8db1dda..706c33d17 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -1432,7 +1432,7 @@ def list( """ return cast( ListObject[PaymentMethodConfiguration], - self._requestor.request( + self._request( "get", "/v1/payment_method_configurations", api_mode="V1", @@ -1452,7 +1452,7 @@ def create( """ return cast( PaymentMethodConfiguration, - self._requestor.request( + self._request( "post", "/v1/payment_method_configurations", api_mode="V1", @@ -1473,7 +1473,7 @@ def retrieve( """ return cast( PaymentMethodConfiguration, - self._requestor.request( + self._request( "get", "/v1/payment_method_configurations/{configuration}".format( configuration=sanitize_id(configuration), @@ -1496,7 +1496,7 @@ def update( """ return cast( PaymentMethodConfiguration, - self._requestor.request( + self._request( "post", "/v1/payment_method_configurations/{configuration}".format( configuration=sanitize_id(configuration), diff --git a/stripe/_payment_method_domain_service.py b/stripe/_payment_method_domain_service.py index 85fa56b3a..41d40a51b 100644 --- a/stripe/_payment_method_domain_service.py +++ b/stripe/_payment_method_domain_service.py @@ -82,7 +82,7 @@ def list( """ return cast( ListObject[PaymentMethodDomain], - self._requestor.request( + self._request( "get", "/v1/payment_method_domains", api_mode="V1", @@ -102,7 +102,7 @@ def create( """ return cast( PaymentMethodDomain, - self._requestor.request( + self._request( "post", "/v1/payment_method_domains", api_mode="V1", @@ -123,7 +123,7 @@ def retrieve( """ return cast( PaymentMethodDomain, - self._requestor.request( + self._request( "get", "/v1/payment_method_domains/{payment_method_domain}".format( payment_method_domain=sanitize_id(payment_method_domain), @@ -146,7 +146,7 @@ def update( """ return cast( PaymentMethodDomain, - self._requestor.request( + self._request( "post", "/v1/payment_method_domains/{payment_method_domain}".format( payment_method_domain=sanitize_id(payment_method_domain), @@ -174,7 +174,7 @@ def validate( """ return cast( PaymentMethodDomain, - self._requestor.request( + self._request( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( payment_method_domain=sanitize_id(payment_method_domain), diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 77abf171d..faacc1703 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -639,7 +639,7 @@ def list( """ return cast( ListObject[PaymentMethod], - self._requestor.request( + self._request( "get", "/v1/payment_methods", api_mode="V1", @@ -661,7 +661,7 @@ def create( """ return cast( PaymentMethod, - self._requestor.request( + self._request( "post", "/v1/payment_methods", api_mode="V1", @@ -682,7 +682,7 @@ def retrieve( """ return cast( PaymentMethod, - self._requestor.request( + self._request( "get", "/v1/payment_methods/{payment_method}".format( payment_method=sanitize_id(payment_method), @@ -705,7 +705,7 @@ def update( """ return cast( PaymentMethod, - self._requestor.request( + self._request( "post", "/v1/payment_methods/{payment_method}".format( payment_method=sanitize_id(payment_method), @@ -740,7 +740,7 @@ def attach( """ return cast( PaymentMethod, - self._requestor.request( + self._request( "post", "/v1/payment_methods/{payment_method}/attach".format( payment_method=sanitize_id(payment_method), @@ -763,7 +763,7 @@ def detach( """ return cast( PaymentMethod, - self._requestor.request( + self._request( "post", "/v1/payment_methods/{payment_method}/detach".format( payment_method=sanitize_id(payment_method), diff --git a/stripe/_payout_service.py b/stripe/_payout_service.py index 27155c0cb..6bd83db57 100644 --- a/stripe/_payout_service.py +++ b/stripe/_payout_service.py @@ -154,7 +154,7 @@ def list( """ return cast( ListObject[Payout], - self._requestor.request( + self._request( "get", "/v1/payouts", api_mode="V1", @@ -178,7 +178,7 @@ def create( """ return cast( Payout, - self._requestor.request( + self._request( "post", "/v1/payouts", api_mode="V1", @@ -199,7 +199,7 @@ def retrieve( """ return cast( Payout, - self._requestor.request( + self._request( "get", "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), api_mode="V1", @@ -220,7 +220,7 @@ def update( """ return cast( Payout, - self._requestor.request( + self._request( "post", "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), api_mode="V1", @@ -241,7 +241,7 @@ def cancel( """ return cast( Payout, - self._requestor.request( + self._request( "post", "/v1/payouts/{payout}/cancel".format( payout=sanitize_id(payout), @@ -266,7 +266,7 @@ def reverse( """ return cast( Payout, - self._requestor.request( + self._request( "post", "/v1/payouts/{payout}/reverse".format( payout=sanitize_id(payout), diff --git a/stripe/_plan_service.py b/stripe/_plan_service.py index d71f1a06f..2c379103e 100644 --- a/stripe/_plan_service.py +++ b/stripe/_plan_service.py @@ -241,7 +241,7 @@ def delete( """ return cast( Plan, - self._requestor.request( + self._request( "delete", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), api_mode="V1", @@ -262,7 +262,7 @@ def retrieve( """ return cast( Plan, - self._requestor.request( + self._request( "get", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), api_mode="V1", @@ -283,7 +283,7 @@ def update( """ return cast( Plan, - self._requestor.request( + self._request( "post", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), api_mode="V1", @@ -303,7 +303,7 @@ def list( """ return cast( ListObject[Plan], - self._requestor.request( + self._request( "get", "/v1/plans", api_mode="V1", @@ -321,7 +321,7 @@ def create( """ return cast( Plan, - self._requestor.request( + self._request( "post", "/v1/plans", api_mode="V1", diff --git a/stripe/_price_service.py b/stripe/_price_service.py index 8dec76bc3..754dd45e1 100644 --- a/stripe/_price_service.py +++ b/stripe/_price_service.py @@ -485,7 +485,7 @@ def list( """ return cast( ListObject[Price], - self._requestor.request( + self._request( "get", "/v1/prices", api_mode="V1", @@ -503,7 +503,7 @@ def create( """ return cast( Price, - self._requestor.request( + self._request( "post", "/v1/prices", api_mode="V1", @@ -524,7 +524,7 @@ def retrieve( """ return cast( Price, - self._requestor.request( + self._request( "get", "/v1/prices/{price}".format(price=sanitize_id(price)), api_mode="V1", @@ -545,7 +545,7 @@ def update( """ return cast( Price, - self._requestor.request( + self._request( "post", "/v1/prices/{price}".format(price=sanitize_id(price)), api_mode="V1", @@ -566,7 +566,7 @@ def search( """ return cast( SearchResultObject[Price], - self._requestor.request( + self._request( "get", "/v1/prices/search", api_mode="V1", diff --git a/stripe/_product_service.py b/stripe/_product_service.py index f80e2e097..8a2d98f77 100644 --- a/stripe/_product_service.py +++ b/stripe/_product_service.py @@ -407,7 +407,7 @@ def delete( """ return cast( Product, - self._requestor.request( + self._request( "delete", "/v1/products/{id}".format(id=sanitize_id(id)), api_mode="V1", @@ -428,7 +428,7 @@ def retrieve( """ return cast( Product, - self._requestor.request( + self._request( "get", "/v1/products/{id}".format(id=sanitize_id(id)), api_mode="V1", @@ -449,7 +449,7 @@ def update( """ return cast( Product, - self._requestor.request( + self._request( "post", "/v1/products/{id}".format(id=sanitize_id(id)), api_mode="V1", @@ -469,7 +469,7 @@ def list( """ return cast( ListObject[Product], - self._requestor.request( + self._request( "get", "/v1/products", api_mode="V1", @@ -489,7 +489,7 @@ def create( """ return cast( Product, - self._requestor.request( + self._request( "post", "/v1/products", api_mode="V1", @@ -512,7 +512,7 @@ def search( """ return cast( SearchResultObject[Product], - self._requestor.request( + self._request( "get", "/v1/products/search", api_mode="V1", diff --git a/stripe/_promotion_code_service.py b/stripe/_promotion_code_service.py index 0955be866..d2c9ebbbb 100644 --- a/stripe/_promotion_code_service.py +++ b/stripe/_promotion_code_service.py @@ -182,7 +182,7 @@ def list( """ return cast( ListObject[PromotionCode], - self._requestor.request( + self._request( "get", "/v1/promotion_codes", api_mode="V1", @@ -202,7 +202,7 @@ def create( """ return cast( PromotionCode, - self._requestor.request( + self._request( "post", "/v1/promotion_codes", api_mode="V1", @@ -223,7 +223,7 @@ def retrieve( """ return cast( PromotionCode, - self._requestor.request( + self._request( "get", "/v1/promotion_codes/{promotion_code}".format( promotion_code=sanitize_id(promotion_code), @@ -246,7 +246,7 @@ def update( """ return cast( PromotionCode, - self._requestor.request( + self._request( "post", "/v1/promotion_codes/{promotion_code}".format( promotion_code=sanitize_id(promotion_code), diff --git a/stripe/_quote_computed_upfront_line_items_service.py b/stripe/_quote_computed_upfront_line_items_service.py index edac48208..9b52150af 100644 --- a/stripe/_quote_computed_upfront_line_items_service.py +++ b/stripe/_quote_computed_upfront_line_items_service.py @@ -39,7 +39,7 @@ def list( """ return cast( ListObject[LineItem], - self._requestor.request( + self._request( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( quote=sanitize_id(quote), diff --git a/stripe/_quote_line_item_service.py b/stripe/_quote_line_item_service.py index 5ea172d9f..b9b03b222 100644 --- a/stripe/_quote_line_item_service.py +++ b/stripe/_quote_line_item_service.py @@ -39,7 +39,7 @@ def list( """ return cast( ListObject[LineItem], - self._requestor.request( + self._request( "get", "/v1/quotes/{quote}/line_items".format( quote=sanitize_id(quote), diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 0fadc0faf..212dc2d01 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -575,7 +575,7 @@ def list( """ return cast( ListObject[Quote], - self._requestor.request( + self._request( "get", "/v1/quotes", api_mode="V1", @@ -595,7 +595,7 @@ def create( """ return cast( Quote, - self._requestor.request( + self._request( "post", "/v1/quotes", api_mode="V1", @@ -616,7 +616,7 @@ def retrieve( """ return cast( Quote, - self._requestor.request( + self._request( "get", "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), api_mode="V1", @@ -637,7 +637,7 @@ def update( """ return cast( Quote, - self._requestor.request( + self._request( "post", "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), api_mode="V1", @@ -658,7 +658,7 @@ def accept( """ return cast( Quote, - self._requestor.request( + self._request( "post", "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), api_mode="V1", @@ -679,7 +679,7 @@ def cancel( """ return cast( Quote, - self._requestor.request( + self._request( "post", "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), api_mode="V1", @@ -700,7 +700,7 @@ def finalize_quote( """ return cast( Quote, - self._requestor.request( + self._request( "post", "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), api_mode="V1", @@ -721,7 +721,7 @@ def pdf( """ return cast( Any, - self._requestor.request_stream( + self._request_stream( "get", "/v1/quotes/{quote}/pdf".format(quote=sanitize_id(quote)), api_mode="V1", diff --git a/stripe/_refund_service.py b/stripe/_refund_service.py index 20efee43e..3a4f80905 100644 --- a/stripe/_refund_service.py +++ b/stripe/_refund_service.py @@ -138,7 +138,7 @@ def list( """ return cast( ListObject[Refund], - self._requestor.request( + self._request( "get", "/v1/refunds", api_mode="V1", @@ -168,7 +168,7 @@ def create( """ return cast( Refund, - self._requestor.request( + self._request( "post", "/v1/refunds", api_mode="V1", @@ -189,7 +189,7 @@ def retrieve( """ return cast( Refund, - self._requestor.request( + self._request( "get", "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), api_mode="V1", @@ -212,7 +212,7 @@ def update( """ return cast( Refund, - self._requestor.request( + self._request( "post", "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), api_mode="V1", @@ -235,7 +235,7 @@ def cancel( """ return cast( Refund, - self._requestor.request( + self._request( "post", "/v1/refunds/{refund}/cancel".format( refund=sanitize_id(refund), diff --git a/stripe/_review_service.py b/stripe/_review_service.py index cbe1df15b..7a3532a1c 100644 --- a/stripe/_review_service.py +++ b/stripe/_review_service.py @@ -69,7 +69,7 @@ def list( """ return cast( ListObject[Review], - self._requestor.request( + self._request( "get", "/v1/reviews", api_mode="V1", @@ -90,7 +90,7 @@ def retrieve( """ return cast( Review, - self._requestor.request( + self._request( "get", "/v1/reviews/{review}".format(review=sanitize_id(review)), api_mode="V1", @@ -111,7 +111,7 @@ def approve( """ return cast( Review, - self._requestor.request( + self._request( "post", "/v1/reviews/{review}/approve".format( review=sanitize_id(review), diff --git a/stripe/_setup_attempt_service.py b/stripe/_setup_attempt_service.py index 38f34cbde..e32727c45 100644 --- a/stripe/_setup_attempt_service.py +++ b/stripe/_setup_attempt_service.py @@ -66,7 +66,7 @@ def list( """ return cast( ListObject[SetupAttempt], - self._requestor.request( + self._request( "get", "/v1/setup_attempts", api_mode="V1", diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 898956001..b26b825d7 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -2887,7 +2887,7 @@ def list( """ return cast( ListObject[SetupIntent], - self._requestor.request( + self._request( "get", "/v1/setup_intents", api_mode="V1", @@ -2910,7 +2910,7 @@ def create( """ return cast( SetupIntent, - self._requestor.request( + self._request( "post", "/v1/setup_intents", api_mode="V1", @@ -2935,7 +2935,7 @@ def retrieve( """ return cast( SetupIntent, - self._requestor.request( + self._request( "get", "/v1/setup_intents/{intent}".format( intent=sanitize_id(intent) @@ -2958,7 +2958,7 @@ def update( """ return cast( SetupIntent, - self._requestor.request( + self._request( "post", "/v1/setup_intents/{intent}".format( intent=sanitize_id(intent) @@ -2983,7 +2983,7 @@ def cancel( """ return cast( SetupIntent, - self._requestor.request( + self._request( "post", "/v1/setup_intents/{intent}/cancel".format( intent=sanitize_id(intent), @@ -3019,7 +3019,7 @@ def confirm( """ return cast( SetupIntent, - self._requestor.request( + self._request( "post", "/v1/setup_intents/{intent}/confirm".format( intent=sanitize_id(intent), @@ -3042,7 +3042,7 @@ def verify_microdeposits( """ return cast( SetupIntent, - self._requestor.request( + self._request( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent), diff --git a/stripe/_shipping_rate_service.py b/stripe/_shipping_rate_service.py index 3dd68e006..d8dffa5d6 100644 --- a/stripe/_shipping_rate_service.py +++ b/stripe/_shipping_rate_service.py @@ -222,7 +222,7 @@ def list( """ return cast( ListObject[ShippingRate], - self._requestor.request( + self._request( "get", "/v1/shipping_rates", api_mode="V1", @@ -242,7 +242,7 @@ def create( """ return cast( ShippingRate, - self._requestor.request( + self._request( "post", "/v1/shipping_rates", api_mode="V1", @@ -263,7 +263,7 @@ def retrieve( """ return cast( ShippingRate, - self._requestor.request( + self._request( "get", "/v1/shipping_rates/{shipping_rate_token}".format( shipping_rate_token=sanitize_id(shipping_rate_token), @@ -286,7 +286,7 @@ def update( """ return cast( ShippingRate, - self._requestor.request( + self._request( "post", "/v1/shipping_rates/{shipping_rate_token}".format( shipping_rate_token=sanitize_id(shipping_rate_token), diff --git a/stripe/_source_service.py b/stripe/_source_service.py index 047fc395f..e2ef4c5b2 100644 --- a/stripe/_source_service.py +++ b/stripe/_source_service.py @@ -545,7 +545,7 @@ def detach( """ return cast( Union[Account, BankAccount, Card, Source], - self._requestor.request( + self._request( "delete", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), @@ -569,7 +569,7 @@ def retrieve( """ return cast( Source, - self._requestor.request( + self._request( "get", "/v1/sources/{source}".format(source=sanitize_id(source)), api_mode="V1", @@ -592,7 +592,7 @@ def update( """ return cast( Source, - self._requestor.request( + self._request( "post", "/v1/sources/{source}".format(source=sanitize_id(source)), api_mode="V1", @@ -612,7 +612,7 @@ def create( """ return cast( Source, - self._requestor.request( + self._request( "post", "/v1/sources", api_mode="V1", @@ -633,7 +633,7 @@ def verify( """ return cast( Source, - self._requestor.request( + self._request( "post", "/v1/sources/{source}/verify".format( source=sanitize_id(source), diff --git a/stripe/_source_transaction_service.py b/stripe/_source_transaction_service.py index 64488900b..c1fe5c061 100644 --- a/stripe/_source_transaction_service.py +++ b/stripe/_source_transaction_service.py @@ -39,7 +39,7 @@ def list( """ return cast( ListObject[SourceTransaction], - self._requestor.request( + self._request( "get", "/v1/sources/{source}/source_transactions".format( source=sanitize_id(source), diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index e69cde46d..7def5bcd8 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -148,7 +148,6 @@ def __init__( self._requestor = _APIRequestor( options=requestor_options, client=http_client, - usage=["stripe_client"], ) self._options = _ClientOptions( diff --git a/stripe/_stripe_service.py b/stripe/_stripe_service.py index e069070a7..7fec47990 100644 --- a/stripe/_stripe_service.py +++ b/stripe/_stripe_service.py @@ -1,4 +1,10 @@ -from stripe._api_requestor import _APIRequestor +from stripe._api_requestor import _APIRequestor, StripeStreamResponse +from stripe._stripe_object import StripeObject +from stripe._request_options import RequestOptions +from stripe._base_address import BaseAddress +from stripe._api_mode import ApiMode + +from typing import Any, Mapping, Optional class StripeService(object): @@ -6,3 +12,43 @@ class StripeService(object): def __init__(self, requestor): self._requestor = requestor + + def _request( + self, + method: str, + url: str, + params: Optional[Mapping[str, Any]] = None, + options: Optional[RequestOptions] = None, + *, + base_address: BaseAddress, + api_mode: ApiMode, + ) -> StripeObject: + return self._requestor.request( + method, + url, + params, + options, + base_address=base_address, + api_mode=api_mode, + _usage=["stripe_client"], + ) + + def _request_stream( + self, + method: str, + url: str, + params: Optional[Mapping[str, Any]] = None, + options: Optional[RequestOptions] = None, + *, + base_address: BaseAddress, + api_mode: ApiMode, + ) -> StripeStreamResponse: + return self._requestor.request_stream( + method, + url, + params, + options, + base_address=base_address, + api_mode=api_mode, + _usage=["stripe_client"], + ) diff --git a/stripe/_subscription_item_service.py b/stripe/_subscription_item_service.py index 40cc68456..1777057f5 100644 --- a/stripe/_subscription_item_service.py +++ b/stripe/_subscription_item_service.py @@ -298,7 +298,7 @@ def delete( """ return cast( SubscriptionItem, - self._requestor.request( + self._request( "delete", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), api_mode="V1", @@ -319,7 +319,7 @@ def retrieve( """ return cast( SubscriptionItem, - self._requestor.request( + self._request( "get", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), api_mode="V1", @@ -340,7 +340,7 @@ def update( """ return cast( SubscriptionItem, - self._requestor.request( + self._request( "post", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), api_mode="V1", @@ -360,7 +360,7 @@ def list( """ return cast( ListObject[SubscriptionItem], - self._requestor.request( + self._request( "get", "/v1/subscription_items", api_mode="V1", @@ -380,7 +380,7 @@ def create( """ return cast( SubscriptionItem, - self._requestor.request( + self._request( "post", "/v1/subscription_items", api_mode="V1", diff --git a/stripe/_subscription_item_usage_record_service.py b/stripe/_subscription_item_usage_record_service.py index d7a803099..c7ccc31df 100644 --- a/stripe/_subscription_item_usage_record_service.py +++ b/stripe/_subscription_item_usage_record_service.py @@ -44,7 +44,7 @@ def create( """ return cast( UsageRecord, - self._requestor.request( + self._request( "post", "/v1/subscription_items/{subscription_item}/usage_records".format( subscription_item=sanitize_id(subscription_item), diff --git a/stripe/_subscription_item_usage_record_summary_service.py b/stripe/_subscription_item_usage_record_summary_service.py index 986e17277..eb0a47fad 100644 --- a/stripe/_subscription_item_usage_record_summary_service.py +++ b/stripe/_subscription_item_usage_record_summary_service.py @@ -41,7 +41,7 @@ def list( """ return cast( ListObject[UsageRecordSummary], - self._requestor.request( + self._request( "get", "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( subscription_item=sanitize_id(subscription_item), diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index fd3150325..2a932a344 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -1062,7 +1062,7 @@ def list( """ return cast( ListObject[SubscriptionSchedule], - self._requestor.request( + self._request( "get", "/v1/subscription_schedules", api_mode="V1", @@ -1082,7 +1082,7 @@ def create( """ return cast( SubscriptionSchedule, - self._requestor.request( + self._request( "post", "/v1/subscription_schedules", api_mode="V1", @@ -1103,7 +1103,7 @@ def retrieve( """ return cast( SubscriptionSchedule, - self._requestor.request( + self._request( "get", "/v1/subscription_schedules/{schedule}".format( schedule=sanitize_id(schedule), @@ -1126,7 +1126,7 @@ def update( """ return cast( SubscriptionSchedule, - self._requestor.request( + self._request( "post", "/v1/subscription_schedules/{schedule}".format( schedule=sanitize_id(schedule), @@ -1149,7 +1149,7 @@ def cancel( """ return cast( SubscriptionSchedule, - self._requestor.request( + self._request( "post", "/v1/subscription_schedules/{schedule}/cancel".format( schedule=sanitize_id(schedule), @@ -1172,7 +1172,7 @@ def release( """ return cast( SubscriptionSchedule, - self._requestor.request( + self._request( "post", "/v1/subscription_schedules/{schedule}/release".format( schedule=sanitize_id(schedule), diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 25fa2c7a9..3fd4ed487 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -1405,7 +1405,7 @@ def cancel( """ return cast( Subscription, - self._requestor.request( + self._request( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id( @@ -1430,7 +1430,7 @@ def retrieve( """ return cast( Subscription, - self._requestor.request( + self._request( "get", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id( @@ -1475,7 +1475,7 @@ def update( """ return cast( Subscription, - self._requestor.request( + self._request( "post", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id( @@ -1500,7 +1500,7 @@ def delete_discount( """ return cast( Discount, - self._requestor.request( + self._request( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( subscription_exposed_id=sanitize_id( @@ -1524,7 +1524,7 @@ def list( """ return cast( ListObject[Subscription], - self._requestor.request( + self._request( "get", "/v1/subscriptions", api_mode="V1", @@ -1550,7 +1550,7 @@ def create( """ return cast( Subscription, - self._requestor.request( + self._request( "post", "/v1/subscriptions", api_mode="V1", @@ -1573,7 +1573,7 @@ def search( """ return cast( SearchResultObject[Subscription], - self._requestor.request( + self._request( "get", "/v1/subscriptions/search", api_mode="V1", @@ -1594,7 +1594,7 @@ def resume( """ return cast( Subscription, - self._requestor.request( + self._request( "post", "/v1/subscriptions/{subscription}/resume".format( subscription=sanitize_id(subscription), diff --git a/stripe/_tax_code_service.py b/stripe/_tax_code_service.py index a17abd06b..f66d1bd3e 100644 --- a/stripe/_tax_code_service.py +++ b/stripe/_tax_code_service.py @@ -44,7 +44,7 @@ def list( """ return cast( ListObject[TaxCode], - self._requestor.request( + self._request( "get", "/v1/tax_codes", api_mode="V1", @@ -65,7 +65,7 @@ def retrieve( """ return cast( TaxCode, - self._requestor.request( + self._request( "get", "/v1/tax_codes/{id}".format(id=sanitize_id(id)), api_mode="V1", diff --git a/stripe/_tax_rate_service.py b/stripe/_tax_rate_service.py index 9ef8c6e3c..4dc574dcc 100644 --- a/stripe/_tax_rate_service.py +++ b/stripe/_tax_rate_service.py @@ -162,7 +162,7 @@ def list( """ return cast( ListObject[TaxRate], - self._requestor.request( + self._request( "get", "/v1/tax_rates", api_mode="V1", @@ -182,7 +182,7 @@ def create( """ return cast( TaxRate, - self._requestor.request( + self._request( "post", "/v1/tax_rates", api_mode="V1", @@ -203,7 +203,7 @@ def retrieve( """ return cast( TaxRate, - self._requestor.request( + self._request( "get", "/v1/tax_rates/{tax_rate}".format( tax_rate=sanitize_id(tax_rate), @@ -226,7 +226,7 @@ def update( """ return cast( TaxRate, - self._requestor.request( + self._request( "post", "/v1/tax_rates/{tax_rate}".format( tax_rate=sanitize_id(tax_rate), diff --git a/stripe/_token_service.py b/stripe/_token_service.py index c2718d708..9b8177bc3 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -1040,7 +1040,7 @@ def retrieve( """ return cast( Token, - self._requestor.request( + self._request( "get", "/v1/tokens/{token}".format(token=sanitize_id(token)), api_mode="V1", @@ -1061,7 +1061,7 @@ def create( """ return cast( Token, - self._requestor.request( + self._request( "post", "/v1/tokens", api_mode="V1", diff --git a/stripe/_topup_service.py b/stripe/_topup_service.py index 3a38727f4..0f05e875b 100644 --- a/stripe/_topup_service.py +++ b/stripe/_topup_service.py @@ -148,7 +148,7 @@ def list( """ return cast( ListObject[Topup], - self._requestor.request( + self._request( "get", "/v1/topups", api_mode="V1", @@ -166,7 +166,7 @@ def create( """ return cast( Topup, - self._requestor.request( + self._request( "post", "/v1/topups", api_mode="V1", @@ -187,7 +187,7 @@ def retrieve( """ return cast( Topup, - self._requestor.request( + self._request( "get", "/v1/topups/{topup}".format(topup=sanitize_id(topup)), api_mode="V1", @@ -208,7 +208,7 @@ def update( """ return cast( Topup, - self._requestor.request( + self._request( "post", "/v1/topups/{topup}".format(topup=sanitize_id(topup)), api_mode="V1", @@ -229,7 +229,7 @@ def cancel( """ return cast( Topup, - self._requestor.request( + self._request( "post", "/v1/topups/{topup}/cancel".format(topup=sanitize_id(topup)), api_mode="V1", diff --git a/stripe/_transfer_reversal_service.py b/stripe/_transfer_reversal_service.py index dd753a247..ffe5cde5a 100644 --- a/stripe/_transfer_reversal_service.py +++ b/stripe/_transfer_reversal_service.py @@ -77,7 +77,7 @@ def list( """ return cast( ListObject[Reversal], - self._requestor.request( + self._request( "get", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), api_mode="V1", @@ -102,7 +102,7 @@ def create( """ return cast( Reversal, - self._requestor.request( + self._request( "post", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), api_mode="V1", @@ -124,7 +124,7 @@ def retrieve( """ return cast( Reversal, - self._requestor.request( + self._request( "get", "/v1/transfers/{transfer}/reversals/{id}".format( transfer=sanitize_id(transfer), @@ -151,7 +151,7 @@ def update( """ return cast( Reversal, - self._requestor.request( + self._request( "post", "/v1/transfers/{transfer}/reversals/{id}".format( transfer=sanitize_id(transfer), diff --git a/stripe/_transfer_service.py b/stripe/_transfer_service.py index fab260f77..817ba1f25 100644 --- a/stripe/_transfer_service.py +++ b/stripe/_transfer_service.py @@ -128,7 +128,7 @@ def list( """ return cast( ListObject[Transfer], - self._requestor.request( + self._request( "get", "/v1/transfers", api_mode="V1", @@ -148,7 +148,7 @@ def create( """ return cast( Transfer, - self._requestor.request( + self._request( "post", "/v1/transfers", api_mode="V1", @@ -169,7 +169,7 @@ def retrieve( """ return cast( Transfer, - self._requestor.request( + self._request( "get", "/v1/transfers/{transfer}".format( transfer=sanitize_id(transfer), @@ -194,7 +194,7 @@ def update( """ return cast( Transfer, - self._requestor.request( + self._request( "post", "/v1/transfers/{transfer}".format( transfer=sanitize_id(transfer), diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index b4f3385fb..e9edca865 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -345,7 +345,7 @@ def delete( """ return cast( WebhookEndpoint, - self._requestor.request( + self._request( "delete", "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), @@ -368,7 +368,7 @@ def retrieve( """ return cast( WebhookEndpoint, - self._requestor.request( + self._request( "get", "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), @@ -391,7 +391,7 @@ def update( """ return cast( WebhookEndpoint, - self._requestor.request( + self._request( "post", "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), @@ -413,7 +413,7 @@ def list( """ return cast( ListObject[WebhookEndpoint], - self._requestor.request( + self._request( "get", "/v1/webhook_endpoints", api_mode="V1", @@ -433,7 +433,7 @@ def create( """ return cast( WebhookEndpoint, - self._requestor.request( + self._request( "post", "/v1/webhook_endpoints", api_mode="V1", diff --git a/stripe/apps/_secret_service.py b/stripe/apps/_secret_service.py index 7b3d0411f..318bed591 100644 --- a/stripe/apps/_secret_service.py +++ b/stripe/apps/_secret_service.py @@ -129,7 +129,7 @@ def list( """ return cast( ListObject[Secret], - self._requestor.request( + self._request( "get", "/v1/apps/secrets", api_mode="V1", @@ -149,7 +149,7 @@ def create( """ return cast( Secret, - self._requestor.request( + self._request( "post", "/v1/apps/secrets", api_mode="V1", @@ -167,7 +167,7 @@ def find( """ return cast( Secret, - self._requestor.request( + self._request( "get", "/v1/apps/secrets/find", api_mode="V1", @@ -187,7 +187,7 @@ def delete_where( """ return cast( Secret, - self._requestor.request( + self._request( "post", "/v1/apps/secrets/delete", api_mode="V1", diff --git a/stripe/billing_portal/_configuration_service.py b/stripe/billing_portal/_configuration_service.py index 14dbe75c1..32f0eea86 100644 --- a/stripe/billing_portal/_configuration_service.py +++ b/stripe/billing_portal/_configuration_service.py @@ -439,7 +439,7 @@ def list( """ return cast( ListObject[Configuration], - self._requestor.request( + self._request( "get", "/v1/billing_portal/configurations", api_mode="V1", @@ -459,7 +459,7 @@ def create( """ return cast( Configuration, - self._requestor.request( + self._request( "post", "/v1/billing_portal/configurations", api_mode="V1", @@ -480,7 +480,7 @@ def retrieve( """ return cast( Configuration, - self._requestor.request( + self._request( "get", "/v1/billing_portal/configurations/{configuration}".format( configuration=sanitize_id(configuration), @@ -503,7 +503,7 @@ def update( """ return cast( Configuration, - self._requestor.request( + self._request( "post", "/v1/billing_portal/configurations/{configuration}".format( configuration=sanitize_id(configuration), diff --git a/stripe/billing_portal/_session_service.py b/stripe/billing_portal/_session_service.py index 004de0a8f..250e4031f 100644 --- a/stripe/billing_portal/_session_service.py +++ b/stripe/billing_portal/_session_service.py @@ -193,7 +193,7 @@ def create( """ return cast( Session, - self._requestor.request( + self._request( "post", "/v1/billing_portal/sessions", api_mode="V1", diff --git a/stripe/checkout/_session_line_item_service.py b/stripe/checkout/_session_line_item_service.py index 4c1cc635c..917bcdf44 100644 --- a/stripe/checkout/_session_line_item_service.py +++ b/stripe/checkout/_session_line_item_service.py @@ -39,7 +39,7 @@ def list( """ return cast( ListObject[LineItem], - self._requestor.request( + self._request( "get", "/v1/checkout/sessions/{session}/line_items".format( session=sanitize_id(session), diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 713f150d7..649f1f8d5 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -2050,7 +2050,7 @@ def list( """ return cast( ListObject[Session], - self._requestor.request( + self._request( "get", "/v1/checkout/sessions", api_mode="V1", @@ -2070,7 +2070,7 @@ def create( """ return cast( Session, - self._requestor.request( + self._request( "post", "/v1/checkout/sessions", api_mode="V1", @@ -2091,7 +2091,7 @@ def retrieve( """ return cast( Session, - self._requestor.request( + self._request( "get", "/v1/checkout/sessions/{session}".format( session=sanitize_id(session), @@ -2116,7 +2116,7 @@ def expire( """ return cast( Session, - self._requestor.request( + self._request( "post", "/v1/checkout/sessions/{session}/expire".format( session=sanitize_id(session), diff --git a/stripe/climate/_order_service.py b/stripe/climate/_order_service.py index 0158947f1..5e9929957 100644 --- a/stripe/climate/_order_service.py +++ b/stripe/climate/_order_service.py @@ -109,7 +109,7 @@ def list( """ return cast( ListObject[Order], - self._requestor.request( + self._request( "get", "/v1/climate/orders", api_mode="V1", @@ -128,7 +128,7 @@ def create( """ return cast( Order, - self._requestor.request( + self._request( "post", "/v1/climate/orders", api_mode="V1", @@ -149,7 +149,7 @@ def retrieve( """ return cast( Order, - self._requestor.request( + self._request( "get", "/v1/climate/orders/{order}".format(order=sanitize_id(order)), api_mode="V1", @@ -170,7 +170,7 @@ def update( """ return cast( Order, - self._requestor.request( + self._request( "post", "/v1/climate/orders/{order}".format(order=sanitize_id(order)), api_mode="V1", @@ -194,7 +194,7 @@ def cancel( """ return cast( Order, - self._requestor.request( + self._request( "post", "/v1/climate/orders/{order}/cancel".format( order=sanitize_id(order), diff --git a/stripe/climate/_product_service.py b/stripe/climate/_product_service.py index 7d0f01ad5..9a0918156 100644 --- a/stripe/climate/_product_service.py +++ b/stripe/climate/_product_service.py @@ -44,7 +44,7 @@ def list( """ return cast( ListObject[Product], - self._requestor.request( + self._request( "get", "/v1/climate/products", api_mode="V1", @@ -65,7 +65,7 @@ def retrieve( """ return cast( Product, - self._requestor.request( + self._request( "get", "/v1/climate/products/{product}".format( product=sanitize_id(product), diff --git a/stripe/climate/_supplier_service.py b/stripe/climate/_supplier_service.py index 7e7e7bebf..5296cf68c 100644 --- a/stripe/climate/_supplier_service.py +++ b/stripe/climate/_supplier_service.py @@ -44,7 +44,7 @@ def list( """ return cast( ListObject[Supplier], - self._requestor.request( + self._request( "get", "/v1/climate/suppliers", api_mode="V1", @@ -65,7 +65,7 @@ def retrieve( """ return cast( Supplier, - self._requestor.request( + self._request( "get", "/v1/climate/suppliers/{supplier}".format( supplier=sanitize_id(supplier), diff --git a/stripe/financial_connections/_account_owner_service.py b/stripe/financial_connections/_account_owner_service.py index fea9754ff..94325989a 100644 --- a/stripe/financial_connections/_account_owner_service.py +++ b/stripe/financial_connections/_account_owner_service.py @@ -43,7 +43,7 @@ def list( """ return cast( ListObject[AccountOwner], - self._requestor.request( + self._request( "get", "/v1/financial_connections/accounts/{account}/owners".format( account=sanitize_id(account), diff --git a/stripe/financial_connections/_account_service.py b/stripe/financial_connections/_account_service.py index 30fd83183..ddd64c02e 100644 --- a/stripe/financial_connections/_account_service.py +++ b/stripe/financial_connections/_account_service.py @@ -105,7 +105,7 @@ def list( """ return cast( ListObject[Account], - self._requestor.request( + self._request( "get", "/v1/financial_connections/accounts", api_mode="V1", @@ -126,7 +126,7 @@ def retrieve( """ return cast( Account, - self._requestor.request( + self._request( "get", "/v1/financial_connections/accounts/{account}".format( account=sanitize_id(account), @@ -149,7 +149,7 @@ def disconnect( """ return cast( Account, - self._requestor.request( + self._request( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( account=sanitize_id(account), @@ -172,7 +172,7 @@ def refresh( """ return cast( Account, - self._requestor.request( + self._request( "post", "/v1/financial_connections/accounts/{account}/refresh".format( account=sanitize_id(account), @@ -195,7 +195,7 @@ def subscribe( """ return cast( Account, - self._requestor.request( + self._request( "post", "/v1/financial_connections/accounts/{account}/subscribe".format( account=sanitize_id(account), @@ -218,7 +218,7 @@ def unsubscribe( """ return cast( Account, - self._requestor.request( + self._request( "post", "/v1/financial_connections/accounts/{account}/unsubscribe".format( account=sanitize_id(account), diff --git a/stripe/financial_connections/_session_service.py b/stripe/financial_connections/_session_service.py index 3df1947f7..640e4b1ca 100644 --- a/stripe/financial_connections/_session_service.py +++ b/stripe/financial_connections/_session_service.py @@ -78,7 +78,7 @@ def retrieve( """ return cast( Session, - self._requestor.request( + self._request( "get", "/v1/financial_connections/sessions/{session}".format( session=sanitize_id(session), @@ -100,7 +100,7 @@ def create( """ return cast( Session, - self._requestor.request( + self._request( "post", "/v1/financial_connections/sessions", api_mode="V1", diff --git a/stripe/financial_connections/_transaction_service.py b/stripe/financial_connections/_transaction_service.py index 1ec5484b8..fde302e5d 100644 --- a/stripe/financial_connections/_transaction_service.py +++ b/stripe/financial_connections/_transaction_service.py @@ -84,7 +84,7 @@ def list( """ return cast( ListObject[Transaction], - self._requestor.request( + self._request( "get", "/v1/financial_connections/transactions", api_mode="V1", @@ -105,7 +105,7 @@ def retrieve( """ return cast( Transaction, - self._requestor.request( + self._request( "get", "/v1/financial_connections/transactions/{transaction}".format( transaction=sanitize_id(transaction), diff --git a/stripe/identity/_verification_report_service.py b/stripe/identity/_verification_report_service.py index d658b4e20..bdf1b0be5 100644 --- a/stripe/identity/_verification_report_service.py +++ b/stripe/identity/_verification_report_service.py @@ -71,7 +71,7 @@ def list( """ return cast( ListObject[VerificationReport], - self._requestor.request( + self._request( "get", "/v1/identity/verification_reports", api_mode="V1", @@ -92,7 +92,7 @@ def retrieve( """ return cast( VerificationReport, - self._requestor.request( + self._request( "get", "/v1/identity/verification_reports/{report}".format( report=sanitize_id(report), diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index 67aa7093b..8fd15286f 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -179,7 +179,7 @@ def list( """ return cast( ListObject[VerificationSession], - self._requestor.request( + self._request( "get", "/v1/identity/verification_sessions", api_mode="V1", @@ -205,7 +205,7 @@ def create( """ return cast( VerificationSession, - self._requestor.request( + self._request( "post", "/v1/identity/verification_sessions", api_mode="V1", @@ -229,7 +229,7 @@ def retrieve( """ return cast( VerificationSession, - self._requestor.request( + self._request( "get", "/v1/identity/verification_sessions/{session}".format( session=sanitize_id(session), @@ -255,7 +255,7 @@ def update( """ return cast( VerificationSession, - self._requestor.request( + self._request( "post", "/v1/identity/verification_sessions/{session}".format( session=sanitize_id(session), @@ -280,7 +280,7 @@ def cancel( """ return cast( VerificationSession, - self._requestor.request( + self._request( "post", "/v1/identity/verification_sessions/{session}/cancel".format( session=sanitize_id(session), @@ -321,7 +321,7 @@ def redact( """ return cast( VerificationSession, - self._requestor.request( + self._request( "post", "/v1/identity/verification_sessions/{session}/redact".format( session=sanitize_id(session), diff --git a/stripe/issuing/_authorization_service.py b/stripe/issuing/_authorization_service.py index aa33b9e8d..b224eabda 100644 --- a/stripe/issuing/_authorization_service.py +++ b/stripe/issuing/_authorization_service.py @@ -112,7 +112,7 @@ def list( """ return cast( ListObject[Authorization], - self._requestor.request( + self._request( "get", "/v1/issuing/authorizations", api_mode="V1", @@ -133,7 +133,7 @@ def retrieve( """ return cast( Authorization, - self._requestor.request( + self._request( "get", "/v1/issuing/authorizations/{authorization}".format( authorization=sanitize_id(authorization), @@ -156,7 +156,7 @@ def update( """ return cast( Authorization, - self._requestor.request( + self._request( "post", "/v1/issuing/authorizations/{authorization}".format( authorization=sanitize_id(authorization), @@ -180,7 +180,7 @@ def approve( """ return cast( Authorization, - self._requestor.request( + self._request( "post", "/v1/issuing/authorizations/{authorization}/approve".format( authorization=sanitize_id(authorization), @@ -204,7 +204,7 @@ def decline( """ return cast( Authorization, - self._requestor.request( + self._request( "post", "/v1/issuing/authorizations/{authorization}/decline".format( authorization=sanitize_id(authorization), diff --git a/stripe/issuing/_card_service.py b/stripe/issuing/_card_service.py index 6a1d6008a..82dccff3f 100644 --- a/stripe/issuing/_card_service.py +++ b/stripe/issuing/_card_service.py @@ -329,7 +329,7 @@ def list( """ return cast( ListObject[Card], - self._requestor.request( + self._request( "get", "/v1/issuing/cards", api_mode="V1", @@ -347,7 +347,7 @@ def create( """ return cast( Card, - self._requestor.request( + self._request( "post", "/v1/issuing/cards", api_mode="V1", @@ -368,7 +368,7 @@ def retrieve( """ return cast( Card, - self._requestor.request( + self._request( "get", "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), api_mode="V1", @@ -389,7 +389,7 @@ def update( """ return cast( Card, - self._requestor.request( + self._request( "post", "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), api_mode="V1", diff --git a/stripe/issuing/_cardholder_service.py b/stripe/issuing/_cardholder_service.py index b0ea428de..9e4efc03d 100644 --- a/stripe/issuing/_cardholder_service.py +++ b/stripe/issuing/_cardholder_service.py @@ -514,7 +514,7 @@ def list( """ return cast( ListObject[Cardholder], - self._requestor.request( + self._request( "get", "/v1/issuing/cardholders", api_mode="V1", @@ -534,7 +534,7 @@ def create( """ return cast( Cardholder, - self._requestor.request( + self._request( "post", "/v1/issuing/cardholders", api_mode="V1", @@ -555,7 +555,7 @@ def retrieve( """ return cast( Cardholder, - self._requestor.request( + self._request( "get", "/v1/issuing/cardholders/{cardholder}".format( cardholder=sanitize_id(cardholder), @@ -578,7 +578,7 @@ def update( """ return cast( Cardholder, - self._requestor.request( + self._request( "post", "/v1/issuing/cardholders/{cardholder}".format( cardholder=sanitize_id(cardholder), diff --git a/stripe/issuing/_dispute_service.py b/stripe/issuing/_dispute_service.py index 79b4d039c..348e175a4 100644 --- a/stripe/issuing/_dispute_service.py +++ b/stripe/issuing/_dispute_service.py @@ -588,7 +588,7 @@ def list( """ return cast( ListObject[Dispute], - self._requestor.request( + self._request( "get", "/v1/issuing/disputes", api_mode="V1", @@ -608,7 +608,7 @@ def create( """ return cast( Dispute, - self._requestor.request( + self._request( "post", "/v1/issuing/disputes", api_mode="V1", @@ -629,7 +629,7 @@ def retrieve( """ return cast( Dispute, - self._requestor.request( + self._request( "get", "/v1/issuing/disputes/{dispute}".format( dispute=sanitize_id(dispute), @@ -652,7 +652,7 @@ def update( """ return cast( Dispute, - self._requestor.request( + self._request( "post", "/v1/issuing/disputes/{dispute}".format( dispute=sanitize_id(dispute), @@ -675,7 +675,7 @@ def submit( """ return cast( Dispute, - self._requestor.request( + self._request( "post", "/v1/issuing/disputes/{dispute}/submit".format( dispute=sanitize_id(dispute), diff --git a/stripe/issuing/_token_service.py b/stripe/issuing/_token_service.py index c5aeb8595..457e6c98f 100644 --- a/stripe/issuing/_token_service.py +++ b/stripe/issuing/_token_service.py @@ -84,7 +84,7 @@ def list( """ return cast( ListObject[Token], - self._requestor.request( + self._request( "get", "/v1/issuing/tokens", api_mode="V1", @@ -105,7 +105,7 @@ def retrieve( """ return cast( Token, - self._requestor.request( + self._request( "get", "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), api_mode="V1", @@ -126,7 +126,7 @@ def update( """ return cast( Token, - self._requestor.request( + self._request( "post", "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), api_mode="V1", diff --git a/stripe/issuing/_transaction_service.py b/stripe/issuing/_transaction_service.py index f5eb4faf3..3a182cf45 100644 --- a/stripe/issuing/_transaction_service.py +++ b/stripe/issuing/_transaction_service.py @@ -88,7 +88,7 @@ def list( """ return cast( ListObject[Transaction], - self._requestor.request( + self._request( "get", "/v1/issuing/transactions", api_mode="V1", @@ -109,7 +109,7 @@ def retrieve( """ return cast( Transaction, - self._requestor.request( + self._request( "get", "/v1/issuing/transactions/{transaction}".format( transaction=sanitize_id(transaction), @@ -132,7 +132,7 @@ def update( """ return cast( Transaction, - self._requestor.request( + self._request( "post", "/v1/issuing/transactions/{transaction}".format( transaction=sanitize_id(transaction), diff --git a/stripe/radar/_early_fraud_warning_service.py b/stripe/radar/_early_fraud_warning_service.py index ef16aaba3..12fb1703d 100644 --- a/stripe/radar/_early_fraud_warning_service.py +++ b/stripe/radar/_early_fraud_warning_service.py @@ -74,7 +74,7 @@ def list( """ return cast( ListObject[EarlyFraudWarning], - self._requestor.request( + self._request( "get", "/v1/radar/early_fraud_warnings", api_mode="V1", @@ -97,7 +97,7 @@ def retrieve( """ return cast( EarlyFraudWarning, - self._requestor.request( + self._request( "get", "/v1/radar/early_fraud_warnings/{early_fraud_warning}".format( early_fraud_warning=sanitize_id(early_fraud_warning), diff --git a/stripe/radar/_value_list_item_service.py b/stripe/radar/_value_list_item_service.py index b5bed3216..6ac1c7fee 100644 --- a/stripe/radar/_value_list_item_service.py +++ b/stripe/radar/_value_list_item_service.py @@ -89,7 +89,7 @@ def delete( """ return cast( ValueListItem, - self._requestor.request( + self._request( "delete", "/v1/radar/value_list_items/{item}".format( item=sanitize_id(item), @@ -112,7 +112,7 @@ def retrieve( """ return cast( ValueListItem, - self._requestor.request( + self._request( "get", "/v1/radar/value_list_items/{item}".format( item=sanitize_id(item), @@ -134,7 +134,7 @@ def list( """ return cast( ListObject[ValueListItem], - self._requestor.request( + self._request( "get", "/v1/radar/value_list_items", api_mode="V1", @@ -154,7 +154,7 @@ def create( """ return cast( ValueListItem, - self._requestor.request( + self._request( "post", "/v1/radar/value_list_items", api_mode="V1", diff --git a/stripe/radar/_value_list_service.py b/stripe/radar/_value_list_service.py index c4d404aca..196cf3d08 100644 --- a/stripe/radar/_value_list_service.py +++ b/stripe/radar/_value_list_service.py @@ -117,7 +117,7 @@ def delete( """ return cast( ValueList, - self._requestor.request( + self._request( "delete", "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), @@ -140,7 +140,7 @@ def retrieve( """ return cast( ValueList, - self._requestor.request( + self._request( "get", "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), @@ -163,7 +163,7 @@ def update( """ return cast( ValueList, - self._requestor.request( + self._request( "post", "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), @@ -185,7 +185,7 @@ def list( """ return cast( ListObject[ValueList], - self._requestor.request( + self._request( "get", "/v1/radar/value_lists", api_mode="V1", @@ -205,7 +205,7 @@ def create( """ return cast( ValueList, - self._requestor.request( + self._request( "post", "/v1/radar/value_lists", api_mode="V1", diff --git a/stripe/reporting/_report_run_service.py b/stripe/reporting/_report_run_service.py index cd3245287..24ef67365 100644 --- a/stripe/reporting/_report_run_service.py +++ b/stripe/reporting/_report_run_service.py @@ -115,7 +115,7 @@ def list( """ return cast( ListObject[ReportRun], - self._requestor.request( + self._request( "get", "/v1/reporting/report_runs", api_mode="V1", @@ -135,7 +135,7 @@ def create( """ return cast( ReportRun, - self._requestor.request( + self._request( "post", "/v1/reporting/report_runs", api_mode="V1", @@ -156,7 +156,7 @@ def retrieve( """ return cast( ReportRun, - self._requestor.request( + self._request( "get", "/v1/reporting/report_runs/{report_run}".format( report_run=sanitize_id(report_run), diff --git a/stripe/reporting/_report_type_service.py b/stripe/reporting/_report_type_service.py index a782fe10c..e86703bee 100644 --- a/stripe/reporting/_report_type_service.py +++ b/stripe/reporting/_report_type_service.py @@ -32,7 +32,7 @@ def list( """ return cast( ListObject[ReportType], - self._requestor.request( + self._request( "get", "/v1/reporting/report_types", api_mode="V1", @@ -53,7 +53,7 @@ def retrieve( """ return cast( ReportType, - self._requestor.request( + self._request( "get", "/v1/reporting/report_types/{report_type}".format( report_type=sanitize_id(report_type), diff --git a/stripe/sigma/_scheduled_query_run_service.py b/stripe/sigma/_scheduled_query_run_service.py index 4be381d54..1569042d0 100644 --- a/stripe/sigma/_scheduled_query_run_service.py +++ b/stripe/sigma/_scheduled_query_run_service.py @@ -44,7 +44,7 @@ def list( """ return cast( ListObject[ScheduledQueryRun], - self._requestor.request( + self._request( "get", "/v1/sigma/scheduled_query_runs", api_mode="V1", @@ -65,7 +65,7 @@ def retrieve( """ return cast( ScheduledQueryRun, - self._requestor.request( + self._request( "get", "/v1/sigma/scheduled_query_runs/{scheduled_query_run}".format( scheduled_query_run=sanitize_id(scheduled_query_run), diff --git a/stripe/tax/_calculation_line_item_service.py b/stripe/tax/_calculation_line_item_service.py index fbc49d800..777d59f5d 100644 --- a/stripe/tax/_calculation_line_item_service.py +++ b/stripe/tax/_calculation_line_item_service.py @@ -39,7 +39,7 @@ def list( """ return cast( ListObject[CalculationLineItem], - self._requestor.request( + self._request( "get", "/v1/tax/calculations/{calculation}/line_items".format( calculation=sanitize_id(calculation), diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index ab72d0457..99513f9f4 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -234,7 +234,7 @@ def create( """ return cast( Calculation, - self._requestor.request( + self._request( "post", "/v1/tax/calculations", api_mode="V1", diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index e1b443c85..de7f87694 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -950,7 +950,7 @@ def list( """ return cast( ListObject[Registration], - self._requestor.request( + self._request( "get", "/v1/tax/registrations", api_mode="V1", @@ -970,7 +970,7 @@ def create( """ return cast( Registration, - self._requestor.request( + self._request( "post", "/v1/tax/registrations", api_mode="V1", @@ -991,7 +991,7 @@ def retrieve( """ return cast( Registration, - self._requestor.request( + self._request( "get", "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), api_mode="V1", @@ -1014,7 +1014,7 @@ def update( """ return cast( Registration, - self._requestor.request( + self._request( "post", "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), api_mode="V1", diff --git a/stripe/tax/_settings_service.py b/stripe/tax/_settings_service.py index a79e14f6f..fcc734488 100644 --- a/stripe/tax/_settings_service.py +++ b/stripe/tax/_settings_service.py @@ -82,7 +82,7 @@ def retrieve( """ return cast( Settings, - self._requestor.request( + self._request( "get", "/v1/tax/settings", api_mode="V1", @@ -102,7 +102,7 @@ def update( """ return cast( Settings, - self._requestor.request( + self._request( "post", "/v1/tax/settings", api_mode="V1", diff --git a/stripe/tax/_transaction_line_item_service.py b/stripe/tax/_transaction_line_item_service.py index 05a47fea4..69c2c7046 100644 --- a/stripe/tax/_transaction_line_item_service.py +++ b/stripe/tax/_transaction_line_item_service.py @@ -39,7 +39,7 @@ def list( """ return cast( ListObject[TransactionLineItem], - self._requestor.request( + self._request( "get", "/v1/tax/transactions/{transaction}/line_items".format( transaction=sanitize_id(transaction), diff --git a/stripe/tax/_transaction_service.py b/stripe/tax/_transaction_service.py index d24984265..64613640f 100644 --- a/stripe/tax/_transaction_service.py +++ b/stripe/tax/_transaction_service.py @@ -125,7 +125,7 @@ def retrieve( """ return cast( Transaction, - self._requestor.request( + self._request( "get", "/v1/tax/transactions/{transaction}".format( transaction=sanitize_id(transaction), @@ -147,7 +147,7 @@ def create_from_calculation( """ return cast( Transaction, - self._requestor.request( + self._request( "post", "/v1/tax/transactions/create_from_calculation", api_mode="V1", @@ -167,7 +167,7 @@ def create_reversal( """ return cast( Transaction, - self._requestor.request( + self._request( "post", "/v1/tax/transactions/create_reversal", api_mode="V1", diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index 2f05f18be..c02ea3437 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -656,7 +656,7 @@ def delete( """ return cast( Configuration, - self._requestor.request( + self._request( "delete", "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), @@ -679,7 +679,7 @@ def retrieve( """ return cast( Configuration, - self._requestor.request( + self._request( "get", "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), @@ -702,7 +702,7 @@ def update( """ return cast( Configuration, - self._requestor.request( + self._request( "post", "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), @@ -724,7 +724,7 @@ def list( """ return cast( ListObject[Configuration], - self._requestor.request( + self._request( "get", "/v1/terminal/configurations", api_mode="V1", @@ -744,7 +744,7 @@ def create( """ return cast( Configuration, - self._requestor.request( + self._request( "post", "/v1/terminal/configurations", api_mode="V1", diff --git a/stripe/terminal/_connection_token_service.py b/stripe/terminal/_connection_token_service.py index ca60c546a..027b897cc 100644 --- a/stripe/terminal/_connection_token_service.py +++ b/stripe/terminal/_connection_token_service.py @@ -28,7 +28,7 @@ def create( """ return cast( ConnectionToken, - self._requestor.request( + self._request( "post", "/v1/terminal/connection_tokens", api_mode="V1", diff --git a/stripe/terminal/_location_service.py b/stripe/terminal/_location_service.py index 853ea8a88..d902b6d02 100644 --- a/stripe/terminal/_location_service.py +++ b/stripe/terminal/_location_service.py @@ -144,7 +144,7 @@ def delete( """ return cast( Location, - self._requestor.request( + self._request( "delete", "/v1/terminal/locations/{location}".format( location=sanitize_id(location), @@ -167,7 +167,7 @@ def retrieve( """ return cast( Location, - self._requestor.request( + self._request( "get", "/v1/terminal/locations/{location}".format( location=sanitize_id(location), @@ -190,7 +190,7 @@ def update( """ return cast( Location, - self._requestor.request( + self._request( "post", "/v1/terminal/locations/{location}".format( location=sanitize_id(location), @@ -212,7 +212,7 @@ def list( """ return cast( ListObject[Location], - self._requestor.request( + self._request( "get", "/v1/terminal/locations", api_mode="V1", @@ -233,7 +233,7 @@ def create( """ return cast( Location, - self._requestor.request( + self._request( "post", "/v1/terminal/locations", api_mode="V1", diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index fa85ec670..067c07234 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -241,7 +241,7 @@ def delete( """ return cast( Reader, - self._requestor.request( + self._request( "delete", "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), @@ -264,7 +264,7 @@ def retrieve( """ return cast( Reader, - self._requestor.request( + self._request( "get", "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), @@ -287,7 +287,7 @@ def update( """ return cast( Reader, - self._requestor.request( + self._request( "post", "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), @@ -309,7 +309,7 @@ def list( """ return cast( ListObject[Reader], - self._requestor.request( + self._request( "get", "/v1/terminal/readers", api_mode="V1", @@ -329,7 +329,7 @@ def create( """ return cast( Reader, - self._requestor.request( + self._request( "post", "/v1/terminal/readers", api_mode="V1", @@ -350,7 +350,7 @@ def cancel_action( """ return cast( Reader, - self._requestor.request( + self._request( "post", "/v1/terminal/readers/{reader}/cancel_action".format( reader=sanitize_id(reader), @@ -373,7 +373,7 @@ def process_payment_intent( """ return cast( Reader, - self._requestor.request( + self._request( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( reader=sanitize_id(reader), @@ -396,7 +396,7 @@ def process_setup_intent( """ return cast( Reader, - self._requestor.request( + self._request( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( reader=sanitize_id(reader), @@ -419,7 +419,7 @@ def refund_payment( """ return cast( Reader, - self._requestor.request( + self._request( "post", "/v1/terminal/readers/{reader}/refund_payment".format( reader=sanitize_id(reader), @@ -442,7 +442,7 @@ def set_reader_display( """ return cast( Reader, - self._requestor.request( + self._request( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( reader=sanitize_id(reader), diff --git a/stripe/test_helpers/_customer_service.py b/stripe/test_helpers/_customer_service.py index 747890f0e..b88612626 100644 --- a/stripe/test_helpers/_customer_service.py +++ b/stripe/test_helpers/_customer_service.py @@ -40,7 +40,7 @@ def fund_cash_balance( """ return cast( CustomerCashBalanceTransaction, - self._requestor.request( + self._request( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( customer=sanitize_id(customer), diff --git a/stripe/test_helpers/_refund_service.py b/stripe/test_helpers/_refund_service.py index 0a7b92fc3..e4ac4b033 100644 --- a/stripe/test_helpers/_refund_service.py +++ b/stripe/test_helpers/_refund_service.py @@ -26,7 +26,7 @@ def expire( """ return cast( Refund, - self._requestor.request( + self._request( "post", "/v1/test_helpers/refunds/{refund}/expire".format( refund=sanitize_id(refund), diff --git a/stripe/test_helpers/_test_clock_service.py b/stripe/test_helpers/_test_clock_service.py index f0d7f460e..3bf6be9cb 100644 --- a/stripe/test_helpers/_test_clock_service.py +++ b/stripe/test_helpers/_test_clock_service.py @@ -72,7 +72,7 @@ def delete( """ return cast( TestClock, - self._requestor.request( + self._request( "delete", "/v1/test_helpers/test_clocks/{test_clock}".format( test_clock=sanitize_id(test_clock), @@ -95,7 +95,7 @@ def retrieve( """ return cast( TestClock, - self._requestor.request( + self._request( "get", "/v1/test_helpers/test_clocks/{test_clock}".format( test_clock=sanitize_id(test_clock), @@ -117,7 +117,7 @@ def list( """ return cast( ListObject[TestClock], - self._requestor.request( + self._request( "get", "/v1/test_helpers/test_clocks", api_mode="V1", @@ -137,7 +137,7 @@ def create( """ return cast( TestClock, - self._requestor.request( + self._request( "post", "/v1/test_helpers/test_clocks", api_mode="V1", @@ -158,7 +158,7 @@ def advance( """ return cast( TestClock, - self._requestor.request( + self._request( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( test_clock=sanitize_id(test_clock), diff --git a/stripe/test_helpers/issuing/_authorization_service.py b/stripe/test_helpers/issuing/_authorization_service.py index 8cfa65dd4..8d5885062 100644 --- a/stripe/test_helpers/issuing/_authorization_service.py +++ b/stripe/test_helpers/issuing/_authorization_service.py @@ -355,7 +355,7 @@ def create( """ return cast( Authorization, - self._requestor.request( + self._request( "post", "/v1/test_helpers/issuing/authorizations", api_mode="V1", @@ -376,7 +376,7 @@ def capture( """ return cast( Authorization, - self._requestor.request( + self._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( authorization=sanitize_id(authorization), @@ -399,7 +399,7 @@ def expire( """ return cast( Authorization, - self._requestor.request( + self._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( authorization=sanitize_id(authorization), @@ -422,7 +422,7 @@ def increment( """ return cast( Authorization, - self._requestor.request( + self._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( authorization=sanitize_id(authorization), @@ -445,7 +445,7 @@ def reverse( """ return cast( Authorization, - self._requestor.request( + self._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( authorization=sanitize_id(authorization), diff --git a/stripe/test_helpers/issuing/_card_service.py b/stripe/test_helpers/issuing/_card_service.py index 20e44dfdd..3a1dd9e82 100644 --- a/stripe/test_helpers/issuing/_card_service.py +++ b/stripe/test_helpers/issuing/_card_service.py @@ -44,7 +44,7 @@ def deliver_card( """ return cast( Card, - self._requestor.request( + self._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( card=sanitize_id(card), @@ -67,7 +67,7 @@ def fail_card( """ return cast( Card, - self._requestor.request( + self._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( card=sanitize_id(card), @@ -90,7 +90,7 @@ def return_card( """ return cast( Card, - self._requestor.request( + self._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( card=sanitize_id(card), @@ -113,7 +113,7 @@ def ship_card( """ return cast( Card, - self._requestor.request( + self._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( card=sanitize_id(card), diff --git a/stripe/test_helpers/issuing/_transaction_service.py b/stripe/test_helpers/issuing/_transaction_service.py index d3caba7cb..f706b5112 100644 --- a/stripe/test_helpers/issuing/_transaction_service.py +++ b/stripe/test_helpers/issuing/_transaction_service.py @@ -402,7 +402,7 @@ def refund( """ return cast( Transaction, - self._requestor.request( + self._request( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( transaction=sanitize_id(transaction), @@ -424,7 +424,7 @@ def create_force_capture( """ return cast( Transaction, - self._requestor.request( + self._request( "post", "/v1/test_helpers/issuing/transactions/create_force_capture", api_mode="V1", @@ -444,7 +444,7 @@ def create_unlinked_refund( """ return cast( Transaction, - self._requestor.request( + self._request( "post", "/v1/test_helpers/issuing/transactions/create_unlinked_refund", api_mode="V1", diff --git a/stripe/test_helpers/terminal/_reader_service.py b/stripe/test_helpers/terminal/_reader_service.py index 2c207341c..2ad9b9e00 100644 --- a/stripe/test_helpers/terminal/_reader_service.py +++ b/stripe/test_helpers/terminal/_reader_service.py @@ -58,7 +58,7 @@ def present_payment_method( """ return cast( Reader, - self._requestor.request( + self._request( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( reader=sanitize_id(reader), diff --git a/stripe/test_helpers/treasury/_inbound_transfer_service.py b/stripe/test_helpers/treasury/_inbound_transfer_service.py index 31b8316a3..ba6fba9e3 100644 --- a/stripe/test_helpers/treasury/_inbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_inbound_transfer_service.py @@ -52,7 +52,7 @@ def fail( """ return cast( InboundTransfer, - self._requestor.request( + self._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( id=sanitize_id(id), @@ -75,7 +75,7 @@ def return_inbound_transfer( """ return cast( InboundTransfer, - self._requestor.request( + self._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( id=sanitize_id(id), @@ -98,7 +98,7 @@ def succeed( """ return cast( InboundTransfer, - self._requestor.request( + self._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( id=sanitize_id(id), diff --git a/stripe/test_helpers/treasury/_outbound_payment_service.py b/stripe/test_helpers/treasury/_outbound_payment_service.py index d1e1a5c96..5e615c137 100644 --- a/stripe/test_helpers/treasury/_outbound_payment_service.py +++ b/stripe/test_helpers/treasury/_outbound_payment_service.py @@ -52,7 +52,7 @@ def fail( """ return cast( OutboundPayment, - self._requestor.request( + self._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( id=sanitize_id(id), @@ -75,7 +75,7 @@ def post( """ return cast( OutboundPayment, - self._requestor.request( + self._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( id=sanitize_id(id), @@ -98,7 +98,7 @@ def return_outbound_payment( """ return cast( OutboundPayment, - self._requestor.request( + self._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( id=sanitize_id(id), diff --git a/stripe/test_helpers/treasury/_outbound_transfer_service.py b/stripe/test_helpers/treasury/_outbound_transfer_service.py index 356b1b270..66697b587 100644 --- a/stripe/test_helpers/treasury/_outbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_outbound_transfer_service.py @@ -52,7 +52,7 @@ def fail( """ return cast( OutboundTransfer, - self._requestor.request( + self._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( outbound_transfer=sanitize_id(outbound_transfer), @@ -75,7 +75,7 @@ def post( """ return cast( OutboundTransfer, - self._requestor.request( + self._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( outbound_transfer=sanitize_id(outbound_transfer), @@ -98,7 +98,7 @@ def return_outbound_transfer( """ return cast( OutboundTransfer, - self._requestor.request( + self._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( outbound_transfer=sanitize_id(outbound_transfer), diff --git a/stripe/test_helpers/treasury/_received_credit_service.py b/stripe/test_helpers/treasury/_received_credit_service.py index 7cec7958d..53b9e5ab9 100644 --- a/stripe/test_helpers/treasury/_received_credit_service.py +++ b/stripe/test_helpers/treasury/_received_credit_service.py @@ -76,7 +76,7 @@ def create( """ return cast( ReceivedCredit, - self._requestor.request( + self._request( "post", "/v1/test_helpers/treasury/received_credits", api_mode="V1", diff --git a/stripe/test_helpers/treasury/_received_debit_service.py b/stripe/test_helpers/treasury/_received_debit_service.py index 7b35c298d..f33626cbf 100644 --- a/stripe/test_helpers/treasury/_received_debit_service.py +++ b/stripe/test_helpers/treasury/_received_debit_service.py @@ -76,7 +76,7 @@ def create( """ return cast( ReceivedDebit, - self._requestor.request( + self._request( "post", "/v1/test_helpers/treasury/received_debits", api_mode="V1", diff --git a/stripe/treasury/_credit_reversal_service.py b/stripe/treasury/_credit_reversal_service.py index 425f61a28..96c4e1812 100644 --- a/stripe/treasury/_credit_reversal_service.py +++ b/stripe/treasury/_credit_reversal_service.py @@ -70,7 +70,7 @@ def list( """ return cast( ListObject[CreditReversal], - self._requestor.request( + self._request( "get", "/v1/treasury/credit_reversals", api_mode="V1", @@ -90,7 +90,7 @@ def create( """ return cast( CreditReversal, - self._requestor.request( + self._request( "post", "/v1/treasury/credit_reversals", api_mode="V1", @@ -111,7 +111,7 @@ def retrieve( """ return cast( CreditReversal, - self._requestor.request( + self._request( "get", "/v1/treasury/credit_reversals/{credit_reversal}".format( credit_reversal=sanitize_id(credit_reversal), diff --git a/stripe/treasury/_debit_reversal_service.py b/stripe/treasury/_debit_reversal_service.py index 3cbe8c0f9..8b8542213 100644 --- a/stripe/treasury/_debit_reversal_service.py +++ b/stripe/treasury/_debit_reversal_service.py @@ -74,7 +74,7 @@ def list( """ return cast( ListObject[DebitReversal], - self._requestor.request( + self._request( "get", "/v1/treasury/debit_reversals", api_mode="V1", @@ -94,7 +94,7 @@ def create( """ return cast( DebitReversal, - self._requestor.request( + self._request( "post", "/v1/treasury/debit_reversals", api_mode="V1", @@ -115,7 +115,7 @@ def retrieve( """ return cast( DebitReversal, - self._requestor.request( + self._request( "get", "/v1/treasury/debit_reversals/{debit_reversal}".format( debit_reversal=sanitize_id(debit_reversal), diff --git a/stripe/treasury/_financial_account_features_service.py b/stripe/treasury/_financial_account_features_service.py index a7ed8d3c4..4e2a7370a 100644 --- a/stripe/treasury/_financial_account_features_service.py +++ b/stripe/treasury/_financial_account_features_service.py @@ -174,7 +174,7 @@ def create( """ return cast( FinancialAccountFeatures, - self._requestor.request( + self._request( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account), @@ -197,7 +197,7 @@ def list( """ return cast( FinancialAccountFeatures, - self._requestor.request( + self._request( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account), diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index e2a915910..ba6ec9604 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -418,7 +418,7 @@ def list( """ return cast( ListObject[FinancialAccount], - self._requestor.request( + self._request( "get", "/v1/treasury/financial_accounts", api_mode="V1", @@ -438,7 +438,7 @@ def create( """ return cast( FinancialAccount, - self._requestor.request( + self._request( "post", "/v1/treasury/financial_accounts", api_mode="V1", @@ -459,7 +459,7 @@ def retrieve( """ return cast( FinancialAccount, - self._requestor.request( + self._request( "get", "/v1/treasury/financial_accounts/{financial_account}".format( financial_account=sanitize_id(financial_account), @@ -482,7 +482,7 @@ def update( """ return cast( FinancialAccount, - self._requestor.request( + self._request( "post", "/v1/treasury/financial_accounts/{financial_account}".format( financial_account=sanitize_id(financial_account), diff --git a/stripe/treasury/_inbound_transfer_service.py b/stripe/treasury/_inbound_transfer_service.py index 715869c2e..406612e21 100644 --- a/stripe/treasury/_inbound_transfer_service.py +++ b/stripe/treasury/_inbound_transfer_service.py @@ -94,7 +94,7 @@ def list( """ return cast( ListObject[InboundTransfer], - self._requestor.request( + self._request( "get", "/v1/treasury/inbound_transfers", api_mode="V1", @@ -114,7 +114,7 @@ def create( """ return cast( InboundTransfer, - self._requestor.request( + self._request( "post", "/v1/treasury/inbound_transfers", api_mode="V1", @@ -135,7 +135,7 @@ def retrieve( """ return cast( InboundTransfer, - self._requestor.request( + self._request( "get", "/v1/treasury/inbound_transfers/{id}".format( id=sanitize_id(id), @@ -158,7 +158,7 @@ def cancel( """ return cast( InboundTransfer, - self._requestor.request( + self._request( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( inbound_transfer=sanitize_id(inbound_transfer), diff --git a/stripe/treasury/_outbound_payment_service.py b/stripe/treasury/_outbound_payment_service.py index 4c407e78c..eca51c4c6 100644 --- a/stripe/treasury/_outbound_payment_service.py +++ b/stripe/treasury/_outbound_payment_service.py @@ -240,7 +240,7 @@ def list( """ return cast( ListObject[OutboundPayment], - self._requestor.request( + self._request( "get", "/v1/treasury/outbound_payments", api_mode="V1", @@ -260,7 +260,7 @@ def create( """ return cast( OutboundPayment, - self._requestor.request( + self._request( "post", "/v1/treasury/outbound_payments", api_mode="V1", @@ -281,7 +281,7 @@ def retrieve( """ return cast( OutboundPayment, - self._requestor.request( + self._request( "get", "/v1/treasury/outbound_payments/{id}".format( id=sanitize_id(id), @@ -304,7 +304,7 @@ def cancel( """ return cast( OutboundPayment, - self._requestor.request( + self._request( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( id=sanitize_id(id), diff --git a/stripe/treasury/_outbound_transfer_service.py b/stripe/treasury/_outbound_transfer_service.py index 9891948c6..694de227e 100644 --- a/stripe/treasury/_outbound_transfer_service.py +++ b/stripe/treasury/_outbound_transfer_service.py @@ -114,7 +114,7 @@ def list( """ return cast( ListObject[OutboundTransfer], - self._requestor.request( + self._request( "get", "/v1/treasury/outbound_transfers", api_mode="V1", @@ -134,7 +134,7 @@ def create( """ return cast( OutboundTransfer, - self._requestor.request( + self._request( "post", "/v1/treasury/outbound_transfers", api_mode="V1", @@ -155,7 +155,7 @@ def retrieve( """ return cast( OutboundTransfer, - self._requestor.request( + self._request( "get", "/v1/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(outbound_transfer), @@ -178,7 +178,7 @@ def cancel( """ return cast( OutboundTransfer, - self._requestor.request( + self._request( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( outbound_transfer=sanitize_id(outbound_transfer), diff --git a/stripe/treasury/_received_credit_service.py b/stripe/treasury/_received_credit_service.py index 3a3ac3e0f..96a3f003c 100644 --- a/stripe/treasury/_received_credit_service.py +++ b/stripe/treasury/_received_credit_service.py @@ -66,7 +66,7 @@ def list( """ return cast( ListObject[ReceivedCredit], - self._requestor.request( + self._request( "get", "/v1/treasury/received_credits", api_mode="V1", @@ -87,7 +87,7 @@ def retrieve( """ return cast( ReceivedCredit, - self._requestor.request( + self._request( "get", "/v1/treasury/received_credits/{id}".format( id=sanitize_id(id) diff --git a/stripe/treasury/_received_debit_service.py b/stripe/treasury/_received_debit_service.py index a2cfbc668..03d9d8666 100644 --- a/stripe/treasury/_received_debit_service.py +++ b/stripe/treasury/_received_debit_service.py @@ -52,7 +52,7 @@ def list( """ return cast( ListObject[ReceivedDebit], - self._requestor.request( + self._request( "get", "/v1/treasury/received_debits", api_mode="V1", @@ -73,7 +73,7 @@ def retrieve( """ return cast( ReceivedDebit, - self._requestor.request( + self._request( "get", "/v1/treasury/received_debits/{id}".format(id=sanitize_id(id)), api_mode="V1", diff --git a/stripe/treasury/_transaction_entry_service.py b/stripe/treasury/_transaction_entry_service.py index 09993c11a..2122e4fee 100644 --- a/stripe/treasury/_transaction_entry_service.py +++ b/stripe/treasury/_transaction_entry_service.py @@ -96,7 +96,7 @@ def list( """ return cast( ListObject[TransactionEntry], - self._requestor.request( + self._request( "get", "/v1/treasury/transaction_entries", api_mode="V1", @@ -117,7 +117,7 @@ def retrieve( """ return cast( TransactionEntry, - self._requestor.request( + self._request( "get", "/v1/treasury/transaction_entries/{id}".format( id=sanitize_id(id), diff --git a/stripe/treasury/_transaction_service.py b/stripe/treasury/_transaction_service.py index 41eb7acf6..f51d713e6 100644 --- a/stripe/treasury/_transaction_service.py +++ b/stripe/treasury/_transaction_service.py @@ -107,7 +107,7 @@ def list( """ return cast( ListObject[Transaction], - self._requestor.request( + self._request( "get", "/v1/treasury/transactions", api_mode="V1", @@ -128,7 +128,7 @@ def retrieve( """ return cast( Transaction, - self._requestor.request( + self._request( "get", "/v1/treasury/transactions/{id}".format(id=sanitize_id(id)), api_mode="V1", diff --git a/tests/http_client_mock.py b/tests/http_client_mock.py index 8e3745819..27631fd76 100644 --- a/tests/http_client_mock.py +++ b/tests/http_client_mock.py @@ -2,7 +2,7 @@ from typing import List import stripe -from urllib.parse import urlsplit, urlencode +from urllib.parse import urlsplit, urlencode, parse_qsl import json from unittest.mock import Mock @@ -11,9 +11,7 @@ def parse_and_sort(query_string, strict_parsing=False): """ Helper function to parse a query string and return a sorted list of tuples. """ - return sorted( - stripe.util.parse_qsl(query_string, strict_parsing=strict_parsing) - ) + return sorted(parse_qsl(query_string, strict_parsing=strict_parsing)) def extract_api_base(abs_url): @@ -30,12 +28,14 @@ def __init__( abs_url=None, headers=None, post_data=None, + usage=None, max_network_retries=None, ): self.method = method self.abs_url = abs_url self.headers = headers self.post_data = post_data + self.usage = usage self.max_network_retries = max_network_retries @classmethod @@ -45,6 +45,7 @@ def from_mock_call(cls, mock_call): abs_url=mock_call[0][1], headers=mock_call[0][2], post_data=mock_call[0][3], + usage=mock_call[1]["_usage"], max_network_retries=mock_call[1]["max_network_retries"], ) @@ -77,6 +78,7 @@ def check( extra_headers=None, post_data=None, is_json=False, + usage=None, max_network_retries=None, ): # METHOD @@ -108,6 +110,8 @@ def check( self.assert_header("User-Agent", user_agent) if extra_headers is not None: self.assert_extra_headers(extra_headers) + if usage is not None: + self.assert_usage(usage) # BODY if post_data is not None: @@ -186,6 +190,12 @@ def assert_extra_headers(self, expected): % (header, value, actual_value) ) + def assert_usage(self, expected): + if self.usage != expected: + raise AssertionError( + "Expected usage to be %s, got %s" % (expected, self.usage) + ) + def assert_post_data(self, expected, is_json=False): actual_data = self.post_data expected_data = expected @@ -202,17 +212,27 @@ def assert_post_data(self, expected, is_json=False): class HTTPClientMock(object): - def __init__(self, mocker, is_streaming=False): - self.mock_client = mocker.Mock( - wraps=stripe.http_client.new_default_http_client() - ) + def __init__(self, mocker, is_streaming=False, is_async=False): + if is_async: + self.mock_client = mocker.Mock( + wraps=stripe.http_client.new_default_http_client_async() + ) + else: + self.mock_client = mocker.Mock( + wraps=stripe.http_client.new_default_http_client() + ) + + self.is_async = is_async self.mock_client._verify_ssl_certs = True self.mock_client.name = "mockclient" - self.func = ( - self.mock_client.request_with_retries - if not is_streaming - else self.mock_client.request_stream_with_retries - ) + if is_async and is_streaming: + self.func = self.mock_client.request_stream_with_retries_async + elif is_async and not is_streaming: + self.func = self.mock_client.request_with_retries_async + elif is_streaming: + self.func = self.mock_client.request_stream_with_retries + else: + self.func = self.mock_client.request_with_retries self.registered_responses = {} def get_mock_http_client(self) -> Mock: @@ -247,12 +267,21 @@ def custom_side_effect(called_method, called_abs_url, *args, **kwargs): (called_method, called_path, called_query) ] + async def awaitable(x): + return x + self.registered_responses[ (method, path, urlencode(parse_and_sort(query_string))) ] = ( - rbody, - rcode, - rheaders, + awaitable( + ( + rbody, + rcode, + rheaders, + ) + ) + if self.is_async + else (rbody, rcode, rheaders) ) self.func.side_effect = custom_side_effect @@ -305,6 +334,7 @@ def assert_requested( extra_headers=None, post_data=None, is_json=False, + usage=None, max_network_retries=None, ) -> None: if abs_url and (api_base or path or query_string): @@ -334,6 +364,7 @@ def assert_requested( extra_headers=extra_headers, post_data=post_data, is_json=is_json, + usage=usage, max_network_retries=max_network_retries, ) diff --git a/tests/test_stripe_client.py b/tests/test_stripe_client.py index c04e9e6fe..6abfe396b 100644 --- a/tests/test_stripe_client.py +++ b/tests/test_stripe_client.py @@ -372,3 +372,34 @@ def test_prefers_max_network_retries_in_request_options( api_key="sk_test_123", max_network_retries=0, ) + + def test_stripe_client_sends_usage( + self, stripe_mock_stripe_client, http_client_mock + ): + path = "/v1/customers/cus_xxxxxxxxxxxxx" + http_client_mock.stub_request( + "get", + path=path, + rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', + rcode=200, + rheaders={}, + ) + + customer = stripe_mock_stripe_client.customers.retrieve( + "cus_xxxxxxxxxxxxx" + ) + + http_client_mock.assert_requested( + "get", path=path, usage=["stripe_client"] + ) + + http_client_mock.stub_request( + "delete", + path=path, + rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer", "deleted": true}', + rcode=200, + rheaders={}, + ) + + customer.delete() + http_client_mock.assert_requested("delete", path=path, usage=None) From 1a668a1e7b7ec2f3d91550d66fe742b67251ba34 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 13:38:16 -0800 Subject: [PATCH 007/179] Update generated code (#1225) * Update generated code for v810 * Update generated code for v812 * Update generated code for v812 * Update generated code for v813 * Update generated code for v813 * Update generated code for v814 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 12 +++-- stripe/_account_service.py | 10 ++++ stripe/_charge.py | 3 +- stripe/_payment_intent.py | 61 ++++++++++++++++++++++-- stripe/_payment_intent_service.py | 48 +++++++++++++++++-- stripe/_payment_method.py | 5 +- stripe/_payment_method_service.py | 2 +- stripe/_setup_intent.py | 6 +-- stripe/_setup_intent_service.py | 6 +-- stripe/_subscription.py | 8 ++++ stripe/_subscription_schedule.py | 25 ++++++++++ stripe/_subscription_schedule_service.py | 16 +++++++ stripe/_subscription_service.py | 8 ++++ stripe/_tax_id.py | 30 +++++++++++- stripe/identity/_verification_report.py | 2 +- 16 files changed, 220 insertions(+), 24 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 70e65014b..2fd2b0687 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v807 \ No newline at end of file +v814 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 25af3088a..4795e9748 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -27,6 +27,7 @@ from stripe._card import Card from stripe._file import File from stripe._login_link import LoginLink + from stripe._tax_id import TaxId @nested_resource_class_methods("capability") @@ -934,6 +935,12 @@ class Dashboard(StripeObject): The timezone used in the Stripe Dashboard for this account. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). """ + class Invoices(StripeObject): + default_account_tax_ids: Optional[List[ExpandableField["TaxId"]]] + """ + The list of default Account Tax IDs to automatically include on invoices. Account Tax IDs get added when an invoice is finalized. + """ + class Payments(StripeObject): statement_descriptor: Optional[str] """ @@ -1015,6 +1022,7 @@ class TosAcceptance(StripeObject): card_issuing: Optional[CardIssuing] card_payments: CardPayments dashboard: Dashboard + invoices: Optional[Invoices] payments: Payments payouts: Optional[Payouts] sepa_debit_payments: Optional[SepaDebitPayments] @@ -1025,6 +1033,7 @@ class TosAcceptance(StripeObject): "card_issuing": CardIssuing, "card_payments": CardPayments, "dashboard": Dashboard, + "invoices": Invoices, "payments": Payments, "payouts": Payouts, "sepa_debit_payments": SepaDebitPayments, @@ -3886,9 +3895,6 @@ def reject( # pyright: ignore[reportGeneralTypeIssues] ), ) - # We are not adding a helper for capabilities here as the Account object already has a - # capabilities property which is a hash and not the sub-list of capabilities. - @classmethod def retrieve(cls, id=None, **params) -> "Account": instance = cls(id, **params) diff --git a/stripe/_account_service.py b/stripe/_account_service.py index cf555557d..492e334ce 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -2836,6 +2836,10 @@ class UpdateParamsSettings(TypedDict): """ Settings specific to card charging on the account. """ + invoices: NotRequired["AccountService.UpdateParamsSettingsInvoices"] + """ + Settings specific to the account's use of Invoices. + """ payments: NotRequired["AccountService.UpdateParamsSettingsPayments"] """ Settings that apply across payment methods for charging on the account. @@ -2925,6 +2929,12 @@ class UpdateParamsSettingsCardPaymentsDeclineOn(TypedDict): Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. """ + class UpdateParamsSettingsInvoices(TypedDict): + default_account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The list of default Account Tax IDs to automatically include on invoices. Account Tax IDs get added when an invoice is finalized. + """ + class UpdateParamsSettingsPayments(TypedDict): statement_descriptor: NotRequired["str"] """ diff --git a/stripe/_charge.py b/stripe/_charge.py index f0e830fff..a8822ff21 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1313,11 +1313,12 @@ class P24(StripeObject): "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", + "velobank", "volkswagen_bank", ] ] """ - The customer's bank. Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. + The customer's bank. Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `velobank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. """ reference: Optional[str] """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index ec4bde097..d625333b8 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1056,7 +1056,14 @@ class Bancontact(StripeObject): """ class Blik(StripeObject): - pass + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ class Boleto(StripeObject): expires_after_days: int @@ -1219,6 +1226,10 @@ class MandateOptions(StripeObject): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + require_cvc_recollection: Optional[bool] + """ + When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + """ setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] @@ -2443,7 +2454,7 @@ class ConfirmParamsPaymentMethodDataOxxo(TypedDict): class ConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. @@ -2887,6 +2898,16 @@ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ + setup_future_usage: NotRequired["Literal['']|Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired["int"] @@ -2971,6 +2992,10 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + require_cvc_recollection: NotRequired["bool"] + """ + When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] @@ -4362,7 +4387,7 @@ class CreateParamsPaymentMethodDataOxxo(TypedDict): class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. @@ -4806,6 +4831,16 @@ class CreateParamsPaymentMethodOptionsBlik(TypedDict): """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ + setup_future_usage: NotRequired["Literal['']|Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired["int"] @@ -4890,6 +4925,10 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + require_cvc_recollection: NotRequired["bool"] + """ + When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] @@ -6283,7 +6322,7 @@ class ModifyParamsPaymentMethodDataOxxo(TypedDict): class ModifyParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. @@ -6727,6 +6766,16 @@ class ModifyParamsPaymentMethodOptionsBlik(TypedDict): """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ + setup_future_usage: NotRequired["Literal['']|Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ class ModifyParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired["int"] @@ -6811,6 +6860,10 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + require_cvc_recollection: NotRequired["bool"] + """ + When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 003f98755..aa5ec6594 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -663,7 +663,7 @@ class ConfirmParamsPaymentMethodDataOxxo(TypedDict): class ConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. @@ -1107,6 +1107,16 @@ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ + setup_future_usage: NotRequired["Literal['']|Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired["int"] @@ -1191,6 +1201,10 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + require_cvc_recollection: NotRequired["bool"] + """ + When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] @@ -2606,7 +2620,7 @@ class CreateParamsPaymentMethodDataOxxo(TypedDict): class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. @@ -3050,6 +3064,16 @@ class CreateParamsPaymentMethodOptionsBlik(TypedDict): """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ + setup_future_usage: NotRequired["Literal['']|Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired["int"] @@ -3134,6 +3158,10 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + require_cvc_recollection: NotRequired["bool"] + """ + When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] @@ -4579,7 +4607,7 @@ class UpdateParamsPaymentMethodDataOxxo(TypedDict): class UpdateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. @@ -5023,6 +5051,16 @@ class UpdateParamsPaymentMethodOptionsBlik(TypedDict): """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ + setup_future_usage: NotRequired["Literal['']|Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ class UpdateParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired["int"] @@ -5107,6 +5145,10 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + require_cvc_recollection: NotRequired["bool"] + """ + When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 230ad569a..4080c1ff5 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -176,7 +176,7 @@ class Networks(StripeObject): """ preferred: Optional[str] """ - The preferred network for the card. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. + The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. """ class ThreeDSecureUsage(StripeObject): @@ -803,6 +803,7 @@ class P24(StripeObject): "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", + "velobank", "volkswagen_bank", ] ] @@ -1385,7 +1386,7 @@ class CreateParamsOxxo(TypedDict): class CreateParamsP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index faacc1703..6b4933e59 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -420,7 +420,7 @@ class CreateParamsOxxo(TypedDict): class CreateParamsP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index fc7708e70..f7a95b46f 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -1106,7 +1106,7 @@ class ConfirmParamsPaymentMethodDataOxxo(TypedDict): class ConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. @@ -2047,7 +2047,7 @@ class CreateParamsPaymentMethodDataOxxo(TypedDict): class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. @@ -2963,7 +2963,7 @@ class ModifyParamsPaymentMethodDataOxxo(TypedDict): class ModifyParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index b26b825d7..289785f85 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -552,7 +552,7 @@ class ConfirmParamsPaymentMethodDataOxxo(TypedDict): class ConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. @@ -1523,7 +1523,7 @@ class CreateParamsPaymentMethodDataOxxo(TypedDict): class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. @@ -2479,7 +2479,7 @@ class UpdateParamsPaymentMethodDataOxxo(TypedDict): class UpdateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'volkswagen_bank']" + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" ] """ The customer's bank. diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 62ed5acf7..36f72b14e 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -708,6 +708,10 @@ class CreateParamsBillingThresholds(TypedDict): """ class CreateParamsInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. + """ issuer: NotRequired["Subscription.CreateParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. @@ -1389,6 +1393,10 @@ class ModifyParamsCancellationDetails(TypedDict): """ class ModifyParamsInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. + """ issuer: NotRequired["Subscription.ModifyParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index 103216c64..913c6a37e 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -26,6 +26,7 @@ from stripe._plan import Plan from stripe._price import Price from stripe._subscription import Subscription + from stripe._tax_id import TaxId from stripe._tax_rate import TaxRate from stripe.test_helpers._test_clock import TestClock @@ -98,6 +99,10 @@ class Issuer(StripeObject): Type of the account referenced. """ + account_tax_ids: Optional[List[ExpandableField["TaxId"]]] + """ + The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. + """ days_until_due: Optional[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. @@ -215,6 +220,10 @@ class Issuer(StripeObject): Type of the account referenced. """ + account_tax_ids: Optional[List[ExpandableField["TaxId"]]] + """ + The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + """ days_until_due: Optional[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. @@ -497,6 +506,10 @@ class CreateParamsDefaultSettingsBillingThresholds(TypedDict): """ class CreateParamsDefaultSettingsInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. + """ days_until_due: NotRequired["int"] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. @@ -707,6 +720,10 @@ class CreateParamsPhaseBillingThresholds(TypedDict): """ class CreateParamsPhaseInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + """ days_until_due: NotRequired["int"] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. @@ -1055,6 +1072,10 @@ class ModifyParamsDefaultSettingsBillingThresholds(TypedDict): """ class ModifyParamsDefaultSettingsInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. + """ days_until_due: NotRequired["int"] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. @@ -1269,6 +1290,10 @@ class ModifyParamsPhaseBillingThresholds(TypedDict): """ class ModifyParamsPhaseInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + """ days_until_due: NotRequired["int"] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index 2a932a344..aa592cfc5 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -151,6 +151,10 @@ class CreateParamsDefaultSettingsBillingThresholds(TypedDict): """ class CreateParamsDefaultSettingsInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. + """ days_until_due: NotRequired["int"] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. @@ -361,6 +365,10 @@ class CreateParamsPhaseBillingThresholds(TypedDict): """ class CreateParamsPhaseInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + """ days_until_due: NotRequired["int"] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. @@ -729,6 +737,10 @@ class UpdateParamsDefaultSettingsBillingThresholds(TypedDict): """ class UpdateParamsDefaultSettingsInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. + """ days_until_due: NotRequired["int"] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. @@ -943,6 +955,10 @@ class UpdateParamsPhaseBillingThresholds(TypedDict): """ class UpdateParamsPhaseInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + """ days_until_due: NotRequired["int"] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 3fd4ed487..f0a3bafca 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -315,6 +315,10 @@ class CreateParamsBillingThresholds(TypedDict): """ class CreateParamsInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. + """ issuer: NotRequired[ "SubscriptionService.CreateParamsInvoiceSettingsIssuer" ] @@ -1050,6 +1054,10 @@ class UpdateParamsCancellationDetails(TypedDict): """ class UpdateParamsInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. + """ issuer: NotRequired[ "SubscriptionService.UpdateParamsInvoiceSettingsIssuer" ] diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index aab908670..386d26c0c 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -6,7 +6,11 @@ from stripe._stripe_object import StripeObject from stripe._util import sanitize_id from typing import ClassVar, Optional -from typing_extensions import Literal +from typing_extensions import Literal, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._account import Account + from stripe._application import Application class TaxId(APIResource["TaxId"]): @@ -19,6 +23,24 @@ class TaxId(APIResource["TaxId"]): OBJECT_NAME: ClassVar[Literal["tax_id"]] = "tax_id" + class Owner(StripeObject): + account: Optional[ExpandableField["Account"]] + """ + The account being referenced when `type` is `account`. + """ + application: Optional[ExpandableField["Application"]] + """ + The Connect Application being referenced when `type` is `application`. + """ + customer: Optional[ExpandableField["Customer"]] + """ + The customer being referenced when `type` is `customer`. + """ + type: Literal["account", "application", "customer", "self"] + """ + Type of owner referenced. + """ + class Verification(StripeObject): status: Literal["pending", "unavailable", "unverified", "verified"] """ @@ -57,6 +79,10 @@ class Verification(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ + owner: Optional[Owner] + """ + The account or customer the tax ID belongs to. + """ type: Literal[ "ad_nrt", "ae_trn", @@ -159,4 +185,4 @@ def retrieve(cls, id, **params): "Can't retrieve a tax id without a customer ID. Use customer.retrieve_tax_id('tax_id')" ) - _inner_class_types = {"verification": Verification} + _inner_class_types = {"owner": Owner, "verification": Verification} diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index c1dec98ff..6701de048 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -213,7 +213,7 @@ class Error(StripeObject): """ id_number: Optional[str] """ - ID number. + ID number. When `id_number_type` is `us_ssn`, only the last 4 digits are present. """ id_number_type: Optional[Literal["br_cpf", "sg_nric", "us_ssn"]] """ From 982da302195e563b5abc6e4dbea439e51037d440 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 8 Feb 2024 14:05:17 -0800 Subject: [PATCH 008/179] Bump version to 8.2.0 --- CHANGELOG.md | 10 ++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bd6f4e1e..c70de0127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 8.2.0 - 2024-02-08 +* [#1225](https://github.com/stripe/stripe-python/pull/1225) Update generated code + * Add support for `invoices` on `Account.Settings` + * Add support for new value `velobank` on various enums `PaymentMethodDetails.P24.bank` + * Add support for `setup_future_usage` on `PaymentMethodOptions.Blik` + * Add support for `require_cvc_recollection` on `PaymentMethodOptions.Card` + * Add support for `account_tax_ids` on various `InvoiceSettings` request parameters +* [#1223](https://github.com/stripe/stripe-python/pull/1223) Move StripeClient usage collection onto StripeService +* [#1220](https://github.com/stripe/stripe-python/pull/1220) Measure StripeClient usage + ## 8.1.0 - 2024-02-01 * [#1213](https://github.com/stripe/stripe-python/pull/1213) Update generated code * Add support for `swish` payment method throughout the API diff --git a/VERSION b/VERSION index 8104cabd3..fbb9ea12d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.1.0 +8.2.0 diff --git a/stripe/_version.py b/stripe/_version.py index 3bbed43f6..c0a494d88 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "8.1.0" +VERSION = "8.2.0" From 6b0d81ec19acce86eb88b0fa008a89747ff2d9d7 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Tue, 13 Feb 2024 13:34:33 -0800 Subject: [PATCH 009/179] Improve types in _http_client.py (#1232) --- flake8_stripe/flake8_stripe.py | 2 +- stripe/_api_requestor.py | 17 ++- stripe/_http_client.py | 271 +++++++++++++++++++++++++++------ 3 files changed, 235 insertions(+), 55 deletions(-) diff --git a/flake8_stripe/flake8_stripe.py b/flake8_stripe/flake8_stripe.py index 1b012be43..16750f997 100644 --- a/flake8_stripe/flake8_stripe.py +++ b/flake8_stripe/flake8_stripe.py @@ -52,7 +52,7 @@ class TypingImportsChecker: "Mapping", "Tuple", "Iterator", - "Mapping", + "MutableMapping", "Set", "Callable", "Generator", diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index 6dd202478..a1c29edb1 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -345,24 +345,27 @@ def request_headers(self, method, options: RequestOptions): if stripe.app_info: ua["application"] = stripe.app_info - headers: Dict[str, Optional[str]] = { + headers: Dict[str, str] = { "X-Stripe-Client-User-Agent": json.dumps(ua), "User-Agent": user_agent, "Authorization": "Bearer %s" % (options.get("api_key"),), } - if options.get("stripe_account"): - headers["Stripe-Account"] = options.get("stripe_account") + stripe_account = options.get("stripe_account") + if stripe_account: + headers["Stripe-Account"] = stripe_account - if options.get("idempotency_key"): - headers["Idempotency-Key"] = options.get("idempotency_key") + idempotency_key = options.get("idempotency_key") + if idempotency_key: + headers["Idempotency-Key"] = idempotency_key if method == "post": headers.setdefault("Idempotency-Key", str(uuid.uuid4())) headers["Content-Type"] = "application/x-www-form-urlencoded" - if options.get("stripe_version"): - headers["Stripe-Version"] = options.get("stripe_version") + stripe_version = options.get("stripe_version") + if stripe_version: + headers["Stripe-Version"] = stripe_version return headers diff --git a/stripe/_http_client.py b/stripe/_http_client.py index 0929bfd7c..d70521283 100644 --- a/stripe/_http_client.py +++ b/stripe/_http_client.py @@ -1,3 +1,4 @@ +from io import BytesIO import sys import textwrap import email @@ -5,6 +6,7 @@ import random import threading import json +from http.client import HTTPResponse # Used for global variables import stripe # noqa: IMP101 @@ -16,13 +18,17 @@ Any, Dict, List, + Mapping, + MutableMapping, Optional, Tuple, ClassVar, Union, cast, + overload, ) from typing_extensions import ( + Literal, NoReturn, TypedDict, ) @@ -45,7 +51,7 @@ try: import requests - from requests import Session + from requests import Session as RequestsSession except ImportError: requests = None else: @@ -141,10 +147,10 @@ def __init__( def _should_retry( self, - response, - api_connection_error, - num_retries, - max_network_retries, + response: Optional[Tuple[Any, int, Optional[Mapping[str, str]]]], + api_connection_error: Optional[APIConnectionError], + num_retries: int, + max_network_retries: Optional[int], ): max_network_retries = ( max_network_retries if max_network_retries is not None else 0 @@ -157,6 +163,7 @@ def _should_retry( # exceptions, but defer this decision to underlying subclass # implementations. They should evaluate the driver-specific # errors worthy of retries, and set flag on the error returned. + assert api_connection_error is not None return api_connection_error.should_retry _, status_code, rheaders = response @@ -185,7 +192,9 @@ def _should_retry( return False - def _retry_after_header(self, response=None): + def _retry_after_header( + self, response: Optional[Tuple[Any, Any, Mapping[str, str]]] = None + ): if response is None: return None _, _, rheaders = response @@ -195,7 +204,11 @@ def _retry_after_header(self, response=None): except (KeyError, ValueError): return None - def _sleep_time_seconds(self, num_retries, response=None): + def _sleep_time_seconds( + self, + num_retries: int, + response: Optional[Tuple[Any, Any, Mapping[str, str]]] = None, + ): # Apply exponential backoff with initial_network_retry_delay on the # number of num_retries so far as inputs. # Do not allow the number to exceed max_network_retry_delay. @@ -216,13 +229,15 @@ def _sleep_time_seconds(self, num_retries, response=None): return sleep_seconds - def _add_jitter_time(self, sleep_seconds): + def _add_jitter_time(self, sleep_seconds: float): # Randomize the value in [(sleep_seconds/ 2) to (sleep_seconds)] # Also separated method here to isolate randomness for tests sleep_seconds *= 0.5 * (1 + random.uniform(0, 1)) return sleep_seconds - def _add_telemetry_header(self, headers): + def _add_telemetry_header( + self, headers: Mapping[str, str] + ) -> Mapping[str, str]: last_request_metrics = getattr( self._thread_local, "last_request_metrics", None ) @@ -230,7 +245,10 @@ def _add_telemetry_header(self, headers): telemetry = { "last_request_metrics": last_request_metrics.payload() } - headers["X-Stripe-Client-Telemetry"] = json.dumps(telemetry) + ret = dict(headers) + ret["X-Stripe-Client-Telemetry"] = json.dumps(telemetry) + return ret + return headers def _record_request_metrics(self, response, request_start, usage): _, _, rheaders = response @@ -246,14 +264,14 @@ class HTTPClient(HTTPClientBase): # TODO: more specific types here would be helpful def request_with_retries( self, - method, - url, - headers, - post_data=None, - max_network_retries=None, + method: str, + url: str, + headers: Mapping[str, str], + post_data: Any = None, + max_network_retries: Optional[int] = None, *, _usage: Optional[List[str]] = None, - ) -> Tuple[Any, int, Any]: + ) -> Tuple[str, int, Mapping[str, str]]: return self._request_with_retries_internal( method, url, @@ -266,14 +284,14 @@ def request_with_retries( def request_stream_with_retries( self, - method, - url, - headers, + method: str, + url: str, + headers: Mapping[str, str], post_data=None, max_network_retries=None, *, _usage: Optional[List[str]] = None, - ) -> Tuple[Any, int, Any]: + ) -> Tuple[Any, int, Mapping[str, str]]: return self._request_with_retries_internal( method, url, @@ -286,16 +304,16 @@ def request_stream_with_retries( def _request_with_retries_internal( self, - method, - url, - headers, - post_data, - is_streaming, - max_network_retries, + method: str, + url: str, + headers: Mapping[str, str], + post_data: Any, + is_streaming: bool, + max_network_retries: Optional[int], *, - _usage=None, - ): - self._add_telemetry_header(headers) + _usage: Optional[List[str]] = None, + ) -> Tuple[Any, int, Mapping[str, str]]: + headers = self._add_telemetry_header(headers) num_retries = 0 @@ -343,14 +361,28 @@ def _request_with_retries_internal( assert connection_error is not None raise connection_error - def request(self, method, url, headers, post_data=None, *, _usage=None): + def request( + self, + method: str, + url: str, + headers: Optional[Mapping[str, str]], + post_data: Any = None, + *, + _usage: Optional[List[str]] = None + ) -> Tuple[str, int, Mapping[str, str]]: raise NotImplementedError( "HTTPClient subclasses must implement `request`" ) def request_stream( - self, method, url, headers, post_data=None, *, _usage=None - ): + self, + method: str, + url: str, + headers: Optional[Mapping[str, str]], + post_data: Any = None, + *, + _usage: Optional[List[str]] = None + ) -> Tuple[Any, int, Mapping[str, str]]: raise NotImplementedError( "HTTPClient subclasses must implement `request_stream`" ) @@ -367,7 +399,7 @@ class RequestsClient(HTTPClient): def __init__( self, timeout: int = 80, - session: Optional["Session"] = None, + session: Optional["RequestsSession"] = None, verify_ssl_certs: bool = True, proxy: Optional[Union[str, HTTPClient._Proxy]] = None, **kwargs @@ -381,17 +413,58 @@ def __init__( assert requests is not None self.requests = requests - def request(self, method, url, headers, post_data=None): + def request( + self, + method: str, + url: str, + headers: Optional[Mapping[str, str]], + post_data=None, + ) -> Tuple[bytes, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=False ) - def request_stream(self, method, url, headers, post_data=None): + def request_stream( + self, + method: str, + url: str, + headers: Optional[Mapping[str, str]], + post_data=None, + ) -> Tuple[Any, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=True ) - def _request_internal(self, method, url, headers, post_data, is_streaming): + @overload + def _request_internal( + self, + method: str, + url: str, + headers: Optional[Mapping[str, str]], + post_data, + is_streaming: Literal[True], + ) -> Tuple[Any, int, Mapping[str, str]]: + ... + + @overload + def _request_internal( + self, + method: str, + url: str, + headers: Optional[Mapping[str, str]], + post_data, + is_streaming: Literal[False], + ) -> Tuple[bytes, int, Mapping[str, str]]: + ... + + def _request_internal( + self, + method: str, + url: str, + headers: Optional[Mapping[str, str]], + post_data, + is_streaming: bool, + ) -> Tuple[Union[bytes, Any], int, Mapping[str, str]]: kwargs = {} if self._verify_ssl_certs: kwargs["verify"] = stripe.ca_bundle_path @@ -411,7 +484,9 @@ def _request_internal(self, method, url, headers, post_data, is_streaming): try: try: - result = self._thread_local.session.request( + result = cast( + "RequestsSession", self._thread_local.session + ).request( method, url, headers=headers, @@ -533,17 +608,50 @@ def __init__( assert urlfetch is not None self.urlfetch = urlfetch - def request(self, method, url, headers, post_data=None): + def request( + self, method: str, url: str, headers: Mapping[str, str], post_data=None + ) -> Tuple[str, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=False ) - def request_stream(self, method, url, headers, post_data=None): + def request_stream( + self, method: str, url: str, headers: Mapping[str, str], post_data=None + ) -> Tuple[BytesIO, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=True ) - def _request_internal(self, method, url, headers, post_data, is_streaming): + @overload + def _request_internal( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data, + is_streaming: Literal[True], + ) -> Tuple[BytesIO, int, Any]: + ... + + @overload + def _request_internal( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data, + is_streaming: Literal[False], + ) -> Tuple[str, int, Any]: + ... + + def _request_internal( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data, + is_streaming, + ): try: result = self.urlfetch.fetch( url=url, @@ -560,6 +668,7 @@ def _request_internal(self, method, url, headers, post_data, is_streaming): self._handle_request_error(e, url) if is_streaming: + # This doesn't really stream. content = _util.io.BytesIO(str.encode(result.content)) else: content = result.content @@ -634,17 +743,50 @@ def parse_headers(self, data): headers = email.message_from_string(raw_headers) return dict((k.lower(), v) for k, v in dict(headers).items()) - def request(self, method, url, headers, post_data=None): + def request( + self, method, url, headers: Mapping[str, str], post_data=None + ) -> Tuple[str, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=False ) - def request_stream(self, method, url, headers, post_data=None): + def request_stream( + self, method, url, headers: Mapping[str, str], post_data=None + ) -> Tuple[BytesIO, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=True ) - def _request_internal(self, method, url, headers, post_data, is_streaming): + @overload + def _request_internal( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data, + is_streaming: Literal[True], + ) -> Tuple[BytesIO, int, Any]: + ... + + @overload + def _request_internal( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data, + is_streaming: Literal[False], + ) -> Tuple[str, int, Mapping[str, str]]: + ... + + def _request_internal( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data, + is_streaming, + ) -> Tuple[Union[str, BytesIO], int, Mapping[str, str]]: b = _util.io.BytesIO() rheaders = _util.io.BytesIO() @@ -777,21 +919,56 @@ def __init__( ) self._opener = urllibrequest.build_opener(proxy_handler) - def request(self, method, url, headers, post_data=None): + def request( + self, method: str, url: str, headers: Mapping[str, str], post_data=None + ) -> Tuple[str, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=False ) - def request_stream(self, method, url, headers, post_data=None): + def request_stream( + self, method: str, url: str, headers: Mapping[str, str], post_data=None + ) -> Tuple[HTTPResponse, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=True ) - def _request_internal(self, method, url, headers, post_data, is_streaming): + @overload + def _request_internal( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data, + is_streaming: Literal[False], + ) -> Tuple[str, int, Any]: + ... + + @overload + def _request_internal( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data, + is_streaming: Literal[True], + ) -> Tuple[HTTPResponse, int, Any]: + ... + + def _request_internal( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data, + is_streaming, + ): if isinstance(post_data, str): post_data = post_data.encode("utf-8") - req = urllibrequest.Request(url, post_data, headers) + req = urllibrequest.Request( + url, post_data, cast(MutableMapping[str, str], headers) + ) if method not in ("get", "post"): req.get_method = lambda: method.upper() From 68a8d665d720a953f4ece72e3f9e28b1027e63a6 Mon Sep 17 00:00:00 2001 From: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:18:57 -0800 Subject: [PATCH 010/179] Remove broken child methods (#1237) --- stripe/_credit_note_line_item.py | 47 +------------ stripe/_customer.py | 16 ++--- stripe/_customer_cash_balance_transaction.py | 70 +------------------- stripe/_ephemeral_key.py | 6 +- stripe/_usage_record.py | 4 +- tests/test_generated_examples.py | 2 +- 6 files changed, 21 insertions(+), 124 deletions(-) diff --git a/stripe/_credit_note_line_item.py b/stripe/_credit_note_line_item.py index 160e8c6dc..f358bc77a 100644 --- a/stripe/_credit_note_line_item.py +++ b/stripe/_credit_note_line_item.py @@ -1,19 +1,16 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField -from stripe._list_object import ListObject -from stripe._listable_api_resource import ListableAPIResource -from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional -from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING +from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._discount import Discount from stripe._tax_rate import TaxRate -class CreditNoteLineItem(ListableAPIResource["CreditNoteLineItem"]): +class CreditNoteLineItem(StripeObject): """ The credit note line item object """ @@ -72,24 +69,6 @@ class TaxAmount(StripeObject): The amount on which tax is calculated, in cents (or local equivalent). """ - class ListParams(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. - """ - amount: int """ The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. @@ -154,28 +133,6 @@ class ListParams(RequestOptions): """ The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts. """ - - @classmethod - def list( - cls, **params: Unpack["CreditNoteLineItem.ListParams"] - ) -> ListObject["CreditNoteLineItem"]: - """ - When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - """ - 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 - _inner_class_types = { "discount_amounts": DiscountAmount, "tax_amounts": TaxAmount, diff --git a/stripe/_customer.py b/stripe/_customer.py index aa49494f8..cc004ff67 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -2061,18 +2061,18 @@ def list_tax_ids( ) @classmethod - def modify_cash_balance( + def retrieve_cash_balance( cls, customer: str, - **params: Unpack["Customer.ModifyCashBalanceParams"] + **params: Unpack["Customer.RetrieveCashBalanceParams"] ) -> "CashBalance": """ - Changes the settings on a customer's cash balance. + Retrieves a customer's cash balance. """ return cast( "CashBalance", cls._static_request( - "post", + "get", "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer) ), @@ -2081,18 +2081,18 @@ def modify_cash_balance( ) @classmethod - def retrieve_cash_balance( + def modify_cash_balance( cls, customer: str, - **params: Unpack["Customer.RetrieveCashBalanceParams"] + **params: Unpack["Customer.ModifyCashBalanceParams"] ) -> "CashBalance": """ - Retrieves a customer's cash balance. + Changes the settings on a customer's cash balance. """ return cast( "CashBalance", cls._static_request( - "get", + "post", "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer) ), diff --git a/stripe/_customer_cash_balance_transaction.py b/stripe/_customer_cash_balance_transaction.py index 32cce2e4e..0983295d1 100644 --- a/stripe/_customer_cash_balance_transaction.py +++ b/stripe/_customer_cash_balance_transaction.py @@ -1,12 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField -from stripe._list_object import ListObject -from stripe._listable_api_resource import ListableAPIResource -from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional -from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING +from typing import ClassVar, Optional +from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction @@ -15,9 +12,7 @@ from stripe._refund import Refund -class CustomerCashBalanceTransaction( - ListableAPIResource["CustomerCashBalanceTransaction"], -): +class CustomerCashBalanceTransaction(StripeObject): """ Customers with certain payments enabled have a cash balance, representing funds that were paid by the customer to a merchant, but have not yet been allocated to a payment. Cash Balance Transactions @@ -145,30 +140,6 @@ class UnappliedFromPayment(StripeObject): The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were unapplied from. """ - class ListParams(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. - """ - - class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] - """ - Specifies which fields in the response should be expanded. - """ - adjusted_for_overdraft: Optional[AdjustedForOverdraft] applied_to_payment: Optional[AppliedToPayment] created: int @@ -221,41 +192,6 @@ class RetrieveParams(RequestOptions): The type of the cash balance transaction. New types may be added in future. See [Customer Balance](https://stripe.com/docs/payments/customer-balance#types) to learn more about these types. """ unapplied_from_payment: Optional[UnappliedFromPayment] - - @classmethod - def list( - cls, **params: Unpack["CustomerCashBalanceTransaction.ListParams"] - ) -> ListObject["CustomerCashBalanceTransaction"]: - """ - Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). - """ - 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 - def retrieve( - cls, - id: str, - **params: Unpack["CustomerCashBalanceTransaction.RetrieveParams"] - ) -> "CustomerCashBalanceTransaction": - """ - Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). - """ - instance = cls(id, **params) - instance.refresh() - return instance - _inner_class_types = { "adjusted_for_overdraft": AdjustedForOverdraft, "applied_to_payment": AppliedToPayment, diff --git a/stripe/_ephemeral_key.py b/stripe/_ephemeral_key.py index 8717ce371..581912159 100644 --- a/stripe/_ephemeral_key.py +++ b/stripe/_ephemeral_key.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._request_options import RequestOptions from stripe._util import class_method_variant, sanitize_id @@ -7,7 +8,10 @@ from typing_extensions import Literal, NotRequired, Unpack -class EphemeralKey(DeletableAPIResource["EphemeralKey"]): +class EphemeralKey( + CreateableAPIResource["EphemeralKey"], + DeletableAPIResource["EphemeralKey"], +): OBJECT_NAME: ClassVar[Literal["ephemeral_key"]] = "ephemeral_key" class DeleteParams(RequestOptions): diff --git a/stripe/_usage_record.py b/stripe/_usage_record.py index d1835ac5d..e9d59a621 100644 --- a/stripe/_usage_record.py +++ b/stripe/_usage_record.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe._api_resource import APIResource +from stripe._createable_api_resource import CreateableAPIResource from typing import ClassVar from typing_extensions import Literal -class UsageRecord(APIResource["UsageRecord"]): +class UsageRecord(CreateableAPIResource["UsageRecord"]): """ Usage records allow you to report customer usage and metrics to Stripe for metered billing of subscription prices. diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 19c0bfd23..623170709 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -726,7 +726,7 @@ def test_accounts_persons_delete_service( def test_accounts_persons_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.list_persons( + stripe.Account.persons( "acct_xxxxxxxxxxxxx", limit=3, ) From da7fd19b0a27a1108cf9a8e9b6d81286cb442c79 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 23:47:43 +0000 Subject: [PATCH 011/179] Update generated code (#1230) * Update generated code for v815 * Update generated code for v817 * Update generated code for v818 * Update generated code for v819 * Update generated code for v820 * Update generated code for v822 * Update generated code for v823 * Update generated code for v826 * Update generated code for v827 * Update generated code for v828 * Update generated code for v829 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_card.py | 10 ++++++++ stripe/_customer.py | 6 +++-- stripe/_customer_service.py | 3 ++- stripe/_customer_tax_id_service.py | 3 ++- stripe/_event.py | 1 + stripe/_invoice.py | 15 +++++++----- stripe/_invoice_line_item.py | 4 ++++ stripe/_invoice_service.py | 7 +++--- stripe/_invoice_upcoming_lines_service.py | 3 ++- stripe/_payment_intent.py | 22 ++++++++---------- stripe/_payment_intent_service.py | 9 ++++---- stripe/_payment_method.py | 28 +++++++++++++++++++++++ stripe/_payment_method_service.py | 24 +++++++++++++++++++ stripe/_setup_intent.py | 8 +++---- stripe/_setup_intent_service.py | 6 ++--- stripe/_subscription.py | 16 ++++++------- stripe/_subscription_service.py | 14 ++++++------ stripe/_tax_id.py | 3 ++- stripe/_token.py | 12 ++++++++++ stripe/_token_service.py | 12 ++++++++++ stripe/_webhook_endpoint.py | 3 ++- stripe/_webhook_endpoint_service.py | 3 ++- stripe/checkout/_session.py | 3 ++- stripe/tax/_calculation.py | 6 +++-- stripe/tax/_calculation_service.py | 3 ++- stripe/tax/_transaction.py | 3 ++- 27 files changed, 166 insertions(+), 63 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 2fd2b0687..5433dd907 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v814 \ No newline at end of file +v829 \ No newline at end of file diff --git a/stripe/_card.py b/stripe/_card.py index 47d00eafc..7a79b0563 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -6,6 +6,7 @@ from stripe._error import InvalidRequestError from stripe._expandable_field import ExpandableField from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast, overload @@ -26,6 +27,12 @@ class Card(DeletableAPIResource["Card"], UpdateableAPIResource["Card"]): OBJECT_NAME: ClassVar[Literal["card"]] = "card" + class Networks(StripeObject): + preferred: Optional[str] + """ + The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. + """ + class DeleteParams(RequestOptions): pass @@ -143,6 +150,7 @@ class DeleteParams(RequestOptions): """ Cardholder name. """ + networks: Optional[Networks] object: Literal["card"] """ String representing the object's type. Objects of the same type share the same value. @@ -261,3 +269,5 @@ def retrieve(cls, id, **params): "stripe.Account.retrieve_external_account('account_id', 'card_id') " "(see https://stripe.com/docs/api/external_account_cards/retrieve)." ) + + _inner_class_types = {"networks": Networks} diff --git a/stripe/_customer.py b/stripe/_customer.py index cc004ff67..9155b77a5 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -549,6 +549,7 @@ class CreateParamsTaxIdDatum(TypedDict): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -572,7 +573,7 @@ class CreateParamsTaxIdDatum(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -645,6 +646,7 @@ class CreateTaxIdParams(RequestOptions): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -668,7 +670,7 @@ class CreateTaxIdParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 1a04f38a6..cc60fea72 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -315,6 +315,7 @@ class CreateParamsTaxIdDatum(TypedDict): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -338,7 +339,7 @@ class CreateParamsTaxIdDatum(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index 6e4a6b22e..839c6c2fc 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -61,6 +61,7 @@ class CreateParams(TypedDict): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -84,7 +85,7 @@ class CreateParams(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_event.py b/stripe/_event.py index eea7e2ab7..1ac83497e 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -226,6 +226,7 @@ class RetrieveParams(RequestOptions): "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", "identity.verification_session.canceled", "identity.verification_session.created", diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 044327f09..883437dbc 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -250,6 +250,7 @@ class CustomerTaxId(StripeObject): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -274,7 +275,7 @@ class CustomerTaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` """ value: Optional[str] """ @@ -595,7 +596,7 @@ class Installments(StripeObject): Literal["any", "automatic", "challenge"] ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ _inner_class_types = {"installments": Installments} @@ -1260,7 +1261,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallments( @@ -1920,7 +1921,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallments( @@ -2573,6 +2574,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -2596,7 +2598,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -3112,6 +3114,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -3135,7 +3138,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 44659793d..44be8a05a 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -127,6 +127,10 @@ class TaxAmount(StripeObject): """ Unique identifier for the object. """ + invoice: Optional[str] + """ + The ID of the invoice that contains this line item. + """ invoice_item: Optional[ExpandableField["InvoiceItem"]] """ The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any. diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index f86a8f879..74ca9dc3e 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -317,7 +317,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallments( @@ -1053,6 +1053,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -1076,7 +1077,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -1588,7 +1589,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallments( diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index 44e8be6e6..144a793e7 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -306,6 +306,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -329,7 +330,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index d625333b8..d207b7816 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -791,7 +791,7 @@ class QrCode(StripeObject): """ mobile_auth_url: Optional[str] """ - The url for mobile redirect based auth + The url for mobile redirect based auth (for internal use only and not typically available in standard API requests). """ qr_code: Optional[QrCode] _inner_class_types = {"qr_code": QrCode} @@ -1224,7 +1224,7 @@ class MandateOptions(StripeObject): Literal["any", "automatic", "challenge"] ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: Optional[bool] """ @@ -2990,7 +2990,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: NotRequired["bool"] """ @@ -4923,7 +4923,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: NotRequired["bool"] """ @@ -6858,7 +6858,7 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: NotRequired["bool"] """ @@ -8084,8 +8084,7 @@ def _cls_confirm( return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment - attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual) - to learn more about manual confirmation. + attempt. """ return cast( "PaymentIntent", @@ -8125,8 +8124,7 @@ def confirm( return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment - attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual) - to learn more about manual confirmation. + attempt. """ ... @@ -8156,8 +8154,7 @@ def confirm( return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment - attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual) - to learn more about manual confirmation. + attempt. """ ... @@ -8187,8 +8184,7 @@ def confirm( # pyright: ignore[reportGeneralTypeIssues] return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment - attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual) - to learn more about manual confirmation. + attempt. """ return cast( "PaymentIntent", diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index aa5ec6594..93e5a5cf7 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -1199,7 +1199,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: NotRequired["bool"] """ @@ -3156,7 +3156,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: NotRequired["bool"] """ @@ -5143,7 +5143,7 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: NotRequired["bool"] """ @@ -6154,8 +6154,7 @@ def confirm( return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment - attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual) - to learn more about manual confirmation. + attempt. """ return cast( PaymentIntent, diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 4080c1ff5..e754b11ba 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -398,6 +398,10 @@ class ShippingAddress(StripeObject): """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ + display_brand: Optional[str] + """ + The brand to use when displaying the card, this accounts for customer's brand choice on dual-branded cards. Can be `american_express`, `cartes_bancaires`, `diners_club`, `discover`, `eftpos_australia`, `interac`, `jcb`, `mastercard`, `union_pay`, `visa`, or `other` and may contain more values in the future. + """ exp_month: int """ Two-digit number representing the card's expiration month. @@ -1282,6 +1286,10 @@ class CreateParamsCard(TypedDict): """ Four-digit number representing the card's expiration year. """ + networks: NotRequired["PaymentMethod.CreateParamsCardNetworks"] + """ + Contains information about card networks used to process the payment. + """ number: NotRequired["str"] """ The card number, as a string without any separators. @@ -1291,6 +1299,14 @@ class CreateParamsCard(TypedDict): For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}. """ + class CreateParamsCardNetworks(TypedDict): + preferred: NotRequired[ + "Literal['cartes_bancaires', 'mastercard', 'visa']" + ] + """ + The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. + """ + class CreateParamsCashapp(TypedDict): pass @@ -1573,6 +1589,18 @@ class ModifyParamsCard(TypedDict): """ Four-digit number representing the card's expiration year. """ + networks: NotRequired["PaymentMethod.ModifyParamsCardNetworks"] + """ + Contains information about card networks used to process the payment. + """ + + class ModifyParamsCardNetworks(TypedDict): + preferred: NotRequired[ + "Literal['']|Literal['cartes_bancaires', 'mastercard', 'visa']" + ] + """ + The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. + """ class ModifyParamsLink(TypedDict): pass diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 6b4933e59..81b8912bf 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -316,6 +316,10 @@ class CreateParamsCard(TypedDict): """ Four-digit number representing the card's expiration year. """ + networks: NotRequired["PaymentMethodService.CreateParamsCardNetworks"] + """ + Contains information about card networks used to process the payment. + """ number: NotRequired["str"] """ The card number, as a string without any separators. @@ -325,6 +329,14 @@ class CreateParamsCard(TypedDict): For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}. """ + class CreateParamsCardNetworks(TypedDict): + preferred: NotRequired[ + "Literal['cartes_bancaires', 'mastercard', 'visa']" + ] + """ + The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. + """ + class CreateParamsCashapp(TypedDict): pass @@ -615,6 +627,18 @@ class UpdateParamsCard(TypedDict): """ Four-digit number representing the card's expiration year. """ + networks: NotRequired["PaymentMethodService.UpdateParamsCardNetworks"] + """ + Contains information about card networks used to process the payment. + """ + + class UpdateParamsCardNetworks(TypedDict): + preferred: NotRequired[ + "Literal['']|Literal['cartes_bancaires', 'mastercard', 'visa']" + ] + """ + The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. + """ class UpdateParamsLink(TypedDict): pass diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index f7a95b46f..68e1546d5 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -519,7 +519,7 @@ class MandateOptions(StripeObject): Literal["any", "automatic", "challenge", "challenge_only"] ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ _inner_class_types = {"mandate_options": MandateOptions} @@ -1277,7 +1277,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ three_d_secure: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" @@ -2218,7 +2218,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ three_d_secure: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsCardThreeDSecure" @@ -3134,7 +3134,7 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ three_d_secure: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecure" diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 289785f85..648261105 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -727,7 +727,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ three_d_secure: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" @@ -1698,7 +1698,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ three_d_secure: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecure" @@ -2654,7 +2654,7 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ three_d_secure: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsCardThreeDSecure" diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 36f72b14e..4ed86fa4f 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -215,7 +215,7 @@ class MandateOptions(StripeObject): Literal["any", "automatic", "challenge"] ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ _inner_class_types = {"mandate_options": MandateOptions} @@ -556,15 +556,15 @@ class CreateParams(RequestOptions): """ Only applies to subscriptions with `collection_method=charge_automatically`. - Use `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. + Use `allow_incomplete` to create Subscriptions with `status=incomplete` if the first invoice can't be paid. Creating Subscriptions with this status allows you to manage scenarios where additional customer actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. - Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the payment intent is not confirmed within 23 hours subscriptions transition to `status=incomplete_expired`, which is a terminal state. + Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the PaymentIntent on the first invoice. This allows simpler management of scenarios where additional customer actions are needed to pay a subscription's invoice, such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the PaymentIntent is not confirmed within 23 hours Subscriptions transition to `status=incomplete_expired`, which is a terminal state. - Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice can't be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further customer action is needed, this parameter doesn't create a Subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. - `pending_if_incomplete` is only used with updates and cannot be passed when creating a subscription. + `pending_if_incomplete` is only used with updates and cannot be passed when creating a Subscription. - Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first invoice status. + Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first Invoice status. """ payment_settings: NotRequired[ "Subscription.CreateParamsPaymentSettings" @@ -906,7 +906,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions( @@ -1613,7 +1613,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions( diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index f0a3bafca..f9f849c72 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -159,15 +159,15 @@ class CreateParams(TypedDict): """ Only applies to subscriptions with `collection_method=charge_automatically`. - Use `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. + Use `allow_incomplete` to create Subscriptions with `status=incomplete` if the first invoice can't be paid. Creating Subscriptions with this status allows you to manage scenarios where additional customer actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. - Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the payment intent is not confirmed within 23 hours subscriptions transition to `status=incomplete_expired`, which is a terminal state. + Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the PaymentIntent on the first invoice. This allows simpler management of scenarios where additional customer actions are needed to pay a subscription's invoice, such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the PaymentIntent is not confirmed within 23 hours Subscriptions transition to `status=incomplete_expired`, which is a terminal state. - Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice can't be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further customer action is needed, this parameter doesn't create a Subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. - `pending_if_incomplete` is only used with updates and cannot be passed when creating a subscription. + `pending_if_incomplete` is only used with updates and cannot be passed when creating a Subscription. - Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first invoice status. + Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first Invoice status. """ payment_settings: NotRequired[ "SubscriptionService.CreateParamsPaymentSettings" @@ -517,7 +517,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions( @@ -1278,7 +1278,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "Literal['any', 'automatic', 'challenge']" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions( diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index 386d26c0c..fc6f4b23c 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -129,6 +129,7 @@ class Verification(StripeObject): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -153,7 +154,7 @@ class Verification(StripeObject): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` """ value: str """ diff --git a/stripe/_token.py b/stripe/_token.py index 9ee9d3caf..08b452376 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -671,11 +671,23 @@ class CreateParamsCard(TypedDict): """ Cardholder's full name. """ + networks: NotRequired["Token.CreateParamsCardNetworks"] + """ + Contains information about card networks used to process the payment. + """ number: str """ The card number, as a string without any separators. """ + class CreateParamsCardNetworks(TypedDict): + preferred: NotRequired[ + "Literal['cartes_bancaires', 'mastercard', 'visa']" + ] + """ + The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. + """ + class CreateParamsCvcUpdate(TypedDict): cvc: str """ diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 9b8177bc3..280b82e96 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -642,11 +642,23 @@ class CreateParamsCard(TypedDict): """ Cardholder's full name. """ + networks: NotRequired["TokenService.CreateParamsCardNetworks"] + """ + Contains information about card networks used to process the payment. + """ number: str """ The card number, as a string without any separators. """ + class CreateParamsCardNetworks(TypedDict): + preferred: NotRequired[ + "Literal['cartes_bancaires', 'mastercard', 'visa']" + ] + """ + The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. + """ + class CreateParamsCvcUpdate(TypedDict): cvc: str """ diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 38fd66280..13cfd4f3e 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -120,6 +120,7 @@ class CreateParams(RequestOptions): "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", "identity.verification_session.canceled", "identity.verification_session.created", @@ -329,7 +330,7 @@ class ModifyParams(RequestOptions): Disable the webhook endpoint if set to true. """ enabled_events: NotRequired[ - "List[Literal['*', 'account.application.authorized', 'account.application.deauthorized', 'account.external_account.created', 'account.external_account.deleted', 'account.external_account.updated', 'account.updated', 'application_fee.created', 'application_fee.refund.updated', 'application_fee.refunded', 'balance.available', 'billing_portal.configuration.created', 'billing_portal.configuration.updated', 'billing_portal.session.created', 'capability.updated', 'cash_balance.funds_available', 'charge.captured', 'charge.dispute.closed', 'charge.dispute.created', 'charge.dispute.funds_reinstated', 'charge.dispute.funds_withdrawn', 'charge.dispute.updated', 'charge.expired', 'charge.failed', 'charge.pending', 'charge.refund.updated', 'charge.refunded', 'charge.succeeded', 'charge.updated', 'checkout.session.async_payment_failed', 'checkout.session.async_payment_succeeded', 'checkout.session.completed', 'checkout.session.expired', 'climate.order.canceled', 'climate.order.created', 'climate.order.delayed', 'climate.order.delivered', 'climate.order.product_substituted', 'climate.product.created', 'climate.product.pricing_updated', 'coupon.created', 'coupon.deleted', 'coupon.updated', 'credit_note.created', 'credit_note.updated', 'credit_note.voided', 'customer.created', 'customer.deleted', 'customer.discount.created', 'customer.discount.deleted', 'customer.discount.updated', 'customer.source.created', 'customer.source.deleted', 'customer.source.expiring', 'customer.source.updated', 'customer.subscription.created', 'customer.subscription.deleted', 'customer.subscription.paused', 'customer.subscription.pending_update_applied', 'customer.subscription.pending_update_expired', 'customer.subscription.resumed', 'customer.subscription.trial_will_end', 'customer.subscription.updated', 'customer.tax_id.created', 'customer.tax_id.deleted', 'customer.tax_id.updated', 'customer.updated', 'customer_cash_balance_transaction.created', 'file.created', 'financial_connections.account.created', 'financial_connections.account.deactivated', 'financial_connections.account.disconnected', 'financial_connections.account.reactivated', 'financial_connections.account.refreshed_balance', 'financial_connections.account.refreshed_transactions', 'identity.verification_session.canceled', 'identity.verification_session.created', 'identity.verification_session.processing', 'identity.verification_session.redacted', 'identity.verification_session.requires_input', 'identity.verification_session.verified', 'invoice.created', 'invoice.deleted', 'invoice.finalization_failed', 'invoice.finalized', 'invoice.marked_uncollectible', 'invoice.paid', 'invoice.payment_action_required', 'invoice.payment_failed', 'invoice.payment_succeeded', 'invoice.sent', 'invoice.upcoming', 'invoice.updated', 'invoice.voided', 'invoiceitem.created', 'invoiceitem.deleted', 'issuing_authorization.created', 'issuing_authorization.request', 'issuing_authorization.updated', 'issuing_card.created', 'issuing_card.updated', 'issuing_cardholder.created', 'issuing_cardholder.updated', 'issuing_dispute.closed', 'issuing_dispute.created', 'issuing_dispute.funds_reinstated', 'issuing_dispute.submitted', 'issuing_dispute.updated', 'issuing_token.created', 'issuing_token.updated', 'issuing_transaction.created', 'issuing_transaction.updated', 'mandate.updated', 'payment_intent.amount_capturable_updated', 'payment_intent.canceled', 'payment_intent.created', 'payment_intent.partially_funded', 'payment_intent.payment_failed', 'payment_intent.processing', 'payment_intent.requires_action', 'payment_intent.succeeded', 'payment_link.created', 'payment_link.updated', 'payment_method.attached', 'payment_method.automatically_updated', 'payment_method.detached', 'payment_method.updated', 'payout.canceled', 'payout.created', 'payout.failed', 'payout.paid', 'payout.reconciliation_completed', 'payout.updated', 'person.created', 'person.deleted', 'person.updated', 'plan.created', 'plan.deleted', 'plan.updated', 'price.created', 'price.deleted', 'price.updated', 'product.created', 'product.deleted', 'product.updated', 'promotion_code.created', 'promotion_code.updated', 'quote.accepted', 'quote.canceled', 'quote.created', 'quote.finalized', 'radar.early_fraud_warning.created', 'radar.early_fraud_warning.updated', 'refund.created', 'refund.updated', 'reporting.report_run.failed', 'reporting.report_run.succeeded', 'reporting.report_type.updated', 'review.closed', 'review.opened', 'setup_intent.canceled', 'setup_intent.created', 'setup_intent.requires_action', 'setup_intent.setup_failed', 'setup_intent.succeeded', 'sigma.scheduled_query_run.created', 'source.canceled', 'source.chargeable', 'source.failed', 'source.mandate_notification', 'source.refund_attributes_required', 'source.transaction.created', 'source.transaction.updated', 'subscription_schedule.aborted', 'subscription_schedule.canceled', 'subscription_schedule.completed', 'subscription_schedule.created', 'subscription_schedule.expiring', 'subscription_schedule.released', 'subscription_schedule.updated', 'tax.settings.updated', 'tax_rate.created', 'tax_rate.updated', 'terminal.reader.action_failed', 'terminal.reader.action_succeeded', 'test_helpers.test_clock.advancing', 'test_helpers.test_clock.created', 'test_helpers.test_clock.deleted', 'test_helpers.test_clock.internal_failure', 'test_helpers.test_clock.ready', 'topup.canceled', 'topup.created', 'topup.failed', 'topup.reversed', 'topup.succeeded', 'transfer.created', 'transfer.reversed', 'transfer.updated', 'treasury.credit_reversal.created', 'treasury.credit_reversal.posted', 'treasury.debit_reversal.completed', 'treasury.debit_reversal.created', 'treasury.debit_reversal.initial_credit_granted', 'treasury.financial_account.closed', 'treasury.financial_account.created', 'treasury.financial_account.features_status_updated', 'treasury.inbound_transfer.canceled', 'treasury.inbound_transfer.created', 'treasury.inbound_transfer.failed', 'treasury.inbound_transfer.succeeded', 'treasury.outbound_payment.canceled', 'treasury.outbound_payment.created', 'treasury.outbound_payment.expected_arrival_date_updated', 'treasury.outbound_payment.failed', 'treasury.outbound_payment.posted', 'treasury.outbound_payment.returned', 'treasury.outbound_transfer.canceled', 'treasury.outbound_transfer.created', 'treasury.outbound_transfer.expected_arrival_date_updated', 'treasury.outbound_transfer.failed', 'treasury.outbound_transfer.posted', 'treasury.outbound_transfer.returned', 'treasury.received_credit.created', 'treasury.received_credit.failed', 'treasury.received_credit.succeeded', 'treasury.received_debit.created', 'invoiceitem.updated', 'order.created', 'recipient.created', 'recipient.deleted', 'recipient.updated', 'sku.created', 'sku.deleted', 'sku.updated']]" + "List[Literal['*', 'account.application.authorized', 'account.application.deauthorized', 'account.external_account.created', 'account.external_account.deleted', 'account.external_account.updated', 'account.updated', 'application_fee.created', 'application_fee.refund.updated', 'application_fee.refunded', 'balance.available', 'billing_portal.configuration.created', 'billing_portal.configuration.updated', 'billing_portal.session.created', 'capability.updated', 'cash_balance.funds_available', 'charge.captured', 'charge.dispute.closed', 'charge.dispute.created', 'charge.dispute.funds_reinstated', 'charge.dispute.funds_withdrawn', 'charge.dispute.updated', 'charge.expired', 'charge.failed', 'charge.pending', 'charge.refund.updated', 'charge.refunded', 'charge.succeeded', 'charge.updated', 'checkout.session.async_payment_failed', 'checkout.session.async_payment_succeeded', 'checkout.session.completed', 'checkout.session.expired', 'climate.order.canceled', 'climate.order.created', 'climate.order.delayed', 'climate.order.delivered', 'climate.order.product_substituted', 'climate.product.created', 'climate.product.pricing_updated', 'coupon.created', 'coupon.deleted', 'coupon.updated', 'credit_note.created', 'credit_note.updated', 'credit_note.voided', 'customer.created', 'customer.deleted', 'customer.discount.created', 'customer.discount.deleted', 'customer.discount.updated', 'customer.source.created', 'customer.source.deleted', 'customer.source.expiring', 'customer.source.updated', 'customer.subscription.created', 'customer.subscription.deleted', 'customer.subscription.paused', 'customer.subscription.pending_update_applied', 'customer.subscription.pending_update_expired', 'customer.subscription.resumed', 'customer.subscription.trial_will_end', 'customer.subscription.updated', 'customer.tax_id.created', 'customer.tax_id.deleted', 'customer.tax_id.updated', 'customer.updated', 'customer_cash_balance_transaction.created', 'file.created', 'financial_connections.account.created', 'financial_connections.account.deactivated', 'financial_connections.account.disconnected', 'financial_connections.account.reactivated', 'financial_connections.account.refreshed_balance', 'financial_connections.account.refreshed_ownership', 'financial_connections.account.refreshed_transactions', 'identity.verification_session.canceled', 'identity.verification_session.created', 'identity.verification_session.processing', 'identity.verification_session.redacted', 'identity.verification_session.requires_input', 'identity.verification_session.verified', 'invoice.created', 'invoice.deleted', 'invoice.finalization_failed', 'invoice.finalized', 'invoice.marked_uncollectible', 'invoice.paid', 'invoice.payment_action_required', 'invoice.payment_failed', 'invoice.payment_succeeded', 'invoice.sent', 'invoice.upcoming', 'invoice.updated', 'invoice.voided', 'invoiceitem.created', 'invoiceitem.deleted', 'issuing_authorization.created', 'issuing_authorization.request', 'issuing_authorization.updated', 'issuing_card.created', 'issuing_card.updated', 'issuing_cardholder.created', 'issuing_cardholder.updated', 'issuing_dispute.closed', 'issuing_dispute.created', 'issuing_dispute.funds_reinstated', 'issuing_dispute.submitted', 'issuing_dispute.updated', 'issuing_token.created', 'issuing_token.updated', 'issuing_transaction.created', 'issuing_transaction.updated', 'mandate.updated', 'payment_intent.amount_capturable_updated', 'payment_intent.canceled', 'payment_intent.created', 'payment_intent.partially_funded', 'payment_intent.payment_failed', 'payment_intent.processing', 'payment_intent.requires_action', 'payment_intent.succeeded', 'payment_link.created', 'payment_link.updated', 'payment_method.attached', 'payment_method.automatically_updated', 'payment_method.detached', 'payment_method.updated', 'payout.canceled', 'payout.created', 'payout.failed', 'payout.paid', 'payout.reconciliation_completed', 'payout.updated', 'person.created', 'person.deleted', 'person.updated', 'plan.created', 'plan.deleted', 'plan.updated', 'price.created', 'price.deleted', 'price.updated', 'product.created', 'product.deleted', 'product.updated', 'promotion_code.created', 'promotion_code.updated', 'quote.accepted', 'quote.canceled', 'quote.created', 'quote.finalized', 'radar.early_fraud_warning.created', 'radar.early_fraud_warning.updated', 'refund.created', 'refund.updated', 'reporting.report_run.failed', 'reporting.report_run.succeeded', 'reporting.report_type.updated', 'review.closed', 'review.opened', 'setup_intent.canceled', 'setup_intent.created', 'setup_intent.requires_action', 'setup_intent.setup_failed', 'setup_intent.succeeded', 'sigma.scheduled_query_run.created', 'source.canceled', 'source.chargeable', 'source.failed', 'source.mandate_notification', 'source.refund_attributes_required', 'source.transaction.created', 'source.transaction.updated', 'subscription_schedule.aborted', 'subscription_schedule.canceled', 'subscription_schedule.completed', 'subscription_schedule.created', 'subscription_schedule.expiring', 'subscription_schedule.released', 'subscription_schedule.updated', 'tax.settings.updated', 'tax_rate.created', 'tax_rate.updated', 'terminal.reader.action_failed', 'terminal.reader.action_succeeded', 'test_helpers.test_clock.advancing', 'test_helpers.test_clock.created', 'test_helpers.test_clock.deleted', 'test_helpers.test_clock.internal_failure', 'test_helpers.test_clock.ready', 'topup.canceled', 'topup.created', 'topup.failed', 'topup.reversed', 'topup.succeeded', 'transfer.created', 'transfer.reversed', 'transfer.updated', 'treasury.credit_reversal.created', 'treasury.credit_reversal.posted', 'treasury.debit_reversal.completed', 'treasury.debit_reversal.created', 'treasury.debit_reversal.initial_credit_granted', 'treasury.financial_account.closed', 'treasury.financial_account.created', 'treasury.financial_account.features_status_updated', 'treasury.inbound_transfer.canceled', 'treasury.inbound_transfer.created', 'treasury.inbound_transfer.failed', 'treasury.inbound_transfer.succeeded', 'treasury.outbound_payment.canceled', 'treasury.outbound_payment.created', 'treasury.outbound_payment.expected_arrival_date_updated', 'treasury.outbound_payment.failed', 'treasury.outbound_payment.posted', 'treasury.outbound_payment.returned', 'treasury.outbound_transfer.canceled', 'treasury.outbound_transfer.created', 'treasury.outbound_transfer.expected_arrival_date_updated', 'treasury.outbound_transfer.failed', 'treasury.outbound_transfer.posted', 'treasury.outbound_transfer.returned', 'treasury.received_credit.created', 'treasury.received_credit.failed', 'treasury.received_credit.succeeded', 'treasury.received_debit.created', 'invoiceitem.updated', 'order.created', 'recipient.created', 'recipient.deleted', 'recipient.updated', 'sku.created', 'sku.deleted', 'sku.updated']]" ] """ The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index e9edca865..76ea445b0 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -101,6 +101,7 @@ class CreateParams(TypedDict): "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", "identity.verification_session.canceled", "identity.verification_session.created", @@ -316,7 +317,7 @@ class UpdateParams(TypedDict): Disable the webhook endpoint if set to true. """ enabled_events: NotRequired[ - "List[Literal['*', 'account.application.authorized', 'account.application.deauthorized', 'account.external_account.created', 'account.external_account.deleted', 'account.external_account.updated', 'account.updated', 'application_fee.created', 'application_fee.refund.updated', 'application_fee.refunded', 'balance.available', 'billing_portal.configuration.created', 'billing_portal.configuration.updated', 'billing_portal.session.created', 'capability.updated', 'cash_balance.funds_available', 'charge.captured', 'charge.dispute.closed', 'charge.dispute.created', 'charge.dispute.funds_reinstated', 'charge.dispute.funds_withdrawn', 'charge.dispute.updated', 'charge.expired', 'charge.failed', 'charge.pending', 'charge.refund.updated', 'charge.refunded', 'charge.succeeded', 'charge.updated', 'checkout.session.async_payment_failed', 'checkout.session.async_payment_succeeded', 'checkout.session.completed', 'checkout.session.expired', 'climate.order.canceled', 'climate.order.created', 'climate.order.delayed', 'climate.order.delivered', 'climate.order.product_substituted', 'climate.product.created', 'climate.product.pricing_updated', 'coupon.created', 'coupon.deleted', 'coupon.updated', 'credit_note.created', 'credit_note.updated', 'credit_note.voided', 'customer.created', 'customer.deleted', 'customer.discount.created', 'customer.discount.deleted', 'customer.discount.updated', 'customer.source.created', 'customer.source.deleted', 'customer.source.expiring', 'customer.source.updated', 'customer.subscription.created', 'customer.subscription.deleted', 'customer.subscription.paused', 'customer.subscription.pending_update_applied', 'customer.subscription.pending_update_expired', 'customer.subscription.resumed', 'customer.subscription.trial_will_end', 'customer.subscription.updated', 'customer.tax_id.created', 'customer.tax_id.deleted', 'customer.tax_id.updated', 'customer.updated', 'customer_cash_balance_transaction.created', 'file.created', 'financial_connections.account.created', 'financial_connections.account.deactivated', 'financial_connections.account.disconnected', 'financial_connections.account.reactivated', 'financial_connections.account.refreshed_balance', 'financial_connections.account.refreshed_transactions', 'identity.verification_session.canceled', 'identity.verification_session.created', 'identity.verification_session.processing', 'identity.verification_session.redacted', 'identity.verification_session.requires_input', 'identity.verification_session.verified', 'invoice.created', 'invoice.deleted', 'invoice.finalization_failed', 'invoice.finalized', 'invoice.marked_uncollectible', 'invoice.paid', 'invoice.payment_action_required', 'invoice.payment_failed', 'invoice.payment_succeeded', 'invoice.sent', 'invoice.upcoming', 'invoice.updated', 'invoice.voided', 'invoiceitem.created', 'invoiceitem.deleted', 'issuing_authorization.created', 'issuing_authorization.request', 'issuing_authorization.updated', 'issuing_card.created', 'issuing_card.updated', 'issuing_cardholder.created', 'issuing_cardholder.updated', 'issuing_dispute.closed', 'issuing_dispute.created', 'issuing_dispute.funds_reinstated', 'issuing_dispute.submitted', 'issuing_dispute.updated', 'issuing_token.created', 'issuing_token.updated', 'issuing_transaction.created', 'issuing_transaction.updated', 'mandate.updated', 'payment_intent.amount_capturable_updated', 'payment_intent.canceled', 'payment_intent.created', 'payment_intent.partially_funded', 'payment_intent.payment_failed', 'payment_intent.processing', 'payment_intent.requires_action', 'payment_intent.succeeded', 'payment_link.created', 'payment_link.updated', 'payment_method.attached', 'payment_method.automatically_updated', 'payment_method.detached', 'payment_method.updated', 'payout.canceled', 'payout.created', 'payout.failed', 'payout.paid', 'payout.reconciliation_completed', 'payout.updated', 'person.created', 'person.deleted', 'person.updated', 'plan.created', 'plan.deleted', 'plan.updated', 'price.created', 'price.deleted', 'price.updated', 'product.created', 'product.deleted', 'product.updated', 'promotion_code.created', 'promotion_code.updated', 'quote.accepted', 'quote.canceled', 'quote.created', 'quote.finalized', 'radar.early_fraud_warning.created', 'radar.early_fraud_warning.updated', 'refund.created', 'refund.updated', 'reporting.report_run.failed', 'reporting.report_run.succeeded', 'reporting.report_type.updated', 'review.closed', 'review.opened', 'setup_intent.canceled', 'setup_intent.created', 'setup_intent.requires_action', 'setup_intent.setup_failed', 'setup_intent.succeeded', 'sigma.scheduled_query_run.created', 'source.canceled', 'source.chargeable', 'source.failed', 'source.mandate_notification', 'source.refund_attributes_required', 'source.transaction.created', 'source.transaction.updated', 'subscription_schedule.aborted', 'subscription_schedule.canceled', 'subscription_schedule.completed', 'subscription_schedule.created', 'subscription_schedule.expiring', 'subscription_schedule.released', 'subscription_schedule.updated', 'tax.settings.updated', 'tax_rate.created', 'tax_rate.updated', 'terminal.reader.action_failed', 'terminal.reader.action_succeeded', 'test_helpers.test_clock.advancing', 'test_helpers.test_clock.created', 'test_helpers.test_clock.deleted', 'test_helpers.test_clock.internal_failure', 'test_helpers.test_clock.ready', 'topup.canceled', 'topup.created', 'topup.failed', 'topup.reversed', 'topup.succeeded', 'transfer.created', 'transfer.reversed', 'transfer.updated', 'treasury.credit_reversal.created', 'treasury.credit_reversal.posted', 'treasury.debit_reversal.completed', 'treasury.debit_reversal.created', 'treasury.debit_reversal.initial_credit_granted', 'treasury.financial_account.closed', 'treasury.financial_account.created', 'treasury.financial_account.features_status_updated', 'treasury.inbound_transfer.canceled', 'treasury.inbound_transfer.created', 'treasury.inbound_transfer.failed', 'treasury.inbound_transfer.succeeded', 'treasury.outbound_payment.canceled', 'treasury.outbound_payment.created', 'treasury.outbound_payment.expected_arrival_date_updated', 'treasury.outbound_payment.failed', 'treasury.outbound_payment.posted', 'treasury.outbound_payment.returned', 'treasury.outbound_transfer.canceled', 'treasury.outbound_transfer.created', 'treasury.outbound_transfer.expected_arrival_date_updated', 'treasury.outbound_transfer.failed', 'treasury.outbound_transfer.posted', 'treasury.outbound_transfer.returned', 'treasury.received_credit.created', 'treasury.received_credit.failed', 'treasury.received_credit.succeeded', 'treasury.received_debit.created', 'invoiceitem.updated', 'order.created', 'recipient.created', 'recipient.deleted', 'recipient.updated', 'sku.created', 'sku.deleted', 'sku.updated']]" + "List[Literal['*', 'account.application.authorized', 'account.application.deauthorized', 'account.external_account.created', 'account.external_account.deleted', 'account.external_account.updated', 'account.updated', 'application_fee.created', 'application_fee.refund.updated', 'application_fee.refunded', 'balance.available', 'billing_portal.configuration.created', 'billing_portal.configuration.updated', 'billing_portal.session.created', 'capability.updated', 'cash_balance.funds_available', 'charge.captured', 'charge.dispute.closed', 'charge.dispute.created', 'charge.dispute.funds_reinstated', 'charge.dispute.funds_withdrawn', 'charge.dispute.updated', 'charge.expired', 'charge.failed', 'charge.pending', 'charge.refund.updated', 'charge.refunded', 'charge.succeeded', 'charge.updated', 'checkout.session.async_payment_failed', 'checkout.session.async_payment_succeeded', 'checkout.session.completed', 'checkout.session.expired', 'climate.order.canceled', 'climate.order.created', 'climate.order.delayed', 'climate.order.delivered', 'climate.order.product_substituted', 'climate.product.created', 'climate.product.pricing_updated', 'coupon.created', 'coupon.deleted', 'coupon.updated', 'credit_note.created', 'credit_note.updated', 'credit_note.voided', 'customer.created', 'customer.deleted', 'customer.discount.created', 'customer.discount.deleted', 'customer.discount.updated', 'customer.source.created', 'customer.source.deleted', 'customer.source.expiring', 'customer.source.updated', 'customer.subscription.created', 'customer.subscription.deleted', 'customer.subscription.paused', 'customer.subscription.pending_update_applied', 'customer.subscription.pending_update_expired', 'customer.subscription.resumed', 'customer.subscription.trial_will_end', 'customer.subscription.updated', 'customer.tax_id.created', 'customer.tax_id.deleted', 'customer.tax_id.updated', 'customer.updated', 'customer_cash_balance_transaction.created', 'file.created', 'financial_connections.account.created', 'financial_connections.account.deactivated', 'financial_connections.account.disconnected', 'financial_connections.account.reactivated', 'financial_connections.account.refreshed_balance', 'financial_connections.account.refreshed_ownership', 'financial_connections.account.refreshed_transactions', 'identity.verification_session.canceled', 'identity.verification_session.created', 'identity.verification_session.processing', 'identity.verification_session.redacted', 'identity.verification_session.requires_input', 'identity.verification_session.verified', 'invoice.created', 'invoice.deleted', 'invoice.finalization_failed', 'invoice.finalized', 'invoice.marked_uncollectible', 'invoice.paid', 'invoice.payment_action_required', 'invoice.payment_failed', 'invoice.payment_succeeded', 'invoice.sent', 'invoice.upcoming', 'invoice.updated', 'invoice.voided', 'invoiceitem.created', 'invoiceitem.deleted', 'issuing_authorization.created', 'issuing_authorization.request', 'issuing_authorization.updated', 'issuing_card.created', 'issuing_card.updated', 'issuing_cardholder.created', 'issuing_cardholder.updated', 'issuing_dispute.closed', 'issuing_dispute.created', 'issuing_dispute.funds_reinstated', 'issuing_dispute.submitted', 'issuing_dispute.updated', 'issuing_token.created', 'issuing_token.updated', 'issuing_transaction.created', 'issuing_transaction.updated', 'mandate.updated', 'payment_intent.amount_capturable_updated', 'payment_intent.canceled', 'payment_intent.created', 'payment_intent.partially_funded', 'payment_intent.payment_failed', 'payment_intent.processing', 'payment_intent.requires_action', 'payment_intent.succeeded', 'payment_link.created', 'payment_link.updated', 'payment_method.attached', 'payment_method.automatically_updated', 'payment_method.detached', 'payment_method.updated', 'payout.canceled', 'payout.created', 'payout.failed', 'payout.paid', 'payout.reconciliation_completed', 'payout.updated', 'person.created', 'person.deleted', 'person.updated', 'plan.created', 'plan.deleted', 'plan.updated', 'price.created', 'price.deleted', 'price.updated', 'product.created', 'product.deleted', 'product.updated', 'promotion_code.created', 'promotion_code.updated', 'quote.accepted', 'quote.canceled', 'quote.created', 'quote.finalized', 'radar.early_fraud_warning.created', 'radar.early_fraud_warning.updated', 'refund.created', 'refund.updated', 'reporting.report_run.failed', 'reporting.report_run.succeeded', 'reporting.report_type.updated', 'review.closed', 'review.opened', 'setup_intent.canceled', 'setup_intent.created', 'setup_intent.requires_action', 'setup_intent.setup_failed', 'setup_intent.succeeded', 'sigma.scheduled_query_run.created', 'source.canceled', 'source.chargeable', 'source.failed', 'source.mandate_notification', 'source.refund_attributes_required', 'source.transaction.created', 'source.transaction.updated', 'subscription_schedule.aborted', 'subscription_schedule.canceled', 'subscription_schedule.completed', 'subscription_schedule.created', 'subscription_schedule.expiring', 'subscription_schedule.released', 'subscription_schedule.updated', 'tax.settings.updated', 'tax_rate.created', 'tax_rate.updated', 'terminal.reader.action_failed', 'terminal.reader.action_succeeded', 'test_helpers.test_clock.advancing', 'test_helpers.test_clock.created', 'test_helpers.test_clock.deleted', 'test_helpers.test_clock.internal_failure', 'test_helpers.test_clock.ready', 'topup.canceled', 'topup.created', 'topup.failed', 'topup.reversed', 'topup.succeeded', 'transfer.created', 'transfer.reversed', 'transfer.updated', 'treasury.credit_reversal.created', 'treasury.credit_reversal.posted', 'treasury.debit_reversal.completed', 'treasury.debit_reversal.created', 'treasury.debit_reversal.initial_credit_granted', 'treasury.financial_account.closed', 'treasury.financial_account.created', 'treasury.financial_account.features_status_updated', 'treasury.inbound_transfer.canceled', 'treasury.inbound_transfer.created', 'treasury.inbound_transfer.failed', 'treasury.inbound_transfer.succeeded', 'treasury.outbound_payment.canceled', 'treasury.outbound_payment.created', 'treasury.outbound_payment.expected_arrival_date_updated', 'treasury.outbound_payment.failed', 'treasury.outbound_payment.posted', 'treasury.outbound_payment.returned', 'treasury.outbound_transfer.canceled', 'treasury.outbound_transfer.created', 'treasury.outbound_transfer.expected_arrival_date_updated', 'treasury.outbound_transfer.failed', 'treasury.outbound_transfer.posted', 'treasury.outbound_transfer.returned', 'treasury.received_credit.created', 'treasury.received_credit.failed', 'treasury.received_credit.succeeded', 'treasury.received_debit.created', 'invoiceitem.updated', 'order.created', 'recipient.created', 'recipient.deleted', 'recipient.updated', 'sku.created', 'sku.deleted', 'sku.updated']]" ] """ The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 90317a716..93ca1d18c 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -368,6 +368,7 @@ class TaxId(StripeObject): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -392,7 +393,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` """ value: Optional[str] """ diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 005077c5e..3d9c22ce6 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -101,6 +101,7 @@ class TaxId(StripeObject): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -125,7 +126,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` """ value: str """ @@ -473,6 +474,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -496,7 +498,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index 99513f9f4..cd75a18df 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -150,6 +150,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -173,7 +174,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index 26ef1583c..2977affcb 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -101,6 +101,7 @@ class TaxId(StripeObject): "my_itn", "my_sst", "no_vat", + "no_voec", "nz_gst", "pe_ruc", "ph_tin", @@ -125,7 +126,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` """ value: str """ From 3e2a1e3006bc9f3d43e8724c1b6486fbaae45c49 Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Thu, 15 Feb 2024 16:22:51 -0800 Subject: [PATCH 012/179] Bump version to 8.3.0 --- CHANGELOG.md | 12 ++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c70de0127..05988c0ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.3.0 - 2024-02-15 +* [#1230](https://github.com/stripe/stripe-python/pull/1230) Update generated code + * Add support for `networks` on `Card`, `PaymentMethod.CreateParamsCard`, `PaymentMethod.ModifyParamsCard`, and `Token.CreateParamsCard` + * Add support for new value `no_voec` on enums `Checkout.Session.CustomerDetails.TaxId.type`, `Invoice.CustomerTaxId.type`, `Tax.Calculation.CustomerDetails.TaxId.type`, `Tax.Transaction.CustomerDetails.TaxId.type`, and `TaxId.type` + * Add support for new value `no_voec` on enums `Customer.CreateParams.tax_id_data[].type`, `Invoice.UpcomingLinesParams.customer_details.tax_ids[].type`, `Invoice.UpcomingParams.customer_details.tax_ids[].type`, and `Tax.Calculation.CreateParams.customer_details.tax_ids[].type` + * Add support for new value `financial_connections.account.refreshed_ownership` on enum `Event.type` + * Add support for `display_brand` on `PaymentMethod.card` + * Add support for new value `financial_connections.account.refreshed_ownership` on enums `WebhookEndpoint.CreateParams.enabled_events[]` and `WebhookEndpoint.UpdateParams.enabled_events[]` +* [#1237](https://github.com/stripe/stripe-python/pull/1237) Remove broken child methods + * Bugfix: remove support for `CreditNoteLineItem.list`, `CustomerCashBalanceTransaction.list`, and `CustomerCashBalanceTransaction.retrieve`. These methods were included in the library unintentionally and never functioned. +* [#1232](https://github.com/stripe/stripe-python/pull/1232) Improve types in _http_client.py + ## 8.2.0 - 2024-02-08 * [#1225](https://github.com/stripe/stripe-python/pull/1225) Update generated code * Add support for `invoices` on `Account.Settings` diff --git a/VERSION b/VERSION index fbb9ea12d..2bf50aaf1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.2.0 +8.3.0 diff --git a/stripe/_version.py b/stripe/_version.py index c0a494d88..f11dae2fd 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "8.2.0" +VERSION = "8.3.0" From aa7d8bf305eb6262919b5237cfebea6491de1b8c Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Fri, 16 Feb 2024 13:01:11 -0800 Subject: [PATCH 013/179] Testing: unify http client mock (#1242) --- .../abstract/test_custom_method.py | 20 ++- tests/api_resources/test_quote.py | 8 +- tests/conftest.py | 27 ---- tests/http_client_mock.py | 148 +++++++++--------- tests/services/test_quote.py | 10 +- tests/test_api_requestor.py | 44 ++---- tests/test_generated_examples.py | 14 +- 7 files changed, 111 insertions(+), 160 deletions(-) diff --git a/tests/api_resources/abstract/test_custom_method.py b/tests/api_resources/abstract/test_custom_method.py index 12142473f..01aa84356 100644 --- a/tests/api_resources/abstract/test_custom_method.py +++ b/tests/api_resources/abstract/test_custom_method.py @@ -109,8 +109,8 @@ def test_call_custom_list_method_class_paginates(self, http_client_mock): assert ids == ["cus_1", "cus_2", "cus_3"] - def test_call_custom_stream_method_class(self, http_client_mock_streaming): - http_client_mock_streaming.stub_request( + def test_call_custom_stream_method_class(self, http_client_mock): + http_client_mock.stub_request( "post", path="/v1/myresources/mid/do_the_stream_thing", rbody=util.io.BytesIO(str.encode("response body")), @@ -119,7 +119,7 @@ def test_call_custom_stream_method_class(self, http_client_mock_streaming): resp = self.MyResource.do_stream_stuff("mid", foo="bar") - http_client_mock_streaming.assert_requested( + http_client_mock.assert_requested( "post", path="/v1/myresources/mid/do_the_stream_thing", post_data="foo=bar", @@ -150,9 +150,9 @@ def test_call_custom_method_class_with_object(self, http_client_mock): assert obj.thing_done is True def test_call_custom_stream_method_class_with_object( - self, http_client_mock_streaming + self, http_client_mock ): - http_client_mock_streaming.stub_request( + http_client_mock.stub_request( "post", path="/v1/myresources/mid/do_the_stream_thing", rbody=util.io.BytesIO(str.encode("response body")), @@ -162,7 +162,7 @@ def test_call_custom_stream_method_class_with_object( obj = self.MyResource.construct_from({"id": "mid"}, "mykey") resp = self.MyResource.do_stream_stuff(obj, foo="bar") - http_client_mock_streaming.assert_requested( + http_client_mock.assert_requested( "post", path="/v1/myresources/mid/do_the_stream_thing", post_data="foo=bar", @@ -192,10 +192,8 @@ def test_call_custom_method_instance(self, http_client_mock): ) assert obj.thing_done is True - def test_call_custom_stream_method_instance( - self, http_client_mock_streaming - ): - http_client_mock_streaming.stub_request( + def test_call_custom_stream_method_instance(self, http_client_mock): + http_client_mock.stub_request( "post", path="/v1/myresources/mid/do_the_stream_thing", rbody=util.io.BytesIO(str.encode("response body")), @@ -205,7 +203,7 @@ def test_call_custom_stream_method_instance( obj = self.MyResource.construct_from({"id": "mid"}, "mykey") resp = obj.do_stream_stuff(foo="bar") - http_client_mock_streaming.assert_requested( + http_client_mock.assert_requested( "post", path="/v1/myresources/mid/do_the_stream_thing", post_data="foo=bar", diff --git a/tests/api_resources/test_quote.py b/tests/api_resources/test_quote.py index 20d04cffc..ebf509765 100644 --- a/tests/api_resources/test_quote.py +++ b/tests/api_resources/test_quote.py @@ -140,10 +140,10 @@ def test_can_list_computed_upfront_line_items_classmethod( ) assert isinstance(resources.data[0], stripe.LineItem) - def test_can_pdf(self, setup_upload_api_base, http_client_mock_streaming): + def test_can_pdf(self, setup_upload_api_base, http_client_mock): resource = stripe.Quote.retrieve(TEST_RESOURCE_ID) stream = resource.pdf() - http_client_mock_streaming.assert_requested( + http_client_mock.assert_requested( "get", api_base=stripe.upload_api_base, path="/v1/quotes/%s/pdf" % TEST_RESOURCE_ID, @@ -152,10 +152,10 @@ def test_can_pdf(self, setup_upload_api_base, http_client_mock_streaming): assert content == b"Stripe binary response" def test_can_pdf_classmethod( - self, setup_upload_api_base, http_client_mock_streaming + self, setup_upload_api_base, http_client_mock ): stream = stripe.Quote.pdf(TEST_RESOURCE_ID) - http_client_mock_streaming.assert_requested( + http_client_mock.assert_requested( "get", api_base=stripe.upload_api_base, path="/v1/quotes/%s/pdf" % TEST_RESOURCE_ID, diff --git a/tests/conftest.py b/tests/conftest.py index 1dd6b7e3e..d8f30969e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -90,15 +90,6 @@ def http_client_mock(mocker): stripe.default_http_client = old_client -@pytest.fixture -def http_client_mock_streaming(mocker): - mock_client = HTTPClientMock(mocker, is_streaming=True) - old_client = stripe.default_http_client - stripe.default_http_client = mock_client.get_mock_http_client() - yield mock_client - stripe.default_http_client = old_client - - @pytest.fixture def stripe_mock_stripe_client(http_client_mock): return StripeClient( @@ -115,21 +106,3 @@ def file_stripe_mock_stripe_client(http_client_mock): base_addresses={"files": MOCK_API_BASE}, http_client=http_client_mock.get_mock_http_client(), ) - - -@pytest.fixture -def stripe_mock_stripe_client_streaming(http_client_mock_streaming): - return StripeClient( - MOCK_API_KEY, - base_addresses={"api": MOCK_API_BASE}, - http_client=http_client_mock_streaming.get_mock_http_client(), - ) - - -@pytest.fixture -def file_stripe_mock_stripe_client_streaming(http_client_mock_streaming): - return StripeClient( - MOCK_API_KEY, - base_addresses={"files": MOCK_API_BASE}, - http_client=http_client_mock_streaming.get_mock_http_client(), - ) diff --git a/tests/http_client_mock.py b/tests/http_client_mock.py index 27631fd76..5f3211b33 100644 --- a/tests/http_client_mock.py +++ b/tests/http_client_mock.py @@ -212,28 +212,19 @@ def assert_post_data(self, expected, is_json=False): class HTTPClientMock(object): - def __init__(self, mocker, is_streaming=False, is_async=False): - if is_async: - self.mock_client = mocker.Mock( - wraps=stripe.http_client.new_default_http_client_async() - ) - else: - self.mock_client = mocker.Mock( - wraps=stripe.http_client.new_default_http_client() - ) + def __init__(self, mocker): + self.mock_client = mocker.Mock( + wraps=stripe.http_client.new_default_http_client() + ) - self.is_async = is_async self.mock_client._verify_ssl_certs = True self.mock_client.name = "mockclient" - if is_async and is_streaming: - self.func = self.mock_client.request_stream_with_retries_async - elif is_async and not is_streaming: - self.func = self.mock_client.request_with_retries_async - elif is_streaming: - self.func = self.mock_client.request_stream_with_retries - else: - self.func = self.mock_client.request_with_retries self.registered_responses = {} + self.funcs = [ + self.mock_client.request_with_retries, + self.mock_client.request_stream_with_retries, + ] + self.func_call_order = [] def get_mock_http_client(self) -> Mock: return self.mock_client @@ -247,73 +238,78 @@ def stub_request( rcode=200, rheaders={}, ) -> None: - def custom_side_effect(called_method, called_abs_url, *args, **kwargs): - called_path = urlsplit(called_abs_url).path - called_query = "" - if urlsplit(called_abs_url).query: - called_query = urlencode( - parse_and_sort(urlsplit(called_abs_url).query) - ) - if ( - called_method, - called_path, - called_query, - ) not in self.registered_responses: - raise AssertionError( - "Unexpected request made to %s %s %s" - % (called_method, called_path, called_query) - ) - return self.registered_responses[ - (called_method, called_path, called_query) - ] - - async def awaitable(x): - return x + def custom_side_effect_for_func(func): + def custom_side_effect( + called_method, called_abs_url, *args, **kwargs + ): + self.func_call_order.append(func) + called_path = urlsplit(called_abs_url).path + called_query = "" + if urlsplit(called_abs_url).query: + called_query = urlencode( + parse_and_sort(urlsplit(called_abs_url).query) + ) + if ( + called_method, + called_path, + called_query, + ) not in self.registered_responses: + raise AssertionError( + "Unexpected request made to %s %s %s" + % (called_method, called_path, called_query) + ) + ret = self.registered_responses[ + (called_method, called_path, called_query) + ] + return ret + + return custom_side_effect self.registered_responses[ (method, path, urlencode(parse_and_sort(query_string))) - ] = ( - awaitable( - ( - rbody, - rcode, - rheaders, - ) - ) - if self.is_async - else (rbody, rcode, rheaders) - ) + ] = (rbody, rcode, rheaders) - self.func.side_effect = custom_side_effect + for func in self.funcs: + func.side_effect = custom_side_effect_for_func(func) def get_last_call(self) -> StripeRequestCall: - if not self.func.called: + if len(self.func_call_order) == 0: raise AssertionError( "Expected request to have been made, but no calls were found." ) - return StripeRequestCall.from_mock_call(self.func.call_args) + return StripeRequestCall.from_mock_call( + self.func_call_order[-1].call_args + ) def get_all_calls(self) -> List[StripeRequestCall]: + calls_by_func = { + func: list(func.call_args_list) for func in self.funcs + } + + calls = [] + for func in self.func_call_order: + calls.append(calls_by_func[func].pop(0)) + return [ - StripeRequestCall.from_mock_call(call_args) - for call_args in self.func.call_args_list + StripeRequestCall.from_mock_call(call_args) for call_args in calls ] def find_call( self, method, api_base, path, query_string ) -> StripeRequestCall: - for call_args in self.func.call_args_list: - request_call = StripeRequestCall.from_mock_call(call_args) - try: - if request_call.check( - method=method, - api_base=api_base, - path=path, - query_string=query_string, - ): - return request_call - except AssertionError: - pass + for func in self.funcs: + for call_args in func.call_args_list: + request_call = StripeRequestCall.from_mock_call(call_args) + try: + if request_call.check( + method=method, + api_base=api_base, + path=path, + query_string=query_string, + ): + return request_call + except AssertionError: + pass raise AssertionError( "Expected request to have been made, but no calls were found." ) @@ -369,13 +365,15 @@ def assert_requested( ) def assert_no_request(self): - if self.func.called: - msg = ( - "Expected no request to have been made, but %s calls were " - "found." % (self.func.call_count) - ) - raise AssertionError(msg) + for func in self.funcs: + if func.called: + msg = ( + "Expected no request to have been made, but %s calls were " + "found." % (sum([func.call_count for func in self.funcs])) + ) + raise AssertionError(msg) def reset_mock(self): - self.func.reset_mock() + for func in self.funcs: + func.reset_mock() self.registered_responses = {} diff --git a/tests/services/test_quote.py b/tests/services/test_quote.py index 555b7ef51..7b7a1afd7 100644 --- a/tests/services/test_quote.py +++ b/tests/services/test_quote.py @@ -105,13 +105,11 @@ def test_can_list_computed_upfront_line_items( def test_can_pdf( self, - file_stripe_mock_stripe_client_streaming, - http_client_mock_streaming, + file_stripe_mock_stripe_client, + http_client_mock, ): - stream = file_stripe_mock_stripe_client_streaming.quotes.pdf( - TEST_RESOURCE_ID - ) - http_client_mock_streaming.assert_requested( + stream = file_stripe_mock_stripe_client.quotes.pdf(TEST_RESOURCE_ID) + http_client_mock.assert_requested( "get", api_base=stripe.upload_api_base, path="/v1/quotes/%s/pdf" % TEST_RESOURCE_ID, diff --git a/tests/test_api_requestor.py b/tests/test_api_requestor.py index 8401b68d9..a04b27435 100644 --- a/tests/test_api_requestor.py +++ b/tests/test_api_requestor.py @@ -109,14 +109,6 @@ def requestor(self, http_client_mock): ) return requestor - @pytest.fixture - def requestor_streaming(self, http_client_mock_streaming): - requestor_streaming = _APIRequestor( - client=http_client_mock_streaming.get_mock_http_client(), - options=_GlobalRequestorOptions(), - ) - return requestor_streaming - @property def valid_path(self): return "/foo" @@ -251,17 +243,17 @@ def test_empty_methods(self, requestor, http_client_mock): assert resp == {} def test_empty_methods_streaming_response( - self, requestor_streaming, http_client_mock_streaming + self, requestor, http_client_mock ): for meth in VALID_API_METHODS: - http_client_mock_streaming.stub_request( + http_client_mock.stub_request( meth, path=self.valid_path, rbody=util.io.BytesIO(b"thisisdata"), rcode=200, ) - resp = requestor_streaming.request_stream( + resp = requestor.request_stream( meth, self.valid_path, {}, @@ -274,9 +266,7 @@ def test_empty_methods_streaming_response( else: post_data = None - http_client_mock_streaming.assert_requested( - meth, post_data=post_data - ) + http_client_mock.assert_requested(meth, post_data=post_data) assert isinstance(resp, StripeStreamResponse) assert resp.io.getvalue() == b"thisisdata" @@ -329,7 +319,7 @@ def test_methods_with_params_and_response( http_client_mock.assert_requested(method, abs_url=abs_url) def test_methods_with_params_and_streaming_response( - self, requestor_streaming, http_client_mock_streaming + self, requestor, http_client_mock ): for method in VALID_API_METHODS: encoded = ( @@ -337,7 +327,7 @@ def test_methods_with_params_and_streaming_response( "alist[0]=1&alist[1]=2&alist[2]=3" ) - http_client_mock_streaming.stub_request( + http_client_mock.stub_request( method, path=self.valid_path, query_string=encoded if method != "post" else "", @@ -351,7 +341,7 @@ def test_methods_with_params_and_streaming_response( "adatetime": datetime.datetime(2013, 1, 1, tzinfo=GMT1()), } - resp = requestor_streaming.request_stream( + resp = requestor.request_stream( method, self.valid_path, params, @@ -363,18 +353,14 @@ def test_methods_with_params_and_streaming_response( assert resp.io.getvalue() == b'{"foo": "bar", "baz": 6}' if method == "post": - http_client_mock_streaming.assert_requested( - method, post_data=encoded - ) + http_client_mock.assert_requested(method, post_data=encoded) else: abs_url = "%s%s?%s" % ( stripe.api_base, self.valid_path, encoded, ) - http_client_mock_streaming.assert_requested( - method, abs_url=abs_url - ) + http_client_mock.assert_requested(method, abs_url=abs_url) def test_uses_headers(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -746,9 +732,9 @@ def test_invalid_grant_error(self, requestor, http_client_mock): ) def test_extract_error_from_stream_request_for_bytes( - self, requestor_streaming, http_client_mock_streaming + self, requestor, http_client_mock ): - http_client_mock_streaming.stub_request( + http_client_mock.stub_request( "get", path=self.valid_path, rbody=util.io.BytesIO(b'{"error": "invalid_grant"}'), @@ -756,15 +742,15 @@ def test_extract_error_from_stream_request_for_bytes( ) with pytest.raises(stripe.oauth_error.InvalidGrantError): - requestor_streaming.request_stream( + requestor.request_stream( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_extract_error_from_stream_request_for_response( - self, requestor_streaming, http_client_mock_streaming + self, requestor, http_client_mock ): # Responses don't have getvalue, they only have a read method. - http_client_mock_streaming.stub_request( + http_client_mock.stub_request( "get", path=self.valid_path, rbody=urllib3.response.HTTPResponse( @@ -775,7 +761,7 @@ def test_extract_error_from_stream_request_for_response( ) with pytest.raises(stripe.oauth_error.InvalidGrantError): - requestor_streaming.request_stream( + requestor.request_stream( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 623170709..b4d180fd5 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -8549,30 +8549,28 @@ def test_quotes_line_items_get_service( api_base="https://api.stripe.com", ) - def test_quotes_pdf_get( - self, http_client_mock_streaming: HTTPClientMock - ) -> None: + def test_quotes_pdf_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.pdf("qt_xxxxxxxxxxxxx") - http_client_mock_streaming.assert_requested( + http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", query_string="", ) def test_quotes_pdf_get_service( - self, http_client_mock_streaming: HTTPClientMock + self, http_client_mock: HTTPClientMock ) -> None: - http_client_mock_streaming.stub_request( + http_client_mock.stub_request( "get", "/v1/quotes/qt_xxxxxxxxxxxxx/pdf", ) client = StripeClient( "sk_test_123", - http_client=http_client_mock_streaming.get_mock_http_client(), + http_client=http_client_mock.get_mock_http_client(), ) client.quotes.pdf("qt_xxxxxxxxxxxxx") - http_client_mock_streaming.assert_requested( + http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", query_string="", From 8ee92b40da9676b19c8fdbb88eff6e6fb92334d8 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:34:35 -0800 Subject: [PATCH 014/179] Remove http client base (#1243) --- stripe/_http_client.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stripe/_http_client.py b/stripe/_http_client.py index d70521283..659ba0c73 100644 --- a/stripe/_http_client.py +++ b/stripe/_http_client.py @@ -106,8 +106,7 @@ def new_default_http_client(*args: Any, **kwargs: Any) -> "HTTPClient": return impl(*args, **kwargs) -class HTTPClientBase(object): - +class HTTPClient(object): name: ClassVar[str] class _Proxy(TypedDict): @@ -259,8 +258,6 @@ def _record_request_metrics(self, response, request_start, usage): request_id, request_duration_ms, usage=usage ) - -class HTTPClient(HTTPClientBase): # TODO: more specific types here would be helpful def request_with_retries( self, From 94d5e9260a65a320662f0f8fa8a390b996ad23fc Mon Sep 17 00:00:00 2001 From: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:29:23 -0800 Subject: [PATCH 015/179] Add TaxIds API (#1244) * Add top-level Tax ID methods * Add tests * fmt --- stripe/__init__.py | 1 + stripe/_stripe_client.py | 2 + stripe/_tax_id.py | 269 +++++++++++++++++++++++++++-- stripe/_tax_id_service.py | 236 +++++++++++++++++++++++++ tests/api_resources/test_tax_id.py | 41 ++++- 5 files changed, 522 insertions(+), 27 deletions(-) create mode 100644 stripe/_tax_id_service.py diff --git a/stripe/__init__.py b/stripe/__init__.py index 71b054df9..387bcaaf8 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -483,6 +483,7 @@ def __getattr__(name): TaxDeductedAtSource as TaxDeductedAtSource, ) from stripe._tax_id import TaxId as TaxId +from stripe._tax_id_service import TaxIdService as TaxIdService from stripe._tax_rate import TaxRate as TaxRate from stripe._tax_rate_service import TaxRateService as TaxRateService from stripe._tax_service import TaxService as TaxService diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 7def5bcd8..d492ddfd5 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -81,6 +81,7 @@ from stripe._subscription_schedule_service import SubscriptionScheduleService from stripe._tax_service import TaxService from stripe._tax_code_service import TaxCodeService +from stripe._tax_id_service import TaxIdService from stripe._tax_rate_service import TaxRateService from stripe._terminal_service import TerminalService from stripe._token_service import TokenService @@ -222,6 +223,7 @@ def __init__( ) self.tax = TaxService(self._requestor) self.tax_codes = TaxCodeService(self._requestor) + self.tax_ids = TaxIdService(self._requestor) self.tax_rates = TaxRateService(self._requestor) self.terminal = TerminalService(self._requestor) self.tokens = TokenService(self._requestor) diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index fc6f4b23c..ec064134c 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -1,19 +1,33 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe._api_resource import APIResource -from stripe._customer import Customer +from stripe._createable_api_resource import CreateableAPIResource +from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from stripe._util import sanitize_id -from typing import ClassVar, Optional -from typing_extensions import Literal, TYPE_CHECKING +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, List, Optional, cast, overload +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) if TYPE_CHECKING: from stripe._account import Account from stripe._application import Application + from stripe._customer import Customer -class TaxId(APIResource["TaxId"]): +class TaxId( + CreateableAPIResource["TaxId"], + DeletableAPIResource["TaxId"], + ListableAPIResource["TaxId"], +): """ You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers) or account. Customer and account tax IDs get displayed on related invoices and credit notes. @@ -55,6 +69,151 @@ class Verification(StripeObject): Verified name. """ + class CreateParams(RequestOptions): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + owner: NotRequired["TaxId.CreateParamsOwner"] + """ + The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. + """ + type: Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "au_abn", + "au_arn", + "bg_uic", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "no_vat", + "no_voec", + "nz_gst", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + """ + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + """ + value: str + """ + Value of the tax ID. + """ + + class CreateParamsOwner(TypedDict): + account: NotRequired["str"] + """ + Account the tax ID belongs to. Required when `type=account` + """ + customer: NotRequired["str"] + """ + Customer the tax ID belongs to. Required when `type=customer` + """ + type: Literal["account", "application", "customer", "self"] + """ + Type of owner referenced. + """ + + class DeleteParams(RequestOptions): + pass + + class ListParams(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. + """ + owner: NotRequired["TaxId.ListParamsOwner"] + """ + The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. + """ + 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. + """ + + class ListParamsOwner(TypedDict): + account: NotRequired["str"] + """ + Account the tax ID belongs to. Required when `type=account` + """ + customer: NotRequired["str"] + """ + Customer the tax ID belongs to. Required when `type=customer` + """ + type: Literal["account", "application", "customer", "self"] + """ + Type of owner referenced. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + country: Optional[str] """ Two-letter ISO code representing the country of the tax ID. @@ -169,21 +328,93 @@ class Verification(StripeObject): Always true for a deleted object """ - def instance_url(self): - token = self.id - customer = self.customer - base = Customer.class_url() - assert customer is not None - if isinstance(customer, Customer): - customer = customer.id - cust_extn = sanitize_id(customer) - extn = sanitize_id(token) - return "%s/%s/tax_ids/%s" % (base, cust_extn, extn) + @classmethod + def create(cls, **params: Unpack["TaxId.CreateParams"]) -> "TaxId": + """ + Creates a new account or customer tax_id object. + """ + return cast( + "TaxId", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def _cls_delete( + cls, sid: str, **params: Unpack["TaxId.DeleteParams"] + ) -> "TaxId": + """ + Deletes an existing account or customer tax_id object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "TaxId", + cls._static_request( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + def delete(sid: str, **params: Unpack["TaxId.DeleteParams"]) -> "TaxId": + """ + Deletes an existing account or customer tax_id object. + """ + ... + + @overload + def delete(self, **params: Unpack["TaxId.DeleteParams"]) -> "TaxId": + """ + Deletes an existing account or customer tax_id object. + """ + ... + + @class_method_variant("_cls_delete") + def delete( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["TaxId.DeleteParams"] + ) -> "TaxId": + """ + Deletes an existing account or customer tax_id object. + """ + return self._request_and_refresh( + "delete", + self.instance_url(), + params=params, + ) @classmethod - def retrieve(cls, id, **params): - raise NotImplementedError( - "Can't retrieve a tax id without a customer ID. Use customer.retrieve_tax_id('tax_id')" + def list(cls, **params: Unpack["TaxId.ListParams"]) -> ListObject["TaxId"]: + """ + Returns a list of tax IDs. + """ + 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 + def retrieve( + cls, id: str, **params: Unpack["TaxId.RetrieveParams"] + ) -> "TaxId": + """ + Retrieves an account or customer tax_id object. + """ + instance = cls(id, **params) + instance.refresh() + return instance _inner_class_types = {"owner": Owner, "verification": Verification} diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py new file mode 100644 index 000000000..e835ad4aa --- /dev/null +++ b/stripe/_tax_id_service.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._tax_id import TaxId +from stripe._util import sanitize_id +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class TaxIdService(StripeService): + class CreateParams(TypedDict): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + owner: NotRequired["TaxIdService.CreateParamsOwner"] + """ + The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. + """ + type: Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "au_abn", + "au_arn", + "bg_uic", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "no_vat", + "no_voec", + "nz_gst", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + """ + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + """ + value: str + """ + Value of the tax ID. + """ + + class CreateParamsOwner(TypedDict): + account: NotRequired["str"] + """ + Account the tax ID belongs to. Required when `type=account` + """ + customer: NotRequired["str"] + """ + Customer the tax ID belongs to. Required when `type=customer` + """ + type: Literal["account", "application", "customer", "self"] + """ + Type of owner referenced. + """ + + class DeleteParams(TypedDict): + pass + + class ListParams(TypedDict): + 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. + """ + owner: NotRequired["TaxIdService.ListParamsOwner"] + """ + The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. + """ + 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. + """ + + class ListParamsOwner(TypedDict): + account: NotRequired["str"] + """ + Account the tax ID belongs to. Required when `type=account` + """ + customer: NotRequired["str"] + """ + Customer the tax ID belongs to. Required when `type=customer` + """ + type: Literal["account", "application", "customer", "self"] + """ + Type of owner referenced. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + def delete( + self, + id: str, + params: "TaxIdService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> TaxId: + """ + Deletes an existing account or customer tax_id object. + """ + return cast( + TaxId, + self._request( + "delete", + "/v1/tax_ids/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "TaxIdService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> TaxId: + """ + Retrieves an account or customer tax_id object. + """ + return cast( + TaxId, + self._request( + "get", + "/v1/tax_ids/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + params: "TaxIdService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[TaxId]: + """ + Returns a list of tax IDs. + """ + return cast( + ListObject[TaxId], + self._request( + "get", + "/v1/tax_ids", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, params: "TaxIdService.CreateParams", options: RequestOptions = {} + ) -> TaxId: + """ + Creates a new account or customer tax_id object. + """ + return cast( + TaxId, + self._request( + "post", + "/v1/tax_ids", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/tests/api_resources/test_tax_id.py b/tests/api_resources/test_tax_id.py index e5e3f5fb6..cdcb11207 100644 --- a/tests/api_resources/test_tax_id.py +++ b/tests/api_resources/test_tax_id.py @@ -1,5 +1,3 @@ -import pytest - import stripe @@ -17,11 +15,38 @@ def construct_resource(self): def test_has_instance_url(self): resource = self.construct_resource() - assert ( - resource.instance_url() - == "/v1/customers/cus_123/tax_ids/%s" % TEST_RESOURCE_ID + assert resource.instance_url() == "/v1/tax_ids/%s" % TEST_RESOURCE_ID + + def test_is_creatable(self, http_client_mock): + stripe.TaxId.create( + type="eu_vat", + value="DE123456789", + ) + http_client_mock.assert_requested("post", path="/v1/tax_ids") + + def test_is_retrievable(self, http_client_mock): + stripe.TaxId.retrieve(TEST_RESOURCE_ID) + http_client_mock.assert_requested( + "get", path="/v1/tax_ids/%s" % TEST_RESOURCE_ID + ) + + def test_is_deletable(self, http_client_mock): + resource = stripe.TaxId.retrieve(TEST_RESOURCE_ID) + resource.delete() + http_client_mock.assert_requested( + "delete", path="/v1/tax_ids/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True + + def test_can_delete(self, http_client_mock): + resource = stripe.TaxId.delete(TEST_RESOURCE_ID) + http_client_mock.assert_requested( + "delete", path="/v1/tax_ids/%s" % TEST_RESOURCE_ID ) + assert resource.deleted is True - def test_is_not_retrievable(self): - with pytest.raises(NotImplementedError): - stripe.TaxId.retrieve(TEST_RESOURCE_ID) + def test_is_listable(self, http_client_mock): + resources = stripe.TaxId.list() + http_client_mock.assert_requested("get", path="/v1/tax_ids") + assert isinstance(resources.data, list) + assert isinstance(resources.data[0], stripe.TaxId) From db4bd1de23c155e42ed6a4b11807a120d0d6749d Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 14:18:04 -0800 Subject: [PATCH 016/179] Update generated code (#1241) * Update generated code for v832 * Update generated code for v833 * Update generated code for v834 * Update generated code for v835 * Update generated code for v835 * Update generated code for v836 * Update generated code for v837 * Update generated code for v838 * Update generated code for v839 * Update generated code for v840 * Update generated code for v840 * Update generated code for v840 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 3 + stripe/_account_service.py | 3 + stripe/_application_fee.py | 3 + stripe/_application_fee_service.py | 3 + stripe/_balance_transaction.py | 5 +- stripe/_balance_transaction_service.py | 3 + stripe/_charge.py | 3 + stripe/_charge_service.py | 3 + stripe/_customer.py | 3 + stripe/_customer_service.py | 3 + stripe/_event.py | 3 + stripe/_event_service.py | 3 + stripe/_file.py | 3 + stripe/_file_link.py | 3 + stripe/_file_link_service.py | 3 + stripe/_file_service.py | 3 + stripe/_invoice.py | 9 +- stripe/_invoice_item.py | 3 + stripe/_invoice_item_service.py | 3 + stripe/_invoice_line_item.py | 214 +++++++++++++++++- stripe/_invoice_line_item_service.py | 210 ++++++++++++++++- stripe/_invoice_service.py | 7 +- stripe/_invoice_upcoming_lines_service.py | 2 +- stripe/_payout.py | 3 + stripe/_payout_service.py | 3 + stripe/_refund_service.py | 3 + stripe/_review.py | 3 + stripe/_review_service.py | 3 + stripe/_subscription.py | 9 +- stripe/_subscription_item.py | 6 +- stripe/_subscription_item_service.py | 6 +- stripe/_subscription_service.py | 9 +- stripe/_tax_rate.py | 6 +- stripe/_tax_rate_service.py | 4 +- stripe/_transfer.py | 3 + stripe/_transfer_service.py | 3 + stripe/billing_portal/_configuration.py | 2 +- stripe/checkout/_session.py | 2 +- stripe/checkout/_session_service.py | 2 +- stripe/identity/_verification_report.py | 11 + .../identity/_verification_report_service.py | 7 + stripe/identity/_verification_session.py | 15 ++ .../identity/_verification_session_service.py | 11 + stripe/issuing/_dispute.py | 2 +- stripe/issuing/_dispute_service.py | 2 +- stripe/issuing/_token.py | 2 +- stripe/issuing/_token_service.py | 2 +- stripe/radar/_value_list.py | 3 + stripe/radar/_value_list_item.py | 3 + stripe/radar/_value_list_item_service.py | 3 + stripe/radar/_value_list_service.py | 3 + stripe/reporting/_report_run.py | 3 + stripe/reporting/_report_run_service.py | 3 + stripe/treasury/_financial_account.py | 3 + .../_financial_account_features_service.py | 202 ++++++++++++++++- stripe/treasury/_financial_account_service.py | 3 + stripe/treasury/_outbound_payment.py | 22 ++ stripe/treasury/_outbound_payment_service.py | 22 ++ stripe/treasury/_transaction.py | 3 + stripe/treasury/_transaction_entry.py | 3 + stripe/treasury/_transaction_entry_service.py | 3 + stripe/treasury/_transaction_service.py | 3 + 63 files changed, 862 insertions(+), 39 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 5433dd907..e3b365910 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v829 \ No newline at end of file +v840 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 4795e9748..dd752a614 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -2983,6 +2983,9 @@ class ListExternalAccountsParams(RequestOptions): class ListParams(RequestOptions): created: NotRequired["Account.ListParamsCreated|int"] + """ + Only return connected accounts that were created during the given date interval. + """ 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. diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 492e334ce..79a36b2b3 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -1498,6 +1498,9 @@ class DeleteParams(TypedDict): class ListParams(TypedDict): created: NotRequired["AccountService.ListParamsCreated|int"] + """ + Only return connected accounts that were created during the given date interval. + """ 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. diff --git a/stripe/_application_fee.py b/stripe/_application_fee.py index 654b58c80..65edc18ca 100644 --- a/stripe/_application_fee.py +++ b/stripe/_application_fee.py @@ -47,6 +47,9 @@ class ListParams(RequestOptions): Only return application fees for the charge specified by this charge ID. """ created: NotRequired["ApplicationFee.ListParamsCreated|int"] + """ + Only return applications fees that were created during the given date interval. + """ 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. diff --git a/stripe/_application_fee_service.py b/stripe/_application_fee_service.py index 7553c1f96..ec6097625 100644 --- a/stripe/_application_fee_service.py +++ b/stripe/_application_fee_service.py @@ -21,6 +21,9 @@ class ListParams(TypedDict): Only return application fees for the charge specified by this charge ID. """ created: NotRequired["ApplicationFeeService.ListParamsCreated|int"] + """ + Only return applications fees that were created during the given date interval. + """ 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. diff --git a/stripe/_balance_transaction.py b/stripe/_balance_transaction.py index cd2be2bef..2dcb2ef9b 100644 --- a/stripe/_balance_transaction.py +++ b/stripe/_balance_transaction.py @@ -67,11 +67,14 @@ class FeeDetail(StripeObject): """ type: str """ - Type of the fee, one of: `application_fee`, `stripe_fee` or `tax`. + Type of the fee, one of: `application_fee`, `payment_method_passthrough_fee`, `stripe_fee` or `tax`. """ class ListParams(RequestOptions): created: NotRequired["BalanceTransaction.ListParamsCreated|int"] + """ + Only return transactions that were created during the given date interval. + """ currency: NotRequired["str"] """ Only return transactions in a certain currency. 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/_balance_transaction_service.py b/stripe/_balance_transaction_service.py index 3ee27421a..ad5eb2e90 100644 --- a/stripe/_balance_transaction_service.py +++ b/stripe/_balance_transaction_service.py @@ -12,6 +12,9 @@ class BalanceTransactionService(StripeService): class ListParams(TypedDict): created: NotRequired["BalanceTransactionService.ListParamsCreated|int"] + """ + Only return transactions that were created during the given date interval. + """ currency: NotRequired["str"] """ Only return transactions in a certain currency. 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/_charge.py b/stripe/_charge.py index a8822ff21..ff4341274 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1877,6 +1877,9 @@ class CreateParamsTransferData(TypedDict): class ListParams(RequestOptions): created: NotRequired["Charge.ListParamsCreated|int"] + """ + Only return charges that were created during the given date interval. + """ customer: NotRequired["str"] """ Only return charges for the customer specified by this customer ID. diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index 923b6cb1b..672df3981 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -203,6 +203,9 @@ class CreateParamsTransferData(TypedDict): class ListParams(TypedDict): created: NotRequired["ChargeService.ListParamsCreated|int"] + """ + Only return charges that were created during the given date interval. + """ customer: NotRequired["str"] """ Only return charges for the customer specified by this customer ID. diff --git a/stripe/_customer.py b/stripe/_customer.py index 9155b77a5..09063ab7c 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -748,6 +748,9 @@ class ListCashBalanceTransactionsParams(RequestOptions): class ListParams(RequestOptions): created: NotRequired["Customer.ListParamsCreated|int"] + """ + Only return customers that were created during the given date interval. + """ email: NotRequired["str"] """ A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index cc60fea72..20b93bc53 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -354,6 +354,9 @@ class DeleteParams(TypedDict): class ListParams(TypedDict): created: NotRequired["CustomerService.ListParamsCreated|int"] + """ + Only return customers that were created during the given date interval. + """ email: NotRequired["str"] """ A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. diff --git a/stripe/_event.py b/stripe/_event.py index 1ac83497e..49fca07ec 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -66,6 +66,9 @@ class Request(StripeObject): class ListParams(RequestOptions): created: NotRequired["Event.ListParamsCreated|int"] + """ + Only return events that were created during the given date interval. + """ delivery_success: NotRequired["bool"] """ Filter events by whether all webhooks were successfully delivered. If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned. diff --git a/stripe/_event_service.py b/stripe/_event_service.py index e2e3a8438..694153301 100644 --- a/stripe/_event_service.py +++ b/stripe/_event_service.py @@ -12,6 +12,9 @@ class EventService(StripeService): class ListParams(TypedDict): created: NotRequired["EventService.ListParamsCreated|int"] + """ + Only return events that were created during the given date interval. + """ delivery_success: NotRequired["bool"] """ Filter events by whether all webhooks were successfully delivered. If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned. diff --git a/stripe/_file.py b/stripe/_file.py index 37af1bbcd..f2309b4f3 100644 --- a/stripe/_file.py +++ b/stripe/_file.py @@ -75,6 +75,9 @@ class CreateParamsFileLinkData(TypedDict): class ListParams(RequestOptions): created: NotRequired["File.ListParamsCreated|int"] + """ + Only return files that were created during the given date interval. + """ 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. diff --git a/stripe/_file_link.py b/stripe/_file_link.py index d4bb91f91..37f0f770e 100644 --- a/stripe/_file_link.py +++ b/stripe/_file_link.py @@ -53,6 +53,9 @@ class CreateParams(RequestOptions): class ListParams(RequestOptions): created: NotRequired["FileLink.ListParamsCreated|int"] + """ + Only return links that were created during the given date interval. + """ 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. diff --git a/stripe/_file_link_service.py b/stripe/_file_link_service.py index 3579ac429..a98bdbc08 100644 --- a/stripe/_file_link_service.py +++ b/stripe/_file_link_service.py @@ -30,6 +30,9 @@ class CreateParams(TypedDict): class ListParams(TypedDict): created: NotRequired["FileLinkService.ListParamsCreated|int"] + """ + Only return links that were created during the given date interval. + """ 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. diff --git a/stripe/_file_service.py b/stripe/_file_service.py index a5ab0060a..70a68b205 100644 --- a/stripe/_file_service.py +++ b/stripe/_file_service.py @@ -55,6 +55,9 @@ class CreateParamsFileLinkData(TypedDict): class ListParams(TypedDict): created: NotRequired["FileService.ListParamsCreated|int"] + """ + Only return files that were created during the given date interval. + """ 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. diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 883437dbc..1a4c51108 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -1071,7 +1071,7 @@ class CreateParams(RequestOptions): "Literal['exclude', 'include', 'include_and_require']" ] """ - How to handle pending invoice items on invoice creation. One of `include` or `exclude`. `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. Defaults to `exclude` if the parameter is omitted. + How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted. """ rendering: NotRequired["Invoice.CreateParamsRendering"] """ @@ -1580,6 +1580,9 @@ class ListParams(RequestOptions): The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. """ created: NotRequired["Invoice.ListParamsCreated|int"] + """ + Only return invoices that were created during the given date interval. + """ customer: NotRequired["str"] """ Only return invoices for the customer specified by this customer ID. @@ -2380,7 +2383,7 @@ class UpcomingLinesParams(RequestOptions): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ subscription_proration_date: NotRequired["int"] """ @@ -2922,7 +2925,7 @@ class UpcomingParams(RequestOptions): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ subscription_proration_date: NotRequired["int"] """ diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index e5368dd08..1d3b0d10d 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -192,6 +192,9 @@ class DeleteParams(RequestOptions): class ListParams(RequestOptions): created: NotRequired["InvoiceItem.ListParamsCreated|int"] + """ + Only return invoice items that were created during the given date interval. + """ customer: NotRequired["str"] """ The identifier of the customer whose invoice items to return. If none is provided, all invoice items will be returned. diff --git a/stripe/_invoice_item_service.py b/stripe/_invoice_item_service.py index 6c3b4c86b..c097edb20 100644 --- a/stripe/_invoice_item_service.py +++ b/stripe/_invoice_item_service.py @@ -141,6 +141,9 @@ class DeleteParams(TypedDict): class ListParams(TypedDict): created: NotRequired["InvoiceItemService.ListParamsCreated|int"] + """ + Only return invoice items that were created during the given date interval. + """ customer: NotRequired["str"] """ The identifier of the customer whose invoice items to return. If none is provided, all invoice items will be returned. diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 44be8a05a..28d6ecdb1 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -1,9 +1,18 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField +from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from typing import ClassVar, Dict, List, Optional -from typing_extensions import Literal, TYPE_CHECKING +from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id +from typing import ClassVar, Dict, List, Optional, cast +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) if TYPE_CHECKING: from stripe._discount import Discount @@ -15,7 +24,7 @@ from stripe._tax_rate import TaxRate -class InvoiceLineItem(StripeObject): +class InvoiceLineItem(UpdateableAPIResource["InvoiceLineItem"]): OBJECT_NAME: ClassVar[Literal["line_item"]] = "line_item" class DiscountAmount(StripeObject): @@ -95,6 +104,184 @@ class TaxAmount(StripeObject): The amount on which tax is calculated, in cents (or local equivalent). """ + class ModifyParams(RequestOptions): + amount: NotRequired["int"] + """ + The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. + """ + description: NotRequired["str"] + """ + An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + """ + discountable: NotRequired["bool"] + """ + Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceLineItem.ModifyParamsDiscount]" + ] + """ + The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + """ + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + period: NotRequired["InvoiceLineItem.ModifyParamsPeriod"] + """ + The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + """ + price: NotRequired["str"] + """ + The ID of the price object. + """ + price_data: NotRequired["InvoiceLineItem.ModifyParamsPriceData"] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired["int"] + """ + Non-negative integer. The quantity of units for the line item. + """ + tax_amounts: NotRequired[ + "Literal['']|List[InvoiceLineItem.ModifyParamsTaxAmount]" + ] + """ + A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. + """ + + class ModifyParamsDiscount(TypedDict): + coupon: NotRequired["str"] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired["str"] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + + class ModifyParamsPeriod(TypedDict): + end: int + """ + The end of the period, which must be greater than or equal to the start. This value is inclusive. + """ + start: int + """ + The start of the period. This value is inclusive. + """ + + class ModifyParamsPriceData(TypedDict): + 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). + """ + product: NotRequired["str"] + """ + The ID of the product that this price will belong to. One of `product` or `product_data` is required. + """ + product_data: NotRequired[ + "InvoiceLineItem.ModifyParamsPriceDataProductData" + ] + """ + Data used to generate a new product object inline. One of `product` or `product_data` is required. + """ + tax_behavior: NotRequired[ + "Literal['exclusive', 'inclusive', 'unspecified']" + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired["int"] + """ + A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + """ + unit_amount_decimal: NotRequired["str"] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class ModifyParamsPriceDataProductData(TypedDict): + description: NotRequired["str"] + """ + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + """ + images: NotRequired["List[str]"] + """ + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + """ + metadata: NotRequired["Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + name: str + """ + The product's name, meant to be displayable to the customer. + """ + tax_code: NotRequired["str"] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + + class ModifyParamsTaxAmount(TypedDict): + amount: int + """ + The amount, in cents (or local equivalent), of the tax. + """ + tax_rate_data: "InvoiceLineItem.ModifyParamsTaxAmountTaxRateData" + """ + Data to find or create a TaxRate object. + + Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. + """ + taxable_amount: int + """ + The amount on which tax is calculated, in cents (or local equivalent). + """ + + class ModifyParamsTaxAmountTaxRateData(TypedDict): + country: NotRequired["str"] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + description: NotRequired["str"] + """ + An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + """ + display_name: str + """ + The display name of the tax rate, which will be shown to users. + """ + inclusive: bool + """ + This specifies if the tax rate is inclusive or exclusive. + """ + jurisdiction: NotRequired["str"] + """ + The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. + """ + percentage: float + """ + The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. + """ + state: NotRequired["str"] + """ + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + """ + tax_type: NotRequired[ + "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'vat', 'service_tax']" + ] + """ + The high-level tax type, such as `vat` or `sales_tax`. + """ + amount: int """ The amount, in cents (or local equivalent). @@ -192,6 +379,27 @@ class TaxAmount(StripeObject): """ The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts. """ + + @classmethod + def modify( + cls, id: str, **params: Unpack["InvoiceLineItem.ModifyParams"] + ) -> "InvoiceLineItem": + """ + Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, + so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice + item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. + Updating an invoice's line item is only possible before the invoice is finalized. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "InvoiceLineItem", + cls._static_request( + "post", + url, + params=params, + ), + ) + _inner_class_types = { "discount_amounts": DiscountAmount, "period": Period, diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index 37fca43f4..af42968d7 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -5,8 +5,8 @@ from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id -from typing import List, cast -from typing_extensions import NotRequired, TypedDict +from typing import Dict, List, cast +from typing_extensions import Literal, NotRequired, TypedDict class InvoiceLineItemService(StripeService): @@ -28,6 +28,184 @@ class ListParams(TypedDict): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ + class UpdateParams(TypedDict): + amount: NotRequired["int"] + """ + The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. + """ + description: NotRequired["str"] + """ + An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + """ + discountable: NotRequired["bool"] + """ + Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceLineItemService.UpdateParamsDiscount]" + ] + """ + The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + """ + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + period: NotRequired["InvoiceLineItemService.UpdateParamsPeriod"] + """ + The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + """ + price: NotRequired["str"] + """ + The ID of the price object. + """ + price_data: NotRequired["InvoiceLineItemService.UpdateParamsPriceData"] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired["int"] + """ + Non-negative integer. The quantity of units for the line item. + """ + tax_amounts: NotRequired[ + "Literal['']|List[InvoiceLineItemService.UpdateParamsTaxAmount]" + ] + """ + A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. + """ + + class UpdateParamsDiscount(TypedDict): + coupon: NotRequired["str"] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired["str"] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + + class UpdateParamsPeriod(TypedDict): + end: int + """ + The end of the period, which must be greater than or equal to the start. This value is inclusive. + """ + start: int + """ + The start of the period. This value is inclusive. + """ + + class UpdateParamsPriceData(TypedDict): + 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). + """ + product: NotRequired["str"] + """ + The ID of the product that this price will belong to. One of `product` or `product_data` is required. + """ + product_data: NotRequired[ + "InvoiceLineItemService.UpdateParamsPriceDataProductData" + ] + """ + Data used to generate a new product object inline. One of `product` or `product_data` is required. + """ + tax_behavior: NotRequired[ + "Literal['exclusive', 'inclusive', 'unspecified']" + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired["int"] + """ + A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + """ + unit_amount_decimal: NotRequired["str"] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class UpdateParamsPriceDataProductData(TypedDict): + description: NotRequired["str"] + """ + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + """ + images: NotRequired["List[str]"] + """ + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + """ + metadata: NotRequired["Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + name: str + """ + The product's name, meant to be displayable to the customer. + """ + tax_code: NotRequired["str"] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + + class UpdateParamsTaxAmount(TypedDict): + amount: int + """ + The amount, in cents (or local equivalent), of the tax. + """ + tax_rate_data: "InvoiceLineItemService.UpdateParamsTaxAmountTaxRateData" + """ + Data to find or create a TaxRate object. + + Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. + """ + taxable_amount: int + """ + The amount on which tax is calculated, in cents (or local equivalent). + """ + + class UpdateParamsTaxAmountTaxRateData(TypedDict): + country: NotRequired["str"] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + description: NotRequired["str"] + """ + An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + """ + display_name: str + """ + The display name of the tax rate, which will be shown to users. + """ + inclusive: bool + """ + This specifies if the tax rate is inclusive or exclusive. + """ + jurisdiction: NotRequired["str"] + """ + The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. + """ + percentage: float + """ + The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. + """ + state: NotRequired["str"] + """ + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + """ + tax_type: NotRequired[ + "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'vat', 'service_tax']" + ] + """ + The high-level tax type, such as `vat` or `sales_tax`. + """ + def list( self, invoice: str, @@ -50,3 +228,31 @@ def list( options=options, ), ) + + def update( + self, + invoice: str, + line_item_id: str, + params: "InvoiceLineItemService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> InvoiceLineItem: + """ + Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, + so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice + item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. + Updating an invoice's line item is only possible before the invoice is finalized. + """ + return cast( + InvoiceLineItem, + self._request( + "post", + "/v1/invoices/{invoice}/lines/{line_item_id}".format( + invoice=sanitize_id(invoice), + line_item_id=sanitize_id(line_item_id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 74ca9dc3e..69cb98fa5 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -123,7 +123,7 @@ class CreateParams(TypedDict): "Literal['exclude', 'include', 'include_and_require']" ] """ - How to handle pending invoice items on invoice creation. One of `include` or `exclude`. `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. Defaults to `exclude` if the parameter is omitted. + How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted. """ rendering: NotRequired["InvoiceService.CreateParamsRendering"] """ @@ -636,6 +636,9 @@ class ListParams(TypedDict): The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. """ created: NotRequired["InvoiceService.ListParamsCreated|int"] + """ + Only return invoices that were created during the given date interval. + """ customer: NotRequired["str"] """ Only return invoices for the customer specified by this customer ID. @@ -859,7 +862,7 @@ class UpcomingParams(TypedDict): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ subscription_proration_date: NotRequired["int"] """ diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index 144a793e7..5ed8a439f 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -110,7 +110,7 @@ class ListParams(TypedDict): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ subscription_proration_date: NotRequired["int"] """ diff --git a/stripe/_payout.py b/stripe/_payout.py index 5aa5ec72d..b20ecbc67 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -87,6 +87,9 @@ class CreateParams(RequestOptions): class ListParams(RequestOptions): arrival_date: NotRequired["Payout.ListParamsArrivalDate|int"] created: NotRequired["Payout.ListParamsCreated|int"] + """ + Only return payouts that were created during the given date interval. + """ destination: NotRequired["str"] """ The ID of an external account - only return payouts sent to this external account. diff --git a/stripe/_payout_service.py b/stripe/_payout_service.py index 6bd83db57..d3070c3b2 100644 --- a/stripe/_payout_service.py +++ b/stripe/_payout_service.py @@ -57,6 +57,9 @@ class CreateParams(TypedDict): class ListParams(TypedDict): arrival_date: NotRequired["PayoutService.ListParamsArrivalDate|int"] created: NotRequired["PayoutService.ListParamsCreated|int"] + """ + Only return payouts that were created during the given date interval. + """ destination: NotRequired["str"] """ The ID of an external account - only return payouts sent to this external account. diff --git a/stripe/_refund_service.py b/stripe/_refund_service.py index 3a4f80905..48c4f620a 100644 --- a/stripe/_refund_service.py +++ b/stripe/_refund_service.py @@ -73,6 +73,9 @@ class ListParams(TypedDict): Only return refunds for the charge specified by this charge ID. """ created: NotRequired["RefundService.ListParamsCreated|int"] + """ + Only return refunds that were created during the given date interval. + """ 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. diff --git a/stripe/_review.py b/stripe/_review.py index 3a55c51a5..2bb7a4e78 100644 --- a/stripe/_review.py +++ b/stripe/_review.py @@ -78,6 +78,9 @@ class ApproveParams(RequestOptions): class ListParams(RequestOptions): created: NotRequired["Review.ListParamsCreated|int"] + """ + Only return reviews that were created during the given date interval. + """ 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. diff --git a/stripe/_review_service.py b/stripe/_review_service.py index 7a3532a1c..cdd2b4f64 100644 --- a/stripe/_review_service.py +++ b/stripe/_review_service.py @@ -18,6 +18,9 @@ class ApproveParams(TypedDict): class ListParams(TypedDict): created: NotRequired["ReviewService.ListParamsCreated|int"] + """ + Only return reviews that were created during the given date interval. + """ 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. diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 4ed86fa4f..8f103635e 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -586,7 +586,7 @@ class CreateParams(RequestOptions): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. """ transfer_data: NotRequired["Subscription.CreateParamsTransferData"] """ @@ -1041,6 +1041,9 @@ class ListParams(RequestOptions): The collection method of the subscriptions to retrieve. Either `charge_automatically` or `send_invoice`. """ created: NotRequired["Subscription.ListParamsCreated|int"] + """ + Only return subscriptions that were created during the given date interval. + """ current_period_end: NotRequired[ "Subscription.ListParamsCurrentPeriodEnd|int" ] @@ -1279,7 +1282,7 @@ class ModifyParams(RequestOptions): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired["int"] """ @@ -1746,7 +1749,7 @@ class ResumeParams(RequestOptions): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired["int"] """ diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index 2b2e64ce4..bc6821b3a 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -90,7 +90,7 @@ class CreateParams(RequestOptions): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired["int"] """ @@ -180,7 +180,7 @@ class DeleteParams(RequestOptions): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired["int"] """ @@ -274,7 +274,7 @@ class ModifyParams(RequestOptions): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired["int"] """ diff --git a/stripe/_subscription_item_service.py b/stripe/_subscription_item_service.py index 1777057f5..499f83d41 100644 --- a/stripe/_subscription_item_service.py +++ b/stripe/_subscription_item_service.py @@ -72,7 +72,7 @@ class CreateParams(TypedDict): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired["int"] """ @@ -144,7 +144,7 @@ class DeleteParams(TypedDict): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired["int"] """ @@ -228,7 +228,7 @@ class UpdateParams(TypedDict): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired["int"] """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index f9f849c72..7be42d79b 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -189,7 +189,7 @@ class CreateParams(TypedDict): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. """ transfer_data: NotRequired[ "SubscriptionService.CreateParamsTransferData" @@ -654,6 +654,9 @@ class ListParams(TypedDict): The collection method of the subscriptions to retrieve. Either `charge_automatically` or `send_invoice`. """ created: NotRequired["SubscriptionService.ListParamsCreated|int"] + """ + Only return subscriptions that were created during the given date interval. + """ current_period_end: NotRequired[ "SubscriptionService.ListParamsCurrentPeriodEnd|int" ] @@ -772,7 +775,7 @@ class ResumeParams(TypedDict): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired["int"] """ @@ -938,7 +941,7 @@ class UpdateParams(TypedDict): "Literal['always_invoice', 'create_prorations', 'none']" ] """ - Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired["int"] """ diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index 8bcebeeb8..0ece4d92a 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -65,7 +65,7 @@ class CreateParams(RequestOptions): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'service_tax', 'vat']" + "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'vat', 'service_tax']" ] """ The high-level tax type, such as `vat` or `sales_tax`. @@ -153,7 +153,7 @@ class ModifyParams(RequestOptions): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'service_tax', 'vat']" + "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'vat', 'service_tax']" ] """ The high-level tax type, such as `vat` or `sales_tax`. @@ -242,8 +242,8 @@ class RetrieveParams(RequestOptions): "qst", "rst", "sales_tax", - "service_tax", "vat", + "service_tax", ] ] """ diff --git a/stripe/_tax_rate_service.py b/stripe/_tax_rate_service.py index 4dc574dcc..4beab11a1 100644 --- a/stripe/_tax_rate_service.py +++ b/stripe/_tax_rate_service.py @@ -52,7 +52,7 @@ class CreateParams(TypedDict): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'service_tax', 'vat']" + "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'vat', 'service_tax']" ] """ The high-level tax type, such as `vat` or `sales_tax`. @@ -146,7 +146,7 @@ class UpdateParams(TypedDict): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'service_tax', 'vat']" + "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'vat', 'service_tax']" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/_transfer.py b/stripe/_transfer.py index f9d2b2b9d..c6763eef6 100644 --- a/stripe/_transfer.py +++ b/stripe/_transfer.py @@ -107,6 +107,9 @@ class CreateReversalParams(RequestOptions): class ListParams(RequestOptions): created: NotRequired["Transfer.ListParamsCreated|int"] + """ + Only return transfers that were created during the given date interval. + """ destination: NotRequired["str"] """ Only return transfers for the destination specified by this account ID. diff --git a/stripe/_transfer_service.py b/stripe/_transfer_service.py index 817ba1f25..581d2d78c 100644 --- a/stripe/_transfer_service.py +++ b/stripe/_transfer_service.py @@ -55,6 +55,9 @@ class CreateParams(TypedDict): class ListParams(TypedDict): created: NotRequired["TransferService.ListParamsCreated|int"] + """ + Only return transfers that were created during the given date interval. + """ destination: NotRequired["str"] """ Only return transfers for the destination specified by this account ID. diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index 29b445e75..7e9fb906c 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -149,7 +149,7 @@ class Product(StripeObject): "always_invoice", "create_prorations", "none" ] """ - Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. + Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. Defaults to a value of `none` if you don't set it during creation. """ _inner_class_types = {"products": Product} diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 93ca1d18c..6d99c10c5 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -3378,7 +3378,7 @@ class ListLineItemsParams(RequestOptions): class ListParams(RequestOptions): created: NotRequired["Session.ListParamsCreated|int"] """ - Only return the Checkout Sessions that were created during the given date interval. + Only return Checkout Sessions that were created during the given date interval. """ customer: NotRequired["str"] """ diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 649f1f8d5..d14975cd0 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -1965,7 +1965,7 @@ class ExpireParams(TypedDict): class ListParams(TypedDict): created: NotRequired["SessionService.ListParamsCreated|int"] """ - Only return the Checkout Sessions that were created during the given date interval. + Only return Checkout Sessions that were created during the given date interval. """ customer: NotRequired["str"] """ diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index 6701de048..fbc13cd64 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -294,7 +294,14 @@ class Error(StripeObject): _inner_class_types = {"error": Error} class ListParams(RequestOptions): + client_reference_id: NotRequired["str"] + """ + A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + """ created: NotRequired["VerificationReport.ListParamsCreated|int"] + """ + Only return VerificationReports that were created during the given date interval. + """ 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. @@ -344,6 +351,10 @@ class RetrieveParams(RequestOptions): Specifies which fields in the response should be expanded. """ + client_reference_id: Optional[str] + """ + A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. diff --git a/stripe/identity/_verification_report_service.py b/stripe/identity/_verification_report_service.py index bdf1b0be5..281f9279a 100644 --- a/stripe/identity/_verification_report_service.py +++ b/stripe/identity/_verification_report_service.py @@ -11,7 +11,14 @@ class VerificationReportService(StripeService): class ListParams(TypedDict): + client_reference_id: NotRequired["str"] + """ + A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + """ created: NotRequired["VerificationReportService.ListParamsCreated|int"] + """ + Only return VerificationReports that were created during the given date interval. + """ 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. diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index d668cefb1..7a1279af1 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -180,6 +180,10 @@ class CancelParams(RequestOptions): """ class CreateParams(RequestOptions): + client_reference_id: NotRequired["str"] + """ + A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + """ expand: NotRequired["List[str]"] """ Specifies which fields in the response should be expanded. @@ -230,7 +234,14 @@ class CreateParamsOptionsDocument(TypedDict): """ class ListParams(RequestOptions): + client_reference_id: NotRequired["str"] + """ + A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + """ created: NotRequired["VerificationSession.ListParamsCreated|int"] + """ + Only return VerificationSessions that were created during the given date interval. + """ 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. @@ -330,6 +341,10 @@ class RetrieveParams(RequestOptions): Specifies which fields in the response should be expanded. """ + client_reference_id: Optional[str] + """ + A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + """ client_secret: Optional[str] """ The short-lived client secret used by Stripe.js to [show a verification modal](https://stripe.com/docs/js/identity/modal) inside your app. This client secret expires after 24 hours and can only be used once. Don't store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on [passing the client secret to the frontend](https://stripe.com/docs/identity/verification-sessions#client-secret) to learn more. diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index 8fd15286f..08cf2148c 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -17,6 +17,10 @@ class CancelParams(TypedDict): """ class CreateParams(TypedDict): + client_reference_id: NotRequired["str"] + """ + A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + """ expand: NotRequired["List[str]"] """ Specifies which fields in the response should be expanded. @@ -67,9 +71,16 @@ class CreateParamsOptionsDocument(TypedDict): """ class ListParams(TypedDict): + client_reference_id: NotRequired["str"] + """ + A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + """ created: NotRequired[ "VerificationSessionService.ListParamsCreated|int" ] + """ + Only return VerificationSessions that were created during the given date interval. + """ 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. diff --git a/stripe/issuing/_dispute.py b/stripe/issuing/_dispute.py index e51c3acf1..42ba8d0a7 100644 --- a/stripe/issuing/_dispute.py +++ b/stripe/issuing/_dispute.py @@ -501,7 +501,7 @@ class CreateParamsTreasury(TypedDict): class ListParams(RequestOptions): created: NotRequired["Dispute.ListParamsCreated|int"] """ - Select Issuing disputes that were created during the given date interval. + Only return Issuing disputes that were created during the given date interval. """ ending_before: NotRequired["str"] """ diff --git a/stripe/issuing/_dispute_service.py b/stripe/issuing/_dispute_service.py index 348e175a4..420dfee49 100644 --- a/stripe/issuing/_dispute_service.py +++ b/stripe/issuing/_dispute_service.py @@ -271,7 +271,7 @@ class CreateParamsTreasury(TypedDict): class ListParams(TypedDict): created: NotRequired["DisputeService.ListParamsCreated|int"] """ - Select Issuing disputes that were created during the given date interval. + Only return Issuing disputes that were created during the given date interval. """ ending_before: NotRequired["str"] """ diff --git a/stripe/issuing/_token.py b/stripe/issuing/_token.py index 5ec5c7c58..4f1ca698b 100644 --- a/stripe/issuing/_token.py +++ b/stripe/issuing/_token.py @@ -199,7 +199,7 @@ class ListParams(RequestOptions): """ created: NotRequired["Token.ListParamsCreated|int"] """ - Select Issuing tokens that were created during the given date interval. + Only return Issuing tokens that were created during the given date interval. """ ending_before: NotRequired["str"] """ diff --git a/stripe/issuing/_token_service.py b/stripe/issuing/_token_service.py index 457e6c98f..49db37535 100644 --- a/stripe/issuing/_token_service.py +++ b/stripe/issuing/_token_service.py @@ -17,7 +17,7 @@ class ListParams(TypedDict): """ created: NotRequired["TokenService.ListParamsCreated|int"] """ - Select Issuing tokens that were created during the given date interval. + Only return Issuing tokens that were created during the given date interval. """ ending_before: NotRequired["str"] """ diff --git a/stripe/radar/_value_list.py b/stripe/radar/_value_list.py index 50191d016..8d91ffae4 100644 --- a/stripe/radar/_value_list.py +++ b/stripe/radar/_value_list.py @@ -71,6 +71,9 @@ class ListParams(RequestOptions): A value contained within a value list - returns all value lists containing this value. """ created: NotRequired["ValueList.ListParamsCreated|int"] + """ + Only return value lists that were created during the given date interval. + """ 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. diff --git a/stripe/radar/_value_list_item.py b/stripe/radar/_value_list_item.py index bcc0a9f15..8f9abd4e6 100644 --- a/stripe/radar/_value_list_item.py +++ b/stripe/radar/_value_list_item.py @@ -44,6 +44,9 @@ class DeleteParams(RequestOptions): class ListParams(RequestOptions): created: NotRequired["ValueListItem.ListParamsCreated|int"] + """ + Only return items that were created during the given date interval. + """ 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. diff --git a/stripe/radar/_value_list_item_service.py b/stripe/radar/_value_list_item_service.py index 6ac1c7fee..ce97a4cd0 100644 --- a/stripe/radar/_value_list_item_service.py +++ b/stripe/radar/_value_list_item_service.py @@ -29,6 +29,9 @@ class DeleteParams(TypedDict): class ListParams(TypedDict): created: NotRequired["ValueListItemService.ListParamsCreated|int"] + """ + Only return items that were created during the given date interval. + """ 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. diff --git a/stripe/radar/_value_list_service.py b/stripe/radar/_value_list_service.py index 196cf3d08..d1a5b49e4 100644 --- a/stripe/radar/_value_list_service.py +++ b/stripe/radar/_value_list_service.py @@ -47,6 +47,9 @@ class ListParams(TypedDict): A value contained within a value list - returns all value lists containing this value. """ created: NotRequired["ValueListService.ListParamsCreated|int"] + """ + Only return value lists that were created during the given date interval. + """ 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. diff --git a/stripe/reporting/_report_run.py b/stripe/reporting/_report_run.py index 2dba14623..cd3fbee92 100644 --- a/stripe/reporting/_report_run.py +++ b/stripe/reporting/_report_run.py @@ -125,6 +125,9 @@ class CreateParamsParameters(TypedDict): class ListParams(RequestOptions): created: NotRequired["ReportRun.ListParamsCreated|int"] + """ + Only return Report Runs that were created during the given date interval. + """ 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. diff --git a/stripe/reporting/_report_run_service.py b/stripe/reporting/_report_run_service.py index 24ef67365..34c1caaab 100644 --- a/stripe/reporting/_report_run_service.py +++ b/stripe/reporting/_report_run_service.py @@ -64,6 +64,9 @@ class CreateParamsParameters(TypedDict): class ListParams(TypedDict): created: NotRequired["ReportRunService.ListParamsCreated|int"] + """ + Only return Report Runs that were created during the given date interval. + """ 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. diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index 98a44f87d..2adb74cc8 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -290,6 +290,9 @@ class CreateParamsPlatformRestrictions(TypedDict): class ListParams(RequestOptions): created: NotRequired["FinancialAccount.ListParamsCreated|int"] + """ + Only return FinancialAccounts that were created during the given date interval. + """ ending_before: NotRequired["str"] """ An object ID cursor for use in pagination. diff --git a/stripe/treasury/_financial_account_features_service.py b/stripe/treasury/_financial_account_features_service.py index 4e2a7370a..db45e91bc 100644 --- a/stripe/treasury/_financial_account_features_service.py +++ b/stripe/treasury/_financial_account_features_service.py @@ -163,10 +163,162 @@ class ListParams(TypedDict): Specifies which fields in the response should be expanded. """ - def create( + class RetrieveParams(TypedDict): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + class UpdateParams(TypedDict): + card_issuing: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsCardIssuing" + ] + """ + Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + """ + deposit_insurance: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsDepositInsurance" + ] + """ + Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. + """ + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + financial_addresses: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsFinancialAddresses" + ] + """ + Contains Features that add FinancialAddresses to the FinancialAccount. + """ + inbound_transfers: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsInboundTransfers" + ] + """ + Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + """ + intra_stripe_flows: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsIntraStripeFlows" + ] + """ + Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + """ + outbound_payments: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsOutboundPayments" + ] + """ + Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + """ + outbound_transfers: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsOutboundTransfers" + ] + """ + Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + """ + + class UpdateParamsCardIssuing(TypedDict): + requested: bool + """ + Whether the FinancialAccount should have the Feature. + """ + + class UpdateParamsDepositInsurance(TypedDict): + requested: bool + """ + Whether the FinancialAccount should have the Feature. + """ + + class UpdateParamsFinancialAddresses(TypedDict): + aba: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsFinancialAddressesAba" + ] + """ + Adds an ABA FinancialAddress to the FinancialAccount. + """ + + class UpdateParamsFinancialAddressesAba(TypedDict): + requested: bool + """ + Whether the FinancialAccount should have the Feature. + """ + + class UpdateParamsInboundTransfers(TypedDict): + ach: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsInboundTransfersAch" + ] + """ + Enables ACH Debits via the InboundTransfers API. + """ + + class UpdateParamsInboundTransfersAch(TypedDict): + requested: bool + """ + Whether the FinancialAccount should have the Feature. + """ + + class UpdateParamsIntraStripeFlows(TypedDict): + requested: bool + """ + Whether the FinancialAccount should have the Feature. + """ + + class UpdateParamsOutboundPayments(TypedDict): + ach: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsOutboundPaymentsAch" + ] + """ + Enables ACH transfers via the OutboundPayments API. + """ + us_domestic_wire: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsOutboundPaymentsUsDomesticWire" + ] + """ + Enables US domestic wire transfers via the OutboundPayments API. + """ + + class UpdateParamsOutboundPaymentsAch(TypedDict): + requested: bool + """ + Whether the FinancialAccount should have the Feature. + """ + + class UpdateParamsOutboundPaymentsUsDomesticWire(TypedDict): + requested: bool + """ + Whether the FinancialAccount should have the Feature. + """ + + class UpdateParamsOutboundTransfers(TypedDict): + ach: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsOutboundTransfersAch" + ] + """ + Enables ACH transfers via the OutboundTransfers API. + """ + us_domestic_wire: NotRequired[ + "FinancialAccountFeaturesService.UpdateParamsOutboundTransfersUsDomesticWire" + ] + """ + Enables US domestic wire transfers via the OutboundTransfers API. + """ + + class UpdateParamsOutboundTransfersAch(TypedDict): + requested: bool + """ + Whether the FinancialAccount should have the Feature. + """ + + class UpdateParamsOutboundTransfersUsDomesticWire(TypedDict): + requested: bool + """ + Whether the FinancialAccount should have the Feature. + """ + + def update( self, financial_account: str, - params: "FinancialAccountFeaturesService.CreateParams" = {}, + params: "FinancialAccountFeaturesService.UpdateParams" = {}, options: RequestOptions = {}, ) -> FinancialAccountFeatures: """ @@ -186,6 +338,29 @@ def create( ), ) + def retrieve( + self, + financial_account: str, + params: "FinancialAccountFeaturesService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccountFeatures: + """ + Retrieves Features information associated with the FinancialAccount. + """ + return cast( + FinancialAccountFeatures, + self._request( + "get", + "/v1/treasury/financial_accounts/{financial_account}/features".format( + financial_account=sanitize_id(financial_account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, financial_account: str, @@ -208,3 +383,26 @@ def list( options=options, ), ) + + def create( + self, + financial_account: str, + params: "FinancialAccountFeaturesService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccountFeatures: + """ + Updates the Features associated with a FinancialAccount. + """ + return cast( + FinancialAccountFeatures, + self._request( + "post", + "/v1/treasury/financial_accounts/{financial_account}/features".format( + financial_account=sanitize_id(financial_account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index ba6ec9604..70b71ad95 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -195,6 +195,9 @@ class CreateParamsPlatformRestrictions(TypedDict): class ListParams(TypedDict): created: NotRequired["FinancialAccountService.ListParamsCreated|int"] + """ + Only return FinancialAccounts that were created during the given date interval. + """ ending_before: NotRequired["str"] """ An object ID cursor for use in pagination. diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index 0b0d60145..08065951c 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -366,6 +366,10 @@ class FailParams(RequestOptions): """ class ListParams(RequestOptions): + created: NotRequired["OutboundPayment.ListParamsCreated|int"] + """ + Only return OutboundPayments that were created during the given date interval. + """ customer: NotRequired["str"] """ Only return OutboundPayments sent to this customer. @@ -397,6 +401,24 @@ class ListParams(RequestOptions): Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. """ + class ListParamsCreated(TypedDict): + gt: NotRequired["int"] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired["int"] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired["int"] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired["int"] + """ + Maximum value to filter by (inclusive) + """ + class PostParams(RequestOptions): expand: NotRequired["List[str]"] """ diff --git a/stripe/treasury/_outbound_payment_service.py b/stripe/treasury/_outbound_payment_service.py index eca51c4c6..11848568d 100644 --- a/stripe/treasury/_outbound_payment_service.py +++ b/stripe/treasury/_outbound_payment_service.py @@ -193,6 +193,10 @@ class CreateParamsEndUserDetails(TypedDict): """ class ListParams(TypedDict): + created: NotRequired["OutboundPaymentService.ListParamsCreated|int"] + """ + Only return OutboundPayments that were created during the given date interval. + """ customer: NotRequired["str"] """ Only return OutboundPayments sent to this customer. @@ -224,6 +228,24 @@ class ListParams(TypedDict): Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. """ + class ListParamsCreated(TypedDict): + gt: NotRequired["int"] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired["int"] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired["int"] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired["int"] + """ + Maximum value to filter by (inclusive) + """ + class RetrieveParams(TypedDict): expand: NotRequired["List[str]"] """ diff --git a/stripe/treasury/_transaction.py b/stripe/treasury/_transaction.py index f98ab5c36..078a4f728 100644 --- a/stripe/treasury/_transaction.py +++ b/stripe/treasury/_transaction.py @@ -116,6 +116,9 @@ class StatusTransitions(StripeObject): class ListParams(RequestOptions): created: NotRequired["Transaction.ListParamsCreated|int"] + """ + Only return Transactions that were created during the given date interval. + """ 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. diff --git a/stripe/treasury/_transaction_entry.py b/stripe/treasury/_transaction_entry.py index 317a5318b..0ae9980b1 100644 --- a/stripe/treasury/_transaction_entry.py +++ b/stripe/treasury/_transaction_entry.py @@ -107,6 +107,9 @@ class FlowDetails(StripeObject): class ListParams(RequestOptions): created: NotRequired["TransactionEntry.ListParamsCreated|int"] + """ + Only return TransactionEntries that were created during the given date interval. + """ effective_at: NotRequired["TransactionEntry.ListParamsEffectiveAt|int"] ending_before: NotRequired["str"] """ diff --git a/stripe/treasury/_transaction_entry_service.py b/stripe/treasury/_transaction_entry_service.py index 2122e4fee..aeee3dfc0 100644 --- a/stripe/treasury/_transaction_entry_service.py +++ b/stripe/treasury/_transaction_entry_service.py @@ -12,6 +12,9 @@ class TransactionEntryService(StripeService): class ListParams(TypedDict): created: NotRequired["TransactionEntryService.ListParamsCreated|int"] + """ + Only return TransactionEntries that were created during the given date interval. + """ effective_at: NotRequired[ "TransactionEntryService.ListParamsEffectiveAt|int" ] diff --git a/stripe/treasury/_transaction_service.py b/stripe/treasury/_transaction_service.py index f51d713e6..1c43b9f84 100644 --- a/stripe/treasury/_transaction_service.py +++ b/stripe/treasury/_transaction_service.py @@ -12,6 +12,9 @@ class TransactionService(StripeService): class ListParams(TypedDict): created: NotRequired["TransactionService.ListParamsCreated|int"] + """ + Only return Transactions that were created during the given date interval. + """ 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. From 58feb242636969f0aca32fa2f090dd18c6852191 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 22 Feb 2024 14:21:01 -0800 Subject: [PATCH 017/179] Bump version to 8.4.0 --- CHANGELOG.md | 119 ++++++++++++++++++++++++--------------------- VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 66 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05988c0ad..e2643d158 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 8.4.0 - 2024-02-22 +* [#1241](https://github.com/stripe/stripe-python/pull/1241) Update generated code + - Add `InvoiceLineItem.modify` method. +* [#1244](https://github.com/stripe/stripe-python/pull/1244) Add TaxIds API + * Add support for `create`, `retrieve`, `delete`, and `list` methods on resource `TaxId` + * The `instance_url` function on resource `TaxId` now returns the top-level `/v1/tax_ids/{id}` path instead of the `/v1/customers/{customer}/tax_ids/{id}` path. +* [#1243](https://github.com/stripe/stripe-python/pull/1243) Remove http client base +* [#1242](https://github.com/stripe/stripe-python/pull/1242) Testing: unify http client mock + ## 8.3.0 - 2024-02-15 * [#1230](https://github.com/stripe/stripe-python/pull/1230) Update generated code * Add support for `networks` on `Card`, `PaymentMethod.CreateParamsCard`, `PaymentMethod.ModifyParamsCard`, and `Token.CreateParamsCard` @@ -12,10 +21,10 @@ ## 8.2.0 - 2024-02-08 * [#1225](https://github.com/stripe/stripe-python/pull/1225) Update generated code - * Add support for `invoices` on `Account.Settings` - * Add support for new value `velobank` on various enums `PaymentMethodDetails.P24.bank` - * Add support for `setup_future_usage` on `PaymentMethodOptions.Blik` - * Add support for `require_cvc_recollection` on `PaymentMethodOptions.Card` + * Add support for `invoices` on `Account.Settings` + * Add support for new value `velobank` on various enums `PaymentMethodDetails.P24.bank` + * Add support for `setup_future_usage` on `PaymentMethodOptions.Blik` + * Add support for `require_cvc_recollection` on `PaymentMethodOptions.Card` * Add support for `account_tax_ids` on various `InvoiceSettings` request parameters * [#1223](https://github.com/stripe/stripe-python/pull/1223) Move StripeClient usage collection onto StripeService * [#1220](https://github.com/stripe/stripe-python/pull/1220) Measure StripeClient usage @@ -29,61 +38,61 @@ ## 8.0.0 - 2024-01-25 * [#1206](https://github.com/stripe/stripe-python/pull/1206) stripe-python v8 release - This release introduces `StripeClient` and a service-based call pattern. This new interface allows you to easily call Stripe APIs and has several benefits over the existing resource-based pattern: - - * No global config: you can simultaneously use multiple clients with different configuration options (such as API keys) - * No static methods for easier mocking - - For full migration instructions, please refer to the [v8 migration guide](https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v8-(StripeClient)). - - "⚠️" symbol highlights breaking changes - - ### ⚠️ Changed - * ⚠️ **Request options like `api_key`, `stripe_account`, `stripe_version`, and `idempotency_key` can no longer be passed in positionally on resource methods. Please pass these in as keyword arguments.** - - **BEFORE** - ```python - stripe.Customer.create( - "sk_test_123", # api key - "KG5LxwFBepaKHyUD", # idempotency key - "2022-11-15", # stripe version - "acct_123", # stripe account - ) - ``` - - **AFTER** - ```python - stripe.Customer.create( - api_key="sk_test_123", - idempotency_key="KG5LxwFBepaKHyUD", - stripe_version="2022-11-15", - stripe_account="acct_123", - ) - ``` - * ⚠️ Methods that turn a response stream (`Quote.pdf`) now returns a single value of type `StripeResponseStream` instead of a tuple containing `(StripeResponseStream, api_key)`. - * ⚠️ Removed public access to `APIRequestor`. `APIRequestor`'s main use is internal, and we don't have a good understanding of its external use cases. We had to make several breaking changes to its interface as part of this update, so rather than leaving it public we made it private. If you have a use case for `APIRequestor`, please open up a Github issue describing it. We'd rather you rely on something specifically designed for your use case than having to reach into the library's internals. - - - ### ⚠️ Removed - * ⚠️ Remove `api_version` from `File.create` parameters. Please use `stripe_version` instead. - * ⚠️ Remove `util.read_special_variable()` utility method (importing directly from `stripe.util` is deprecated as of [v7.8.0](https://github.com/stripe/stripe-python/blob/master/CHANGELOG.md#780---2023-12-07)) - * ⚠️ Remove `StripeError.construct_error_object()`. This method was intended for internal stripe-python use only. - * ⚠️ Remove `ListObject.empty_list()`. This method was intended for internal stripe-python use only. - * ⚠️ Remove `SearchResultObject.empty_search_result()`. This method was intended for internal stripe-python use only. - * ⚠️ Remove `StripeObject.ReprJSONEncoder`. This class was intended for internal stripe-python use only. + This release introduces `StripeClient` and a service-based call pattern. This new interface allows you to easily call Stripe APIs and has several benefits over the existing resource-based pattern: + + * No global config: you can simultaneously use multiple clients with different configuration options (such as API keys) + * No static methods for easier mocking + + For full migration instructions, please refer to the [v8 migration guide](https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v8-(StripeClient)). + + "⚠️" symbol highlights breaking changes + + ### ⚠️ Changed + * ⚠️ **Request options like `api_key`, `stripe_account`, `stripe_version`, and `idempotency_key` can no longer be passed in positionally on resource methods. Please pass these in as keyword arguments.** + + **BEFORE** + ```python + stripe.Customer.create( + "sk_test_123", # api key + "KG5LxwFBepaKHyUD", # idempotency key + "2022-11-15", # stripe version + "acct_123", # stripe account + ) + ``` + + **AFTER** + ```python + stripe.Customer.create( + api_key="sk_test_123", + idempotency_key="KG5LxwFBepaKHyUD", + stripe_version="2022-11-15", + stripe_account="acct_123", + ) + ``` + * ⚠️ Methods that turn a response stream (`Quote.pdf`) now returns a single value of type `StripeResponseStream` instead of a tuple containing `(StripeResponseStream, api_key)`. + * ⚠️ Removed public access to `APIRequestor`. `APIRequestor`'s main use is internal, and we don't have a good understanding of its external use cases. We had to make several breaking changes to its interface as part of this update, so rather than leaving it public we made it private. If you have a use case for `APIRequestor`, please open up a Github issue describing it. We'd rather you rely on something specifically designed for your use case than having to reach into the library's internals. + + + ### ⚠️ Removed + * ⚠️ Remove `api_version` from `File.create` parameters. Please use `stripe_version` instead. + * ⚠️ Remove `util.read_special_variable()` utility method (importing directly from `stripe.util` is deprecated as of [v7.8.0](https://github.com/stripe/stripe-python/blob/master/CHANGELOG.md#780---2023-12-07)) + * ⚠️ Remove `StripeError.construct_error_object()`. This method was intended for internal stripe-python use only. + * ⚠️ Remove `ListObject.empty_list()`. This method was intended for internal stripe-python use only. + * ⚠️ Remove `SearchResultObject.empty_search_result()`. This method was intended for internal stripe-python use only. + * ⚠️ Remove `StripeObject.ReprJSONEncoder`. This class was intended for internal stripe-python use only. * ⚠️ Remove `StripeObject.api_base`. This property was defunct and returned `None`. ## 7.14.0 - 2024-01-25 * [#1199](https://github.com/stripe/stripe-python/pull/1199) Update generated code - * Add support for `annual_revenue` and `estimated_worker_count` on `Account.business_profile`, `Account.CreateParams.business_profile`, and `Account.UpdateParams.business_profile` - * Add support for new value `registered_charity` on enums `Account.CreateParams.company.structure`, `Account.UpdateParams.company.structure`, and `Token.CreateParams.account.company.structure` - * Add support for `collection_options` on `AccountLink.CreateParams` - * Add support for `liability` on `Checkout.Session.automatic_tax`, `PaymentLink.automatic_tax`, `PaymentLink.CreateParams.automatic_tax`, `PaymentLink.UpdateParams.automatic_tax`, `Quote.automatic_tax`, `Quote.CreateParams.automatic_tax`, `Quote.UpdateParams.automatic_tax`, `SubscriptionSchedule.default_settings.automatic_tax`, `SubscriptionSchedule.phases[].automatic_tax`, `SubscriptionSchedule.CreateParams.default_settings.automatic_tax`, `SubscriptionSchedule.CreateParams.phases[].automatic_tax`, `SubscriptionSchedule.UpdateParams.default_settings.automatic_tax`, `SubscriptionSchedule.UpdateParams.phases[].automatic_tax`, and `checkout.Session.CreateParams.automatic_tax` - * Add support for `issuer` on `Checkout.Session.invoice_creation.invoice_data`, `PaymentLink.invoice_creation.invoice_data`, `PaymentLink.CreateParams.invoice_creation.invoice_data`, `PaymentLink.UpdateParams.invoice_creation.invoice_data`, `Quote.invoice_settings`, `Quote.CreateParams.invoice_settings`, `Quote.UpdateParams.invoice_settings`, `SubscriptionSchedule.default_settings.invoice_settings`, `SubscriptionSchedule.phases[].invoice_settings`, `SubscriptionSchedule.CreateParams.default_settings.invoice_settings`, `SubscriptionSchedule.CreateParams.phases[].invoice_settings`, `SubscriptionSchedule.UpdateParams.default_settings.invoice_settings`, `SubscriptionSchedule.UpdateParams.phases[].invoice_settings`, and `checkout.Session.CreateParams.invoice_creation.invoice_data` - * Add support for `invoice_settings` on `PaymentLink.subscription_data`, `PaymentLink.CreateParams.subscription_data`, `PaymentLink.UpdateParams.subscription_data`, and `checkout.Session.CreateParams.subscription_data` - * Add support for new value `challenge` on enums `Invoice.CreateParams.payment_settings.payment_method_options.card.request_three_d_secure`, `Invoice.UpdateParams.payment_settings.payment_method_options.card.request_three_d_secure`, `Subscription.CreateParams.payment_settings.payment_method_options.card.request_three_d_secure`, and `Subscription.UpdateParams.payment_settings.payment_method_options.card.request_three_d_secure` - * Add support for `promotion_code` on `Invoice.UpcomingLinesParams.discounts[]`, `Invoice.UpcomingLinesParams.invoice_items[].discounts[]`, `Invoice.UpcomingParams.discounts[]`, and `Invoice.UpcomingParams.invoice_items[].discounts[]` - * Add support for `account_type` on `PaymentMethod.UpdateParams.us_bank_account` + * Add support for `annual_revenue` and `estimated_worker_count` on `Account.business_profile`, `Account.CreateParams.business_profile`, and `Account.UpdateParams.business_profile` + * Add support for new value `registered_charity` on enums `Account.CreateParams.company.structure`, `Account.UpdateParams.company.structure`, and `Token.CreateParams.account.company.structure` + * Add support for `collection_options` on `AccountLink.CreateParams` + * Add support for `liability` on `Checkout.Session.automatic_tax`, `PaymentLink.automatic_tax`, `PaymentLink.CreateParams.automatic_tax`, `PaymentLink.UpdateParams.automatic_tax`, `Quote.automatic_tax`, `Quote.CreateParams.automatic_tax`, `Quote.UpdateParams.automatic_tax`, `SubscriptionSchedule.default_settings.automatic_tax`, `SubscriptionSchedule.phases[].automatic_tax`, `SubscriptionSchedule.CreateParams.default_settings.automatic_tax`, `SubscriptionSchedule.CreateParams.phases[].automatic_tax`, `SubscriptionSchedule.UpdateParams.default_settings.automatic_tax`, `SubscriptionSchedule.UpdateParams.phases[].automatic_tax`, and `checkout.Session.CreateParams.automatic_tax` + * Add support for `issuer` on `Checkout.Session.invoice_creation.invoice_data`, `PaymentLink.invoice_creation.invoice_data`, `PaymentLink.CreateParams.invoice_creation.invoice_data`, `PaymentLink.UpdateParams.invoice_creation.invoice_data`, `Quote.invoice_settings`, `Quote.CreateParams.invoice_settings`, `Quote.UpdateParams.invoice_settings`, `SubscriptionSchedule.default_settings.invoice_settings`, `SubscriptionSchedule.phases[].invoice_settings`, `SubscriptionSchedule.CreateParams.default_settings.invoice_settings`, `SubscriptionSchedule.CreateParams.phases[].invoice_settings`, `SubscriptionSchedule.UpdateParams.default_settings.invoice_settings`, `SubscriptionSchedule.UpdateParams.phases[].invoice_settings`, and `checkout.Session.CreateParams.invoice_creation.invoice_data` + * Add support for `invoice_settings` on `PaymentLink.subscription_data`, `PaymentLink.CreateParams.subscription_data`, `PaymentLink.UpdateParams.subscription_data`, and `checkout.Session.CreateParams.subscription_data` + * Add support for new value `challenge` on enums `Invoice.CreateParams.payment_settings.payment_method_options.card.request_three_d_secure`, `Invoice.UpdateParams.payment_settings.payment_method_options.card.request_three_d_secure`, `Subscription.CreateParams.payment_settings.payment_method_options.card.request_three_d_secure`, and `Subscription.UpdateParams.payment_settings.payment_method_options.card.request_three_d_secure` + * Add support for `promotion_code` on `Invoice.UpcomingLinesParams.discounts[]`, `Invoice.UpcomingLinesParams.invoice_items[].discounts[]`, `Invoice.UpcomingParams.discounts[]`, and `Invoice.UpcomingParams.invoice_items[].discounts[]` + * Add support for `account_type` on `PaymentMethod.UpdateParams.us_bank_account` ## 7.13.0 - 2024-01-18 * [#1193](https://github.com/stripe/stripe-python/pull/1193) Update generated code diff --git a/VERSION b/VERSION index 2bf50aaf1..a2f28f43b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.0 +8.4.0 diff --git a/stripe/_version.py b/stripe/_version.py index f11dae2fd..65dc005e4 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "8.3.0" +VERSION = "8.4.0" From 341b23fe2a620fd2d1c95a76ee70851c23f7feda Mon Sep 17 00:00:00 2001 From: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> Date: Fri, 23 Feb 2024 09:41:05 -0800 Subject: [PATCH 018/179] Fix type of ErrorObject.code (#1250) --- stripe/_error_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stripe/_error_object.py b/stripe/_error_object.py index cd30fc325..f3556b019 100644 --- a/stripe/_error_object.py +++ b/stripe/_error_object.py @@ -13,7 +13,7 @@ class ErrorObject(StripeObject): charge: Optional[str] - code: int + code: Optional[str] decline_code: Optional[str] doc_url: Optional[str] message: Optional[str] From 26d940f475aa9dbbc56a2b529aa761b65dfb0802 Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:18:47 -0800 Subject: [PATCH 019/179] Update README to use add_beta_version (#1260) --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 06b268bff..b35c14639 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ python setup.py install ### Requirements -- Python 3.6+ (PyPy supported) +- Python 3.6+ (PyPy supported) #### Python 2.7 deprecation @@ -228,9 +228,9 @@ is anything we can do to improve the types for your type checker of choice. ### Types and the Versioning Policy We release type changes in minor releases. While stripe-python follows semantic -versioning, our semantic versions describe the *runtime behavior* of the -library alone. Our *type annotations are not reflected in the semantic -version*. That is, upgrading to a new minor version of stripe-python might +versioning, our semantic versions describe the _runtime behavior_ of the +library alone. Our _type annotations are not reflected in the semantic +version_. That is, upgrading to a new minor version of stripe-python might result in your type checker producing a type error that it didn't before. You can use a `~=x.x` or `x.x.*` [version specifier](https://peps.python.org/pep-0440/#examples) in your `requirements.txt` to constrain `pip` to a certain minor range of `stripe-python`. @@ -258,10 +258,10 @@ pip install stripe==5.3.0b3 We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version. -If your beta feature requires a `Stripe-Version` header to be sent, use the `stripe.api_version` field to set it: +If your beta feature requires a `Stripe-Version` header to be sent, set the `stripe.api_version` field using the `stripe.add_beta_version` function: ```python -stripe.api_version += "; feature_beta=v3" +stripe.add_beta_version("feature_beta", "v3") ``` ## Support From dc8b8118bae06818862af3f9a3830dcb99982faf Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 19:34:16 +0000 Subject: [PATCH 020/179] Update generated code (#1255) * Update generated code for v841 * Update generated code for v845 * Update generated code for v849 * Update generated code for v850 * Update generated code for v851 * Update generated code for v852 * Update generated code for v853 * Update generated code for v855 * Update generated code for v857 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_bank_account.py | 2 +- stripe/_charge.py | 65 ++++++++++++++++++++++++ stripe/_invoice.py | 8 +++ stripe/_invoice_service.py | 8 +++ stripe/_payment_link.py | 12 ++--- stripe/_payment_link_service.py | 8 +-- stripe/_refund.py | 41 ++++++++++++++- stripe/_token.py | 6 ++- stripe/_token_service.py | 6 ++- stripe/checkout/_session.py | 18 +++---- stripe/checkout/_session_service.py | 8 +-- stripe/identity/_verification_report.py | 2 +- stripe/identity/_verification_session.py | 2 +- stripe/terminal/_reader.py | 41 ++++++++++++++- stripe/terminal/_reader_service.py | 21 +++++++- 16 files changed, 216 insertions(+), 34 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e3b365910..148e3ec37 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v840 \ No newline at end of file +v857 \ No newline at end of file diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index 6c5d6e236..9f253c840 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -355,7 +355,7 @@ class DeleteParams(RequestOptions): """ For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated. - For external accounts, possible values are `new`, `errored` and `verification_failed`. If a payouts fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. + For external accounts, possible values are `new`, `errored` and `verification_failed`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. """ deleted: Optional[Literal[True]] """ diff --git a/stripe/_charge.py b/stripe/_charge.py index ff4341274..dcc1f47af 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -4,6 +4,7 @@ from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource +from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._searchable_api_resource import SearchableAPIResource @@ -46,6 +47,7 @@ from stripe._transfer import Transfer +@nested_resource_class_methods("refund") class Charge( CreateableAPIResource["Charge"], ListableAPIResource["Charge"], @@ -1927,6 +1929,24 @@ class ListParamsCreated(TypedDict): Maximum value to filter by (inclusive) """ + class ListRefundsParams(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. + """ + class ModifyParams(RequestOptions): customer: NotRequired["str"] """ @@ -2021,6 +2041,12 @@ class RetrieveParams(RequestOptions): Specifies which fields in the response should be expanded. """ + class RetrieveRefundParams(RequestOptions): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + class SearchParams(RequestOptions): expand: NotRequired["List[str]"] """ @@ -2398,6 +2424,45 @@ def mark_as_safe(self, idempotency_key=None) -> "Charge": self._request_and_refresh("post", url, params) return self + @classmethod + def retrieve_refund( + cls, + charge: str, + refund: str, + **params: Unpack["Charge.RetrieveRefundParams"] + ) -> "Refund": + """ + Retrieves the details of an existing refund. + """ + return cast( + "Refund", + cls._static_request( + "get", + "/v1/charges/{charge}/refunds/{refund}".format( + charge=sanitize_id(charge), refund=sanitize_id(refund) + ), + params=params, + ), + ) + + @classmethod + def list_refunds( + cls, charge: str, **params: Unpack["Charge.ListRefundsParams"] + ) -> ListObject["Refund"]: + """ + You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. + """ + return cast( + ListObject["Refund"], + cls._static_request( + "get", + "/v1/charges/{charge}/refunds".format( + charge=sanitize_id(charge) + ), + params=params, + ), + ) + _inner_class_types = { "billing_details": BillingDetails, "fraud_details": FraudDetails, diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 1a4c51108..00f080b2a 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -1059,6 +1059,10 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + number: NotRequired["str"] + """ + Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. + """ on_behalf_of: NotRequired["str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. @@ -1736,6 +1740,10 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + number: NotRequired["Literal['']|str"] + """ + Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. + """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 69cb98fa5..8824ff44f 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -109,6 +109,10 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + number: NotRequired["str"] + """ + Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. + """ on_behalf_of: NotRequired["str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. @@ -1400,6 +1404,10 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + number: NotRequired["Literal['']|str"] + """ + Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. + """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 7cfb0d096..bae3f7821 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -702,7 +702,7 @@ class CreateParams(RequestOptions): """ billing_address_collection: NotRequired["Literal['auto', 'required']"] """ - Configuration for collecting the customer's billing address. + Configuration for collecting the customer's billing address. Defaults to `auto`. """ consent_collection: NotRequired[ "PaymentLink.CreateParamsConsentCollection" @@ -764,7 +764,7 @@ class CreateParams(RequestOptions): """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. - Can only be set in `subscription` mode. + Can only be set in `subscription` mode. Defaults to `always`. 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://stripe.com/docs/payments/checkout/free-trials). """ @@ -1576,7 +1576,7 @@ class ModifyParams(RequestOptions): """ billing_address_collection: NotRequired["Literal['auto', 'required']"] """ - Configuration for collecting the customer's billing address. + Configuration for collecting the customer's billing address. Defaults to `auto`. """ custom_fields: NotRequired[ "Literal['']|List[PaymentLink.ModifyParamsCustomField]" @@ -1626,7 +1626,7 @@ class ModifyParams(RequestOptions): """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. - Can only be set in `subscription` mode. + Can only be set in `subscription` mode. Defaults to `always`. 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://stripe.com/docs/payments/checkout/free-trials). """ @@ -2296,7 +2296,7 @@ class RetrieveParams(RequestOptions): automatic_tax: AutomaticTax billing_address_collection: Literal["auto", "required"] """ - Configuration for collecting the customer's billing address. + Configuration for collecting the customer's billing address. Defaults to `auto`. """ consent_collection: Optional[ConsentCollection] """ @@ -2353,7 +2353,7 @@ class RetrieveParams(RequestOptions): """ payment_method_collection: Literal["always", "if_required"] """ - Configuration for collecting a payment method during checkout. + Configuration for collecting a payment method during checkout. Defaults to `always`. """ payment_method_types: Optional[ List[ diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 7794ba179..3242dfe95 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -42,7 +42,7 @@ class CreateParams(TypedDict): """ billing_address_collection: NotRequired["Literal['auto', 'required']"] """ - Configuration for collecting the customer's billing address. + Configuration for collecting the customer's billing address. Defaults to `auto`. """ consent_collection: NotRequired[ "PaymentLinkService.CreateParamsConsentCollection" @@ -106,7 +106,7 @@ class CreateParams(TypedDict): """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. - Can only be set in `subscription` mode. + Can only be set in `subscription` mode. Defaults to `always`. 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://stripe.com/docs/payments/checkout/free-trials). """ @@ -920,7 +920,7 @@ class UpdateParams(TypedDict): """ billing_address_collection: NotRequired["Literal['auto', 'required']"] """ - Configuration for collecting the customer's billing address. + Configuration for collecting the customer's billing address. Defaults to `auto`. """ custom_fields: NotRequired[ "Literal['']|List[PaymentLinkService.UpdateParamsCustomField]" @@ -972,7 +972,7 @@ class UpdateParams(TypedDict): """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. - Can only be set in `subscription` mode. + Can only be set in `subscription` mode. Defaults to `always`. 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://stripe.com/docs/payments/checkout/free-trials). """ diff --git a/stripe/_refund.py b/stripe/_refund.py index f06a4df91..1df08c45d 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -10,7 +10,14 @@ from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload -from typing_extensions import Literal, NotRequired, Type, Unpack, TYPE_CHECKING +from typing_extensions import ( + Literal, + NotRequired, + Type, + TypedDict, + Unpack, + TYPE_CHECKING, +) if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction @@ -360,6 +367,14 @@ class ExpireParams(RequestOptions): """ class ListParams(RequestOptions): + charge: NotRequired["str"] + """ + Only return refunds for the charge specified by this charge ID. + """ + created: NotRequired["Refund.ListParamsCreated|int"] + """ + Only return refunds that were created during the given date interval. + """ 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. @@ -372,11 +387,33 @@ class ListParams(RequestOptions): """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ + payment_intent: NotRequired["str"] + """ + Only return refunds for the PaymentIntent specified by this ID. + """ 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. """ + class ListParamsCreated(TypedDict): + gt: NotRequired["int"] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired["int"] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired["int"] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired["int"] + """ + Maximum value to filter by (inclusive) + """ + class ModifyParams(RequestOptions): expand: NotRequired["List[str]"] """ @@ -567,7 +604,7 @@ def list( cls, **params: Unpack["Refund.ListParams"] ) -> ListObject["Refund"]: """ - You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. + Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. """ result = cls._static_request( "get", diff --git a/stripe/_token.py b/stripe/_token.py index 08b452376..ea31719c8 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -597,7 +597,7 @@ class CreateParamsAccountIndividualVerificationDocument(TypedDict): class CreateParamsBankAccount(TypedDict): account_holder_name: NotRequired["str"] """ - The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. + The name of the person or business that owns the bank account. This field is required when attaching the bank account to a `Customer` object. """ account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -621,6 +621,10 @@ class CreateParamsBankAccount(TypedDict): """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts) """ + payment_method: NotRequired["str"] + """ + The ID of a Payment Method with a `type` of `us_bank_account`. The Payment Method's bank account information will be copied and returned as a Bank Account Token. This parameter is exclusive with respect to all other parameters in the `bank_account` hash. You must include the top-level `customer` parameter if the Payment Method is attached to a `Customer` object. If the Payment Method is not attached to a `Customer` object, it will be consumed and cannot be used again. You may not use Payment Methods which were created by a Setup Intent with `attach_to_self=true`. + """ routing_number: NotRequired["str"] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 280b82e96..798459555 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -568,7 +568,7 @@ class CreateParamsAccountIndividualVerificationDocument(TypedDict): class CreateParamsBankAccount(TypedDict): account_holder_name: NotRequired["str"] """ - The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. + The name of the person or business that owns the bank account. This field is required when attaching the bank account to a `Customer` object. """ account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -592,6 +592,10 @@ class CreateParamsBankAccount(TypedDict): """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts) """ + payment_method: NotRequired["str"] + """ + The ID of a Payment Method with a `type` of `us_bank_account`. The Payment Method's bank account information will be copied and returned as a Bank Account Token. This parameter is exclusive with respect to all other parameters in the `bank_account` hash. You must include the top-level `customer` parameter if the Payment Method is attached to a `Customer` object. If the Payment Method is not attached to a `Customer` object, it will be consumed and cannot be used again. You may not use Payment Methods which were created by a Setup Intent with `attach_to_self=true`. + """ routing_number: NotRequired["str"] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 6d99c10c5..28898775d 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1479,7 +1479,7 @@ class CreateParams(RequestOptions): """ billing_address_collection: NotRequired["Literal['auto', 'required']"] """ - Specify whether Checkout should collect the customer's billing address. + Specify whether Checkout should collect the customer's billing address. Defaults to `auto`. """ cancel_url: NotRequired["str"] """ @@ -1598,7 +1598,7 @@ class CreateParams(RequestOptions): Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. This may occur if the Checkout Session includes a free trial or a discount. - Can only be set in `subscription` mode. + Can only be set in `subscription` mode. Defaults to `always`. 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://stripe.com/docs/payments/checkout/free-trials). """ @@ -1641,7 +1641,7 @@ class CreateParams(RequestOptions): "Literal['always', 'if_required', 'never']" ] """ - This parameter applies to `ui_mode: embedded`. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. + This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. """ return_url: NotRequired["str"] """ @@ -1689,7 +1689,7 @@ class CreateParams(RequestOptions): """ ui_mode: NotRequired["Literal['embedded', 'hosted']"] """ - `ui_mode` can be `hosted` or `embedded`. The default is `hosted`. + The UI mode of the Session. Defaults to `hosted`. """ class CreateParamsAfterExpiration(TypedDict): @@ -3470,7 +3470,7 @@ class RetrieveParams(RequestOptions): automatic_tax: AutomaticTax billing_address_collection: Optional[Literal["auto", "required"]] """ - Describes whether Checkout should collect the customer's billing address. + Describes whether Checkout should collect the customer's billing address. Defaults to `auto`. """ cancel_url: Optional[str] """ @@ -3525,7 +3525,7 @@ class RetrieveParams(RequestOptions): """ customer_details: Optional[CustomerDetails] """ - The customer details including the customer's tax exempt status and the customer's tax IDs. Only the customer's email is present on Sessions in `setup` mode. + The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions in `setup` mode. """ customer_email: Optional[str] """ @@ -3629,7 +3629,7 @@ class RetrieveParams(RequestOptions): """ payment_method_collection: Optional[Literal["always", "if_required"]] """ - Configure whether a Checkout Session should collect a payment method. + Configure whether a Checkout Session should collect a payment method. Defaults to `always`. """ payment_method_configuration_details: Optional[ PaymentMethodConfigurationDetails @@ -3658,7 +3658,7 @@ class RetrieveParams(RequestOptions): """ redirect_on_completion: Optional[Literal["always", "if_required", "never"]] """ - Applies to Checkout Sessions with `ui_mode: embedded`. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. + This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. """ return_url: Optional[str] """ @@ -3710,7 +3710,7 @@ class RetrieveParams(RequestOptions): """ ui_mode: Optional[Literal["embedded", "hosted"]] """ - The UI mode of the Session. Can be `hosted` (default) or `embedded`. + The UI mode of the Session. Defaults to `hosted`. """ url: Optional[str] """ diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index d14975cd0..ba38a4ff2 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -32,7 +32,7 @@ class CreateParams(TypedDict): """ billing_address_collection: NotRequired["Literal['auto', 'required']"] """ - Specify whether Checkout should collect the customer's billing address. + Specify whether Checkout should collect the customer's billing address. Defaults to `auto`. """ cancel_url: NotRequired["str"] """ @@ -157,7 +157,7 @@ class CreateParams(TypedDict): Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. This may occur if the Checkout Session includes a free trial or a discount. - Can only be set in `subscription` mode. + Can only be set in `subscription` mode. Defaults to `always`. 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://stripe.com/docs/payments/checkout/free-trials). """ @@ -200,7 +200,7 @@ class CreateParams(TypedDict): "Literal['always', 'if_required', 'never']" ] """ - This parameter applies to `ui_mode: embedded`. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. + This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. """ return_url: NotRequired["str"] """ @@ -254,7 +254,7 @@ class CreateParams(TypedDict): """ ui_mode: NotRequired["Literal['embedded', 'hosted']"] """ - `ui_mode` can be `hosted` or `embedded`. The default is `hosted`. + The UI mode of the Session. Defaults to `hosted`. """ class CreateParamsAfterExpiration(TypedDict): diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index fbc13cd64..8f291ed02 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -384,7 +384,7 @@ class RetrieveParams(RequestOptions): """ Result from a selfie check """ - type: Optional[Literal["document", "id_number"]] + type: Literal["document", "id_number"] """ Type of report. """ diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 7a1279af1..d66717bfa 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -389,7 +389,7 @@ class RetrieveParams(RequestOptions): """ Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). """ - type: Optional[Literal["document", "id_number"]] + type: Literal["document", "id_number"] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. """ diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index f13a1fe65..378c6cec9 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -51,6 +51,10 @@ class Tipping(StripeObject): Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). """ + enable_customer_cancellation: Optional[bool] + """ + Enable customer initiated cancellation when processing this payment. + """ skip_tipping: Optional[bool] """ Override showing a tipping selection screen on this transaction. @@ -73,7 +77,10 @@ class Tipping(StripeObject): class ProcessSetupIntent(StripeObject): class ProcessConfig(StripeObject): - pass + enable_customer_cancellation: Optional[bool] + """ + Enable customer initiated cancellation when processing this SetupIntent. + """ generated_card: Optional[str] """ @@ -90,6 +97,12 @@ class ProcessConfig(StripeObject): _inner_class_types = {"process_config": ProcessConfig} class RefundPayment(StripeObject): + class RefundPaymentConfig(StripeObject): + enable_customer_cancellation: Optional[bool] + """ + Enable customer initiated cancellation when refunding this payment. + """ + amount: Optional[int] """ The amount being refunded. @@ -120,10 +133,15 @@ class RefundPayment(StripeObject): """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ + refund_payment_config: Optional[RefundPaymentConfig] + """ + Represents a per-transaction override of a reader configuration + """ reverse_transfer: Optional[bool] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ + _inner_class_types = {"refund_payment_config": RefundPaymentConfig} class SetReaderDisplay(StripeObject): class Cart(StripeObject): @@ -349,6 +367,10 @@ class ProcessPaymentIntentParams(RequestOptions): """ class ProcessPaymentIntentParamsProcessConfig(TypedDict): + enable_customer_cancellation: NotRequired["bool"] + """ + Enables cancel button on transaction screens. + """ skip_tipping: NotRequired["bool"] """ Override showing a tipping selection screen on this transaction. @@ -387,7 +409,10 @@ class ProcessSetupIntentParams(RequestOptions): """ class ProcessSetupIntentParamsProcessConfig(TypedDict): - pass + enable_customer_cancellation: NotRequired["bool"] + """ + Enables cancel button on transaction screens. + """ class RefundPaymentParams(RequestOptions): amount: NotRequired["int"] @@ -414,11 +439,23 @@ class RefundPaymentParams(RequestOptions): """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ + refund_payment_config: NotRequired[ + "Reader.RefundPaymentParamsRefundPaymentConfig" + ] + """ + Configuration overrides + """ reverse_transfer: NotRequired["bool"] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ + class RefundPaymentParamsRefundPaymentConfig(TypedDict): + enable_customer_cancellation: NotRequired["bool"] + """ + Enables cancel button on transaction screens. + """ + class RetrieveParams(RequestOptions): expand: NotRequired["List[str]"] """ diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 067c07234..0692e7bfb 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -94,6 +94,10 @@ class ProcessPaymentIntentParams(TypedDict): """ class ProcessPaymentIntentParamsProcessConfig(TypedDict): + enable_customer_cancellation: NotRequired["bool"] + """ + Enables cancel button on transaction screens. + """ skip_tipping: NotRequired["bool"] """ Override showing a tipping selection screen on this transaction. @@ -132,7 +136,10 @@ class ProcessSetupIntentParams(TypedDict): """ class ProcessSetupIntentParamsProcessConfig(TypedDict): - pass + enable_customer_cancellation: NotRequired["bool"] + """ + Enables cancel button on transaction screens. + """ class RefundPaymentParams(TypedDict): amount: NotRequired["int"] @@ -159,11 +166,23 @@ class RefundPaymentParams(TypedDict): """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ + refund_payment_config: NotRequired[ + "ReaderService.RefundPaymentParamsRefundPaymentConfig" + ] + """ + Configuration overrides + """ reverse_transfer: NotRequired["bool"] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ + class RefundPaymentParamsRefundPaymentConfig(TypedDict): + enable_customer_cancellation: NotRequired["bool"] + """ + Enables cancel button on transaction screens. + """ + class RetrieveParams(TypedDict): expand: NotRequired["List[str]"] """ From 9e67ba3dabb1dd68b6cbca2581d975a1df328b56 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 29 Feb 2024 15:21:45 -0500 Subject: [PATCH 021/179] Bump version to 8.5.0 --- CHANGELOG.md | 12 ++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2643d158..5306459ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.5.0 - 2024-02-29 +* [#1255](https://github.com/stripe/stripe-python/pull/1255) Update generated code + * Change `identity.VerificationReport.type` to be required + * Change type of `identity.VerificationSession.type` from `Optional[Literal["document", "id_number"]]` to `Literal["document", "id_number"]` + * Add support for `number` on `Invoice.CreateParams` and `Invoice.ModifyParams` + * Add support for `enable_customer_cancellation` on `terminal.Reader.Action.ProcessPaymentIntent.process_config`, `Terminal.Reader.Action.ProcessSetupIntent.process_config`, `Terminal.Reader.ProcessPaymentIntentParams.process_config`, and `Terminal.Reader.ProcessSetupIntentParams.process_config` + * Add support for `refund_payment_config` on `Terminal.Reader.Action.refund_payment` and `Terminal.Reader.RefundPaymentParams` + * Add support for `payment_method` on `Token.CreateParams.bank_account` + * Add `list_refunds` and `retrieve_refund` methods on resource `Charge`. +* [#1260](https://github.com/stripe/stripe-python/pull/1260) Update README to use add_beta_version +* [#1250](https://github.com/stripe/stripe-python/pull/1250) Fix type of ErrorObject.code + ## 8.4.0 - 2024-02-22 * [#1241](https://github.com/stripe/stripe-python/pull/1241) Update generated code - Add `InvoiceLineItem.modify` method. diff --git a/VERSION b/VERSION index a2f28f43b..6d2890793 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.4.0 +8.5.0 diff --git a/stripe/_version.py b/stripe/_version.py index 65dc005e4..cd9b3c81d 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "8.4.0" +VERSION = "8.5.0" From ca945d97312ffd2306e4b74cec4cd526366f4e5f Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:12:44 -0800 Subject: [PATCH 022/179] Update README.md (#1268) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b35c14639..55b8bc8e0 100644 --- a/README.md +++ b/README.md @@ -250,7 +250,7 @@ We would love for you to try these and share feedback with us before these featu To install a beta version use `pip install` with the exact version you'd like to use: ``` -pip install stripe==5.3.0b3 +pip install stripe==v8.6.0b1 ``` > **Note** From 0bad9bd20c66d84034d77a13fe722744eecda8db Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:29:31 -0800 Subject: [PATCH 023/179] Update generated code (#1267) * Update generated code for v857 * Update generated code for v859 * Update generated code for v860 * Update generated code for v861 * Update generated code for v862 * Update generated code for v864 * Update generated code for v865 * Update generated code for v866 * Update generated code for v867 * Update generated code for v869 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account_session.py | 31 +++++ stripe/_account_session_service.py | 18 +++ stripe/_credit_note.py | 22 ++++ stripe/_credit_note_service.py | 22 ++++ stripe/_invoice.py | 29 ++++- stripe/_invoice_service.py | 18 +++ stripe/_payment_intent.py | 2 +- stripe/_payment_intent_service.py | 2 +- stripe/_payout.py | 3 + stripe/_payout_service.py | 3 + stripe/checkout/_session.py | 10 ++ stripe/checkout/_session_service.py | 6 + .../treasury/_received_credit_service.py | 2 +- .../treasury/_received_debit_service.py | 2 +- stripe/treasury/_inbound_transfer.py | 2 +- stripe/treasury/_outbound_payment.py | 4 +- stripe/treasury/_outbound_payment_service.py | 2 +- stripe/treasury/_outbound_transfer.py | 4 +- stripe/treasury/_outbound_transfer_service.py | 2 +- stripe/treasury/_received_credit.py | 2 +- stripe/treasury/_received_debit.py | 2 +- tests/test_generated_examples.py | 117 ++++++++++++++++++ 23 files changed, 292 insertions(+), 15 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 148e3ec37..6ccc2b12f 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v857 \ No newline at end of file +v869 \ No newline at end of file diff --git a/stripe/_account_session.py b/stripe/_account_session.py index d79d80cfa..35442e2b1 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -32,6 +32,17 @@ class Features(StripeObject): features: Features _inner_class_types = {"features": Features} + class Documents(StripeObject): + class Features(StripeObject): + pass + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + class PaymentDetails(StripeObject): class Features(StripeObject): capture_payments: bool @@ -99,11 +110,13 @@ class Features(StripeObject): _inner_class_types = {"features": Features} account_onboarding: AccountOnboarding + documents: Documents payment_details: PaymentDetails payments: Payments payouts: Payouts _inner_class_types = { "account_onboarding": AccountOnboarding, + "documents": Documents, "payment_details": PaymentDetails, "payments": Payments, "payouts": Payouts, @@ -130,6 +143,9 @@ class CreateParamsComponents(TypedDict): """ Configuration for the account onboarding embedded component. """ + documents: NotRequired[ + "AccountSession.CreateParamsComponentsDocuments" + ] payment_details: NotRequired[ "AccountSession.CreateParamsComponentsPaymentDetails" ] @@ -160,6 +176,21 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): pass + class CreateParamsComponentsDocuments(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsDocumentsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsDocumentsFeatures(TypedDict): + pass + class CreateParamsComponentsPaymentDetails(TypedDict): enabled: bool """ diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 4a0e9b447..0f5c78a99 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -29,6 +29,9 @@ class CreateParamsComponents(TypedDict): """ Configuration for the account onboarding embedded component. """ + documents: NotRequired[ + "AccountSessionService.CreateParamsComponentsDocuments" + ] payment_details: NotRequired[ "AccountSessionService.CreateParamsComponentsPaymentDetails" ] @@ -63,6 +66,21 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): pass + class CreateParamsComponentsDocuments(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsDocumentsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsDocumentsFeatures(TypedDict): + pass + class CreateParamsComponentsPaymentDetails(TypedDict): enabled: bool """ diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index dc8ab7619..0a257fa66 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -289,6 +289,10 @@ class ListLinesParams(RequestOptions): """ class ListParams(RequestOptions): + created: NotRequired["CreditNote.ListParamsCreated|int"] + """ + Only return credit notes that were created during the given date interval. + """ customer: NotRequired["str"] """ Only return credit notes for the customer specified by this customer ID. @@ -314,6 +318,24 @@ class ListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ + class ListParamsCreated(TypedDict): + gt: NotRequired["int"] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired["int"] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired["int"] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired["int"] + """ + Maximum value to filter by (inclusive) + """ + class ModifyParams(RequestOptions): expand: NotRequired["List[str]"] """ diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index cbe4e251d..389fff7e4 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -138,6 +138,10 @@ class CreateParamsShippingCost(TypedDict): """ class ListParams(TypedDict): + created: NotRequired["CreditNoteService.ListParamsCreated|int"] + """ + Only return credit notes that were created during the given date interval. + """ customer: NotRequired["str"] """ Only return credit notes for the customer specified by this customer ID. @@ -163,6 +167,24 @@ class ListParams(TypedDict): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ + class ListParamsCreated(TypedDict): + gt: NotRequired["int"] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired["int"] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired["int"] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired["int"] + """ + Maximum value to filter by (inclusive) + """ + class PreviewParams(TypedDict): amount: NotRequired["int"] """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 00f080b2a..d1ac8a708 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -625,6 +625,9 @@ class EuBankTransfer(StripeObject): class Konbini(StripeObject): pass + class SepaDebit(StripeObject): + pass + class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): permissions: Optional[ @@ -675,6 +678,10 @@ class FinancialConnections(StripeObject): """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ + sepa_debit: Optional[SepaDebit] + """ + If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. + """ us_bank_account: Optional[UsBankAccount] """ If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. @@ -685,6 +692,7 @@ class FinancialConnections(StripeObject): "card": Card, "customer_balance": CustomerBalance, "konbini": Konbini, + "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, } @@ -884,7 +892,8 @@ class StatusTransitions(StripeObject): class SubscriptionDetails(StripeObject): metadata: Optional[Dict[str, str]] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will reflect the metadata of the subscription at the time of invoice creation. *Note: This attribute is populated only for invoices created on or after June 29, 2023.* + Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization. + *Note: This attribute is populated only for invoices created on or after June 29, 2023.* """ class ThresholdReason(StripeObject): @@ -1217,6 +1226,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ + sepa_debit: NotRequired[ + "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. + """ us_bank_account: NotRequired[ "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] @@ -1339,6 +1354,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass + class CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + pass + class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): @@ -1884,6 +1902,12 @@ class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ + sepa_debit: NotRequired[ + "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. + """ us_bank_account: NotRequired[ "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] @@ -2006,6 +2030,9 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer class ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass + class ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + pass + class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 8824ff44f..fa041ba57 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -273,6 +273,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ + sepa_debit: NotRequired[ + "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. + """ us_bank_account: NotRequired[ "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] @@ -395,6 +401,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass + class CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + pass + class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): @@ -1552,6 +1561,12 @@ class UpdateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ + sepa_debit: NotRequired[ + "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. + """ us_bank_account: NotRequired[ "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] @@ -1674,6 +1689,9 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer class UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass + class UpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + pass + class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index d207b7816..0fd377299 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -3777,7 +3777,7 @@ class CreateParams(RequestOptions): """ confirm: NotRequired["bool"] """ - Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). + Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). """ confirmation_method: NotRequired["Literal['automatic', 'manual']"] """ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 93e5a5cf7..f3ff4850f 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -1986,7 +1986,7 @@ class CreateParams(TypedDict): """ confirm: NotRequired["bool"] """ - Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). + Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). """ confirmation_method: NotRequired["Literal['automatic', 'manual']"] """ diff --git a/stripe/_payout.py b/stripe/_payout.py index b20ecbc67..b86193c7f 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -86,6 +86,9 @@ class CreateParams(RequestOptions): class ListParams(RequestOptions): arrival_date: NotRequired["Payout.ListParamsArrivalDate|int"] + """ + Only return payouts that are expected to arrive during the given date interval. + """ created: NotRequired["Payout.ListParamsCreated|int"] """ Only return payouts that were created during the given date interval. diff --git a/stripe/_payout_service.py b/stripe/_payout_service.py index d3070c3b2..68342b6e4 100644 --- a/stripe/_payout_service.py +++ b/stripe/_payout_service.py @@ -56,6 +56,9 @@ class CreateParams(TypedDict): class ListParams(TypedDict): arrival_date: NotRequired["PayoutService.ListParamsArrivalDate|int"] + """ + Only return payouts that are expected to arrive during the given date interval. + """ created: NotRequired["PayoutService.ListParamsCreated|int"] """ Only return payouts that were created during the given date interval. diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 28898775d..3c82a846e 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -641,6 +641,10 @@ class Installments(StripeObject): """ installments: Optional[Installments] + request_three_d_secure: Literal["any", "automatic", "challenge"] + """ + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + """ setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] @@ -2513,6 +2517,12 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Installment options for card payments """ + request_three_d_secure: NotRequired[ + "Literal['any', 'automatic', 'challenge']" + ] + """ + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + """ setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index ba38a4ff2..77fc71dc7 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -1118,6 +1118,12 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Installment options for card payments """ + request_three_d_secure: NotRequired[ + "Literal['any', 'automatic', 'challenge']" + ] + """ + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + """ setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/test_helpers/treasury/_received_credit_service.py b/stripe/test_helpers/treasury/_received_credit_service.py index 53b9e5ab9..1dc4f3b63 100644 --- a/stripe/test_helpers/treasury/_received_credit_service.py +++ b/stripe/test_helpers/treasury/_received_credit_service.py @@ -37,7 +37,7 @@ class CreateParams(TypedDict): """ network: Literal["ach", "us_domestic_wire"] """ - The rails used for the object. + Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): diff --git a/stripe/test_helpers/treasury/_received_debit_service.py b/stripe/test_helpers/treasury/_received_debit_service.py index f33626cbf..e04d4652a 100644 --- a/stripe/test_helpers/treasury/_received_debit_service.py +++ b/stripe/test_helpers/treasury/_received_debit_service.py @@ -37,7 +37,7 @@ class CreateParams(TypedDict): """ network: Literal["ach"] """ - The rails used for the object. + Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): diff --git a/stripe/treasury/_inbound_transfer.py b/stripe/treasury/_inbound_transfer.py index 86aa6d66d..24b9e16cf 100644 --- a/stripe/treasury/_inbound_transfer.py +++ b/stripe/treasury/_inbound_transfer.py @@ -122,7 +122,7 @@ class UsBankAccount(StripeObject): """ network: Literal["ach"] """ - The US bank account network used to debit funds. + The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ routing_number: Optional[str] """ diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index 08065951c..aa0229c0d 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -108,7 +108,7 @@ class UsBankAccount(StripeObject): """ network: Literal["ach", "us_domestic_wire"] """ - The US bank account network used to send funds. + The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ routing_number: Optional[str] """ @@ -346,7 +346,7 @@ class CreateParamsDestinationPaymentMethodOptions(TypedDict): class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): network: NotRequired["Literal['ach', 'us_domestic_wire']"] """ - The US bank account network that must be used for this OutboundPayment. If not set, we will default to the PaymentMethod's preferred network. + Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsEndUserDetails(TypedDict): diff --git a/stripe/treasury/_outbound_payment_service.py b/stripe/treasury/_outbound_payment_service.py index 11848568d..91160ee4d 100644 --- a/stripe/treasury/_outbound_payment_service.py +++ b/stripe/treasury/_outbound_payment_service.py @@ -179,7 +179,7 @@ class CreateParamsDestinationPaymentMethodOptions(TypedDict): class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): network: NotRequired["Literal['ach', 'us_domestic_wire']"] """ - The US bank account network that must be used for this OutboundPayment. If not set, we will default to the PaymentMethod's preferred network. + Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsEndUserDetails(TypedDict): diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index 02673bb47..21084b909 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -98,7 +98,7 @@ class UsBankAccount(StripeObject): """ network: Literal["ach", "us_domestic_wire"] """ - The US bank account network used to send funds. + The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ routing_number: Optional[str] """ @@ -212,7 +212,7 @@ class CreateParamsDestinationPaymentMethodOptions(TypedDict): class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): network: NotRequired["Literal['ach', 'us_domestic_wire']"] """ - Designate the OutboundTransfer as using a US bank account network configuration. + Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class FailParams(RequestOptions): diff --git a/stripe/treasury/_outbound_transfer_service.py b/stripe/treasury/_outbound_transfer_service.py index 694de227e..752814833 100644 --- a/stripe/treasury/_outbound_transfer_service.py +++ b/stripe/treasury/_outbound_transfer_service.py @@ -67,7 +67,7 @@ class CreateParamsDestinationPaymentMethodOptions(TypedDict): class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): network: NotRequired["Literal['ach', 'us_domestic_wire']"] """ - Designate the OutboundTransfer as using a US bank account network configuration. + Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class ListParams(TypedDict): diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 49db0ccef..8b3d18101 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -225,7 +225,7 @@ class CreateParams(RequestOptions): """ network: Literal["ach", "us_domestic_wire"] """ - The rails used for the object. + Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): diff --git a/stripe/treasury/_received_debit.py b/stripe/treasury/_received_debit.py index d5541bb6a..434c93829 100644 --- a/stripe/treasury/_received_debit.py +++ b/stripe/treasury/_received_debit.py @@ -184,7 +184,7 @@ class CreateParams(RequestOptions): """ network: Literal["ach"] """ - The rails used for the object. + Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index b4d180fd5..3eeea1afb 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -10939,6 +10939,123 @@ def test_tax_codes_get_2_service( api_base="https://api.stripe.com", ) + def test_tax_ids_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxId.delete("taxid_123") + http_client_mock.assert_requested( + "delete", + path="/v1/tax_ids/taxid_123", + query_string="", + ) + + def test_tax_ids_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/tax_ids/taxid_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_ids.delete("taxid_123") + http_client_mock.assert_requested( + "delete", + path="/v1/tax_ids/taxid_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_tax_ids_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxId.list() + http_client_mock.assert_requested( + "get", + path="/v1/tax_ids", + query_string="", + ) + + def test_tax_ids_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_ids", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_ids.list() + http_client_mock.assert_requested( + "get", + path="/v1/tax_ids", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_tax_ids_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxId.retrieve("taxid_123") + http_client_mock.assert_requested( + "get", + path="/v1/tax_ids/taxid_123", + query_string="", + ) + + def test_tax_ids_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_ids/taxid_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_ids.retrieve("taxid_123") + http_client_mock.assert_requested( + "get", + path="/v1/tax_ids/taxid_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_tax_ids_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxId.create( + type="eu_vat", + value="123", + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_ids", + query_string="", + post_data="type=eu_vat&value=123", + ) + + def test_tax_ids_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax_ids", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_ids.create({"type": "eu_vat", "value": "123"}) + http_client_mock.assert_requested( + "post", + path="/v1/tax_ids", + query_string="", + api_base="https://api.stripe.com", + post_data="type=eu_vat&value=123", + ) + def test_tax_rates_get(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.list(limit=3) http_client_mock.assert_requested( From da0de819d384613ff7dd721834fe3838540a0deb Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Thu, 7 Mar 2024 15:41:11 -0800 Subject: [PATCH 024/179] Bump version to 8.6.0 --- CHANGELOG.md | 8 ++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5306459ba..8e9cc4e7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 8.6.0 - 2024-03-07 +* [#1267](https://github.com/stripe/stripe-python/pull/1267) Update generated code + * Add support for `documents` on `AccountSession.Components` + * Add support for `request_three_d_secure` on `Checkout.Session.PaymentMethodOptionsCard` and `Checkout.Session.CreateParams.PaymentMethodOptionsCard` + * Add support for `created` on `CreditNote.ListParams` + * Add support for `sepa_debit` on `Invoice.PaymentSettings.PaymentMethodOptions`, `InvoiceCreateParams.PaymentSettings.PaymentMethodOptions`, and `InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions` +* [#1268](https://github.com/stripe/stripe-python/pull/1268) Update README.md + ## 8.5.0 - 2024-02-29 * [#1255](https://github.com/stripe/stripe-python/pull/1255) Update generated code * Change `identity.VerificationReport.type` to be required diff --git a/VERSION b/VERSION index 6d2890793..acd405b1d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.5.0 +8.6.0 diff --git a/stripe/_version.py b/stripe/_version.py index cd9b3c81d..b365c0237 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "8.5.0" +VERSION = "8.6.0" From fde1c1742a76afed8f6907ff4eeae47132b889d5 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 14:37:13 -0700 Subject: [PATCH 025/179] Update generated code (#1269) * Update generated code for v878 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account_session.py | 3 + stripe/_account_session_service.py | 3 + stripe/_issuing_service.py | 8 + stripe/_object_classes.py | 2 + stripe/_subscription.py | 30 +- stripe/_subscription_service.py | 22 +- stripe/api_resources/issuing/__init__.py | 4 + .../issuing/personalization_design.py | 21 + .../api_resources/issuing/physical_bundle.py | 21 + stripe/issuing/__init__.py | 10 + stripe/issuing/_card.py | 11 + stripe/issuing/_card_service.py | 6 + stripe/issuing/_personalization_design.py | 631 ++++++++++++++++++ .../_personalization_design_service.py | 279 ++++++++ stripe/issuing/_physical_bundle.py | 124 ++++ stripe/issuing/_physical_bundle_service.py | 86 +++ stripe/test_helpers/_issuing_service.py | 6 + stripe/test_helpers/issuing/__init__.py | 3 + .../_personalization_design_service.py | 115 ++++ tests/test_generated_examples.py | 323 +++++++++ 21 files changed, 1705 insertions(+), 5 deletions(-) create mode 100644 stripe/api_resources/issuing/personalization_design.py create mode 100644 stripe/api_resources/issuing/physical_bundle.py create mode 100644 stripe/issuing/_personalization_design.py create mode 100644 stripe/issuing/_personalization_design_service.py create mode 100644 stripe/issuing/_physical_bundle.py create mode 100644 stripe/issuing/_physical_bundle_service.py create mode 100644 stripe/test_helpers/issuing/_personalization_design_service.py diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 6ccc2b12f..0963e32fc 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v869 \ No newline at end of file +v878 \ No newline at end of file diff --git a/stripe/_account_session.py b/stripe/_account_session.py index 35442e2b1..811687089 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -146,6 +146,9 @@ class CreateParamsComponents(TypedDict): documents: NotRequired[ "AccountSession.CreateParamsComponentsDocuments" ] + """ + Configuration for the documents embedded component. + """ payment_details: NotRequired[ "AccountSession.CreateParamsComponentsPaymentDetails" ] diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 0f5c78a99..081b7cd80 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -32,6 +32,9 @@ class CreateParamsComponents(TypedDict): documents: NotRequired[ "AccountSessionService.CreateParamsComponentsDocuments" ] + """ + Configuration for the documents embedded component. + """ payment_details: NotRequired[ "AccountSessionService.CreateParamsComponentsPaymentDetails" ] diff --git a/stripe/_issuing_service.py b/stripe/_issuing_service.py index 62f65c00f..bdb9f6321 100644 --- a/stripe/_issuing_service.py +++ b/stripe/_issuing_service.py @@ -5,6 +5,10 @@ from stripe.issuing._card_service import CardService from stripe.issuing._cardholder_service import CardholderService from stripe.issuing._dispute_service import DisputeService +from stripe.issuing._personalization_design_service import ( + PersonalizationDesignService, +) +from stripe.issuing._physical_bundle_service import PhysicalBundleService from stripe.issuing._token_service import TokenService from stripe.issuing._transaction_service import TransactionService @@ -16,5 +20,9 @@ def __init__(self, requestor): self.cards = CardService(self._requestor) self.cardholders = CardholderService(self._requestor) self.disputes = DisputeService(self._requestor) + self.personalization_designs = PersonalizationDesignService( + self._requestor, + ) + self.physical_bundles = PhysicalBundleService(self._requestor) self.tokens = TokenService(self._requestor) self.transactions = TransactionService(self._requestor) diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index e6bc9b7a2..6fa65ed35 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -59,6 +59,8 @@ stripe.issuing.Card.OBJECT_NAME: stripe.issuing.Card, stripe.issuing.Cardholder.OBJECT_NAME: stripe.issuing.Cardholder, stripe.issuing.Dispute.OBJECT_NAME: stripe.issuing.Dispute, + stripe.issuing.PersonalizationDesign.OBJECT_NAME: stripe.issuing.PersonalizationDesign, + stripe.issuing.PhysicalBundle.OBJECT_NAME: stripe.issuing.PhysicalBundle, stripe.issuing.Token.OBJECT_NAME: stripe.issuing.Token, stripe.issuing.Transaction.OBJECT_NAME: stripe.issuing.Transaction, stripe.LineItem.OBJECT_NAME: stripe.LineItem, diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 8f103635e..485f2a9ab 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -244,6 +244,9 @@ class EuBankTransfer(StripeObject): class Konbini(StripeObject): pass + class SepaDebit(StripeObject): + pass + class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): permissions: Optional[ @@ -294,6 +297,10 @@ class FinancialConnections(StripeObject): """ This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription. """ + sepa_debit: Optional[SepaDebit] + """ + This sub-hash contains details about the SEPA Direct Debit payment method options to pass to invoices created by the subscription. + """ us_bank_account: Optional[UsBankAccount] """ This sub-hash contains details about the ACH direct debit payment method options to pass to invoices created by the subscription. @@ -304,6 +311,7 @@ class FinancialConnections(StripeObject): "card": Card, "customer_balance": CustomerBalance, "konbini": Konbini, + "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, } @@ -450,7 +458,7 @@ class CreateParams(RequestOptions): """ A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. """ - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired["Literal['']|float"] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ @@ -854,6 +862,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ + sepa_debit: NotRequired[ + "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. + """ us_bank_account: NotRequired[ "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] @@ -964,6 +978,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass + class CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + pass + class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): @@ -1156,7 +1173,7 @@ class ModifyParams(RequestOptions): """ A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. """ - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired["Literal['']|float"] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ @@ -1564,6 +1581,12 @@ class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ + sepa_debit: NotRequired[ + "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. + """ us_bank_account: NotRequired[ "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] @@ -1674,6 +1697,9 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer class ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass + class ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + pass + class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 7be42d79b..098182929 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -51,7 +51,7 @@ class CreateParams(TypedDict): """ A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. """ - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired["Literal['']|float"] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ @@ -465,6 +465,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ + sepa_debit: NotRequired[ + "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. + """ us_bank_account: NotRequired[ "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] @@ -575,6 +581,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass + class CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + pass + class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): @@ -813,7 +822,7 @@ class UpdateParams(TypedDict): """ A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. """ - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired["Literal['']|float"] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ @@ -1229,6 +1238,12 @@ class UpdateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ + sepa_debit: NotRequired[ + "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. + """ us_bank_account: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] @@ -1339,6 +1354,9 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer class UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass + class UpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + pass + class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): diff --git a/stripe/api_resources/issuing/__init__.py b/stripe/api_resources/issuing/__init__.py index d63d6a6cc..33190567e 100644 --- a/stripe/api_resources/issuing/__init__.py +++ b/stripe/api_resources/issuing/__init__.py @@ -20,5 +20,9 @@ from stripe.api_resources.issuing.card import Card from stripe.api_resources.issuing.cardholder import Cardholder from stripe.api_resources.issuing.dispute import Dispute + from stripe.api_resources.issuing.personalization_design import ( + PersonalizationDesign, + ) + from stripe.api_resources.issuing.physical_bundle import PhysicalBundle from stripe.api_resources.issuing.token import Token from stripe.api_resources.issuing.transaction import Transaction diff --git a/stripe/api_resources/issuing/personalization_design.py b/stripe/api_resources/issuing/personalization_design.py new file mode 100644 index 000000000..2b65c1db6 --- /dev/null +++ b/stripe/api_resources/issuing/personalization_design.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.issuing.personalization_design package is deprecated, please change your + imports to import from stripe.issuing directly. + From: + from stripe.api_resources.issuing.personalization_design import PersonalizationDesign + To: + from stripe.issuing import PersonalizationDesign + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.issuing._personalization_design import ( # noqa + PersonalizationDesign, + ) diff --git a/stripe/api_resources/issuing/physical_bundle.py b/stripe/api_resources/issuing/physical_bundle.py new file mode 100644 index 000000000..ea29db063 --- /dev/null +++ b/stripe/api_resources/issuing/physical_bundle.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.issuing.physical_bundle package is deprecated, please change your + imports to import from stripe.issuing directly. + From: + from stripe.api_resources.issuing.physical_bundle import PhysicalBundle + To: + from stripe.issuing import PhysicalBundle + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.issuing._physical_bundle import ( # noqa + PhysicalBundle, + ) diff --git a/stripe/issuing/__init__.py b/stripe/issuing/__init__.py index 9b76120a0..c393631e1 100644 --- a/stripe/issuing/__init__.py +++ b/stripe/issuing/__init__.py @@ -12,6 +12,16 @@ ) from stripe.issuing._dispute import Dispute as Dispute from stripe.issuing._dispute_service import DisputeService as DisputeService +from stripe.issuing._personalization_design import ( + PersonalizationDesign as PersonalizationDesign, +) +from stripe.issuing._personalization_design_service import ( + PersonalizationDesignService as PersonalizationDesignService, +) +from stripe.issuing._physical_bundle import PhysicalBundle as PhysicalBundle +from stripe.issuing._physical_bundle_service import ( + PhysicalBundleService as PhysicalBundleService, +) from stripe.issuing._token import Token as Token from stripe.issuing._token_service import TokenService as TokenService from stripe.issuing._transaction import Transaction as Transaction diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index 24b6f118f..f2f1a05eb 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -21,6 +21,7 @@ if TYPE_CHECKING: from stripe.issuing._cardholder import Cardholder + from stripe.issuing._personalization_design import PersonalizationDesign class Card( @@ -1122,6 +1123,10 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + personalization_design: NotRequired["str"] + """ + The personalization design object belonging to this card. + """ pin: NotRequired["Card.CreateParamsPin"] """ The desired PIN for this card. @@ -1309,6 +1314,7 @@ class ListParams(RequestOptions): """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ + personalization_design: NotRequired["str"] 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. @@ -1353,6 +1359,7 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + personalization_design: NotRequired["str"] pin: NotRequired["Card.ModifyParamsPin"] """ The desired new PIN for this card. @@ -1495,6 +1502,10 @@ class ShipCardParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ + personalization_design: Optional[ExpandableField["PersonalizationDesign"]] + """ + The personalization design object belonging to this card. + """ replaced_by: Optional[ExpandableField["Card"]] """ The latest card that replaces this card, if any. diff --git a/stripe/issuing/_card_service.py b/stripe/issuing/_card_service.py index 82dccff3f..d12a70c70 100644 --- a/stripe/issuing/_card_service.py +++ b/stripe/issuing/_card_service.py @@ -28,6 +28,10 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + personalization_design: NotRequired["str"] + """ + The personalization design object belonging to this card. + """ pin: NotRequired["CardService.CreateParamsPin"] """ The desired PIN for this card. @@ -205,6 +209,7 @@ class ListParams(TypedDict): """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ + personalization_design: NotRequired["str"] 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. @@ -255,6 +260,7 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + personalization_design: NotRequired["str"] pin: NotRequired["CardService.UpdateParamsPin"] """ The desired new PIN for this card. diff --git a/stripe/issuing/_personalization_design.py b/stripe/issuing/_personalization_design.py new file mode 100644 index 000000000..d7ae91469 --- /dev/null +++ b/stripe/issuing/_personalization_design.py @@ -0,0 +1,631 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from stripe._test_helpers import APIResourceTestHelpers +from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, Dict, List, Optional, cast, overload +from typing_extensions import ( + Literal, + NotRequired, + Type, + TypedDict, + Unpack, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from stripe._file import File + from stripe.issuing._physical_bundle import PhysicalBundle + + +class PersonalizationDesign( + CreateableAPIResource["PersonalizationDesign"], + ListableAPIResource["PersonalizationDesign"], + UpdateableAPIResource["PersonalizationDesign"], +): + """ + A Personalization Design is a logical grouping of a Physical Bundle, card logo, and carrier text that represents a product line. + """ + + OBJECT_NAME: ClassVar[ + Literal["issuing.personalization_design"] + ] = "issuing.personalization_design" + + class CarrierText(StripeObject): + footer_body: Optional[str] + """ + The footer body text of the carrier letter. + """ + footer_title: Optional[str] + """ + The footer title text of the carrier letter. + """ + header_body: Optional[str] + """ + The header body text of the carrier letter. + """ + header_title: Optional[str] + """ + The header title text of the carrier letter. + """ + + class Preferences(StripeObject): + is_default: bool + """ + Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. + """ + is_platform_default: Optional[bool] + """ + Whether this personalization design is used to create cards when one is not specified and a default for this connected account does not exist. + """ + + class RejectionReasons(StripeObject): + card_logo: Optional[ + List[ + Literal[ + "geographic_location", + "inappropriate", + "network_name", + "non_binary_image", + "non_fiat_currency", + "other", + "other_entity", + "promotional_material", + ] + ] + ] + """ + The reason(s) the card logo was rejected. + """ + carrier_text: Optional[ + List[ + Literal[ + "geographic_location", + "inappropriate", + "network_name", + "non_fiat_currency", + "other", + "other_entity", + "promotional_material", + ] + ] + ] + """ + The reason(s) the carrier text was rejected. + """ + + class ActivateParams(RequestOptions): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + class CreateParams(RequestOptions): + card_logo: NotRequired["str"] + """ + The file for the card logo, for use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. + """ + carrier_text: NotRequired[ + "PersonalizationDesign.CreateParamsCarrierText" + ] + """ + Hash containing carrier text, for use with physical bundles that support carrier text. + """ + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + lookup_key: NotRequired["str"] + """ + A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. + """ + metadata: NotRequired["Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + name: NotRequired["str"] + """ + Friendly display name. + """ + physical_bundle: str + """ + The physical bundle object belonging to this personalization design. + """ + preferences: NotRequired[ + "PersonalizationDesign.CreateParamsPreferences" + ] + """ + Information on whether this personalization design is used to create cards when one is not specified. + """ + transfer_lookup_key: NotRequired["bool"] + """ + If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. + """ + + class CreateParamsCarrierText(TypedDict): + footer_body: NotRequired["Literal['']|str"] + """ + The footer body text of the carrier letter. + """ + footer_title: NotRequired["Literal['']|str"] + """ + The footer title text of the carrier letter. + """ + header_body: NotRequired["Literal['']|str"] + """ + The header body text of the carrier letter. + """ + header_title: NotRequired["Literal['']|str"] + """ + The header title text of the carrier letter. + """ + + class CreateParamsPreferences(TypedDict): + is_default: bool + """ + Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. + """ + + class DeactivateParams(RequestOptions): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + class ListParams(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. + """ + lookup_keys: NotRequired["List[str]"] + """ + Only return personalization designs with the given lookup keys. + """ + preferences: NotRequired["PersonalizationDesign.ListParamsPreferences"] + """ + Only return personalization designs with the given preferences. + """ + starting_after: NotRequired["str"] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[ + "Literal['active', 'inactive', 'rejected', 'review']" + ] + """ + Only return personalization designs with the given status. + """ + + class ListParamsPreferences(TypedDict): + is_default: NotRequired["bool"] + """ + Only return the personalization design that's set as the default. A connected account uses the Connect platform's default design if no personalization design is set as the default. + """ + is_platform_default: NotRequired["bool"] + """ + Only return the personalization design that is set as the Connect platform's default. This parameter is only applicable to connected accounts. + """ + + class ModifyParams(RequestOptions): + card_logo: NotRequired["Literal['']|str"] + """ + The file for the card logo, for use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. + """ + carrier_text: NotRequired[ + "Literal['']|PersonalizationDesign.ModifyParamsCarrierText" + ] + """ + Hash containing carrier text, for use with physical bundles that support carrier text. + """ + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + lookup_key: NotRequired["Literal['']|str"] + """ + A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. + """ + metadata: NotRequired["Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + name: NotRequired["Literal['']|str"] + """ + Friendly display name. Providing an empty string will set the field to null. + """ + physical_bundle: NotRequired["str"] + """ + The physical bundle object belonging to this personalization design. + """ + preferences: NotRequired[ + "PersonalizationDesign.ModifyParamsPreferences" + ] + """ + Information on whether this personalization design is used to create cards when one is not specified. + """ + transfer_lookup_key: NotRequired["bool"] + """ + If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. + """ + + class ModifyParamsCarrierText(TypedDict): + footer_body: NotRequired["Literal['']|str"] + """ + The footer body text of the carrier letter. + """ + footer_title: NotRequired["Literal['']|str"] + """ + The footer title text of the carrier letter. + """ + header_body: NotRequired["Literal['']|str"] + """ + The header body text of the carrier letter. + """ + header_title: NotRequired["Literal['']|str"] + """ + The header title text of the carrier letter. + """ + + class ModifyParamsPreferences(TypedDict): + is_default: bool + """ + Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. + """ + + class RejectParams(RequestOptions): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + rejection_reasons: "PersonalizationDesign.RejectParamsRejectionReasons" + """ + The reason(s) the personalization design was rejected. + """ + + class RejectParamsRejectionReasons(TypedDict): + card_logo: NotRequired[ + "List[Literal['geographic_location', 'inappropriate', 'network_name', 'non_binary_image', 'non_fiat_currency', 'other', 'other_entity', 'promotional_material']]" + ] + """ + The reason(s) the card logo was rejected. + """ + carrier_text: NotRequired[ + "List[Literal['geographic_location', 'inappropriate', 'network_name', 'non_fiat_currency', 'other', 'other_entity', 'promotional_material']]" + ] + """ + The reason(s) the carrier text was rejected. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + card_logo: Optional[ExpandableField["File"]] + """ + The file for the card logo to use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. + """ + carrier_text: Optional[CarrierText] + """ + Hash containing carrier text, for use with physical bundles that support carrier text. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + lookup_key: Optional[str] + """ + A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. + """ + metadata: Dict[str, str] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + name: Optional[str] + """ + Friendly display name. + """ + object: Literal["issuing.personalization_design"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + physical_bundle: ExpandableField["PhysicalBundle"] + """ + The physical bundle object belonging to this personalization design. + """ + preferences: Preferences + rejection_reasons: RejectionReasons + status: Literal["active", "inactive", "rejected", "review"] + """ + Whether this personalization design can be used to create cards. + """ + + @classmethod + def create( + cls, **params: Unpack["PersonalizationDesign.CreateParams"] + ) -> "PersonalizationDesign": + """ + Creates a personalization design object. + """ + return cast( + "PersonalizationDesign", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["PersonalizationDesign.ListParams"] + ) -> ListObject["PersonalizationDesign"]: + """ + Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + 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 + def modify( + cls, id: str, **params: Unpack["PersonalizationDesign.ModifyParams"] + ) -> "PersonalizationDesign": + """ + Updates a card personalization object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "PersonalizationDesign", + cls._static_request( + "post", + url, + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["PersonalizationDesign.RetrieveParams"] + ) -> "PersonalizationDesign": + """ + Retrieves a personalization design object. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + class TestHelpers(APIResourceTestHelpers["PersonalizationDesign"]): + _resource_cls: Type["PersonalizationDesign"] + + @classmethod + def _cls_activate( + cls, + personalization_design: str, + **params: Unpack["PersonalizationDesign.ActivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to active. + """ + return cast( + "PersonalizationDesign", + cls._static_request( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( + personalization_design=sanitize_id( + personalization_design + ) + ), + params=params, + ), + ) + + @overload + @staticmethod + def activate( + personalization_design: str, + **params: Unpack["PersonalizationDesign.ActivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to active. + """ + ... + + @overload + def activate( + self, **params: Unpack["PersonalizationDesign.ActivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to active. + """ + ... + + @class_method_variant("_cls_activate") + def activate( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PersonalizationDesign.ActivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to active. + """ + return cast( + "PersonalizationDesign", + self.resource._request( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( + personalization_design=sanitize_id( + self.resource.get("id") + ) + ), + params=params, + ), + ) + + @classmethod + def _cls_deactivate( + cls, + personalization_design: str, + **params: Unpack["PersonalizationDesign.DeactivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to inactive. + """ + return cast( + "PersonalizationDesign", + cls._static_request( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( + personalization_design=sanitize_id( + personalization_design + ) + ), + params=params, + ), + ) + + @overload + @staticmethod + def deactivate( + personalization_design: str, + **params: Unpack["PersonalizationDesign.DeactivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to inactive. + """ + ... + + @overload + def deactivate( + self, **params: Unpack["PersonalizationDesign.DeactivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to inactive. + """ + ... + + @class_method_variant("_cls_deactivate") + def deactivate( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PersonalizationDesign.DeactivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to inactive. + """ + return cast( + "PersonalizationDesign", + self.resource._request( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( + personalization_design=sanitize_id( + self.resource.get("id") + ) + ), + params=params, + ), + ) + + @classmethod + def _cls_reject( + cls, + personalization_design: str, + **params: Unpack["PersonalizationDesign.RejectParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to rejected. + """ + return cast( + "PersonalizationDesign", + cls._static_request( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( + personalization_design=sanitize_id( + personalization_design + ) + ), + params=params, + ), + ) + + @overload + @staticmethod + def reject( + personalization_design: str, + **params: Unpack["PersonalizationDesign.RejectParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to rejected. + """ + ... + + @overload + def reject( + self, **params: Unpack["PersonalizationDesign.RejectParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to rejected. + """ + ... + + @class_method_variant("_cls_reject") + def reject( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PersonalizationDesign.RejectParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to rejected. + """ + return cast( + "PersonalizationDesign", + self.resource._request( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( + personalization_design=sanitize_id( + self.resource.get("id") + ) + ), + params=params, + ), + ) + + @property + def test_helpers(self): + return self.TestHelpers(self) + + _inner_class_types = { + "carrier_text": CarrierText, + "preferences": Preferences, + "rejection_reasons": RejectionReasons, + } + + +PersonalizationDesign.TestHelpers._resource_cls = PersonalizationDesign diff --git a/stripe/issuing/_personalization_design_service.py b/stripe/issuing/_personalization_design_service.py new file mode 100644 index 000000000..fa06f7e7e --- /dev/null +++ b/stripe/issuing/_personalization_design_service.py @@ -0,0 +1,279 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.issuing._personalization_design import PersonalizationDesign +from typing import Dict, List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class PersonalizationDesignService(StripeService): + class CreateParams(TypedDict): + card_logo: NotRequired["str"] + """ + The file for the card logo, for use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. + """ + carrier_text: NotRequired[ + "PersonalizationDesignService.CreateParamsCarrierText" + ] + """ + Hash containing carrier text, for use with physical bundles that support carrier text. + """ + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + lookup_key: NotRequired["str"] + """ + A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. + """ + metadata: NotRequired["Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + name: NotRequired["str"] + """ + Friendly display name. + """ + physical_bundle: str + """ + The physical bundle object belonging to this personalization design. + """ + preferences: NotRequired[ + "PersonalizationDesignService.CreateParamsPreferences" + ] + """ + Information on whether this personalization design is used to create cards when one is not specified. + """ + transfer_lookup_key: NotRequired["bool"] + """ + If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. + """ + + class CreateParamsCarrierText(TypedDict): + footer_body: NotRequired["Literal['']|str"] + """ + The footer body text of the carrier letter. + """ + footer_title: NotRequired["Literal['']|str"] + """ + The footer title text of the carrier letter. + """ + header_body: NotRequired["Literal['']|str"] + """ + The header body text of the carrier letter. + """ + header_title: NotRequired["Literal['']|str"] + """ + The header title text of the carrier letter. + """ + + class CreateParamsPreferences(TypedDict): + is_default: bool + """ + Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. + """ + + class ListParams(TypedDict): + 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. + """ + lookup_keys: NotRequired["List[str]"] + """ + Only return personalization designs with the given lookup keys. + """ + preferences: NotRequired[ + "PersonalizationDesignService.ListParamsPreferences" + ] + """ + Only return personalization designs with the given preferences. + """ + starting_after: NotRequired["str"] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[ + "Literal['active', 'inactive', 'rejected', 'review']" + ] + """ + Only return personalization designs with the given status. + """ + + class ListParamsPreferences(TypedDict): + is_default: NotRequired["bool"] + """ + Only return the personalization design that's set as the default. A connected account uses the Connect platform's default design if no personalization design is set as the default. + """ + is_platform_default: NotRequired["bool"] + """ + Only return the personalization design that is set as the Connect platform's default. This parameter is only applicable to connected accounts. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + class UpdateParams(TypedDict): + card_logo: NotRequired["Literal['']|str"] + """ + The file for the card logo, for use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. + """ + carrier_text: NotRequired[ + "Literal['']|PersonalizationDesignService.UpdateParamsCarrierText" + ] + """ + Hash containing carrier text, for use with physical bundles that support carrier text. + """ + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + lookup_key: NotRequired["Literal['']|str"] + """ + A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. + """ + metadata: NotRequired["Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + name: NotRequired["Literal['']|str"] + """ + Friendly display name. Providing an empty string will set the field to null. + """ + physical_bundle: NotRequired["str"] + """ + The physical bundle object belonging to this personalization design. + """ + preferences: NotRequired[ + "PersonalizationDesignService.UpdateParamsPreferences" + ] + """ + Information on whether this personalization design is used to create cards when one is not specified. + """ + transfer_lookup_key: NotRequired["bool"] + """ + If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. + """ + + class UpdateParamsCarrierText(TypedDict): + footer_body: NotRequired["Literal['']|str"] + """ + The footer body text of the carrier letter. + """ + footer_title: NotRequired["Literal['']|str"] + """ + The footer title text of the carrier letter. + """ + header_body: NotRequired["Literal['']|str"] + """ + The header body text of the carrier letter. + """ + header_title: NotRequired["Literal['']|str"] + """ + The header title text of the carrier letter. + """ + + class UpdateParamsPreferences(TypedDict): + is_default: bool + """ + Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. + """ + + def list( + self, + params: "PersonalizationDesignService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PersonalizationDesign]: + """ + Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[PersonalizationDesign], + self._request( + "get", + "/v1/issuing/personalization_designs", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "PersonalizationDesignService.CreateParams", + options: RequestOptions = {}, + ) -> PersonalizationDesign: + """ + Creates a personalization design object. + """ + return cast( + PersonalizationDesign, + self._request( + "post", + "/v1/issuing/personalization_designs", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + personalization_design: str, + params: "PersonalizationDesignService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PersonalizationDesign: + """ + Retrieves a personalization design object. + """ + return cast( + PersonalizationDesign, + self._request( + "get", + "/v1/issuing/personalization_designs/{personalization_design}".format( + personalization_design=sanitize_id(personalization_design), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + personalization_design: str, + params: "PersonalizationDesignService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> PersonalizationDesign: + """ + Updates a card personalization object. + """ + return cast( + PersonalizationDesign, + self._request( + "post", + "/v1/issuing/personalization_designs/{personalization_design}".format( + personalization_design=sanitize_id(personalization_design), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/issuing/_physical_bundle.py b/stripe/issuing/_physical_bundle.py new file mode 100644 index 000000000..156e2c1f5 --- /dev/null +++ b/stripe/issuing/_physical_bundle.py @@ -0,0 +1,124 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal, NotRequired, Unpack + + +class PhysicalBundle(ListableAPIResource["PhysicalBundle"]): + """ + A Physical Bundle represents the bundle of physical items - card stock, carrier letter, and envelope - that is shipped to a cardholder when you create a physical card. + """ + + OBJECT_NAME: ClassVar[ + Literal["issuing.physical_bundle"] + ] = "issuing.physical_bundle" + + class Features(StripeObject): + card_logo: Literal["optional", "required", "unsupported"] + """ + The policy for how to use card logo images in a card design with this physical bundle. + """ + carrier_text: Literal["optional", "required", "unsupported"] + """ + The policy for how to use carrier letter text in a card design with this physical bundle. + """ + second_line: Literal["optional", "required", "unsupported"] + """ + The policy for how to use a second line on a card with this physical bundle. + """ + + class ListParams(RequestOptions): + ending_before: NotRequired["str"] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired["int"] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired["str"] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired["Literal['active', 'inactive', 'review']"] + """ + Only return physical bundles with the given status. + """ + type: NotRequired["Literal['custom', 'standard']"] + """ + Only return physical bundles with the given type. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + features: Optional[Features] + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + name: str + """ + Friendly display name. + """ + object: Literal["issuing.physical_bundle"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + status: Literal["active", "inactive", "review"] + """ + Whether this physical bundle can be used to create cards. + """ + type: Literal["custom", "standard"] + """ + Whether this physical bundle is a standard Stripe offering or custom-made for you. + """ + + @classmethod + def list( + cls, **params: Unpack["PhysicalBundle.ListParams"] + ) -> ListObject["PhysicalBundle"]: + """ + Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + 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 + def retrieve( + cls, id: str, **params: Unpack["PhysicalBundle.RetrieveParams"] + ) -> "PhysicalBundle": + """ + Retrieves a physical bundle object. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + _inner_class_types = {"features": Features} diff --git a/stripe/issuing/_physical_bundle_service.py b/stripe/issuing/_physical_bundle_service.py new file mode 100644 index 000000000..35d93189d --- /dev/null +++ b/stripe/issuing/_physical_bundle_service.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.issuing._physical_bundle import PhysicalBundle +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class PhysicalBundleService(StripeService): + class ListParams(TypedDict): + ending_before: NotRequired["str"] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired["int"] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired["str"] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired["Literal['active', 'inactive', 'review']"] + """ + Only return physical bundles with the given status. + """ + type: NotRequired["Literal['custom', 'standard']"] + """ + Only return physical bundles with the given type. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "PhysicalBundleService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PhysicalBundle]: + """ + Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[PhysicalBundle], + self._request( + "get", + "/v1/issuing/physical_bundles", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + physical_bundle: str, + params: "PhysicalBundleService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PhysicalBundle: + """ + Retrieves a physical bundle object. + """ + return cast( + PhysicalBundle, + self._request( + "get", + "/v1/issuing/physical_bundles/{physical_bundle}".format( + physical_bundle=sanitize_id(physical_bundle), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/_issuing_service.py b/stripe/test_helpers/_issuing_service.py index 59913225a..4bb7e9614 100644 --- a/stripe/test_helpers/_issuing_service.py +++ b/stripe/test_helpers/_issuing_service.py @@ -5,6 +5,9 @@ AuthorizationService, ) from stripe.test_helpers.issuing._card_service import CardService +from stripe.test_helpers.issuing._personalization_design_service import ( + PersonalizationDesignService, +) from stripe.test_helpers.issuing._transaction_service import TransactionService @@ -13,4 +16,7 @@ def __init__(self, requestor): super().__init__(requestor) self.authorizations = AuthorizationService(self._requestor) self.cards = CardService(self._requestor) + self.personalization_designs = PersonalizationDesignService( + self._requestor, + ) self.transactions = TransactionService(self._requestor) diff --git a/stripe/test_helpers/issuing/__init__.py b/stripe/test_helpers/issuing/__init__.py index 4d189b228..6b99426b9 100644 --- a/stripe/test_helpers/issuing/__init__.py +++ b/stripe/test_helpers/issuing/__init__.py @@ -6,6 +6,9 @@ from stripe.test_helpers.issuing._card_service import ( CardService as CardService, ) +from stripe.test_helpers.issuing._personalization_design_service import ( + PersonalizationDesignService as PersonalizationDesignService, +) from stripe.test_helpers.issuing._transaction_service import ( TransactionService as TransactionService, ) diff --git a/stripe/test_helpers/issuing/_personalization_design_service.py b/stripe/test_helpers/issuing/_personalization_design_service.py new file mode 100644 index 000000000..a83a52a1d --- /dev/null +++ b/stripe/test_helpers/issuing/_personalization_design_service.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.issuing._personalization_design import PersonalizationDesign +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class PersonalizationDesignService(StripeService): + class ActivateParams(TypedDict): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + class DeactivateParams(TypedDict): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + class RejectParams(TypedDict): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + rejection_reasons: "PersonalizationDesignService.RejectParamsRejectionReasons" + """ + The reason(s) the personalization design was rejected. + """ + + class RejectParamsRejectionReasons(TypedDict): + card_logo: NotRequired[ + "List[Literal['geographic_location', 'inappropriate', 'network_name', 'non_binary_image', 'non_fiat_currency', 'other', 'other_entity', 'promotional_material']]" + ] + """ + The reason(s) the card logo was rejected. + """ + carrier_text: NotRequired[ + "List[Literal['geographic_location', 'inappropriate', 'network_name', 'non_fiat_currency', 'other', 'other_entity', 'promotional_material']]" + ] + """ + The reason(s) the carrier text was rejected. + """ + + def activate( + self, + personalization_design: str, + params: "PersonalizationDesignService.ActivateParams" = {}, + options: RequestOptions = {}, + ) -> PersonalizationDesign: + """ + Updates the status of the specified testmode personalization design object to active. + """ + return cast( + PersonalizationDesign, + self._request( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( + personalization_design=sanitize_id(personalization_design), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def deactivate( + self, + personalization_design: str, + params: "PersonalizationDesignService.DeactivateParams" = {}, + options: RequestOptions = {}, + ) -> PersonalizationDesign: + """ + Updates the status of the specified testmode personalization design object to inactive. + """ + return cast( + PersonalizationDesign, + self._request( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( + personalization_design=sanitize_id(personalization_design), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def reject( + self, + personalization_design: str, + params: "PersonalizationDesignService.RejectParams", + options: RequestOptions = {}, + ) -> PersonalizationDesign: + """ + Updates the status of the specified testmode personalization design object to rejected. + """ + return cast( + PersonalizationDesign, + self._request( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( + personalization_design=sanitize_id(personalization_design), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 3eeea1afb..5c80d2b7f 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -2873,6 +2873,43 @@ def test_customers_cash_balance_post_service( post_data="settings[reconciliation_mode]=manual", ) + def test_customers_cash_balance_transactions_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.list_cash_balance_transactions( + "cus_123", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_123/cash_balance_transactions", + query_string="limit=3", + ) + + def test_customers_cash_balance_transactions_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/customers/cus_123/cash_balance_transactions", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.customers.cash_balance_transactions.list( + "cus_123", + {"limit": 3}, + ) + http_client_mock.assert_requested( + "get", + path="/v1/customers/cus_123/cash_balance_transactions", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + def test_customers_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.delete("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -6217,6 +6254,192 @@ def test_issuing_disputes_submit_post_service( api_base="https://api.stripe.com", ) + def test_issuing_personalization_designs_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PersonalizationDesign.list() + http_client_mock.assert_requested( + "get", + path="/v1/issuing/personalization_designs", + query_string="", + ) + + def test_issuing_personalization_designs_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/issuing/personalization_designs", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.issuing.personalization_designs.list() + http_client_mock.assert_requested( + "get", + path="/v1/issuing/personalization_designs", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_issuing_personalization_designs_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PersonalizationDesign.retrieve("pd_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/personalization_designs/pd_xyz", + query_string="", + ) + + def test_issuing_personalization_designs_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/issuing/personalization_designs/pd_xyz", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.issuing.personalization_designs.retrieve("pd_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/personalization_designs/pd_xyz", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_issuing_personalization_designs_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PersonalizationDesign.create(physical_bundle="pb_xyz") + http_client_mock.assert_requested( + "post", + path="/v1/issuing/personalization_designs", + query_string="", + post_data="physical_bundle=pb_xyz", + ) + + def test_issuing_personalization_designs_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/issuing/personalization_designs", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.issuing.personalization_designs.create( + { + "physical_bundle": "pb_xyz", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/issuing/personalization_designs", + query_string="", + api_base="https://api.stripe.com", + post_data="physical_bundle=pb_xyz", + ) + + def test_issuing_personalization_designs_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PersonalizationDesign.modify("pd_xyz") + http_client_mock.assert_requested( + "post", + path="/v1/issuing/personalization_designs/pd_xyz", + query_string="", + ) + + def test_issuing_personalization_designs_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/issuing/personalization_designs/pd_xyz", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.issuing.personalization_designs.update("pd_xyz") + http_client_mock.assert_requested( + "post", + path="/v1/issuing/personalization_designs/pd_xyz", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_issuing_physical_bundles_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PhysicalBundle.list() + http_client_mock.assert_requested( + "get", + path="/v1/issuing/physical_bundles", + query_string="", + ) + + def test_issuing_physical_bundles_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/issuing/physical_bundles", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.issuing.physical_bundles.list() + http_client_mock.assert_requested( + "get", + path="/v1/issuing/physical_bundles", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_issuing_physical_bundles_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PhysicalBundle.retrieve("pb_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/physical_bundles/pb_xyz", + query_string="", + ) + + def test_issuing_physical_bundles_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/issuing/physical_bundles/pb_xyz", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.issuing.physical_bundles.retrieve("pb_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/physical_bundles/pb_xyz", + query_string="", + api_base="https://api.stripe.com", + ) + def test_issuing_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -12683,6 +12906,106 @@ def test_test_helpers_issuing_cards_shipping_ship_post_service( api_base="https://api.stripe.com", ) + def test_test_helpers_issuing_personalization_designs_activate_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PersonalizationDesign.TestHelpers.activate("pd_xyz") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", + query_string="", + ) + + def test_test_helpers_issuing_personalization_designs_activate_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.personalization_designs.activate("pd_xyz") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_issuing_personalization_designs_deactivate_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PersonalizationDesign.TestHelpers.deactivate("pd_xyz") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", + query_string="", + ) + + def test_test_helpers_issuing_personalization_designs_deactivate_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.personalization_designs.deactivate( + "pd_xyz" + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_issuing_personalization_designs_reject_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PersonalizationDesign.TestHelpers.reject( + "pd_xyz", + rejection_reasons={"card_logo": ["geographic_location"]}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", + query_string="", + post_data="rejection_reasons[card_logo][0]=geographic_location", + ) + + def test_test_helpers_issuing_personalization_designs_reject_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.personalization_designs.reject( + "pd_xyz", + {"rejection_reasons": {"card_logo": ["geographic_location"]}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", + query_string="", + api_base="https://api.stripe.com", + post_data="rejection_reasons[card_logo][0]=geographic_location", + ) + def test_test_helpers_issuing_transactions_create_force_capture_post( self, http_client_mock: HTTPClientMock ) -> None: From 38bcf6eec367906663df8be46a0d54005900a1b1 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 14 Mar 2024 14:37:41 -0700 Subject: [PATCH 026/179] Bump version to 8.7.0 --- CHANGELOG.md | 9 +++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e9cc4e7a..29dc48ba3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 8.7.0 - 2024-03-14 +* [#1269](https://github.com/stripe/stripe-python/pull/1269) Update generated code + * Add support for `personalization_design` on parameter classes `CardService.CreateParams`, `CardService.ListParams`, `CardService.UpdateParams`, `stripe.issuing.Card.CreateParams`, `stripe.issuing.Card.ListParams`, and `stripe.issuing.Card.ModifyParams` and resource `stripe.issuing.Card` + * Add support for `sepa_debit` on parameter classes `SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptions`, `SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptions`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptions`, and `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptions` and resource class `stripe.Subscription.PaymentSettings.PaymentMethodOptions` + * Add support for resource `stripe.issuing.PersonalizationDesign` + * Add support for resource `stripe.issuing.PhysicalBundle` + * Change type from `float` to `Literal['']|float` of `application_fee_percent` on fields `stripe.Subscription.CreateParams`, `stripe.Subscription.ModifyParams`, `SubscriptionService.UpdateParams`, and `SubscriptionService.CreateParams` + + ## 8.6.0 - 2024-03-07 * [#1267](https://github.com/stripe/stripe-python/pull/1267) Update generated code * Add support for `documents` on `AccountSession.Components` diff --git a/VERSION b/VERSION index acd405b1d..df5119ec6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.6.0 +8.7.0 diff --git a/stripe/_version.py b/stripe/_version.py index b365c0237..b8bb0a2c9 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "8.6.0" +VERSION = "8.7.0" From cfb106b49a02c814c32b4a657ed211182e99c2d8 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 15:14:34 -0700 Subject: [PATCH 027/179] Update generated code (#1273) * Update generated code for v881 * Update generated code for v883 * Update generated code for v884 * Update generated code for v888 * Update generated code for v889 * Update generated code for v890 * Update generated code for v890 * Update generated code for v891 * Update generated code for v894 * Update generated code for v895 * Update generated code for v896 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/__init__.py | 6 + stripe/_account.py | 16 + stripe/_account_service.py | 24 + stripe/_charge.py | 32 + stripe/_confirmation_token.py | 1857 +++++++++++++++++ stripe/_confirmation_token_service.py | 39 + stripe/_customer.py | 2 +- stripe/_customer_payment_method_service.py | 2 +- stripe/_forwarding_service.py | 10 + stripe/_invoice.py | 4 + stripe/_object_classes.py | 2 + stripe/_payment_intent.py | 140 ++ stripe/_payment_intent_service.py | 120 ++ stripe/_payment_method.py | 17 +- stripe/_payment_method_service.py | 11 +- stripe/_product.py | 12 +- stripe/_product_service.py | 8 +- stripe/_quote.py | 8 +- stripe/_quote_service.py | 2 +- stripe/_setup_attempt.py | 4 + stripe/_setup_intent.py | 46 + stripe/_setup_intent_service.py | 42 + stripe/_stripe_client.py | 8 +- stripe/_subscription.py | 10 +- stripe/_subscription_service.py | 2 +- stripe/_test_helpers_service.py | 4 + stripe/api_resources/__init__.py | 2 + stripe/api_resources/confirmation_token.py | 21 + stripe/api_resources/forwarding/__init__.py | 19 + stripe/api_resources/forwarding/request.py | 21 + stripe/forwarding/__init__.py | 4 + stripe/forwarding/_request.py | 287 +++ stripe/forwarding/_request_service.py | 168 ++ stripe/terminal/_configuration.py | 12 + stripe/terminal/_configuration_service.py | 8 + stripe/test_helpers/__init__.py | 3 + .../_confirmation_token_service.py | 630 ++++++ stripe/treasury/_received_debit.py | 4 + 39 files changed, 3580 insertions(+), 29 deletions(-) create mode 100644 stripe/_confirmation_token.py create mode 100644 stripe/_confirmation_token_service.py create mode 100644 stripe/_forwarding_service.py create mode 100644 stripe/api_resources/confirmation_token.py create mode 100644 stripe/api_resources/forwarding/__init__.py create mode 100644 stripe/api_resources/forwarding/request.py create mode 100644 stripe/forwarding/__init__.py create mode 100644 stripe/forwarding/_request.py create mode 100644 stripe/forwarding/_request_service.py create mode 100644 stripe/test_helpers/_confirmation_token_service.py diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 0963e32fc..62a99e0ea 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v878 \ No newline at end of file +v896 \ No newline at end of file diff --git a/stripe/__init__.py b/stripe/__init__.py index 387bcaaf8..0c0943da9 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -214,6 +214,7 @@ def __getattr__(name): checkout as checkout, climate as climate, financial_connections as financial_connections, + forwarding as forwarding, identity as identity, issuing as issuing, radar as radar, @@ -281,6 +282,10 @@ def __getattr__(name): from stripe._charge_service import ChargeService as ChargeService from stripe._checkout_service import CheckoutService as CheckoutService from stripe._climate_service import ClimateService as ClimateService +from stripe._confirmation_token import ConfirmationToken as ConfirmationToken +from stripe._confirmation_token_service import ( + ConfirmationTokenService as ConfirmationTokenService, +) from stripe._connect_collection_transfer import ( ConnectCollectionTransfer as ConnectCollectionTransfer, ) @@ -354,6 +359,7 @@ def __getattr__(name): from stripe._financial_connections_service import ( FinancialConnectionsService as FinancialConnectionsService, ) +from stripe._forwarding_service import ForwardingService as ForwardingService from stripe._funding_instructions import ( FundingInstructions as FundingInstructions, ) diff --git a/stripe/_account.py b/stripe/_account.py index dd752a614..d9de212d4 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -257,6 +257,10 @@ class Capabilities(StripeObject): """ The status of the link_payments capability of the account, or whether the account can directly process Link charges. """ + mobilepay_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the MobilepPay capability of the account, or whether the account can directly process MobilePay charges. + """ oxxo_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. @@ -1484,6 +1488,12 @@ class CreateParamsCapabilities(TypedDict): """ The link_payments capability. """ + mobilepay_payments: NotRequired[ + "Account.CreateParamsCapabilitiesMobilepayPayments" + ] + """ + The mobilepay_payments capability. + """ oxxo_payments: NotRequired[ "Account.CreateParamsCapabilitiesOxxoPayments" ] @@ -1709,6 +1719,12 @@ class CreateParamsCapabilitiesLinkPayments(TypedDict): 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 CreateParamsCapabilitiesMobilepayPayments(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 CreateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired["bool"] """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 79a36b2b3..dec3571a3 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -371,6 +371,12 @@ class CreateParamsCapabilities(TypedDict): """ The link_payments capability. """ + mobilepay_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesMobilepayPayments" + ] + """ + The mobilepay_payments capability. + """ oxxo_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesOxxoPayments" ] @@ -600,6 +606,12 @@ class CreateParamsCapabilitiesLinkPayments(TypedDict): 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 CreateParamsCapabilitiesMobilepayPayments(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 CreateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired["bool"] """ @@ -1898,6 +1910,12 @@ class UpdateParamsCapabilities(TypedDict): """ The link_payments capability. """ + mobilepay_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesMobilepayPayments" + ] + """ + The mobilepay_payments capability. + """ oxxo_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesOxxoPayments" ] @@ -2127,6 +2145,12 @@ class UpdateParamsCapabilitiesLinkPayments(TypedDict): 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 UpdateParamsCapabilitiesMobilepayPayments(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 UpdateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired["bool"] """ diff --git a/stripe/_charge.py b/stripe/_charge.py index dcc1f47af..535fea913 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1272,6 +1272,32 @@ class Link(StripeObject): You could use this attribute to get a sense of international fees. """ + class Mobilepay(StripeObject): + class Card(StripeObject): + brand: Optional[str] + """ + Brand of the card used in the transaction + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card + """ + exp_month: Optional[int] + """ + Two digit number representing the card's expiration month + """ + exp_year: Optional[int] + """ + Two digit number representing the card's expiration year + """ + last4: Optional[str] + """ + The last 4 digits of the card + """ + + card: Optional[Card] + _inner_class_types = {"card": Card} + class Multibanco(StripeObject): entity: Optional[str] """ @@ -1513,6 +1539,10 @@ class UsBankAccount(StripeObject): """ Last four digits of the bank account number. """ + payment_reference: Optional[str] + """ + Reference number to locate ACH payments with customer's bank. + """ routing_number: Optional[str] """ Routing number of the bank account. @@ -1558,6 +1588,7 @@ class Zip(StripeObject): klarna: Optional[Klarna] konbini: Optional[Konbini] link: Optional[Link] + mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] oxxo: Optional[Oxxo] p24: Optional[P24] @@ -1606,6 +1637,7 @@ class Zip(StripeObject): "klarna": Klarna, "konbini": Konbini, "link": Link, + "mobilepay": Mobilepay, "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py new file mode 100644 index 000000000..723986260 --- /dev/null +++ b/stripe/_confirmation_token.py @@ -0,0 +1,1857 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_resource import APIResource +from stripe._expandable_field import ExpandableField +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from stripe._test_helpers import APIResourceTestHelpers +from typing import ClassVar, Dict, List, Optional, cast +from typing_extensions import ( + Literal, + NotRequired, + Type, + TypedDict, + Unpack, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from stripe._charge import Charge + from stripe._setup_attempt import SetupAttempt + + +class ConfirmationToken(APIResource["ConfirmationToken"]): + """ + ConfirmationTokens help transport client side data collected by Stripe JS over + to your server for confirming a PaymentIntent or SetupIntent. If the confirmation + is successful, values present on the ConfirmationToken are written onto the Intent. + + To learn more or request access, visit the related guided: [Finalize payments on the server using Confirmation Tokens](https://stripe.com/docs/payments/finalize-payments-on-the-server-confirmation-tokens). + """ + + OBJECT_NAME: ClassVar[Literal["confirmation_token"]] = "confirmation_token" + + class MandateData(StripeObject): + class CustomerAcceptance(StripeObject): + class Online(StripeObject): + ip_address: Optional[str] + """ + The IP address from which the Mandate was accepted by the customer. + """ + user_agent: Optional[str] + """ + The user agent of the browser from which the Mandate was accepted by the customer. + """ + + online: Optional[Online] + """ + If this is a Mandate accepted online, this hash contains details about the online acceptance. + """ + type: str + """ + The type of customer acceptance information included with the Mandate. + """ + _inner_class_types = {"online": Online} + + customer_acceptance: CustomerAcceptance + """ + This hash contains details about the customer acceptance of the Mandate. + """ + _inner_class_types = {"customer_acceptance": CustomerAcceptance} + + class PaymentMethodPreview(StripeObject): + class AcssDebit(StripeObject): + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + institution_number: Optional[str] + """ + Institution number of the bank account. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + transit_number: Optional[str] + """ + Transit number of the bank account. + """ + + class Affirm(StripeObject): + pass + + class AfterpayClearpay(StripeObject): + pass + + class Alipay(StripeObject): + pass + + class AuBecsDebit(StripeObject): + bsb_number: Optional[str] + """ + Six-digit number identifying bank and branch associated with this bank account. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + + class BacsDebit(StripeObject): + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + sort_code: Optional[str] + """ + Sort code of the bank account. (e.g., `10-20-30`) + """ + + class Bancontact(StripeObject): + pass + + class BillingDetails(StripeObject): + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Optional[Address] + """ + Billing address. + """ + email: Optional[str] + """ + Email address. + """ + name: Optional[str] + """ + Full name. + """ + phone: Optional[str] + """ + Billing phone number (including extension). + """ + _inner_class_types = {"address": Address} + + class Blik(StripeObject): + pass + + class Boleto(StripeObject): + tax_id: str + """ + Uniquely identifies the customer tax id (CNPJ or CPF) + """ + + class Card(StripeObject): + class Checks(StripeObject): + address_line1_check: Optional[str] + """ + If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + """ + address_postal_code_check: Optional[str] + """ + If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + """ + cvc_check: Optional[str] + """ + If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + """ + + class Networks(StripeObject): + available: List[str] + """ + All available networks for the card. + """ + preferred: Optional[str] + """ + The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. + """ + + class ThreeDSecureUsage(StripeObject): + supported: bool + """ + Whether 3D Secure is supported on this card. + """ + + class Wallet(StripeObject): + class AmexExpressCheckout(StripeObject): + pass + + class ApplePay(StripeObject): + pass + + class GooglePay(StripeObject): + pass + + class Link(StripeObject): + pass + + class Masterpass(StripeObject): + class BillingAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class ShippingAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + billing_address: Optional[BillingAddress] + """ + Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + email: Optional[str] + """ + Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + shipping_address: Optional[ShippingAddress] + """ + Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + _inner_class_types = { + "billing_address": BillingAddress, + "shipping_address": ShippingAddress, + } + + class SamsungPay(StripeObject): + pass + + class VisaCheckout(StripeObject): + class BillingAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class ShippingAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + billing_address: Optional[BillingAddress] + """ + Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + email: Optional[str] + """ + Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + shipping_address: Optional[ShippingAddress] + """ + Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + _inner_class_types = { + "billing_address": BillingAddress, + "shipping_address": ShippingAddress, + } + + amex_express_checkout: Optional[AmexExpressCheckout] + apple_pay: Optional[ApplePay] + dynamic_last4: Optional[str] + """ + (For tokenized numbers only.) The last four digits of the device account number. + """ + google_pay: Optional[GooglePay] + link: Optional[Link] + masterpass: Optional[Masterpass] + samsung_pay: Optional[SamsungPay] + type: Literal[ + "amex_express_checkout", + "apple_pay", + "google_pay", + "link", + "masterpass", + "samsung_pay", + "visa_checkout", + ] + """ + The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + """ + visa_checkout: Optional[VisaCheckout] + _inner_class_types = { + "amex_express_checkout": AmexExpressCheckout, + "apple_pay": ApplePay, + "google_pay": GooglePay, + "link": Link, + "masterpass": Masterpass, + "samsung_pay": SamsungPay, + "visa_checkout": VisaCheckout, + } + + brand: str + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + checks: Optional[Checks] + """ + Checks on Card address and CVC if provided. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + description: Optional[str] + """ + A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + """ + display_brand: Optional[str] + """ + The brand to use when displaying the card, this accounts for customer's brand choice on dual-branded cards. Can be `american_express`, `cartes_bancaires`, `diners_club`, `discover`, `eftpos_australia`, `interac`, `jcb`, `mastercard`, `union_pay`, `visa`, or `other` and may contain more values in the future. + """ + exp_month: int + """ + Two-digit number representing the card's expiration month. + """ + exp_year: int + """ + Four-digit number representing the card's expiration year. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + + *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: str + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + iin: Optional[str] + """ + Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + """ + issuer: Optional[str] + """ + The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + """ + last4: str + """ + The last four digits of the card. + """ + networks: Optional[Networks] + """ + Contains information about card networks that can be used to process the payment. + """ + three_d_secure_usage: Optional[ThreeDSecureUsage] + """ + Contains details on how this Card may be used for 3D Secure authentication. + """ + wallet: Optional[Wallet] + """ + If this Card is part of a card wallet, this contains the details of the card wallet. + """ + _inner_class_types = { + "checks": Checks, + "networks": Networks, + "three_d_secure_usage": ThreeDSecureUsage, + "wallet": Wallet, + } + + class CardPresent(StripeObject): + class Networks(StripeObject): + available: List[str] + """ + All available networks for the card. + """ + preferred: Optional[str] + """ + The preferred network for the card. + """ + + brand: Optional[str] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + cardholder_name: Optional[str] + """ + The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + description: Optional[str] + """ + A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + """ + exp_month: int + """ + Two-digit number representing the card's expiration month. + """ + exp_year: int + """ + Four-digit number representing the card's expiration year. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + + *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: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + iin: Optional[str] + """ + Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + """ + issuer: Optional[str] + """ + The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + networks: Optional[Networks] + """ + Contains information about card networks that can be used to process the payment. + """ + read_method: Optional[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ] + ] + """ + How card details were read in this transaction. + """ + _inner_class_types = {"networks": Networks} + + class Cashapp(StripeObject): + buyer_id: Optional[str] + """ + A unique and immutable identifier assigned by Cash App to every buyer. + """ + cashtag: Optional[str] + """ + A public identifier for buyers using Cash App. + """ + + class CustomerBalance(StripeObject): + pass + + class Eps(StripeObject): + bank: Optional[ + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] + ] + """ + The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + """ + + class Fpx(StripeObject): + account_holder_type: Optional[Literal["company", "individual"]] + """ + Account holder type, if provided. Can be one of `individual` or `company`. + """ + bank: Literal[ + "affin_bank", + "agrobank", + "alliance_bank", + "ambank", + "bank_islam", + "bank_muamalat", + "bank_of_china", + "bank_rakyat", + "bsn", + "cimb", + "deutsche_bank", + "hong_leong_bank", + "hsbc", + "kfh", + "maybank2e", + "maybank2u", + "ocbc", + "pb_enterprise", + "public_bank", + "rhb", + "standard_chartered", + "uob", + ] + """ + The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + """ + + class Giropay(StripeObject): + pass + + class Grabpay(StripeObject): + pass + + class Ideal(StripeObject): + bank: Optional[ + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] + ] + """ + The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + """ + bic: Optional[ + Literal[ + "ABNANL2A", + "ASNBNL21", + "BITSNL2A", + "BUNQNL2A", + "FVLBNL22", + "HANDNL2A", + "INGBNL2A", + "KNABNL2H", + "MOYONL21", + "NNBANL2G", + "NTSBDEB1", + "RABONL2U", + "RBRBNL21", + "REVOIE23", + "REVOLT21", + "SNSBNL2A", + "TRIONL2U", + ] + ] + """ + The Bank Identifier Code of the customer's bank, if the bank was provided. + """ + + class InteracPresent(StripeObject): + class Networks(StripeObject): + available: List[str] + """ + All available networks for the card. + """ + preferred: Optional[str] + """ + The preferred network for the card. + """ + + brand: Optional[str] + """ + Card brand. Can be `interac`, `mastercard` or `visa`. + """ + cardholder_name: Optional[str] + """ + The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + description: Optional[str] + """ + A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + """ + exp_month: int + """ + Two-digit number representing the card's expiration month. + """ + exp_year: int + """ + Four-digit number representing the card's expiration year. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + + *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: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + iin: Optional[str] + """ + Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + """ + issuer: Optional[str] + """ + The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + networks: Optional[Networks] + """ + Contains information about card networks that can be used to process the payment. + """ + preferred_locales: Optional[List[str]] + """ + EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + """ + read_method: Optional[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ] + ] + """ + How card details were read in this transaction. + """ + _inner_class_types = {"networks": Networks} + + class Klarna(StripeObject): + class Dob(StripeObject): + day: Optional[int] + """ + The day of birth, between 1 and 31. + """ + month: Optional[int] + """ + The month of birth, between 1 and 12. + """ + year: Optional[int] + """ + The four-digit year of birth. + """ + + dob: Optional[Dob] + """ + The customer's date of birth, if provided. + """ + _inner_class_types = {"dob": Dob} + + class Konbini(StripeObject): + pass + + class Link(StripeObject): + email: Optional[str] + """ + Account owner's email address. + """ + persistent_token: Optional[str] + """ + [Deprecated] This is a legacy parameter that no longer has any function. + """ + + class Mobilepay(StripeObject): + pass + + class Oxxo(StripeObject): + pass + + class P24(StripeObject): + bank: Optional[ + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] + ] + """ + The customer's bank, if provided. + """ + + class Paynow(StripeObject): + pass + + class Paypal(StripeObject): + payer_email: Optional[str] + """ + Owner's email. Values are provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + payer_id: Optional[str] + """ + PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + """ + + class Pix(StripeObject): + pass + + class Promptpay(StripeObject): + pass + + class RevolutPay(StripeObject): + pass + + class SepaDebit(StripeObject): + class GeneratedFrom(StripeObject): + charge: Optional[ExpandableField["Charge"]] + """ + The ID of the Charge that generated this PaymentMethod, if any. + """ + setup_attempt: Optional[ExpandableField["SetupAttempt"]] + """ + The ID of the SetupAttempt that generated this PaymentMethod, if any. + """ + + bank_code: Optional[str] + """ + Bank code of bank associated with the bank account. + """ + branch_code: Optional[str] + """ + Branch code of bank associated with the bank account. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country the bank account is located in. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + generated_from: Optional[GeneratedFrom] + """ + Information about the object that generated this PaymentMethod. + """ + last4: Optional[str] + """ + Last four characters of the IBAN. + """ + _inner_class_types = {"generated_from": GeneratedFrom} + + class Sofort(StripeObject): + country: Optional[str] + """ + Two-letter ISO code representing the country the bank account is located in. + """ + + class Swish(StripeObject): + pass + + class UsBankAccount(StripeObject): + class Networks(StripeObject): + preferred: Optional[str] + """ + The preferred network. + """ + supported: List[Literal["ach", "us_domestic_wire"]] + """ + All supported networks. + """ + + class StatusDetails(StripeObject): + class Blocked(StripeObject): + network_code: Optional[ + Literal[ + "R02", + "R03", + "R04", + "R05", + "R07", + "R08", + "R10", + "R11", + "R16", + "R20", + "R29", + "R31", + ] + ] + """ + The ACH network code that resulted in this block. + """ + reason: Optional[ + Literal[ + "bank_account_closed", + "bank_account_frozen", + "bank_account_invalid_details", + "bank_account_restricted", + "bank_account_unusable", + "debit_not_authorized", + ] + ] + """ + The reason why this PaymentMethod's fingerprint has been blocked + """ + + blocked: Optional[Blocked] + _inner_class_types = {"blocked": Blocked} + + account_holder_type: Optional[Literal["company", "individual"]] + """ + Account holder type: individual or company. + """ + account_type: Optional[Literal["checking", "savings"]] + """ + Account type: checkings or savings. Defaults to checking if omitted. + """ + bank_name: Optional[str] + """ + The name of the bank. + """ + financial_connections_account: Optional[str] + """ + The ID of the Financial Connections Account used to create the payment method. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + networks: Optional[Networks] + """ + Contains information about US bank account networks that can be used. + """ + routing_number: Optional[str] + """ + Routing number of the bank account. + """ + status_details: Optional[StatusDetails] + """ + Contains information about the future reusability of this PaymentMethod. + """ + _inner_class_types = { + "networks": Networks, + "status_details": StatusDetails, + } + + class WechatPay(StripeObject): + pass + + class Zip(StripeObject): + pass + + acss_debit: Optional[AcssDebit] + affirm: Optional[Affirm] + afterpay_clearpay: Optional[AfterpayClearpay] + alipay: Optional[Alipay] + au_becs_debit: Optional[AuBecsDebit] + bacs_debit: Optional[BacsDebit] + bancontact: Optional[Bancontact] + billing_details: BillingDetails + blik: Optional[Blik] + boleto: Optional[Boleto] + card: Optional[Card] + card_present: Optional[CardPresent] + cashapp: Optional[Cashapp] + customer_balance: Optional[CustomerBalance] + eps: Optional[Eps] + fpx: Optional[Fpx] + giropay: Optional[Giropay] + grabpay: Optional[Grabpay] + ideal: Optional[Ideal] + interac_present: Optional[InteracPresent] + klarna: Optional[Klarna] + konbini: Optional[Konbini] + link: Optional[Link] + mobilepay: Optional[Mobilepay] + oxxo: Optional[Oxxo] + p24: Optional[P24] + paynow: Optional[Paynow] + paypal: Optional[Paypal] + pix: Optional[Pix] + promptpay: Optional[Promptpay] + revolut_pay: Optional[RevolutPay] + sepa_debit: Optional[SepaDebit] + sofort: Optional[Sofort] + swish: Optional[Swish] + type: Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "card", + "card_present", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "interac_present", + "klarna", + "konbini", + "link", + "mobilepay", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "revolut_pay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + "zip", + ] + """ + 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. + """ + us_bank_account: Optional[UsBankAccount] + wechat_pay: Optional[WechatPay] + zip: Optional[Zip] + _inner_class_types = { + "acss_debit": AcssDebit, + "affirm": Affirm, + "afterpay_clearpay": AfterpayClearpay, + "alipay": Alipay, + "au_becs_debit": AuBecsDebit, + "bacs_debit": BacsDebit, + "bancontact": Bancontact, + "billing_details": BillingDetails, + "blik": Blik, + "boleto": Boleto, + "card": Card, + "card_present": CardPresent, + "cashapp": Cashapp, + "customer_balance": CustomerBalance, + "eps": Eps, + "fpx": Fpx, + "giropay": Giropay, + "grabpay": Grabpay, + "ideal": Ideal, + "interac_present": InteracPresent, + "klarna": Klarna, + "konbini": Konbini, + "link": Link, + "mobilepay": Mobilepay, + "oxxo": Oxxo, + "p24": P24, + "paynow": Paynow, + "paypal": Paypal, + "pix": Pix, + "promptpay": Promptpay, + "revolut_pay": RevolutPay, + "sepa_debit": SepaDebit, + "sofort": Sofort, + "swish": Swish, + "us_bank_account": UsBankAccount, + "wechat_pay": WechatPay, + "zip": Zip, + } + + class Shipping(StripeObject): + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Address + name: str + """ + Recipient name. + """ + phone: Optional[str] + """ + Recipient phone (including extension). + """ + _inner_class_types = {"address": Address} + + class CreateParams(RequestOptions): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + payment_method: NotRequired["str"] + """ + ID of an existing PaymentMethod. + """ + payment_method_data: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodData" + ] + """ + If provided, this hash will be used to create a PaymentMethod. + """ + return_url: NotRequired["str"] + """ + Return URL used to confirm the Intent. + """ + setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] + """ + Indicates that you intend to make future payments with this ConfirmationToken's payment method. + + The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + """ + shipping: NotRequired["ConfirmationToken.CreateParamsShipping"] + """ + Shipping information for this ConfirmationToken. + """ + + class CreateParamsPaymentMethodData(TypedDict): + acss_debit: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataAcssDebit" + ] + """ + If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + """ + affirm: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataAffirm" + ] + """ + If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + """ + afterpay_clearpay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataAfterpayClearpay" + ] + """ + If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + """ + alipay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataAlipay" + ] + """ + If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + """ + au_becs_debit: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataAuBecsDebit" + ] + """ + If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + """ + bacs_debit: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataBacsDebit" + ] + """ + If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + """ + bancontact: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataBancontact" + ] + """ + If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + """ + billing_details: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataBillingDetails" + ] + """ + Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + """ + blik: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataBlik" + ] + """ + If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + """ + boleto: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataBoleto" + ] + """ + If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + """ + cashapp: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataCashapp" + ] + """ + If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + """ + customer_balance: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataCustomerBalance" + ] + """ + If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + """ + eps: NotRequired["ConfirmationToken.CreateParamsPaymentMethodDataEps"] + """ + If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + """ + fpx: NotRequired["ConfirmationToken.CreateParamsPaymentMethodDataFpx"] + """ + If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + """ + giropay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataGiropay" + ] + """ + If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + """ + grabpay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataGrabpay" + ] + """ + If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + """ + ideal: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataIdeal" + ] + """ + If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + """ + interac_present: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataInteracPresent" + ] + """ + If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + """ + klarna: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + """ + konbini: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataKonbini" + ] + """ + If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + """ + link: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataLink" + ] + """ + If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + """ + metadata: NotRequired["Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + mobilepay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ + oxxo: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataOxxo" + ] + """ + If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + """ + p24: NotRequired["ConfirmationToken.CreateParamsPaymentMethodDataP24"] + """ + If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + """ + paynow: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataPaynow" + ] + """ + If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + """ + paypal: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataPaypal" + ] + """ + If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + """ + pix: NotRequired["ConfirmationToken.CreateParamsPaymentMethodDataPix"] + """ + If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + """ + promptpay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataPromptpay" + ] + """ + If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + """ + radar_options: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataRadarOptions" + ] + """ + Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + """ + revolut_pay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataRevolutPay" + ] + """ + If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + """ + sepa_debit: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataSepaDebit" + ] + """ + If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + """ + sofort: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataSofort" + ] + """ + If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + """ + swish: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataSwish" + ] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ + type: Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "mobilepay", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "revolut_pay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + "zip", + ] + """ + 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. + """ + us_bank_account: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataUsBankAccount" + ] + """ + If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + """ + wechat_pay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataWechatPay" + ] + """ + If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + """ + zip: NotRequired["ConfirmationToken.CreateParamsPaymentMethodDataZip"] + """ + If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + """ + + class CreateParamsPaymentMethodDataAcssDebit(TypedDict): + account_number: str + """ + Customer's bank account number. + """ + institution_number: str + """ + Institution number of the customer's bank. + """ + transit_number: str + """ + Transit number of the customer's bank. + """ + + class CreateParamsPaymentMethodDataAffirm(TypedDict): + pass + + class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): + pass + + class CreateParamsPaymentMethodDataAlipay(TypedDict): + pass + + class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): + account_number: str + """ + The account number for the bank account. + """ + bsb_number: str + """ + Bank-State-Branch number of the bank account. + """ + + class CreateParamsPaymentMethodDataBacsDebit(TypedDict): + account_number: NotRequired["str"] + """ + Account number of the bank account that the funds will be debited from. + """ + sort_code: NotRequired["str"] + """ + Sort code of the bank account. (e.g., `10-20-30`) + """ + + class CreateParamsPaymentMethodDataBancontact(TypedDict): + pass + + class CreateParamsPaymentMethodDataBillingDetails(TypedDict): + address: NotRequired[ + "Literal['']|ConfirmationToken.CreateParamsPaymentMethodDataBillingDetailsAddress" + ] + """ + Billing address. + """ + email: NotRequired["Literal['']|str"] + """ + Email address. + """ + name: NotRequired["Literal['']|str"] + """ + Full name. + """ + phone: NotRequired["Literal['']|str"] + """ + Billing phone number (including extension). + """ + + class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): + city: NotRequired["str"] + """ + City, district, suburb, town, or village. + """ + country: NotRequired["str"] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired["str"] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired["str"] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired["str"] + """ + ZIP or postal code. + """ + state: NotRequired["str"] + """ + State, county, province, or region. + """ + + class CreateParamsPaymentMethodDataBlik(TypedDict): + pass + + class CreateParamsPaymentMethodDataBoleto(TypedDict): + tax_id: str + """ + The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + """ + + class CreateParamsPaymentMethodDataCashapp(TypedDict): + pass + + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): + pass + + class CreateParamsPaymentMethodDataEps(TypedDict): + bank: NotRequired[ + "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + ] + """ + The customer's bank. + """ + + class CreateParamsPaymentMethodDataFpx(TypedDict): + account_holder_type: NotRequired["Literal['company', 'individual']"] + """ + Account holder type for FPX transaction + """ + bank: Literal[ + "affin_bank", + "agrobank", + "alliance_bank", + "ambank", + "bank_islam", + "bank_muamalat", + "bank_of_china", + "bank_rakyat", + "bsn", + "cimb", + "deutsche_bank", + "hong_leong_bank", + "hsbc", + "kfh", + "maybank2e", + "maybank2u", + "ocbc", + "pb_enterprise", + "public_bank", + "rhb", + "standard_chartered", + "uob", + ] + """ + The customer's bank. + """ + + class CreateParamsPaymentMethodDataGiropay(TypedDict): + pass + + class CreateParamsPaymentMethodDataGrabpay(TypedDict): + pass + + class CreateParamsPaymentMethodDataIdeal(TypedDict): + bank: NotRequired[ + "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + ] + """ + The customer's bank. + """ + + class CreateParamsPaymentMethodDataInteracPresent(TypedDict): + pass + + class CreateParamsPaymentMethodDataKlarna(TypedDict): + dob: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataKlarnaDob" + ] + """ + Customer's date of birth + """ + + class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + + class CreateParamsPaymentMethodDataKonbini(TypedDict): + pass + + class CreateParamsPaymentMethodDataLink(TypedDict): + pass + + class CreateParamsPaymentMethodDataMobilepay(TypedDict): + pass + + class CreateParamsPaymentMethodDataOxxo(TypedDict): + pass + + class CreateParamsPaymentMethodDataP24(TypedDict): + bank: NotRequired[ + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + ] + """ + The customer's bank. + """ + + class CreateParamsPaymentMethodDataPaynow(TypedDict): + pass + + class CreateParamsPaymentMethodDataPaypal(TypedDict): + pass + + class CreateParamsPaymentMethodDataPix(TypedDict): + pass + + class CreateParamsPaymentMethodDataPromptpay(TypedDict): + pass + + class CreateParamsPaymentMethodDataRadarOptions(TypedDict): + session: NotRequired["str"] + """ + A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + """ + + class CreateParamsPaymentMethodDataRevolutPay(TypedDict): + pass + + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): + iban: str + """ + IBAN of the bank account. + """ + + class CreateParamsPaymentMethodDataSofort(TypedDict): + country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + """ + Two-letter ISO code representing the country the bank account is located in. + """ + + class CreateParamsPaymentMethodDataSwish(TypedDict): + pass + + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): + account_holder_type: NotRequired["Literal['company', 'individual']"] + """ + Account holder type: individual or company. + """ + account_number: NotRequired["str"] + """ + Account number of the bank account. + """ + account_type: NotRequired["Literal['checking', 'savings']"] + """ + Account type: checkings or savings. Defaults to checking if omitted. + """ + financial_connections_account: NotRequired["str"] + """ + The ID of a Financial Connections Account to use as a payment method. + """ + routing_number: NotRequired["str"] + """ + Routing number of the bank account. + """ + + class CreateParamsPaymentMethodDataWechatPay(TypedDict): + pass + + class CreateParamsPaymentMethodDataZip(TypedDict): + pass + + class CreateParamsShipping(TypedDict): + address: "ConfirmationToken.CreateParamsShippingAddress" + """ + Shipping address + """ + name: str + """ + Recipient name. + """ + phone: NotRequired["Literal['']|str"] + """ + Recipient phone (including extension) + """ + + class CreateParamsShippingAddress(TypedDict): + city: NotRequired["str"] + """ + City, district, suburb, town, or village. + """ + country: NotRequired["str"] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired["str"] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired["str"] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired["str"] + """ + ZIP or postal code. + """ + state: NotRequired["str"] + """ + State, county, province, or region. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + expires_at: Optional[int] + """ + Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. This is set to null once this ConfirmationToken has been used. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + mandate_data: Optional[MandateData] + """ + Data used for generating a Mandate. + """ + object: Literal["confirmation_token"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payment_intent: Optional[str] + """ + ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + """ + payment_method_preview: Optional[PaymentMethodPreview] + """ + Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. + """ + return_url: Optional[str] + """ + Return URL used to confirm the Intent. + """ + setup_future_usage: Optional[Literal["off_session", "on_session"]] + """ + Indicates that you intend to make future payments with this ConfirmationToken's payment method. + + The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + """ + setup_intent: Optional[str] + """ + ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + """ + shipping: Optional[Shipping] + """ + Shipping information collected on this ConfirmationToken. + """ + use_stripe_sdk: bool + """ + Indicates whether the Stripe SDK is used to handle confirmation flow. Defaults to `true` on ConfirmationToken. + """ + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["ConfirmationToken.RetrieveParams"] + ) -> "ConfirmationToken": + """ + Retrieves an existing ConfirmationToken object + """ + instance = cls(id, **params) + instance.refresh() + return instance + + class TestHelpers(APIResourceTestHelpers["ConfirmationToken"]): + _resource_cls: Type["ConfirmationToken"] + + @classmethod + def create( + cls, **params: Unpack["ConfirmationToken.CreateParams"] + ) -> "ConfirmationToken": + """ + Creates a test mode Confirmation Token server side for your integration tests. + """ + return cast( + "ConfirmationToken", + cls._static_request( + "post", + "/v1/test_helpers/confirmation_tokens", + params=params, + ), + ) + + @property + def test_helpers(self): + return self.TestHelpers(self) + + _inner_class_types = { + "mandate_data": MandateData, + "payment_method_preview": PaymentMethodPreview, + "shipping": Shipping, + } + + +ConfirmationToken.TestHelpers._resource_cls = ConfirmationToken diff --git a/stripe/_confirmation_token_service.py b/stripe/_confirmation_token_service.py new file mode 100644 index 000000000..92a80564b --- /dev/null +++ b/stripe/_confirmation_token_service.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._confirmation_token import ConfirmationToken +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class ConfirmationTokenService(StripeService): + class RetrieveParams(TypedDict): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + def retrieve( + self, + confirmation_token: str, + params: "ConfirmationTokenService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ConfirmationToken: + """ + Retrieves an existing ConfirmationToken object + """ + return cast( + ConfirmationToken, + self._request( + "get", + "/v1/confirmation_tokens/{confirmation_token}".format( + confirmation_token=sanitize_id(confirmation_token), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_customer.py b/stripe/_customer.py index 09063ab7c..95dfe9190 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -812,7 +812,7 @@ class ListPaymentMethodsParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 55b24945a..83cfa1712 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -28,7 +28,7 @@ class ListParams(TypedDict): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. diff --git a/stripe/_forwarding_service.py b/stripe/_forwarding_service.py new file mode 100644 index 000000000..f04e03340 --- /dev/null +++ b/stripe/_forwarding_service.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe.forwarding._request_service import RequestService + + +class ForwardingService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.requests = RequestService(self._requestor) diff --git a/stripe/_invoice.py b/stripe/_invoice.py index d1ac8a708..d485a3f5b 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -357,6 +357,10 @@ class LastFinalizationError(StripeObject): "expired_card", "financial_connections_account_inactive", "financial_connections_no_successful_transaction_refresh", + "forwarding_api_inactive", + "forwarding_api_invalid_parameter", + "forwarding_api_upstream_connection_error", + "forwarding_api_upstream_connection_timeout", "idempotency_key_in_use", "incorrect_address", "incorrect_cvc", diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 6fa65ed35..f20225fe3 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -28,6 +28,7 @@ stripe.climate.Order.OBJECT_NAME: stripe.climate.Order, stripe.climate.Product.OBJECT_NAME: stripe.climate.Product, stripe.climate.Supplier.OBJECT_NAME: stripe.climate.Supplier, + stripe.ConfirmationToken.OBJECT_NAME: stripe.ConfirmationToken, stripe.ConnectCollectionTransfer.OBJECT_NAME: stripe.ConnectCollectionTransfer, stripe.CountrySpec.OBJECT_NAME: stripe.CountrySpec, stripe.Coupon.OBJECT_NAME: stripe.Coupon, @@ -49,6 +50,7 @@ stripe.financial_connections.AccountOwnership.OBJECT_NAME: stripe.financial_connections.AccountOwnership, stripe.financial_connections.Session.OBJECT_NAME: stripe.financial_connections.Session, stripe.financial_connections.Transaction.OBJECT_NAME: stripe.financial_connections.Transaction, + stripe.forwarding.Request.OBJECT_NAME: stripe.forwarding.Request, stripe.FundingInstructions.OBJECT_NAME: stripe.FundingInstructions, stripe.identity.VerificationReport.OBJECT_NAME: stripe.identity.VerificationReport, stripe.identity.VerificationSession.OBJECT_NAME: stripe.identity.VerificationSession, diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 0fd377299..ca6739a74 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -142,6 +142,10 @@ class LastPaymentError(StripeObject): "expired_card", "financial_connections_account_inactive", "financial_connections_no_successful_transaction_refresh", + "forwarding_api_inactive", + "forwarding_api_invalid_parameter", + "forwarding_api_upstream_connection_error", + "forwarding_api_upstream_connection_timeout", "idempotency_key_in_use", "incorrect_address", "incorrect_cvc", @@ -1450,6 +1454,20 @@ class Link(StripeObject): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class Mobilepay(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class Oxxo(StripeObject): expires_after_days: int """ @@ -1693,6 +1711,7 @@ class Zip(StripeObject): klarna: Optional[Klarna] konbini: Optional[Konbini] link: Optional[Link] + mobilepay: Optional[Mobilepay] oxxo: Optional[Oxxo] p24: Optional[P24] paynow: Optional[Paynow] @@ -1729,6 +1748,7 @@ class Zip(StripeObject): "klarna": Klarna, "konbini": Konbini, "link": Link, + "mobilepay": Mobilepay, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, @@ -1906,6 +1926,12 @@ class ConfirmParams(RequestOptions): """ Controls when the funds will be captured from the customer's account. """ + confirmation_token: NotRequired["str"] + """ + ID of the ConfirmationToken used to confirm this PaymentIntent. + + If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + """ error_on_requires_action: NotRequired["bool"] """ 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://stripe.com/docs/payments/save-card-without-authentication). @@ -2144,6 +2170,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -2222,6 +2254,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -2449,6 +2482,9 @@ class ConfirmParamsPaymentMethodDataKonbini(TypedDict): class ConfirmParamsPaymentMethodDataLink(TypedDict): pass + class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2657,6 +2693,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ + mobilepay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsMobilepay" + ] + """ + If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsOxxo" ] @@ -3413,6 +3455,26 @@ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ + setup_future_usage: NotRequired["Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired["int"] """ @@ -3783,6 +3845,12 @@ class CreateParams(RequestOptions): """ Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. """ + confirmation_token: NotRequired["str"] + """ + ID of the ConfirmationToken used to confirm this PaymentIntent. + + If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + """ 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). @@ -4077,6 +4145,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -4155,6 +4229,7 @@ class CreateParamsPaymentMethodData(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -4382,6 +4457,9 @@ class CreateParamsPaymentMethodDataKonbini(TypedDict): class CreateParamsPaymentMethodDataLink(TypedDict): pass + class CreateParamsPaymentMethodDataMobilepay(TypedDict): + pass + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -4590,6 +4668,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ + mobilepay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsMobilepay" + ] + """ + If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsOxxo" ] @@ -5346,6 +5430,26 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ + setup_future_usage: NotRequired["Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired["int"] """ @@ -6012,6 +6116,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -6090,6 +6200,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -6317,6 +6428,9 @@ class ModifyParamsPaymentMethodDataKonbini(TypedDict): class ModifyParamsPaymentMethodDataLink(TypedDict): pass + class ModifyParamsPaymentMethodDataMobilepay(TypedDict): + pass + class ModifyParamsPaymentMethodDataOxxo(TypedDict): pass @@ -6525,6 +6639,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ + mobilepay: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsMobilepay" + ] + """ + If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsOxxo" ] @@ -7281,6 +7401,26 @@ class ModifyParamsPaymentMethodOptionsLink(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsMobilepay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ + setup_future_usage: NotRequired["Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class ModifyParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired["int"] """ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index f3ff4850f..12ffa0d2b 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -93,6 +93,12 @@ class ConfirmParams(TypedDict): """ Controls when the funds will be captured from the customer's account. """ + confirmation_token: NotRequired["str"] + """ + ID of the ConfirmationToken used to confirm this PaymentIntent. + + If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + """ error_on_requires_action: NotRequired["bool"] """ 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://stripe.com/docs/payments/save-card-without-authentication). @@ -343,6 +349,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataOxxo" ] @@ -429,6 +441,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -658,6 +671,9 @@ class ConfirmParamsPaymentMethodDataKonbini(TypedDict): class ConfirmParamsPaymentMethodDataLink(TypedDict): pass + class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -866,6 +882,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ + mobilepay: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsMobilepay" + ] + """ + If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsOxxo" ] @@ -1622,6 +1644,26 @@ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ + setup_future_usage: NotRequired["Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired["int"] """ @@ -1992,6 +2034,12 @@ class CreateParams(TypedDict): """ Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. """ + confirmation_token: NotRequired["str"] + """ + ID of the ConfirmationToken used to confirm this PaymentIntent. + + If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + """ 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). @@ -2300,6 +2348,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataOxxo" ] @@ -2386,6 +2440,7 @@ class CreateParamsPaymentMethodData(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -2615,6 +2670,9 @@ class CreateParamsPaymentMethodDataKonbini(TypedDict): class CreateParamsPaymentMethodDataLink(TypedDict): pass + class CreateParamsPaymentMethodDataMobilepay(TypedDict): + pass + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2823,6 +2881,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ + mobilepay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsMobilepay" + ] + """ + If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsOxxo" ] @@ -3579,6 +3643,26 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ + setup_future_usage: NotRequired["Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired["int"] """ @@ -4287,6 +4371,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataOxxo" ] @@ -4373,6 +4463,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -4602,6 +4693,9 @@ class UpdateParamsPaymentMethodDataKonbini(TypedDict): class UpdateParamsPaymentMethodDataLink(TypedDict): pass + class UpdateParamsPaymentMethodDataMobilepay(TypedDict): + pass + class UpdateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -4810,6 +4904,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ + mobilepay: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsMobilepay" + ] + """ + If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsOxxo" ] @@ -5566,6 +5666,26 @@ class UpdateParamsPaymentMethodOptionsLink(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsMobilepay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ + setup_future_usage: NotRequired["Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class UpdateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired["int"] """ diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index e754b11ba..993551cab 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -777,6 +777,9 @@ class Link(StripeObject): [Deprecated] This is a legacy parameter that no longer has any function. """ + class Mobilepay(StripeObject): + pass + class Oxxo(StripeObject): pass @@ -1105,6 +1108,10 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired["PaymentMethod.CreateParamsMobilepay"] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired["PaymentMethod.CreateParamsOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -1154,7 +1161,7 @@ class CreateParams(RequestOptions): If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" ] """ 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. @@ -1397,6 +1404,9 @@ class CreateParamsKonbini(TypedDict): class CreateParamsLink(TypedDict): pass + class CreateParamsMobilepay(TypedDict): + pass + class CreateParamsOxxo(TypedDict): pass @@ -1500,7 +1510,7 @@ class ListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. @@ -1664,6 +1674,7 @@ class RetrieveParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ + mobilepay: Optional[Mobilepay] object: Literal["payment_method"] """ String representing the object's type. Objects of the same type share the same value. @@ -1705,6 +1716,7 @@ class RetrieveParams(RequestOptions): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -1979,6 +1991,7 @@ def retrieve( "klarna": Klarna, "konbini": Konbini, "link": Link, + "mobilepay": Mobilepay, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 81b8912bf..259fd7443 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -131,6 +131,10 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired["PaymentMethodService.CreateParamsMobilepay"] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired["PaymentMethodService.CreateParamsOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -182,7 +186,7 @@ class CreateParams(TypedDict): If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" ] """ 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. @@ -427,6 +431,9 @@ class CreateParamsKonbini(TypedDict): class CreateParamsLink(TypedDict): pass + class CreateParamsMobilepay(TypedDict): + pass + class CreateParamsOxxo(TypedDict): pass @@ -530,7 +537,7 @@ class ListParams(TypedDict): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. diff --git a/stripe/_product.py b/stripe/_product.py index 240d230bf..4e5d77cb6 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -57,7 +57,7 @@ class Product( class Feature(StripeObject): name: Optional[str] """ - The feature's name. Up to 80 characters long. + The marketing feature name. Up to 80 characters long. """ class PackageDimensions(StripeObject): @@ -97,7 +97,7 @@ class CreateParams(RequestOptions): """ features: NotRequired["List[Product.CreateParamsFeature]"] """ - A list of up to 15 features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). """ id: NotRequired["str"] """ @@ -262,7 +262,7 @@ class CreateParamsDefaultPriceDataRecurring(TypedDict): class CreateParamsFeature(TypedDict): name: str """ - The feature's name. Up to 80 characters long. + The marketing feature name. Up to 80 characters long. """ class CreateParamsPackageDimensions(TypedDict): @@ -365,7 +365,7 @@ class ModifyParams(RequestOptions): """ features: NotRequired["Literal['']|List[Product.ModifyParamsFeature]"] """ - A list of up to 15 features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). """ images: NotRequired["Literal['']|List[str]"] """ @@ -412,7 +412,7 @@ class ModifyParams(RequestOptions): class ModifyParamsFeature(TypedDict): name: str """ - The feature's name. Up to 80 characters long. + The marketing feature name. Up to 80 characters long. """ class ModifyParamsPackageDimensions(TypedDict): @@ -475,7 +475,7 @@ class SearchParams(RequestOptions): """ features: List[Feature] """ - A list of up to 15 features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). """ id: str """ diff --git a/stripe/_product_service.py b/stripe/_product_service.py index 8a2d98f77..cfaaccbfe 100644 --- a/stripe/_product_service.py +++ b/stripe/_product_service.py @@ -32,7 +32,7 @@ class CreateParams(TypedDict): """ features: NotRequired["List[ProductService.CreateParamsFeature]"] """ - A list of up to 15 features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). """ id: NotRequired["str"] """ @@ -199,7 +199,7 @@ class CreateParamsDefaultPriceDataRecurring(TypedDict): class CreateParamsFeature(TypedDict): name: str """ - The feature's name. Up to 80 characters long. + The marketing feature name. Up to 80 characters long. """ class CreateParamsPackageDimensions(TypedDict): @@ -328,7 +328,7 @@ class UpdateParams(TypedDict): "Literal['']|List[ProductService.UpdateParamsFeature]" ] """ - A list of up to 15 features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). """ images: NotRequired["Literal['']|List[str]"] """ @@ -375,7 +375,7 @@ class UpdateParams(TypedDict): class UpdateParamsFeature(TypedDict): name: str """ - The feature's name. Up to 80 characters long. + The marketing feature name. Up to 80 characters long. """ class UpdateParamsPackageDimensions(TypedDict): diff --git a/stripe/_quote.py b/stripe/_quote.py index 1ba645fc1..5af37be32 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -1419,7 +1419,7 @@ def modify( @classmethod def _cls_pdf(cls, quote: str, **params: Unpack["Quote.PdfParams"]) -> Any: """ - Download the PDF for a finalized quote + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, @@ -1435,14 +1435,14 @@ def _cls_pdf(cls, quote: str, **params: Unpack["Quote.PdfParams"]) -> Any: @staticmethod def pdf(quote: str, **params: Unpack["Quote.PdfParams"]) -> Any: """ - Download the PDF for a finalized quote + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ ... @overload def pdf(self, **params: Unpack["Quote.PdfParams"]) -> Any: """ - Download the PDF for a finalized quote + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ ... @@ -1451,7 +1451,7 @@ def pdf( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.PdfParams"] ) -> Any: """ - Download the PDF for a finalized quote + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 212dc2d01..7f904cc0a 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -717,7 +717,7 @@ def pdf( options: RequestOptions = {}, ) -> Any: """ - Download the PDF for a finalized quote + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 573d9267e..f9ca69fff 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -454,6 +454,10 @@ class SetupError(StripeObject): "expired_card", "financial_connections_account_inactive", "financial_connections_no_successful_transaction_refresh", + "forwarding_api_inactive", + "forwarding_api_invalid_parameter", + "forwarding_api_upstream_connection_error", + "forwarding_api_upstream_connection_timeout", "idempotency_key_in_use", "incorrect_address", "incorrect_cvc", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 68e1546d5..0d353fb0d 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -128,6 +128,10 @@ class LastSetupError(StripeObject): "expired_card", "financial_connections_account_inactive", "financial_connections_no_successful_transaction_refresh", + "forwarding_api_inactive", + "forwarding_api_invalid_parameter", + "forwarding_api_upstream_connection_error", + "forwarding_api_upstream_connection_timeout", "idempotency_key_in_use", "incorrect_address", "incorrect_cvc", @@ -613,6 +617,12 @@ class CancelParams(RequestOptions): """ class ConfirmParams(RequestOptions): + confirmation_token: NotRequired["str"] + """ + ID of the ConfirmationToken used to confirm this SetupIntent. + + If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + """ expand: NotRequired["List[str]"] """ Specifies which fields in the response should be expanded. @@ -804,6 +814,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -876,6 +892,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -1101,6 +1118,9 @@ class ConfirmParamsPaymentMethodDataKonbini(TypedDict): class ConfirmParamsPaymentMethodDataLink(TypedDict): pass + class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -1503,6 +1523,12 @@ class CreateParams(RequestOptions): """ Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary. """ + confirmation_token: NotRequired["str"] + """ + ID of the ConfirmationToken used to confirm this SetupIntent. + + If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + """ customer: NotRequired["str"] """ ID of the Customer this SetupIntent belongs to, if one exists. @@ -1745,6 +1771,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired["SetupIntent.CreateParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -1817,6 +1849,7 @@ class CreateParamsPaymentMethodData(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -2042,6 +2075,9 @@ class CreateParamsPaymentMethodDataKonbini(TypedDict): class CreateParamsPaymentMethodDataLink(TypedDict): pass + class CreateParamsPaymentMethodDataMobilepay(TypedDict): + pass + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2661,6 +2697,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -2733,6 +2775,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -2958,6 +3001,9 @@ class ModifyParamsPaymentMethodDataKonbini(TypedDict): class ModifyParamsPaymentMethodDataLink(TypedDict): pass + class ModifyParamsPaymentMethodDataMobilepay(TypedDict): + pass + class ModifyParamsPaymentMethodDataOxxo(TypedDict): pass diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 648261105..cd81278e5 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -23,6 +23,12 @@ class CancelParams(TypedDict): """ class ConfirmParams(TypedDict): + confirmation_token: NotRequired["str"] + """ + ID of the ConfirmationToken used to confirm this SetupIntent. + + If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + """ expand: NotRequired["List[str]"] """ Specifies which fields in the response should be expanded. @@ -232,6 +238,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataOxxo" ] @@ -318,6 +330,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -547,6 +560,9 @@ class ConfirmParamsPaymentMethodDataKonbini(TypedDict): class ConfirmParamsPaymentMethodDataLink(TypedDict): pass + class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -953,6 +969,12 @@ class CreateParams(TypedDict): """ Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary. """ + confirmation_token: NotRequired["str"] + """ + ID of the ConfirmationToken used to confirm this SetupIntent. + + If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + """ customer: NotRequired["str"] """ ID of the Customer this SetupIntent belongs to, if one exists. @@ -1209,6 +1231,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataOxxo" ] @@ -1291,6 +1319,7 @@ class CreateParamsPaymentMethodData(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -1518,6 +1547,9 @@ class CreateParamsPaymentMethodDataKonbini(TypedDict): class CreateParamsPaymentMethodDataLink(TypedDict): pass + class CreateParamsPaymentMethodDataMobilepay(TypedDict): + pass + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2165,6 +2197,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + mobilepay: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ oxxo: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataOxxo" ] @@ -2247,6 +2285,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -2474,6 +2513,9 @@ class UpdateParamsPaymentMethodDataKonbini(TypedDict): class UpdateParamsPaymentMethodDataLink(TypedDict): pass + class UpdateParamsPaymentMethodDataMobilepay(TypedDict): + pass + class UpdateParamsPaymentMethodDataOxxo(TypedDict): pass diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index d492ddfd5..2879ffe77 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -36,11 +36,12 @@ from stripe._charge_service import ChargeService from stripe._checkout_service import CheckoutService from stripe._climate_service import ClimateService +from stripe._confirmation_token_service import ConfirmationTokenService +from stripe._test_helpers_service import TestHelpersService from stripe._country_spec_service import CountrySpecService from stripe._coupon_service import CouponService from stripe._credit_note_service import CreditNoteService from stripe._customer_service import CustomerService -from stripe._test_helpers_service import TestHelpersService from stripe._customer_session_service import CustomerSessionService from stripe._dispute_service import DisputeService from stripe._ephemeral_key_service import EphemeralKeyService @@ -49,6 +50,7 @@ from stripe._file_service import FileService from stripe._file_link_service import FileLinkService from stripe._financial_connections_service import FinancialConnectionsService +from stripe._forwarding_service import ForwardingService from stripe._identity_service import IdentityService from stripe._invoice_service import InvoiceService from stripe._invoice_item_service import InvoiceItemService @@ -172,11 +174,12 @@ def __init__( self.charges = ChargeService(self._requestor) self.checkout = CheckoutService(self._requestor) self.climate = ClimateService(self._requestor) + self.confirmation_tokens = ConfirmationTokenService(self._requestor) + self.test_helpers = TestHelpersService(self._requestor) self.country_specs = CountrySpecService(self._requestor) self.coupons = CouponService(self._requestor) self.credit_notes = CreditNoteService(self._requestor) self.customers = CustomerService(self._requestor) - self.test_helpers = TestHelpersService(self._requestor) self.customer_sessions = CustomerSessionService(self._requestor) self.disputes = DisputeService(self._requestor) self.ephemeral_keys = EphemeralKeyService(self._requestor) @@ -187,6 +190,7 @@ def __init__( self.financial_connections = FinancialConnectionsService( self._requestor ) + self.forwarding = ForwardingService(self._requestor) self.identity = IdentityService(self._requestor) self.invoices = InvoiceService(self._requestor) self.invoice_items = InvoiceItemService(self._requestor) diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 485f2a9ab..c37ed8471 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -1265,7 +1265,7 @@ class ModifyParams(RequestOptions): "Literal['']|Subscription.ModifyParamsPauseCollection" ] """ - If specified, payment collection for this subscription will be paused. + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment). """ payment_behavior: NotRequired[ "Literal['allow_incomplete', 'default_incomplete', 'error_if_incomplete', 'pending_if_incomplete']" @@ -1933,7 +1933,7 @@ class SearchParams(RequestOptions): """ pause_collection: Optional[PauseCollection] """ - If specified, payment collection for this subscription will be paused. + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment). """ payment_settings: Optional[PaymentSettings] """ @@ -1970,12 +1970,14 @@ class SearchParams(RequestOptions): "unpaid", ] """ - Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. + Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid`, or `paused`. - For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` state. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal state, the open invoice will be voided and no further invoices will be generated. + For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this status can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` status. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal status, the open invoice will be voided and no further invoices will be generated. A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. + A subscription can only enter a `paused` status [when a trial ends without a payment method](https://stripe.com/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://stripe.com/billing/subscriptions/pause-payment), which still generates invoices. + If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 098182929..f806e5b8d 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -916,7 +916,7 @@ class UpdateParams(TypedDict): "Literal['']|SubscriptionService.UpdateParamsPauseCollection" ] """ - If specified, payment collection for this subscription will be paused. + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment). """ payment_behavior: NotRequired[ "Literal['allow_incomplete', 'default_incomplete', 'error_if_incomplete', 'pending_if_incomplete']" diff --git a/stripe/_test_helpers_service.py b/stripe/_test_helpers_service.py index b21181768..74bd2cf38 100644 --- a/stripe/_test_helpers_service.py +++ b/stripe/_test_helpers_service.py @@ -1,6 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService +from stripe.test_helpers._confirmation_token_service import ( + ConfirmationTokenService, +) from stripe.test_helpers._customer_service import CustomerService from stripe.test_helpers._issuing_service import IssuingService from stripe.test_helpers._refund_service import RefundService @@ -12,6 +15,7 @@ class TestHelpersService(StripeService): def __init__(self, requestor): super().__init__(requestor) + self.confirmation_tokens = ConfirmationTokenService(self._requestor) self.customers = CustomerService(self._requestor) self.issuing = IssuingService(self._requestor) self.refunds = RefundService(self._requestor) diff --git a/stripe/api_resources/__init__.py b/stripe/api_resources/__init__.py index 0879c77e4..9ec1c9830 100644 --- a/stripe/api_resources/__init__.py +++ b/stripe/api_resources/__init__.py @@ -22,6 +22,7 @@ checkout, climate, financial_connections, + forwarding, identity, issuing, radar, @@ -48,6 +49,7 @@ from stripe.api_resources.card import Card from stripe.api_resources.cash_balance import CashBalance from stripe.api_resources.charge import Charge + from stripe.api_resources.confirmation_token import ConfirmationToken from stripe.api_resources.connect_collection_transfer import ( ConnectCollectionTransfer, ) diff --git a/stripe/api_resources/confirmation_token.py b/stripe/api_resources/confirmation_token.py new file mode 100644 index 000000000..3f0fe344c --- /dev/null +++ b/stripe/api_resources/confirmation_token.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.confirmation_token package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.confirmation_token import ConfirmationToken + To: + from stripe import ConfirmationToken + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._confirmation_token import ( # noqa + ConfirmationToken, + ) diff --git a/stripe/api_resources/forwarding/__init__.py b/stripe/api_resources/forwarding/__init__.py new file mode 100644 index 000000000..2ca62e372 --- /dev/null +++ b/stripe/api_resources/forwarding/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.forwarding package is deprecated, please change your + imports to import from stripe.forwarding directly. + From: + from stripe.api_resources.forwarding import ... + To: + from stripe.forwarding import ... + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.api_resources.forwarding.request import Request diff --git a/stripe/api_resources/forwarding/request.py b/stripe/api_resources/forwarding/request.py new file mode 100644 index 000000000..26e6969ff --- /dev/null +++ b/stripe/api_resources/forwarding/request.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.forwarding.request package is deprecated, please change your + imports to import from stripe.forwarding directly. + From: + from stripe.api_resources.forwarding.request import Request + To: + from stripe.forwarding import Request + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.forwarding._request import ( # noqa + Request, + ) diff --git a/stripe/forwarding/__init__.py b/stripe/forwarding/__init__.py new file mode 100644 index 000000000..ea2294ca7 --- /dev/null +++ b/stripe/forwarding/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.forwarding._request import Request as Request +from stripe.forwarding._request_service import RequestService as RequestService diff --git a/stripe/forwarding/_request.py b/stripe/forwarding/_request.py new file mode 100644 index 000000000..1d3e1d67e --- /dev/null +++ b/stripe/forwarding/_request.py @@ -0,0 +1,287 @@ +# -*- 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._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional, cast +from typing_extensions import Literal, NotRequired, TypedDict, Unpack + + +class Request( + CreateableAPIResource["Request"], ListableAPIResource["Request"] +): + """ + Instructs Stripe to make a request on your behalf using the destination URL and HTTP method in the config. + A config is set up for each destination URL by Stripe at the time of onboarding. Stripe verifies requests with + your credentials in the config, and injects card details from the payment_method into the request. + + Stripe redacts all sensitive fields and headers, including authentication credentials and card numbers, + before storing the request and response data in the forwarding Request object, which are subject to a + 30-day retention period. + + You can provide a Stripe idempotency key to make sure that requests with the same key result in only one + outbound request. The Stripe idempotency key provided should be unique and different from any idempotency + keys provided on the underlying third-party request. + + Forwarding Requests are synchronous requests that return a response or time out according to + Stripe's limits. + """ + + OBJECT_NAME: ClassVar[Literal["forwarding.request"]] = "forwarding.request" + + class RequestContext(StripeObject): + destination_duration: int + """ + The time it took in milliseconds for the destination endpoint to respond. + """ + destination_ip_address: str + """ + The IP address of the destination. + """ + + class RequestDetails(StripeObject): + class Header(StripeObject): + name: str + """ + The header name. + """ + value: str + """ + The header value. + """ + + body: str + """ + The body payload to send to the destination endpoint. + """ + headers: List[Header] + """ + The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included. + """ + http_method: Literal["POST"] + """ + The HTTP method used to call the destination endpoint. + """ + _inner_class_types = {"headers": Header} + + class ResponseDetails(StripeObject): + class Header(StripeObject): + name: str + """ + The header name. + """ + value: str + """ + The header value. + """ + + body: str + """ + The response body from the destination endpoint to Stripe. + """ + headers: List[Header] + """ + HTTP headers that the destination endpoint returned. + """ + status: int + """ + The HTTP status code that the destination endpoint returned. + """ + _inner_class_types = {"headers": Header} + + class CreateParams(RequestOptions): + config: str + """ + The Forwarding Config used when making the forwarded request. The config specifes the HTTP method, merchant credentials, connection settings, and supported destination URLs. + """ + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + payment_method: str + """ + The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. + """ + replacements: List[ + Literal[ + "card_cvc", "card_expiry", "card_number", "cardholder_name" + ] + ] + """ + The field kinds to be replaced in the forwarded request. + """ + request: "Request.CreateParamsRequest" + """ + The request body and headers to be sent to the destination endpoint. + """ + url: str + """ + The destination URL for the forwarded request. Must be supported by the config. + """ + + class CreateParamsRequest(TypedDict): + body: NotRequired["str"] + """ + The body payload to send to the destination endpoint. + """ + headers: NotRequired["List[Request.CreateParamsRequestHeader]"] + """ + The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included. + """ + + class CreateParamsRequestHeader(TypedDict): + name: str + """ + The header name. + """ + value: str + """ + The header value. + """ + + class ListParams(RequestOptions): + created: NotRequired["Request.ListParamsCreated"] + """ + Similar to other List endpoints, filters results based on created timestamp. You can pass gt, gte, lt, and lte timestamp values. + """ + ending_before: NotRequired["str"] + """ + A pagination cursor to fetch the previous page of the list. The value must be a ForwardingRequest ID. + """ + 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 pagination cursor to fetch the next page of the list. The value must be a ForwardingRequest ID. + """ + + class ListParamsCreated(TypedDict): + gt: NotRequired["int"] + """ + Return results where the `created` field is greater than this value. + """ + gte: NotRequired["int"] + """ + Return results where the `created` field is greater than or equal to this value. + """ + lt: NotRequired["int"] + """ + Return results where the `created` field is less than this value. + """ + lte: NotRequired["int"] + """ + Return results where the `created` field is less than or equal to this value. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + config: str + """ + The Forwarding Config used when making the forwarded request. The config specifes the HTTP method, merchant credentials, connection settings, and supported destination URLs. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["forwarding.request"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payment_method: str + """ + The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. + """ + replacements: List[ + Literal["card_cvc", "card_expiry", "card_number", "cardholder_name"] + ] + """ + The field kinds to be replaced in the forwarded request. + """ + request_context: Optional[RequestContext] + """ + Context about the request from Stripe's servers to the destination endpoint. + """ + request_details: Optional[RequestDetails] + """ + The request that was sent to the destination endpoint. We redact any sensitive fields. + """ + response_details: Optional[ResponseDetails] + """ + The response that the destination endpoint returned to us. We redact any sensitive fields. + """ + url: Optional[str] + """ + The destination URL for the forwarded request. Must be supported by the config. + """ + + @classmethod + def create(cls, **params: Unpack["Request.CreateParams"]) -> "Request": + """ + Creates a ForwardingRequest object. + """ + return cast( + "Request", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["Request.ListParams"] + ) -> ListObject["Request"]: + """ + Lists all ForwardingRequest objects. + """ + 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 + def retrieve( + cls, id: str, **params: Unpack["Request.RetrieveParams"] + ) -> "Request": + """ + Retrieves a ForwardingRequest object. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + _inner_class_types = { + "request_context": RequestContext, + "request_details": RequestDetails, + "response_details": ResponseDetails, + } diff --git a/stripe/forwarding/_request_service.py b/stripe/forwarding/_request_service.py new file mode 100644 index 000000000..1796e9630 --- /dev/null +++ b/stripe/forwarding/_request_service.py @@ -0,0 +1,168 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.forwarding._request import Request +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class RequestService(StripeService): + class CreateParams(TypedDict): + config: str + """ + The Forwarding Config used when making the forwarded request. The config specifes the HTTP method, merchant credentials, connection settings, and supported destination URLs. + """ + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + payment_method: str + """ + The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. + """ + replacements: List[ + Literal[ + "card_cvc", "card_expiry", "card_number", "cardholder_name" + ] + ] + """ + The field kinds to be replaced in the forwarded request. + """ + request: "RequestService.CreateParamsRequest" + """ + The request body and headers to be sent to the destination endpoint. + """ + url: str + """ + The destination URL for the forwarded request. Must be supported by the config. + """ + + class CreateParamsRequest(TypedDict): + body: NotRequired["str"] + """ + The body payload to send to the destination endpoint. + """ + headers: NotRequired["List[RequestService.CreateParamsRequestHeader]"] + """ + The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included. + """ + + class CreateParamsRequestHeader(TypedDict): + name: str + """ + The header name. + """ + value: str + """ + The header value. + """ + + class ListParams(TypedDict): + created: NotRequired["RequestService.ListParamsCreated"] + """ + Similar to other List endpoints, filters results based on created timestamp. You can pass gt, gte, lt, and lte timestamp values. + """ + ending_before: NotRequired["str"] + """ + A pagination cursor to fetch the previous page of the list. The value must be a ForwardingRequest ID. + """ + 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 pagination cursor to fetch the next page of the list. The value must be a ForwardingRequest ID. + """ + + class ListParamsCreated(TypedDict): + gt: NotRequired["int"] + """ + Return results where the `created` field is greater than this value. + """ + gte: NotRequired["int"] + """ + Return results where the `created` field is greater than or equal to this value. + """ + lt: NotRequired["int"] + """ + Return results where the `created` field is less than this value. + """ + lte: NotRequired["int"] + """ + Return results where the `created` field is less than or equal to this value. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "RequestService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Request]: + """ + Lists all ForwardingRequest objects. + """ + return cast( + ListObject[Request], + self._request( + "get", + "/v1/forwarding/requests", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "RequestService.CreateParams", + options: RequestOptions = {}, + ) -> Request: + """ + Creates a ForwardingRequest object. + """ + return cast( + Request, + self._request( + "post", + "/v1/forwarding/requests", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "RequestService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Request: + """ + Retrieves a ForwardingRequest object. + """ + return cast( + Request, + self._request( + "get", + "/v1/forwarding/requests/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index 8814af346..e996f7dee 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -291,6 +291,10 @@ class CreateParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + name: NotRequired["str"] + """ + Name of the configuration + """ offline: NotRequired["Literal['']|Configuration.CreateParamsOffline"] """ Configurations for collecting transactions offline. @@ -612,6 +616,10 @@ class ModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + name: NotRequired["str"] + """ + Name of the configuration + """ offline: NotRequired["Literal['']|Configuration.ModifyParamsOffline"] """ Configurations for collecting transactions offline. @@ -918,6 +926,10 @@ class RetrieveParams(RequestOptions): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ + name: Optional[str] + """ + String indicating the name of the Configuration object, set by the user + """ object: Literal["terminal.configuration"] """ String representing the object's type. Objects of the same type share the same value. diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index c02ea3437..c9a90d1c4 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -21,6 +21,10 @@ class CreateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + name: NotRequired["str"] + """ + Name of the configuration + """ offline: NotRequired[ "Literal['']|ConfigurationService.CreateParamsOffline" ] @@ -354,6 +358,10 @@ class UpdateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + name: NotRequired["str"] + """ + Name of the configuration + """ offline: NotRequired[ "Literal['']|ConfigurationService.UpdateParamsOffline" ] diff --git a/stripe/test_helpers/__init__.py b/stripe/test_helpers/__init__.py index 99f8cf0bc..15febed04 100644 --- a/stripe/test_helpers/__init__.py +++ b/stripe/test_helpers/__init__.py @@ -5,6 +5,9 @@ terminal as terminal, treasury as treasury, ) +from stripe.test_helpers._confirmation_token_service import ( + ConfirmationTokenService as ConfirmationTokenService, +) from stripe.test_helpers._customer_service import ( CustomerService as CustomerService, ) diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py new file mode 100644 index 000000000..5a056b55c --- /dev/null +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -0,0 +1,630 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._confirmation_token import ConfirmationToken +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from typing import Dict, List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class ConfirmationTokenService(StripeService): + class CreateParams(TypedDict): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + payment_method: NotRequired["str"] + """ + ID of an existing PaymentMethod. + """ + payment_method_data: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodData" + ] + """ + If provided, this hash will be used to create a PaymentMethod. + """ + return_url: NotRequired["str"] + """ + Return URL used to confirm the Intent. + """ + setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] + """ + Indicates that you intend to make future payments with this ConfirmationToken's payment method. + + The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + """ + shipping: NotRequired["ConfirmationTokenService.CreateParamsShipping"] + """ + Shipping information for this ConfirmationToken. + """ + + class CreateParamsPaymentMethodData(TypedDict): + acss_debit: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataAcssDebit" + ] + """ + If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + """ + affirm: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataAffirm" + ] + """ + If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + """ + afterpay_clearpay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataAfterpayClearpay" + ] + """ + If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + """ + alipay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataAlipay" + ] + """ + If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + """ + au_becs_debit: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataAuBecsDebit" + ] + """ + If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + """ + bacs_debit: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataBacsDebit" + ] + """ + If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + """ + bancontact: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataBancontact" + ] + """ + If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + """ + billing_details: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataBillingDetails" + ] + """ + Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + """ + blik: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataBlik" + ] + """ + If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + """ + boleto: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataBoleto" + ] + """ + If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + """ + cashapp: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataCashapp" + ] + """ + If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + """ + customer_balance: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataCustomerBalance" + ] + """ + If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + """ + eps: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataEps" + ] + """ + If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + """ + fpx: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataFpx" + ] + """ + If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + """ + giropay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataGiropay" + ] + """ + If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + """ + grabpay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataGrabpay" + ] + """ + If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + """ + ideal: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataIdeal" + ] + """ + If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + """ + interac_present: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataInteracPresent" + ] + """ + If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + """ + klarna: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + """ + konbini: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataKonbini" + ] + """ + If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + """ + link: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataLink" + ] + """ + If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + """ + metadata: NotRequired["Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + mobilepay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ + oxxo: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataOxxo" + ] + """ + If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + """ + p24: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataP24" + ] + """ + If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + """ + paynow: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataPaynow" + ] + """ + If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + """ + paypal: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataPaypal" + ] + """ + If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + """ + pix: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataPix" + ] + """ + If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + """ + promptpay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataPromptpay" + ] + """ + If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + """ + radar_options: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataRadarOptions" + ] + """ + Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + """ + revolut_pay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataRevolutPay" + ] + """ + If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + """ + sepa_debit: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataSepaDebit" + ] + """ + If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + """ + sofort: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataSofort" + ] + """ + If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + """ + swish: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataSwish" + ] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ + type: Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "mobilepay", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "revolut_pay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + "zip", + ] + """ + 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. + """ + us_bank_account: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataUsBankAccount" + ] + """ + If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + """ + wechat_pay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataWechatPay" + ] + """ + If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + """ + zip: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataZip" + ] + """ + If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + """ + + class CreateParamsPaymentMethodDataAcssDebit(TypedDict): + account_number: str + """ + Customer's bank account number. + """ + institution_number: str + """ + Institution number of the customer's bank. + """ + transit_number: str + """ + Transit number of the customer's bank. + """ + + class CreateParamsPaymentMethodDataAffirm(TypedDict): + pass + + class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): + pass + + class CreateParamsPaymentMethodDataAlipay(TypedDict): + pass + + class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): + account_number: str + """ + The account number for the bank account. + """ + bsb_number: str + """ + Bank-State-Branch number of the bank account. + """ + + class CreateParamsPaymentMethodDataBacsDebit(TypedDict): + account_number: NotRequired["str"] + """ + Account number of the bank account that the funds will be debited from. + """ + sort_code: NotRequired["str"] + """ + Sort code of the bank account. (e.g., `10-20-30`) + """ + + class CreateParamsPaymentMethodDataBancontact(TypedDict): + pass + + class CreateParamsPaymentMethodDataBillingDetails(TypedDict): + address: NotRequired[ + "Literal['']|ConfirmationTokenService.CreateParamsPaymentMethodDataBillingDetailsAddress" + ] + """ + Billing address. + """ + email: NotRequired["Literal['']|str"] + """ + Email address. + """ + name: NotRequired["Literal['']|str"] + """ + Full name. + """ + phone: NotRequired["Literal['']|str"] + """ + Billing phone number (including extension). + """ + + class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): + city: NotRequired["str"] + """ + City, district, suburb, town, or village. + """ + country: NotRequired["str"] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired["str"] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired["str"] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired["str"] + """ + ZIP or postal code. + """ + state: NotRequired["str"] + """ + State, county, province, or region. + """ + + class CreateParamsPaymentMethodDataBlik(TypedDict): + pass + + class CreateParamsPaymentMethodDataBoleto(TypedDict): + tax_id: str + """ + The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + """ + + class CreateParamsPaymentMethodDataCashapp(TypedDict): + pass + + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): + pass + + class CreateParamsPaymentMethodDataEps(TypedDict): + bank: NotRequired[ + "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + ] + """ + The customer's bank. + """ + + class CreateParamsPaymentMethodDataFpx(TypedDict): + account_holder_type: NotRequired["Literal['company', 'individual']"] + """ + Account holder type for FPX transaction + """ + bank: Literal[ + "affin_bank", + "agrobank", + "alliance_bank", + "ambank", + "bank_islam", + "bank_muamalat", + "bank_of_china", + "bank_rakyat", + "bsn", + "cimb", + "deutsche_bank", + "hong_leong_bank", + "hsbc", + "kfh", + "maybank2e", + "maybank2u", + "ocbc", + "pb_enterprise", + "public_bank", + "rhb", + "standard_chartered", + "uob", + ] + """ + The customer's bank. + """ + + class CreateParamsPaymentMethodDataGiropay(TypedDict): + pass + + class CreateParamsPaymentMethodDataGrabpay(TypedDict): + pass + + class CreateParamsPaymentMethodDataIdeal(TypedDict): + bank: NotRequired[ + "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + ] + """ + The customer's bank. + """ + + class CreateParamsPaymentMethodDataInteracPresent(TypedDict): + pass + + class CreateParamsPaymentMethodDataKlarna(TypedDict): + dob: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataKlarnaDob" + ] + """ + Customer's date of birth + """ + + class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + + class CreateParamsPaymentMethodDataKonbini(TypedDict): + pass + + class CreateParamsPaymentMethodDataLink(TypedDict): + pass + + class CreateParamsPaymentMethodDataMobilepay(TypedDict): + pass + + class CreateParamsPaymentMethodDataOxxo(TypedDict): + pass + + class CreateParamsPaymentMethodDataP24(TypedDict): + bank: NotRequired[ + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + ] + """ + The customer's bank. + """ + + class CreateParamsPaymentMethodDataPaynow(TypedDict): + pass + + class CreateParamsPaymentMethodDataPaypal(TypedDict): + pass + + class CreateParamsPaymentMethodDataPix(TypedDict): + pass + + class CreateParamsPaymentMethodDataPromptpay(TypedDict): + pass + + class CreateParamsPaymentMethodDataRadarOptions(TypedDict): + session: NotRequired["str"] + """ + A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + """ + + class CreateParamsPaymentMethodDataRevolutPay(TypedDict): + pass + + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): + iban: str + """ + IBAN of the bank account. + """ + + class CreateParamsPaymentMethodDataSofort(TypedDict): + country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + """ + Two-letter ISO code representing the country the bank account is located in. + """ + + class CreateParamsPaymentMethodDataSwish(TypedDict): + pass + + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): + account_holder_type: NotRequired["Literal['company', 'individual']"] + """ + Account holder type: individual or company. + """ + account_number: NotRequired["str"] + """ + Account number of the bank account. + """ + account_type: NotRequired["Literal['checking', 'savings']"] + """ + Account type: checkings or savings. Defaults to checking if omitted. + """ + financial_connections_account: NotRequired["str"] + """ + The ID of a Financial Connections Account to use as a payment method. + """ + routing_number: NotRequired["str"] + """ + Routing number of the bank account. + """ + + class CreateParamsPaymentMethodDataWechatPay(TypedDict): + pass + + class CreateParamsPaymentMethodDataZip(TypedDict): + pass + + class CreateParamsShipping(TypedDict): + address: "ConfirmationTokenService.CreateParamsShippingAddress" + """ + Shipping address + """ + name: str + """ + Recipient name. + """ + phone: NotRequired["Literal['']|str"] + """ + Recipient phone (including extension) + """ + + class CreateParamsShippingAddress(TypedDict): + city: NotRequired["str"] + """ + City, district, suburb, town, or village. + """ + country: NotRequired["str"] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired["str"] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired["str"] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired["str"] + """ + ZIP or postal code. + """ + state: NotRequired["str"] + """ + State, county, province, or region. + """ + + def create( + self, + params: "ConfirmationTokenService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> ConfirmationToken: + """ + Creates a test mode Confirmation Token server side for your integration tests. + """ + return cast( + ConfirmationToken, + self._request( + "post", + "/v1/test_helpers/confirmation_tokens", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_received_debit.py b/stripe/treasury/_received_debit.py index 434c93829..f5ae9a38f 100644 --- a/stripe/treasury/_received_debit.py +++ b/stripe/treasury/_received_debit.py @@ -136,6 +136,10 @@ class LinkedFlows(StripeObject): """ Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object. """ + payout: Optional[str] + """ + Set if the ReceivedDebit was created due to a [Payout](https://stripe.com/docs/api#payouts) object. + """ class ReversalDetails(StripeObject): deadline: Optional[int] From cd6c5b3e2d6749b8e0131f8c20ccf93581a250f3 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 21 Mar 2024 15:21:29 -0700 Subject: [PATCH 028/179] Bump version to 8.8.0 --- CHANGELOG.md | 18 ++++++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29dc48ba3..1a77a757a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +## 8.8.0 - 2024-03-21 +* [#1273](https://github.com/stripe/stripe-python/pull/1273) Update generated code + * Add support for new resources `ConfirmationToken` and `Forwarding.Request` + * Add support for `retrieve` method on resource `ConfirmationToken` + * Add support for `create`, `list`, and `retrieve` methods on resource `Request` + * Add support for `mobilepay_payments` on `Account.Capabilities`, `Account.CreateParamsCapabilities`, and `Account.UpdateParamsCapabilities` + * Add support for new values `forwarding_api_inactive`, `forwarding_api_invalid_parameter`, `forwarding_api_upstream_connection_error`, and `forwarding_api_upstream_connection_timeout` on enums `Invoice.LastFinalizationError.code`, `PaymentIntent.LastPaymentError.code`, `SetupAttempt.SetupError.code`, `SetupIntent.LastSetupError.code`, and `StripeError.code` + * Add support for `payment_reference` on `Charge.PaymentMethodDetails.UsBankAccount` + * Add support for `payout` on `Treasury.ReceivedDebit.LinkedFlows` + * Add support for `name` on `ConfigurationService.CreateParams`, `ConfigurationService.UpdateParams`, and `Configuration` for terminal + * Add support for `confirmation_token` on `PaymentIntentService.ConfirmParams`, `PaymentIntentService.CreateParams`, `SetupIntentService.ConfirmParams`, and `SetupIntentService.CreateParams` + * Add support for new value `mobilepay` on enums `Customer.ListPaymentMethodsParams.type`, `PaymentMethod.CreateParams.type`, and `PaymentMethod.ListParams.type` + * Add support for `mobilepay` on `Charge.PaymentMethodDetails`, `PaymentIntent.PaymentMethodOptions`, `PaymentIntentService.ConfirmParamsPaymentMethodData`, `PaymentIntentService.ConfirmParamsPaymentMethodOptions`, `PaymentIntentService.CreateParamsPaymentMethodData`, `PaymentIntentService.CreateParamsPaymentMethodOptions`, `PaymentIntentService.UpdateParamsPaymentMethodData`, `PaymentIntentService.UpdateParamsPaymentMethodOptions`, `PaymentMethod.CreateParams`, `PaymentMethod`, `SetupIntentService.ConfirmParamsPaymentMethodData`, `SetupIntentService.CreateParamsPaymentMethodData`, and `SetupIntentService.UpdateParamsPaymentMethodData` + * Add support for new value `mobilepay` on enums `PaymentIntentService.ConfirmParamsPaymentMethodData.type`, `PaymentIntentService.CreateParamsPaymentMethodData.type`, `PaymentIntentService.UpdateParamsPaymentMethodData.type`, `SetupIntentService.ConfirmParamsPaymentMethodData.type`, `SetupIntentService.CreateParamsPaymentMethodData.type`, and `SetupIntentService.UpdateParamsPaymentMethodData.type` + * Add support for new value `mobilepay` on enum `PaymentMethod.type` + + + ## 8.7.0 - 2024-03-14 * [#1269](https://github.com/stripe/stripe-python/pull/1269) Update generated code * Add support for `personalization_design` on parameter classes `CardService.CreateParams`, `CardService.ListParams`, `CardService.UpdateParams`, `stripe.issuing.Card.CreateParams`, `stripe.issuing.Card.ListParams`, and `stripe.issuing.Card.ModifyParams` and resource `stripe.issuing.Card` diff --git a/VERSION b/VERSION index df5119ec6..3b6825376 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.7.0 +8.8.0 diff --git a/stripe/_version.py b/stripe/_version.py index b8bb0a2c9..7d1384a5c 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "8.7.0" +VERSION = "8.8.0" From 69b590619f1a40e6b0fbbd52e59c6158cd04f403 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Tue, 26 Mar 2024 10:07:46 -0700 Subject: [PATCH 029/179] Update README.md (#1279) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 55b8bc8e0..2e24b7c88 100644 --- a/README.md +++ b/README.md @@ -250,7 +250,7 @@ We would love for you to try these and share feedback with us before these featu To install a beta version use `pip install` with the exact version you'd like to use: ``` -pip install stripe==v8.6.0b1 +pip install --pre stripe ``` > **Note** From ea1901a548f7ed8fe5ea81e29bab4fa035e9fbde Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:05:06 -0700 Subject: [PATCH 030/179] codegen (#1278) --- stripe/_account.py | 768 +++---- stripe/_account_capability_service.py | 8 +- stripe/_account_external_account_service.py | 76 +- stripe/_account_link.py | 10 +- stripe/_account_link_service.py | 10 +- stripe/_account_login_link_service.py | 2 +- stripe/_account_person_service.py | 252 +-- stripe/_account_service.py | 806 +++---- stripe/_account_session.py | 20 +- stripe/_account_session_service.py | 20 +- stripe/_apple_pay_domain.py | 14 +- stripe/_apple_pay_domain_service.py | 14 +- stripe/_application_fee.py | 44 +- stripe/_application_fee_refund_service.py | 18 +- stripe/_application_fee_service.py | 20 +- stripe/_balance.py | 2 +- stripe/_balance_service.py | 2 +- stripe/_balance_transaction.py | 26 +- stripe/_balance_transaction_service.py | 26 +- stripe/_charge.py | 138 +- stripe/_charge_service.py | 128 +- stripe/_confirmation_token.py | 133 +- stripe/_confirmation_token_service.py | 2 +- stripe/_country_spec.py | 10 +- stripe/_country_spec_service.py | 10 +- stripe/_coupon.py | 48 +- stripe/_coupon_service.py | 48 +- stripe/_credit_note.py | 167 +- stripe/_credit_note_line_item_service.py | 8 +- stripe/_credit_note_preview_lines_service.py | 47 +- stripe/_credit_note_service.py | 112 +- stripe/_customer.py | 319 +-- .../_customer_balance_transaction_service.py | 18 +- stripe/_customer_cash_balance_service.py | 6 +- ...stomer_cash_balance_transaction_service.py | 10 +- .../_customer_funding_instructions_service.py | 4 +- stripe/_customer_payment_method_service.py | 47 +- stripe/_customer_payment_source_service.py | 66 +- stripe/_customer_service.py | 156 +- stripe/_customer_session.py | 2 +- stripe/_customer_session_service.py | 2 +- stripe/_customer_tax_id_service.py | 12 +- stripe/_dispute.py | 82 +- stripe/_dispute_service.py | 82 +- stripe/_ephemeral_key.py | 2 +- stripe/_ephemeral_key_service.py | 12 +- stripe/_event.py | 24 +- stripe/_event_service.py | 24 +- stripe/_exchange_rate.py | 10 +- stripe/_exchange_rate_service.py | 10 +- stripe/_file.py | 40 +- stripe/_file_link.py | 28 +- stripe/_file_link_service.py | 28 +- stripe/_file_service.py | 40 +- stripe/_invoice.py | 496 ++--- stripe/_invoice_item.py | 88 +- stripe/_invoice_item_service.py | 88 +- stripe/_invoice_line_item.py | 56 +- stripe/_invoice_line_item_service.py | 64 +- stripe/_invoice_service.py | 370 ++-- stripe/_invoice_upcoming_lines_service.py | 126 +- stripe/_mandate.py | 2 +- stripe/_mandate_service.py | 2 +- stripe/_payment_intent.py | 1242 +++++++---- stripe/_payment_intent_service.py | 1242 +++++++---- stripe/_payment_link.py | 180 +- stripe/_payment_link_line_item_service.py | 8 +- stripe/_payment_link_service.py | 172 +- stripe/_payment_method.py | 241 ++- stripe/_payment_method_configuration.py | 156 +- .../_payment_method_configuration_service.py | 156 +- stripe/_payment_method_domain.py | 24 +- stripe/_payment_method_domain_service.py | 24 +- stripe/_payment_method_service.py | 241 ++- stripe/_payout.py | 52 +- stripe/_payout_service.py | 52 +- stripe/_plan.py | 78 +- stripe/_plan_service.py | 78 +- stripe/_price.py | 156 +- stripe/_price_service.py | 156 +- stripe/_product.py | 104 +- stripe/_product_service.py | 109 +- stripe/_promotion_code.py | 58 +- stripe/_promotion_code_service.py | 64 +- stripe/_quote.py | 130 +- ...ote_computed_upfront_line_items_service.py | 8 +- stripe/_quote_line_item_service.py | 8 +- stripe/_quote_service.py | 114 +- stripe/_refund.py | 50 +- stripe/_refund_service.py | 48 +- stripe/_review.py | 20 +- stripe/_review_service.py | 20 +- stripe/_setup_attempt.py | 16 +- stripe/_setup_attempt_service.py | 16 +- stripe/_setup_intent.py | 651 ++++-- stripe/_setup_intent_service.py | 651 ++++-- stripe/_shipping_rate.py | 48 +- stripe/_shipping_rate_service.py | 54 +- stripe/_source.py | 186 +- stripe/_source_service.py | 180 +- stripe/_source_transaction_service.py | 8 +- stripe/_subscription.py | 335 +-- stripe/_subscription_item.py | 86 +- stripe/_subscription_item_service.py | 74 +- ..._subscription_item_usage_record_service.py | 4 +- ...ption_item_usage_record_summary_service.py | 8 +- stripe/_subscription_schedule.py | 250 ++- stripe/_subscription_schedule_service.py | 250 ++- stripe/_subscription_service.py | 335 +-- stripe/_tax_code.py | 10 +- stripe/_tax_code_service.py | 10 +- stripe/_tax_id.py | 20 +- stripe/_tax_id_service.py | 20 +- stripe/_tax_rate.py | 82 +- stripe/_tax_rate_service.py | 82 +- stripe/_token.py | 330 +-- stripe/_token_service.py | 330 +-- stripe/_topup.py | 44 +- stripe/_topup_service.py | 44 +- stripe/_transfer.py | 60 +- stripe/_transfer_reversal_service.py | 20 +- stripe/_transfer_service.py | 40 +- stripe/_webhook_endpoint.py | 363 +++- stripe/_webhook_endpoint_service.py | 363 +++- stripe/apps/_secret.py | 24 +- stripe/apps/_secret_service.py | 24 +- stripe/billing_portal/_configuration.py | 48 +- .../billing_portal/_configuration_service.py | 48 +- stripe/billing_portal/_session.py | 72 +- stripe/billing_portal/_session_service.py | 72 +- stripe/checkout/_session.py | 453 ++-- stripe/checkout/_session_line_item_service.py | 8 +- stripe/checkout/_session_service.py | 445 ++-- stripe/climate/_order.py | 26 +- stripe/climate/_order_service.py | 26 +- stripe/climate/_product.py | 10 +- stripe/climate/_product_service.py | 10 +- stripe/climate/_supplier.py | 10 +- stripe/climate/_supplier_service.py | 10 +- stripe/financial_connections/_account.py | 32 +- .../_account_owner_service.py | 8 +- .../financial_connections/_account_service.py | 24 +- stripe/financial_connections/_session.py | 12 +- .../financial_connections/_session_service.py | 12 +- stripe/financial_connections/_transaction.py | 18 +- .../_transaction_service.py | 18 +- stripe/forwarding/_request.py | 24 +- stripe/forwarding/_request_service.py | 24 +- stripe/identity/_verification_report.py | 24 +- .../identity/_verification_report_service.py | 24 +- stripe/identity/_verification_session.py | 56 +- .../identity/_verification_session_service.py | 56 +- stripe/issuing/_authorization.py | 441 +++- stripe/issuing/_authorization_service.py | 32 +- stripe/issuing/_card.py | 1886 +++++++++++++++- stripe/issuing/_card_service.py | 1878 +++++++++++++++- stripe/issuing/_cardholder.py | 1896 ++++++++++++++++- stripe/issuing/_cardholder_service.py | 1896 ++++++++++++++++- stripe/issuing/_dispute.py | 60 +- stripe/issuing/_dispute_service.py | 60 +- stripe/issuing/_personalization_design.py | 69 +- .../_personalization_design_service.py | 38 +- stripe/issuing/_physical_bundle.py | 14 +- stripe/issuing/_physical_bundle_service.py | 14 +- stripe/issuing/_token.py | 22 +- stripe/issuing/_token_service.py | 22 +- stripe/issuing/_transaction.py | 774 ++++++- stripe/issuing/_transaction_service.py | 26 +- stripe/radar/_early_fraud_warning.py | 22 +- stripe/radar/_early_fraud_warning_service.py | 22 +- stripe/radar/_value_list.py | 47 +- stripe/radar/_value_list_item.py | 22 +- stripe/radar/_value_list_item_service.py | 22 +- stripe/radar/_value_list_service.py | 47 +- stripe/reporting/_report_run.py | 674 +++++- stripe/reporting/_report_run_service.py | 674 +++++- stripe/reporting/_report_type.py | 4 +- stripe/reporting/_report_type_service.py | 4 +- stripe/sigma/_scheduled_query_run.py | 10 +- stripe/sigma/_scheduled_query_run_service.py | 10 +- stripe/tax/_calculation.py | 40 +- stripe/tax/_calculation_line_item_service.py | 8 +- stripe/tax/_calculation_service.py | 32 +- stripe/tax/_registration.py | 18 +- stripe/tax/_registration_service.py | 18 +- stripe/tax/_settings.py | 20 +- stripe/tax/_settings_service.py | 20 +- stripe/tax/_transaction.py | 26 +- stripe/tax/_transaction_line_item_service.py | 8 +- stripe/tax/_transaction_service.py | 18 +- stripe/terminal/_configuration.py | 188 +- stripe/terminal/_configuration_service.py | 188 +- stripe/terminal/_connection_token.py | 4 +- stripe/terminal/_connection_token_service.py | 4 +- stripe/terminal/_location.py | 40 +- stripe/terminal/_location_service.py | 40 +- stripe/terminal/_reader.py | 77 +- stripe/terminal/_reader_service.py | 67 +- .../_confirmation_token_service.py | 131 +- stripe/test_helpers/_customer_service.py | 4 +- stripe/test_helpers/_refund_service.py | 2 +- stripe/test_helpers/_test_clock.py | 16 +- stripe/test_helpers/_test_clock_service.py | 16 +- .../issuing/_authorization_service.py | 411 +++- stripe/test_helpers/issuing/_card_service.py | 8 +- .../_personalization_design_service.py | 31 +- .../issuing/_transaction_service.py | 750 ++++++- .../test_helpers/terminal/_reader_service.py | 10 +- .../treasury/_inbound_transfer_service.py | 22 +- .../treasury/_outbound_payment_service.py | 19 +- .../treasury/_outbound_transfer_service.py | 19 +- .../treasury/_received_credit_service.py | 10 +- .../treasury/_received_debit_service.py | 10 +- stripe/treasury/_credit_reversal.py | 18 +- stripe/treasury/_credit_reversal_service.py | 18 +- stripe/treasury/_debit_reversal.py | 20 +- stripe/treasury/_debit_reversal_service.py | 20 +- stripe/treasury/_financial_account.py | 38 +- .../_financial_account_features_service.py | 8 +- stripe/treasury/_financial_account_service.py | 34 +- stripe/treasury/_inbound_transfer.py | 44 +- stripe/treasury/_inbound_transfer_service.py | 22 +- stripe/treasury/_outbound_payment.py | 85 +- stripe/treasury/_outbound_payment_service.py | 66 +- stripe/treasury/_outbound_transfer.py | 45 +- stripe/treasury/_outbound_transfer_service.py | 26 +- stripe/treasury/_received_credit.py | 22 +- stripe/treasury/_received_credit_service.py | 12 +- stripe/treasury/_received_debit.py | 22 +- stripe/treasury/_received_debit_service.py | 12 +- stripe/treasury/_transaction.py | 30 +- stripe/treasury/_transaction_entry.py | 30 +- stripe/treasury/_transaction_entry_service.py | 30 +- stripe/treasury/_transaction_service.py | 30 +- 234 files changed, 22170 insertions(+), 8307 deletions(-) diff --git a/stripe/_account.py b/stripe/_account.py index d9de212d4..b3142da74 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -1063,11 +1063,11 @@ class TosAcceptance(StripeObject): """ class CreateExternalAccountParams(RequestOptions): - default_for_currency: NotRequired["bool"] + default_for_currency: NotRequired[bool] """ When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1080,18 +1080,18 @@ class CreateExternalAccountParams(RequestOptions): """ Please refer to full [documentation](https://stripe.com/docs/api) instead. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ class CreateExternalAccountParamsBankAccount(TypedDict): object: Literal["bank_account"] - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. """ - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ @@ -1103,47 +1103,47 @@ class CreateExternalAccountParamsBankAccount(TypedDict): """ The country in which the bank account is located. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](docs/payouts) """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. """ class CreateExternalAccountParamsCard(TypedDict): object: Literal["card"] - address_city: NotRequired["str"] - address_country: NotRequired["str"] - address_line1: NotRequired["str"] - address_line2: NotRequired["str"] - address_state: NotRequired["str"] - address_zip: NotRequired["str"] - currency: NotRequired["str"] - cvc: NotRequired["str"] + address_city: NotRequired[str] + address_country: NotRequired[str] + address_line1: NotRequired[str] + address_line2: NotRequired[str] + address_state: NotRequired[str] + address_zip: NotRequired[str] + currency: NotRequired[str] + cvc: NotRequired[str] exp_month: int exp_year: int - name: NotRequired["str"] + name: NotRequired[str] number: str - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ class CreateExternalAccountParamsCardToken(TypedDict): object: Literal["card"] - currency: NotRequired["str"] + currency: NotRequired[str] token: str class CreateLoginLinkParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): - account_token: NotRequired["str"] + account_token: NotRequired[str] """ An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. """ @@ -1152,7 +1152,7 @@ class CreateParams(RequestOptions): Business information about the account. """ business_type: NotRequired[ - "Literal['company', 'government_entity', 'individual', 'non_profit']" + Literal["company", "government_entity", "individual", "non_profit"] ] """ The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. @@ -1165,11 +1165,11 @@ class CreateParams(RequestOptions): """ Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. """ - country: NotRequired["str"] + country: NotRequired[str] """ The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. """ - default_currency: NotRequired["str"] + default_currency: NotRequired[str] """ Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). """ @@ -1177,11 +1177,11 @@ class CreateParams(RequestOptions): """ Documents that may be submitted to satisfy various informational requests. """ - email: NotRequired["str"] + email: NotRequired[str] """ The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1209,18 +1209,18 @@ class CreateParams(RequestOptions): """ Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. """ - type: NotRequired["Literal['custom', 'express', 'standard']"] + type: NotRequired[Literal["custom", "express", "standard"]] """ The type of Stripe account to create. May be one of `custom`, `express` or `standard`. """ class CreateParamsBankAccount(TypedDict): object: Literal["bank_account"] - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. """ - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ @@ -1232,11 +1232,11 @@ class CreateParamsBankAccount(TypedDict): """ The country in which the bank account is located. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](docs/payouts) """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. """ @@ -1248,11 +1248,11 @@ class CreateParamsBusinessProfile(TypedDict): """ The applicant's gross annual revenue for its preceding fiscal year. """ - estimated_worker_count: NotRequired["int"] + estimated_worker_count: NotRequired[int] """ An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. """ - mcc: NotRequired["str"] + mcc: NotRequired[str] """ [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ @@ -1262,11 +1262,11 @@ class CreateParamsBusinessProfile(TypedDict): """ An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. """ - name: NotRequired["str"] + name: NotRequired[str] """ The customer-facing business name. """ - product_description: NotRequired["str"] + product_description: NotRequired[str] """ Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. """ @@ -1276,11 +1276,11 @@ class CreateParamsBusinessProfile(TypedDict): """ A publicly available mailing address for sending support issues to. """ - support_email: NotRequired["str"] + support_email: NotRequired[str] """ A publicly available email address for sending support issues to. """ - support_phone: NotRequired["str"] + support_phone: NotRequired[str] """ A publicly available phone number to call with support issues. """ @@ -1288,7 +1288,7 @@ class CreateParamsBusinessProfile(TypedDict): """ A publicly available website for handling support issues. """ - url: NotRequired["str"] + url: NotRequired[str] """ The business's publicly available website. """ @@ -1318,27 +1318,27 @@ class CreateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict): """ class CreateParamsBusinessProfileSupportAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -1576,262 +1576,262 @@ class CreateParamsCapabilities(TypedDict): """ class CreateParamsCapabilitiesAcssDebitPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesAffirmPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesAfterpayClearpayPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesAuBecsDebitPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesBacsDebitPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesBancontactPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesBankTransferPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesBlikPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesBoletoPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesCardIssuing(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesCardPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesCartesBancairesPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesCashappPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesEpsPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesFpxPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesGiropayPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesGrabpayPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesIdealPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesIndiaInternationalPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesJcbPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesKlarnaPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesKonbiniPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesLegacyPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesLinkPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesMobilepayPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesOxxoPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesP24Payments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesPaynowPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesPromptpayPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesRevolutPayPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesSepaDebitPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesSofortPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesSwishPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesTaxReportingUs1099K(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesTaxReportingUs1099Misc(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesTransfers(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesTreasury(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesZipPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCard(TypedDict): object: Literal["card"] - address_city: NotRequired["str"] - address_country: NotRequired["str"] - address_line1: NotRequired["str"] - address_line2: NotRequired["str"] - address_state: NotRequired["str"] - address_zip: NotRequired["str"] - currency: NotRequired["str"] - cvc: NotRequired["str"] + address_city: NotRequired[str] + address_country: NotRequired[str] + address_line1: NotRequired[str] + address_line2: NotRequired[str] + address_state: NotRequired[str] + address_zip: NotRequired[str] + currency: NotRequired[str] + cvc: NotRequired[str] exp_month: int exp_year: int - name: NotRequired["str"] + name: NotRequired[str] number: str - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ - default_for_currency: NotRequired["bool"] + default_for_currency: NotRequired[bool] class CreateParamsCardToken(TypedDict): object: Literal["card"] - currency: NotRequired["str"] + currency: NotRequired[str] token: str class CreateParamsCompany(TypedDict): @@ -1847,35 +1847,35 @@ class CreateParamsCompany(TypedDict): """ The Kanji variation of the company's primary address (Japan only). """ - directors_provided: NotRequired["bool"] + directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ - executives_provided: NotRequired["bool"] + executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. """ - export_license_id: NotRequired["str"] + export_license_id: NotRequired[str] """ The export license ID number of the company, also referred as Import Export Code (India only). """ - export_purpose_code: NotRequired["str"] + export_purpose_code: NotRequired[str] """ The purpose code to use for export transactions (India only). """ - name: NotRequired["str"] + name: NotRequired[str] """ The company's legal name. """ - name_kana: NotRequired["str"] + name_kana: NotRequired[str] """ The Kana variation of the company's legal name (Japan only). """ - name_kanji: NotRequired["str"] + name_kanji: NotRequired[str] """ The Kanji variation of the company's legal name (Japan only). """ - owners_provided: NotRequired["bool"] + owners_provided: NotRequired[bool] """ Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. """ @@ -1885,11 +1885,11 @@ class CreateParamsCompany(TypedDict): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The company's phone number (used for verification). """ - registration_number: NotRequired["str"] + registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). """ @@ -1899,15 +1899,15 @@ class CreateParamsCompany(TypedDict): """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ - tax_id: NotRequired["str"] + tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) """ - tax_id_registrar: NotRequired["str"] + tax_id_registrar: NotRequired[str] """ The jurisdiction in which the `tax_id` is registered (Germany-based companies only). """ - vat_id: NotRequired["str"] + vat_id: NotRequired[str] """ The VAT number of the company. """ @@ -1917,101 +1917,101 @@ class CreateParamsCompany(TypedDict): """ class CreateParamsCompanyAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsCompanyAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsCompanyAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsCompanyOwnershipDeclaration(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the beneficial owner attestation was made. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the beneficial owner attestation was made. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the beneficial owner attestation was made. """ @@ -2025,11 +2025,11 @@ class CreateParamsCompanyVerification(TypedDict): """ class CreateParamsCompanyVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -2079,43 +2079,43 @@ class CreateParamsDocuments(TypedDict): """ class CreateParamsDocumentsBankAccountOwnershipVerification(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyLicense(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyMemorandumOfAssociation(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyMinisterialDecree(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyRegistrationVerification(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyTaxIdVerification(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsProofOfRegistration(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -2139,19 +2139,19 @@ class CreateParamsIndividual(TypedDict): """ The individual's date of birth. """ - email: NotRequired["str"] + email: NotRequired[str] """ The individual's email address. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The individual's first name. """ - first_name_kana: NotRequired["str"] + first_name_kana: NotRequired[str] """ The Kana variation of the the individual's first name (Japan only). """ - first_name_kanji: NotRequired["str"] + first_name_kanji: NotRequired[str] """ The Kanji variation of the individual's first name (Japan only). """ @@ -2159,31 +2159,31 @@ class CreateParamsIndividual(TypedDict): """ A list of alternate names or aliases that the individual is known by. """ - gender: NotRequired["str"] + gender: NotRequired[str] """ The individual's gender (International regulations require either "male" or "female"). """ - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - id_number_secondary: NotRequired["str"] + id_number_secondary: NotRequired[str] """ The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The individual's last name. """ - last_name_kana: NotRequired["str"] + last_name_kana: NotRequired[str] """ The Kana variation of the individual's last name (Japan only). """ - last_name_kanji: NotRequired["str"] + last_name_kanji: NotRequired[str] """ The Kanji variation of the individual's last name (Japan only). """ - maiden_name: NotRequired["str"] + maiden_name: NotRequired[str] """ The individual's maiden name. """ @@ -2191,11 +2191,11 @@ class CreateParamsIndividual(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The individual's phone number. """ - political_exposure: NotRequired["Literal['existing', 'none']"] + political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -2209,7 +2209,7 @@ class CreateParamsIndividual(TypedDict): """ Describes the person's relationship to the account. """ - ssn_last_4: NotRequired["str"] + ssn_last_4: NotRequired[str] """ The last four digits of the individual's Social Security Number (U.S. only). """ @@ -2219,87 +2219,87 @@ class CreateParamsIndividual(TypedDict): """ class CreateParamsIndividualAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsIndividualAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsIndividualAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ @@ -2319,41 +2319,41 @@ class CreateParamsIndividualDob(TypedDict): """ class CreateParamsIndividualRegisteredAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsIndividualRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ @@ -2361,7 +2361,7 @@ class CreateParamsIndividualRelationship(TypedDict): """ The percent owned by the person of the account's legal entity. """ - title: NotRequired["str"] + title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ @@ -2381,21 +2381,21 @@ class CreateParamsIndividualVerification(TypedDict): """ class CreateParamsIndividualVerificationAdditionalDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class CreateParamsIndividualVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -2433,25 +2433,25 @@ class CreateParamsSettings(TypedDict): """ class CreateParamsSettingsBacsDebitPayments(TypedDict): - display_name: NotRequired["str"] + display_name: NotRequired[str] """ The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ class CreateParamsSettingsBranding(TypedDict): - icon: NotRequired["str"] + icon: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. """ - logo: NotRequired["str"] + logo: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. """ - primary_color: NotRequired["str"] + primary_color: NotRequired[str] """ A CSS hex color value representing the primary branding color for this account. """ - secondary_color: NotRequired["str"] + secondary_color: NotRequired[str] """ A CSS hex color value representing the secondary branding color for this account. """ @@ -2465,11 +2465,11 @@ class CreateParamsSettingsCardIssuing(TypedDict): """ class CreateParamsSettingsCardIssuingTosAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ @@ -2485,7 +2485,7 @@ class CreateParamsSettingsCardPayments(TypedDict): """ Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. """ - statement_descriptor_prefix: NotRequired["str"] + statement_descriptor_prefix: NotRequired[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. """ @@ -2499,31 +2499,31 @@ class CreateParamsSettingsCardPayments(TypedDict): """ class CreateParamsSettingsCardPaymentsDeclineOn(TypedDict): - avs_failure: NotRequired["bool"] + avs_failure: NotRequired[bool] """ Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. """ - cvc_failure: NotRequired["bool"] + cvc_failure: NotRequired[bool] """ Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. """ class CreateParamsSettingsPayments(TypedDict): - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. """ - statement_descriptor_kana: NotRequired["str"] + statement_descriptor_kana: NotRequired[str] """ The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). """ - statement_descriptor_kanji: NotRequired["str"] + statement_descriptor_kanji: NotRequired[str] """ The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). """ class CreateParamsSettingsPayouts(TypedDict): - debit_negative_balances: NotRequired["bool"] + debit_negative_balances: NotRequired[bool] """ A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). """ @@ -2531,7 +2531,7 @@ class CreateParamsSettingsPayouts(TypedDict): """ Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. """ @@ -2541,18 +2541,24 @@ class CreateParamsSettingsPayoutsSchedule(TypedDict): """ The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). """ - interval: NotRequired[ - "Literal['daily', 'manual', 'monthly', 'weekly']" - ] + interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] """ How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. """ - monthly_anchor: NotRequired["int"] + monthly_anchor: NotRequired[int] """ The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ weekly_anchor: NotRequired[ - "Literal['friday', 'monday', 'saturday', 'sunday', 'thursday', 'tuesday', 'wednesday']" + Literal[ + "friday", + "monday", + "saturday", + "sunday", + "thursday", + "tuesday", + "wednesday", + ] ] """ The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) @@ -2567,11 +2573,11 @@ class CreateParamsSettingsTreasury(TypedDict): """ class CreateParamsSettingsTreasuryTosAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ @@ -2581,19 +2587,19 @@ class CreateParamsSettingsTreasuryTosAcceptance(TypedDict): """ class CreateParamsTosAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted their service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted their service agreement. """ - service_agreement: NotRequired["str"] + service_agreement: NotRequired[str] """ The user's service agreement type. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the account representative accepted their service agreement. """ @@ -2625,23 +2631,23 @@ class CreatePersonParams(RequestOptions): """ Documents that may be submitted to satisfy various informational requests. """ - email: NotRequired["str"] + email: NotRequired[str] """ The person's email address. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The person's first name. """ - first_name_kana: NotRequired["str"] + first_name_kana: NotRequired[str] """ The Kana variation of the person's first name (Japan only). """ - first_name_kanji: NotRequired["str"] + first_name_kanji: NotRequired[str] """ The Kanji variation of the person's first name (Japan only). """ @@ -2649,31 +2655,31 @@ class CreatePersonParams(RequestOptions): """ A list of alternate names or aliases that the person is known by. """ - gender: NotRequired["str"] + gender: NotRequired[str] """ The person's gender (International regulations require either "male" or "female"). """ - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - id_number_secondary: NotRequired["str"] + id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The person's last name. """ - last_name_kana: NotRequired["str"] + last_name_kana: NotRequired[str] """ The Kana variation of the person's last name (Japan only). """ - last_name_kanji: NotRequired["str"] + last_name_kanji: NotRequired[str] """ The Kanji variation of the person's last name (Japan only). """ - maiden_name: NotRequired["str"] + maiden_name: NotRequired[str] """ The person's maiden name. """ @@ -2681,19 +2687,19 @@ class CreatePersonParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nationality: NotRequired["str"] + nationality: NotRequired[str] """ The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. """ - person_token: NotRequired["str"] + person_token: NotRequired[str] """ A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The person's phone number. """ - political_exposure: NotRequired["str"] + political_exposure: NotRequired[str] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -2707,7 +2713,7 @@ class CreatePersonParams(RequestOptions): """ The relationship that this person has with the account's legal entity. """ - ssn_last_4: NotRequired["str"] + ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). """ @@ -2725,11 +2731,11 @@ class CreatePersonParamsAdditionalTosAcceptances(TypedDict): """ class CreatePersonParamsAdditionalTosAcceptancesAccount(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ @@ -2739,87 +2745,87 @@ class CreatePersonParamsAdditionalTosAcceptancesAccount(TypedDict): """ class CreatePersonParamsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreatePersonParamsAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreatePersonParamsAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ @@ -2855,63 +2861,63 @@ class CreatePersonParamsDocuments(TypedDict): """ class CreatePersonParamsDocumentsCompanyAuthorization(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreatePersonParamsDocumentsPassport(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreatePersonParamsDocumentsVisa(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreatePersonParamsRegisteredAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreatePersonParamsRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ - legal_guardian: NotRequired["bool"] + legal_guardian: NotRequired[bool] """ Whether the person is the legal guardian of the account's representative. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ @@ -2919,11 +2925,11 @@ class CreatePersonParamsRelationship(TypedDict): """ The percent owned by the person of the account's legal entity. """ - representative: NotRequired["bool"] + representative: NotRequired[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ - title: NotRequired["str"] + title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ @@ -2941,21 +2947,21 @@ class CreatePersonParamsVerification(TypedDict): """ class CreatePersonParamsVerificationAdditionalDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class CreatePersonParamsVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -2970,29 +2976,29 @@ class DeletePersonParams(RequestOptions): pass class ListCapabilitiesParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListExternalAccountsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - object: NotRequired["Literal['bank_account', 'card']"] + object: NotRequired[Literal["bank_account", "card"]] """ Filter external accounts according to a particular object type. """ - starting_after: NotRequired["str"] + 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. """ @@ -3002,51 +3008,51 @@ class ListParams(RequestOptions): """ Only return connected accounts that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListPersonsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -3054,39 +3060,39 @@ class ListPersonsParams(RequestOptions): """ Filters on the list of people returned based on the person's relationship to the account's company. """ - starting_after: NotRequired["str"] + 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. """ class ListPersonsParamsRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ A filter on the list of people returned based on whether these people are directors of the account's company. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ A filter on the list of people returned based on whether these people are executives of the account's company. """ - legal_guardian: NotRequired["bool"] + legal_guardian: NotRequired[bool] """ A filter on the list of people returned based on whether these people are legal guardians of the account's representative. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ A filter on the list of people returned based on whether these people are owners of the account's company. """ - representative: NotRequired["bool"] + representative: NotRequired[bool] """ A filter on the list of people returned based on whether these people are the representative of the account's company. """ class ModifyCapabilityParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - requested: NotRequired["bool"] + requested: NotRequired[bool] """ To request a new capability for an account, pass true. There can be a delay before the requested capability becomes active. If the capability has any activation requirements, the response includes them in the `requirements` arrays. @@ -3094,7 +3100,7 @@ class ModifyCapabilityParams(RequestOptions): """ class ModifyExternalAccountParams(RequestOptions): - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account. """ @@ -3105,36 +3111,36 @@ class ModifyExternalAccountParams(RequestOptions): The type of entity that holds the account. This can be either `individual` or `company`. """ account_type: NotRequired[ - "Literal['checking', 'futsu', 'savings', 'toza']" + Literal["checking", "futsu", "savings", "toza"] ] """ The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. """ - address_city: NotRequired["str"] + address_city: NotRequired[str] """ City/District/Suburb/Town/Village. """ - address_country: NotRequired["str"] + address_country: NotRequired[str] """ Billing address country, if provided when creating card. """ - address_line1: NotRequired["str"] + address_line1: NotRequired[str] """ Address line 1 (Street address/PO Box/Company name). """ - address_line2: NotRequired["str"] + address_line2: NotRequired[str] """ Address line 2 (Apartment/Suite/Unit/Building). """ - address_state: NotRequired["str"] + address_state: NotRequired[str] """ State/County/Province/Region. """ - address_zip: NotRequired["str"] + address_zip: NotRequired[str] """ ZIP or postal code. """ - default_for_currency: NotRequired["bool"] + default_for_currency: NotRequired[bool] """ When set to true, this becomes the default external account for its currency. """ @@ -3142,15 +3148,15 @@ class ModifyExternalAccountParams(RequestOptions): """ Documents that may be submitted to satisfy various informational requests. """ - exp_month: NotRequired["str"] + exp_month: NotRequired[str] """ Two digit number representing the card's expiration month. """ - exp_year: NotRequired["str"] + exp_year: NotRequired[str] """ Four digit number representing the card's expiration year. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -3158,7 +3164,7 @@ class ModifyExternalAccountParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ Cardholder name. """ @@ -3174,7 +3180,7 @@ class ModifyExternalAccountParamsDocuments(TypedDict): class ModifyExternalAccountParamsDocumentsBankAccountOwnershipVerification( TypedDict, ): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -3206,23 +3212,23 @@ class ModifyPersonParams(RequestOptions): """ Documents that may be submitted to satisfy various informational requests. """ - email: NotRequired["str"] + email: NotRequired[str] """ The person's email address. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The person's first name. """ - first_name_kana: NotRequired["str"] + first_name_kana: NotRequired[str] """ The Kana variation of the person's first name (Japan only). """ - first_name_kanji: NotRequired["str"] + first_name_kanji: NotRequired[str] """ The Kanji variation of the person's first name (Japan only). """ @@ -3230,31 +3236,31 @@ class ModifyPersonParams(RequestOptions): """ A list of alternate names or aliases that the person is known by. """ - gender: NotRequired["str"] + gender: NotRequired[str] """ The person's gender (International regulations require either "male" or "female"). """ - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - id_number_secondary: NotRequired["str"] + id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The person's last name. """ - last_name_kana: NotRequired["str"] + last_name_kana: NotRequired[str] """ The Kana variation of the person's last name (Japan only). """ - last_name_kanji: NotRequired["str"] + last_name_kanji: NotRequired[str] """ The Kanji variation of the person's last name (Japan only). """ - maiden_name: NotRequired["str"] + maiden_name: NotRequired[str] """ The person's maiden name. """ @@ -3262,19 +3268,19 @@ class ModifyPersonParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nationality: NotRequired["str"] + nationality: NotRequired[str] """ The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. """ - person_token: NotRequired["str"] + person_token: NotRequired[str] """ A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The person's phone number. """ - political_exposure: NotRequired["str"] + political_exposure: NotRequired[str] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -3288,7 +3294,7 @@ class ModifyPersonParams(RequestOptions): """ The relationship that this person has with the account's legal entity. """ - ssn_last_4: NotRequired["str"] + ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). """ @@ -3306,11 +3312,11 @@ class ModifyPersonParamsAdditionalTosAcceptances(TypedDict): """ class ModifyPersonParamsAdditionalTosAcceptancesAccount(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ @@ -3320,87 +3326,87 @@ class ModifyPersonParamsAdditionalTosAcceptancesAccount(TypedDict): """ class ModifyPersonParamsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class ModifyPersonParamsAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class ModifyPersonParamsAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ @@ -3436,63 +3442,63 @@ class ModifyPersonParamsDocuments(TypedDict): """ class ModifyPersonParamsDocumentsCompanyAuthorization(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class ModifyPersonParamsDocumentsPassport(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class ModifyPersonParamsDocumentsVisa(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class ModifyPersonParamsRegisteredAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class ModifyPersonParamsRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ - legal_guardian: NotRequired["bool"] + legal_guardian: NotRequired[bool] """ Whether the person is the legal guardian of the account's representative. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ @@ -3500,11 +3506,11 @@ class ModifyPersonParamsRelationship(TypedDict): """ The percent owned by the person of the account's legal entity. """ - representative: NotRequired["bool"] + representative: NotRequired[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ - title: NotRequired["str"] + title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ @@ -3522,35 +3528,35 @@ class ModifyPersonParamsVerification(TypedDict): """ class ModifyPersonParamsVerificationAdditionalDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class ModifyPersonParamsVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class PersonsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -3558,35 +3564,35 @@ class PersonsParams(RequestOptions): """ Filters on the list of people returned based on the person's relationship to the account's company. """ - starting_after: NotRequired["str"] + 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. """ class PersonsParamsRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ A filter on the list of people returned based on whether these people are directors of the account's company. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ A filter on the list of people returned based on whether these people are executives of the account's company. """ - legal_guardian: NotRequired["bool"] + legal_guardian: NotRequired[bool] """ A filter on the list of people returned based on whether these people are legal guardians of the account's representative. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ A filter on the list of people returned based on whether these people are owners of the account's company. """ - representative: NotRequired["bool"] + representative: NotRequired[bool] """ A filter on the list of people returned based on whether these people are the representative of the account's company. """ class RejectParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -3596,19 +3602,19 @@ class RejectParams(RequestOptions): """ class RetrieveCapabilityParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveExternalAccountParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrievePersonParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_account_capability_service.py b/stripe/_account_capability_service.py index 1142bb1e2..6ce2f3647 100644 --- a/stripe/_account_capability_service.py +++ b/stripe/_account_capability_service.py @@ -11,23 +11,23 @@ class AccountCapabilityService(StripeService): class ListParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - requested: NotRequired["bool"] + requested: NotRequired[bool] """ To request a new capability for an account, pass true. There can be a delay before the requested capability becomes active. If the capability has any activation requirements, the response includes them in the `requirements` arrays. diff --git a/stripe/_account_external_account_service.py b/stripe/_account_external_account_service.py index 2466c487f..9f8b77e75 100644 --- a/stripe/_account_external_account_service.py +++ b/stripe/_account_external_account_service.py @@ -12,11 +12,11 @@ class AccountExternalAccountService(StripeService): class CreateParams(TypedDict): - default_for_currency: NotRequired["bool"] + default_for_currency: NotRequired[bool] """ When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -29,18 +29,18 @@ class CreateParams(TypedDict): """ Please refer to full [documentation](https://stripe.com/docs/api) instead. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ class CreateParamsBankAccount(TypedDict): object: Literal["bank_account"] - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. """ - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ @@ -52,72 +52,72 @@ class CreateParamsBankAccount(TypedDict): """ The country in which the bank account is located. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](docs/payouts) """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. """ class CreateParamsCard(TypedDict): object: Literal["card"] - address_city: NotRequired["str"] - address_country: NotRequired["str"] - address_line1: NotRequired["str"] - address_line2: NotRequired["str"] - address_state: NotRequired["str"] - address_zip: NotRequired["str"] - currency: NotRequired["str"] - cvc: NotRequired["str"] + address_city: NotRequired[str] + address_country: NotRequired[str] + address_line1: NotRequired[str] + address_line2: NotRequired[str] + address_state: NotRequired[str] + address_zip: NotRequired[str] + currency: NotRequired[str] + cvc: NotRequired[str] exp_month: int exp_year: int - name: NotRequired["str"] + name: NotRequired[str] number: str - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ class CreateParamsCardToken(TypedDict): object: Literal["card"] - currency: NotRequired["str"] + currency: NotRequired[str] token: str class DeleteParams(TypedDict): pass class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - object: NotRequired["Literal['bank_account', 'card']"] + object: NotRequired[Literal["bank_account", "card"]] """ Filter external accounts according to a particular object type. """ - starting_after: NotRequired["str"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account. """ @@ -128,36 +128,36 @@ class UpdateParams(TypedDict): The type of entity that holds the account. This can be either `individual` or `company`. """ account_type: NotRequired[ - "Literal['checking', 'futsu', 'savings', 'toza']" + Literal["checking", "futsu", "savings", "toza"] ] """ The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. """ - address_city: NotRequired["str"] + address_city: NotRequired[str] """ City/District/Suburb/Town/Village. """ - address_country: NotRequired["str"] + address_country: NotRequired[str] """ Billing address country, if provided when creating card. """ - address_line1: NotRequired["str"] + address_line1: NotRequired[str] """ Address line 1 (Street address/PO Box/Company name). """ - address_line2: NotRequired["str"] + address_line2: NotRequired[str] """ Address line 2 (Apartment/Suite/Unit/Building). """ - address_state: NotRequired["str"] + address_state: NotRequired[str] """ State/County/Province/Region. """ - address_zip: NotRequired["str"] + address_zip: NotRequired[str] """ ZIP or postal code. """ - default_for_currency: NotRequired["bool"] + default_for_currency: NotRequired[bool] """ When set to true, this becomes the default external account for its currency. """ @@ -167,15 +167,15 @@ class UpdateParams(TypedDict): """ Documents that may be submitted to satisfy various informational requests. """ - exp_month: NotRequired["str"] + exp_month: NotRequired[str] """ Two digit number representing the card's expiration month. """ - exp_year: NotRequired["str"] + exp_year: NotRequired[str] """ Four digit number representing the card's expiration year. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -183,7 +183,7 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ Cardholder name. """ @@ -197,7 +197,7 @@ class UpdateParamsDocuments(TypedDict): """ class UpdateParamsDocumentsBankAccountOwnershipVerification(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ diff --git a/stripe/_account_link.py b/stripe/_account_link.py index b16247d89..03aff08df 100644 --- a/stripe/_account_link.py +++ b/stripe/_account_link.py @@ -21,7 +21,7 @@ class CreateParams(RequestOptions): """ The identifier of the account to create an account link for. """ - collect: NotRequired["Literal['currently_due', 'eventually_due']"] + collect: NotRequired[Literal["currently_due", "eventually_due"]] """ The collect parameter is deprecated. Use `collection_options` instead. """ @@ -31,15 +31,15 @@ class CreateParams(RequestOptions): """ Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - refresh_url: NotRequired["str"] + refresh_url: NotRequired[str] """ The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL that the user will be redirected to upon leaving or completing the linked flow. """ @@ -53,7 +53,7 @@ class CreateParamsCollectionOptions(TypedDict): """ Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify `collection_options`, the default value is `currently_due`. """ - future_requirements: NotRequired["Literal['include', 'omit']"] + future_requirements: NotRequired[Literal["include", "omit"]] """ Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`. """ diff --git a/stripe/_account_link_service.py b/stripe/_account_link_service.py index f03d5ce74..e55a9dbea 100644 --- a/stripe/_account_link_service.py +++ b/stripe/_account_link_service.py @@ -13,7 +13,7 @@ class CreateParams(TypedDict): """ The identifier of the account to create an account link for. """ - collect: NotRequired["Literal['currently_due', 'eventually_due']"] + collect: NotRequired[Literal["currently_due", "eventually_due"]] """ The collect parameter is deprecated. Use `collection_options` instead. """ @@ -23,15 +23,15 @@ class CreateParams(TypedDict): """ Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - refresh_url: NotRequired["str"] + refresh_url: NotRequired[str] """ The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL that the user will be redirected to upon leaving or completing the linked flow. """ @@ -45,7 +45,7 @@ class CreateParamsCollectionOptions(TypedDict): """ Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify `collection_options`, the default value is `currently_due`. """ - future_requirements: NotRequired["Literal['include', 'omit']"] + future_requirements: NotRequired[Literal["include", "omit"]] """ Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`. """ diff --git a/stripe/_account_login_link_service.py b/stripe/_account_login_link_service.py index 88250da44..20bbbb2ea 100644 --- a/stripe/_account_login_link_service.py +++ b/stripe/_account_login_link_service.py @@ -10,7 +10,7 @@ class AccountLoginLinkService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_account_person_service.py b/stripe/_account_person_service.py index d000a9407..e308cfa86 100644 --- a/stripe/_account_person_service.py +++ b/stripe/_account_person_service.py @@ -41,23 +41,23 @@ class CreateParams(TypedDict): """ Documents that may be submitted to satisfy various informational requests. """ - email: NotRequired["str"] + email: NotRequired[str] """ The person's email address. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The person's first name. """ - first_name_kana: NotRequired["str"] + first_name_kana: NotRequired[str] """ The Kana variation of the person's first name (Japan only). """ - first_name_kanji: NotRequired["str"] + first_name_kanji: NotRequired[str] """ The Kanji variation of the person's first name (Japan only). """ @@ -65,31 +65,31 @@ class CreateParams(TypedDict): """ A list of alternate names or aliases that the person is known by. """ - gender: NotRequired["str"] + gender: NotRequired[str] """ The person's gender (International regulations require either "male" or "female"). """ - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - id_number_secondary: NotRequired["str"] + id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The person's last name. """ - last_name_kana: NotRequired["str"] + last_name_kana: NotRequired[str] """ The Kana variation of the person's last name (Japan only). """ - last_name_kanji: NotRequired["str"] + last_name_kanji: NotRequired[str] """ The Kanji variation of the person's last name (Japan only). """ - maiden_name: NotRequired["str"] + maiden_name: NotRequired[str] """ The person's maiden name. """ @@ -97,19 +97,19 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nationality: NotRequired["str"] + nationality: NotRequired[str] """ The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. """ - person_token: NotRequired["str"] + person_token: NotRequired[str] """ A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The person's phone number. """ - political_exposure: NotRequired["str"] + political_exposure: NotRequired[str] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -125,7 +125,7 @@ class CreateParams(TypedDict): """ The relationship that this person has with the account's legal entity. """ - ssn_last_4: NotRequired["str"] + ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). """ @@ -145,11 +145,11 @@ class CreateParamsAdditionalTosAcceptances(TypedDict): """ class CreateParamsAdditionalTosAcceptancesAccount(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ @@ -159,87 +159,87 @@ class CreateParamsAdditionalTosAcceptancesAccount(TypedDict): """ class CreateParamsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ @@ -277,63 +277,63 @@ class CreateParamsDocuments(TypedDict): """ class CreateParamsDocumentsCompanyAuthorization(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsPassport(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsVisa(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsRegisteredAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ - legal_guardian: NotRequired["bool"] + legal_guardian: NotRequired[bool] """ Whether the person is the legal guardian of the account's representative. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ @@ -341,11 +341,11 @@ class CreateParamsRelationship(TypedDict): """ The percent owned by the person of the account's legal entity. """ - representative: NotRequired["bool"] + representative: NotRequired[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ - title: NotRequired["str"] + title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ @@ -365,21 +365,21 @@ class CreateParamsVerification(TypedDict): """ class CreateParamsVerificationAdditionalDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class CreateParamsVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -388,15 +388,15 @@ class DeleteParams(TypedDict): pass class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -406,35 +406,35 @@ class ListParams(TypedDict): """ Filters on the list of people returned based on the person's relationship to the account's company. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ A filter on the list of people returned based on whether these people are directors of the account's company. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ A filter on the list of people returned based on whether these people are executives of the account's company. """ - legal_guardian: NotRequired["bool"] + legal_guardian: NotRequired[bool] """ A filter on the list of people returned based on whether these people are legal guardians of the account's representative. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ A filter on the list of people returned based on whether these people are owners of the account's company. """ - representative: NotRequired["bool"] + representative: NotRequired[bool] """ A filter on the list of people returned based on whether these people are the representative of the account's company. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -470,23 +470,23 @@ class UpdateParams(TypedDict): """ Documents that may be submitted to satisfy various informational requests. """ - email: NotRequired["str"] + email: NotRequired[str] """ The person's email address. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The person's first name. """ - first_name_kana: NotRequired["str"] + first_name_kana: NotRequired[str] """ The Kana variation of the person's first name (Japan only). """ - first_name_kanji: NotRequired["str"] + first_name_kanji: NotRequired[str] """ The Kanji variation of the person's first name (Japan only). """ @@ -494,31 +494,31 @@ class UpdateParams(TypedDict): """ A list of alternate names or aliases that the person is known by. """ - gender: NotRequired["str"] + gender: NotRequired[str] """ The person's gender (International regulations require either "male" or "female"). """ - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - id_number_secondary: NotRequired["str"] + id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The person's last name. """ - last_name_kana: NotRequired["str"] + last_name_kana: NotRequired[str] """ The Kana variation of the person's last name (Japan only). """ - last_name_kanji: NotRequired["str"] + last_name_kanji: NotRequired[str] """ The Kanji variation of the person's last name (Japan only). """ - maiden_name: NotRequired["str"] + maiden_name: NotRequired[str] """ The person's maiden name. """ @@ -526,19 +526,19 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nationality: NotRequired["str"] + nationality: NotRequired[str] """ The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. """ - person_token: NotRequired["str"] + person_token: NotRequired[str] """ A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The person's phone number. """ - political_exposure: NotRequired["str"] + political_exposure: NotRequired[str] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -554,7 +554,7 @@ class UpdateParams(TypedDict): """ The relationship that this person has with the account's legal entity. """ - ssn_last_4: NotRequired["str"] + ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). """ @@ -574,11 +574,11 @@ class UpdateParamsAdditionalTosAcceptances(TypedDict): """ class UpdateParamsAdditionalTosAcceptancesAccount(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ @@ -588,87 +588,87 @@ class UpdateParamsAdditionalTosAcceptancesAccount(TypedDict): """ class UpdateParamsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class UpdateParamsAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ @@ -706,63 +706,63 @@ class UpdateParamsDocuments(TypedDict): """ class UpdateParamsDocumentsCompanyAuthorization(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsPassport(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsVisa(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsRegisteredAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ - legal_guardian: NotRequired["bool"] + legal_guardian: NotRequired[bool] """ Whether the person is the legal guardian of the account's representative. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ @@ -770,11 +770,11 @@ class UpdateParamsRelationship(TypedDict): """ The percent owned by the person of the account's legal entity. """ - representative: NotRequired["bool"] + representative: NotRequired[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ - title: NotRequired["str"] + title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ @@ -794,21 +794,21 @@ class UpdateParamsVerification(TypedDict): """ class UpdateParamsVerificationAdditionalDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class UpdateParamsVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index dec3571a3..97aff8509 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -24,7 +24,7 @@ def __init__(self, requestor): self.persons = AccountPersonService(self._requestor) class CreateParams(TypedDict): - account_token: NotRequired["str"] + account_token: NotRequired[str] """ An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. """ @@ -35,7 +35,7 @@ class CreateParams(TypedDict): Business information about the account. """ business_type: NotRequired[ - "Literal['company', 'government_entity', 'individual', 'non_profit']" + Literal["company", "government_entity", "individual", "non_profit"] ] """ The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. @@ -48,11 +48,11 @@ class CreateParams(TypedDict): """ Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. """ - country: NotRequired["str"] + country: NotRequired[str] """ The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. """ - default_currency: NotRequired["str"] + default_currency: NotRequired[str] """ Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). """ @@ -60,11 +60,11 @@ class CreateParams(TypedDict): """ Documents that may be submitted to satisfy various informational requests. """ - email: NotRequired["str"] + email: NotRequired[str] """ The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -92,18 +92,18 @@ class CreateParams(TypedDict): """ Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. """ - type: NotRequired["Literal['custom', 'express', 'standard']"] + type: NotRequired[Literal["custom", "express", "standard"]] """ The type of Stripe account to create. May be one of `custom`, `express` or `standard`. """ class CreateParamsBankAccount(TypedDict): object: Literal["bank_account"] - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. """ - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ @@ -115,11 +115,11 @@ class CreateParamsBankAccount(TypedDict): """ The country in which the bank account is located. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](docs/payouts) """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. """ @@ -131,11 +131,11 @@ class CreateParamsBusinessProfile(TypedDict): """ The applicant's gross annual revenue for its preceding fiscal year. """ - estimated_worker_count: NotRequired["int"] + estimated_worker_count: NotRequired[int] """ An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. """ - mcc: NotRequired["str"] + mcc: NotRequired[str] """ [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ @@ -145,11 +145,11 @@ class CreateParamsBusinessProfile(TypedDict): """ An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. """ - name: NotRequired["str"] + name: NotRequired[str] """ The customer-facing business name. """ - product_description: NotRequired["str"] + product_description: NotRequired[str] """ Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. """ @@ -159,11 +159,11 @@ class CreateParamsBusinessProfile(TypedDict): """ A publicly available mailing address for sending support issues to. """ - support_email: NotRequired["str"] + support_email: NotRequired[str] """ A publicly available email address for sending support issues to. """ - support_phone: NotRequired["str"] + support_phone: NotRequired[str] """ A publicly available phone number to call with support issues. """ @@ -171,7 +171,7 @@ class CreateParamsBusinessProfile(TypedDict): """ A publicly available website for handling support issues. """ - url: NotRequired["str"] + url: NotRequired[str] """ The business's publicly available website. """ @@ -201,27 +201,27 @@ class CreateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict): """ class CreateParamsBusinessProfileSupportAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -463,262 +463,262 @@ class CreateParamsCapabilities(TypedDict): """ class CreateParamsCapabilitiesAcssDebitPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesAffirmPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesAfterpayClearpayPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesAuBecsDebitPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesBacsDebitPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesBancontactPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesBankTransferPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesBlikPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesBoletoPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesCardIssuing(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesCardPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesCartesBancairesPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesCashappPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesEpsPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesFpxPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesGiropayPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesGrabpayPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesIdealPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesIndiaInternationalPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesJcbPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesKlarnaPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesKonbiniPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesLegacyPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesLinkPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesMobilepayPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesOxxoPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesP24Payments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesPaynowPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesPromptpayPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesRevolutPayPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesSepaDebitPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesSofortPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesSwishPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesTaxReportingUs1099K(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesTaxReportingUs1099Misc(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesTransfers(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesTreasury(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCapabilitiesZipPayments(TypedDict): - requested: NotRequired["bool"] + 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 CreateParamsCard(TypedDict): object: Literal["card"] - address_city: NotRequired["str"] - address_country: NotRequired["str"] - address_line1: NotRequired["str"] - address_line2: NotRequired["str"] - address_state: NotRequired["str"] - address_zip: NotRequired["str"] - currency: NotRequired["str"] - cvc: NotRequired["str"] + address_city: NotRequired[str] + address_country: NotRequired[str] + address_line1: NotRequired[str] + address_line2: NotRequired[str] + address_state: NotRequired[str] + address_zip: NotRequired[str] + currency: NotRequired[str] + cvc: NotRequired[str] exp_month: int exp_year: int - name: NotRequired["str"] + name: NotRequired[str] number: str - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ - default_for_currency: NotRequired["bool"] + default_for_currency: NotRequired[bool] class CreateParamsCardToken(TypedDict): object: Literal["card"] - currency: NotRequired["str"] + currency: NotRequired[str] token: str class CreateParamsCompany(TypedDict): @@ -738,35 +738,35 @@ class CreateParamsCompany(TypedDict): """ The Kanji variation of the company's primary address (Japan only). """ - directors_provided: NotRequired["bool"] + directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ - executives_provided: NotRequired["bool"] + executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. """ - export_license_id: NotRequired["str"] + export_license_id: NotRequired[str] """ The export license ID number of the company, also referred as Import Export Code (India only). """ - export_purpose_code: NotRequired["str"] + export_purpose_code: NotRequired[str] """ The purpose code to use for export transactions (India only). """ - name: NotRequired["str"] + name: NotRequired[str] """ The company's legal name. """ - name_kana: NotRequired["str"] + name_kana: NotRequired[str] """ The Kana variation of the company's legal name (Japan only). """ - name_kanji: NotRequired["str"] + name_kanji: NotRequired[str] """ The Kanji variation of the company's legal name (Japan only). """ - owners_provided: NotRequired["bool"] + owners_provided: NotRequired[bool] """ Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. """ @@ -776,11 +776,11 @@ class CreateParamsCompany(TypedDict): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The company's phone number (used for verification). """ - registration_number: NotRequired["str"] + registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). """ @@ -790,15 +790,15 @@ class CreateParamsCompany(TypedDict): """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ - tax_id: NotRequired["str"] + tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) """ - tax_id_registrar: NotRequired["str"] + tax_id_registrar: NotRequired[str] """ The jurisdiction in which the `tax_id` is registered (Germany-based companies only). """ - vat_id: NotRequired["str"] + vat_id: NotRequired[str] """ The VAT number of the company. """ @@ -810,101 +810,101 @@ class CreateParamsCompany(TypedDict): """ class CreateParamsCompanyAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsCompanyAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsCompanyAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsCompanyOwnershipDeclaration(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the beneficial owner attestation was made. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the beneficial owner attestation was made. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the beneficial owner attestation was made. """ @@ -918,11 +918,11 @@ class CreateParamsCompanyVerification(TypedDict): """ class CreateParamsCompanyVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -972,43 +972,43 @@ class CreateParamsDocuments(TypedDict): """ class CreateParamsDocumentsBankAccountOwnershipVerification(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyLicense(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyMemorandumOfAssociation(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyMinisterialDecree(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyRegistrationVerification(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyTaxIdVerification(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsProofOfRegistration(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -1036,19 +1036,19 @@ class CreateParamsIndividual(TypedDict): """ The individual's date of birth. """ - email: NotRequired["str"] + email: NotRequired[str] """ The individual's email address. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The individual's first name. """ - first_name_kana: NotRequired["str"] + first_name_kana: NotRequired[str] """ The Kana variation of the the individual's first name (Japan only). """ - first_name_kanji: NotRequired["str"] + first_name_kanji: NotRequired[str] """ The Kanji variation of the individual's first name (Japan only). """ @@ -1056,31 +1056,31 @@ class CreateParamsIndividual(TypedDict): """ A list of alternate names or aliases that the individual is known by. """ - gender: NotRequired["str"] + gender: NotRequired[str] """ The individual's gender (International regulations require either "male" or "female"). """ - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - id_number_secondary: NotRequired["str"] + id_number_secondary: NotRequired[str] """ The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The individual's last name. """ - last_name_kana: NotRequired["str"] + last_name_kana: NotRequired[str] """ The Kana variation of the individual's last name (Japan only). """ - last_name_kanji: NotRequired["str"] + last_name_kanji: NotRequired[str] """ The Kanji variation of the individual's last name (Japan only). """ - maiden_name: NotRequired["str"] + maiden_name: NotRequired[str] """ The individual's maiden name. """ @@ -1088,11 +1088,11 @@ class CreateParamsIndividual(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The individual's phone number. """ - political_exposure: NotRequired["Literal['existing', 'none']"] + political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -1108,7 +1108,7 @@ class CreateParamsIndividual(TypedDict): """ Describes the person's relationship to the account. """ - ssn_last_4: NotRequired["str"] + ssn_last_4: NotRequired[str] """ The last four digits of the individual's Social Security Number (U.S. only). """ @@ -1120,87 +1120,87 @@ class CreateParamsIndividual(TypedDict): """ class CreateParamsIndividualAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsIndividualAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsIndividualAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ @@ -1220,41 +1220,41 @@ class CreateParamsIndividualDob(TypedDict): """ class CreateParamsIndividualRegisteredAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsIndividualRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ @@ -1262,7 +1262,7 @@ class CreateParamsIndividualRelationship(TypedDict): """ The percent owned by the person of the account's legal entity. """ - title: NotRequired["str"] + title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ @@ -1282,21 +1282,21 @@ class CreateParamsIndividualVerification(TypedDict): """ class CreateParamsIndividualVerificationAdditionalDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class CreateParamsIndividualVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -1338,25 +1338,25 @@ class CreateParamsSettings(TypedDict): """ class CreateParamsSettingsBacsDebitPayments(TypedDict): - display_name: NotRequired["str"] + display_name: NotRequired[str] """ The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ class CreateParamsSettingsBranding(TypedDict): - icon: NotRequired["str"] + icon: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. """ - logo: NotRequired["str"] + logo: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. """ - primary_color: NotRequired["str"] + primary_color: NotRequired[str] """ A CSS hex color value representing the primary branding color for this account. """ - secondary_color: NotRequired["str"] + secondary_color: NotRequired[str] """ A CSS hex color value representing the secondary branding color for this account. """ @@ -1370,11 +1370,11 @@ class CreateParamsSettingsCardIssuing(TypedDict): """ class CreateParamsSettingsCardIssuingTosAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ @@ -1390,7 +1390,7 @@ class CreateParamsSettingsCardPayments(TypedDict): """ Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. """ - statement_descriptor_prefix: NotRequired["str"] + statement_descriptor_prefix: NotRequired[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. """ @@ -1404,31 +1404,31 @@ class CreateParamsSettingsCardPayments(TypedDict): """ class CreateParamsSettingsCardPaymentsDeclineOn(TypedDict): - avs_failure: NotRequired["bool"] + avs_failure: NotRequired[bool] """ Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. """ - cvc_failure: NotRequired["bool"] + cvc_failure: NotRequired[bool] """ Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. """ class CreateParamsSettingsPayments(TypedDict): - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. """ - statement_descriptor_kana: NotRequired["str"] + statement_descriptor_kana: NotRequired[str] """ The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). """ - statement_descriptor_kanji: NotRequired["str"] + statement_descriptor_kanji: NotRequired[str] """ The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). """ class CreateParamsSettingsPayouts(TypedDict): - debit_negative_balances: NotRequired["bool"] + debit_negative_balances: NotRequired[bool] """ A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). """ @@ -1438,7 +1438,7 @@ class CreateParamsSettingsPayouts(TypedDict): """ Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. """ @@ -1448,18 +1448,24 @@ class CreateParamsSettingsPayoutsSchedule(TypedDict): """ The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). """ - interval: NotRequired[ - "Literal['daily', 'manual', 'monthly', 'weekly']" - ] + interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] """ How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. """ - monthly_anchor: NotRequired["int"] + monthly_anchor: NotRequired[int] """ The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ weekly_anchor: NotRequired[ - "Literal['friday', 'monday', 'saturday', 'sunday', 'thursday', 'tuesday', 'wednesday']" + Literal[ + "friday", + "monday", + "saturday", + "sunday", + "thursday", + "tuesday", + "wednesday", + ] ] """ The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) @@ -1474,11 +1480,11 @@ class CreateParamsSettingsTreasury(TypedDict): """ class CreateParamsSettingsTreasuryTosAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ @@ -1488,19 +1494,19 @@ class CreateParamsSettingsTreasuryTosAcceptance(TypedDict): """ class CreateParamsTosAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted their service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted their service agreement. """ - service_agreement: NotRequired["str"] + service_agreement: NotRequired[str] """ The user's service agreement type. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the account representative accepted their service agreement. """ @@ -1513,43 +1519,43 @@ class ListParams(TypedDict): """ Only return connected accounts that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RejectParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1559,19 +1565,19 @@ class RejectParams(TypedDict): """ class RetrieveCurrentParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - account_token: NotRequired["str"] + account_token: NotRequired[str] """ An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. """ @@ -1582,7 +1588,7 @@ class UpdateParams(TypedDict): Business information about the account. """ business_type: NotRequired[ - "Literal['company', 'government_entity', 'individual', 'non_profit']" + Literal["company", "government_entity", "individual", "non_profit"] ] """ The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. @@ -1595,7 +1601,7 @@ class UpdateParams(TypedDict): """ Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. """ - default_currency: NotRequired["str"] + default_currency: NotRequired[str] """ Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). """ @@ -1603,11 +1609,11 @@ class UpdateParams(TypedDict): """ Documents that may be submitted to satisfy various informational requests. """ - email: NotRequired["str"] + email: NotRequired[str] """ The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1638,11 +1644,11 @@ class UpdateParams(TypedDict): class UpdateParamsBankAccount(TypedDict): object: Literal["bank_account"] - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. """ - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ @@ -1654,11 +1660,11 @@ class UpdateParamsBankAccount(TypedDict): """ The country in which the bank account is located. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](docs/payouts) """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. """ @@ -1670,11 +1676,11 @@ class UpdateParamsBusinessProfile(TypedDict): """ The applicant's gross annual revenue for its preceding fiscal year. """ - estimated_worker_count: NotRequired["int"] + estimated_worker_count: NotRequired[int] """ An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. """ - mcc: NotRequired["str"] + mcc: NotRequired[str] """ [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ @@ -1684,11 +1690,11 @@ class UpdateParamsBusinessProfile(TypedDict): """ An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. """ - name: NotRequired["str"] + name: NotRequired[str] """ The customer-facing business name. """ - product_description: NotRequired["str"] + product_description: NotRequired[str] """ Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. """ @@ -1698,11 +1704,11 @@ class UpdateParamsBusinessProfile(TypedDict): """ A publicly available mailing address for sending support issues to. """ - support_email: NotRequired["str"] + support_email: NotRequired[str] """ A publicly available email address for sending support issues to. """ - support_phone: NotRequired["str"] + support_phone: NotRequired[str] """ A publicly available phone number to call with support issues. """ @@ -1710,7 +1716,7 @@ class UpdateParamsBusinessProfile(TypedDict): """ A publicly available website for handling support issues. """ - url: NotRequired["str"] + url: NotRequired[str] """ The business's publicly available website. """ @@ -1740,27 +1746,27 @@ class UpdateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict): """ class UpdateParamsBusinessProfileSupportAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -2002,262 +2008,262 @@ class UpdateParamsCapabilities(TypedDict): """ class UpdateParamsCapabilitiesAcssDebitPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesAffirmPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesAfterpayClearpayPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesAuBecsDebitPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesBacsDebitPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesBancontactPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesBankTransferPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesBlikPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesBoletoPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesCardIssuing(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesCardPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesCartesBancairesPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesCashappPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesEpsPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesFpxPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesGiropayPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesGrabpayPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesIdealPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesIndiaInternationalPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesJcbPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesKlarnaPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesKonbiniPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesLegacyPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesLinkPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesMobilepayPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesOxxoPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesP24Payments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesPaynowPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesPromptpayPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesRevolutPayPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesSepaDebitPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesSofortPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesSwishPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesTaxReportingUs1099K(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesTaxReportingUs1099Misc(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesTransfers(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesTreasury(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCapabilitiesZipPayments(TypedDict): - requested: NotRequired["bool"] + 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 UpdateParamsCard(TypedDict): object: Literal["card"] - address_city: NotRequired["str"] - address_country: NotRequired["str"] - address_line1: NotRequired["str"] - address_line2: NotRequired["str"] - address_state: NotRequired["str"] - address_zip: NotRequired["str"] - currency: NotRequired["str"] - cvc: NotRequired["str"] + address_city: NotRequired[str] + address_country: NotRequired[str] + address_line1: NotRequired[str] + address_line2: NotRequired[str] + address_state: NotRequired[str] + address_zip: NotRequired[str] + currency: NotRequired[str] + cvc: NotRequired[str] exp_month: int exp_year: int - name: NotRequired["str"] + name: NotRequired[str] number: str - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ - default_for_currency: NotRequired["bool"] + default_for_currency: NotRequired[bool] class UpdateParamsCardToken(TypedDict): object: Literal["card"] - currency: NotRequired["str"] + currency: NotRequired[str] token: str class UpdateParamsCompany(TypedDict): @@ -2277,35 +2283,35 @@ class UpdateParamsCompany(TypedDict): """ The Kanji variation of the company's primary address (Japan only). """ - directors_provided: NotRequired["bool"] + directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ - executives_provided: NotRequired["bool"] + executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. """ - export_license_id: NotRequired["str"] + export_license_id: NotRequired[str] """ The export license ID number of the company, also referred as Import Export Code (India only). """ - export_purpose_code: NotRequired["str"] + export_purpose_code: NotRequired[str] """ The purpose code to use for export transactions (India only). """ - name: NotRequired["str"] + name: NotRequired[str] """ The company's legal name. """ - name_kana: NotRequired["str"] + name_kana: NotRequired[str] """ The Kana variation of the company's legal name (Japan only). """ - name_kanji: NotRequired["str"] + name_kanji: NotRequired[str] """ The Kanji variation of the company's legal name (Japan only). """ - owners_provided: NotRequired["bool"] + owners_provided: NotRequired[bool] """ Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. """ @@ -2315,11 +2321,11 @@ class UpdateParamsCompany(TypedDict): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The company's phone number (used for verification). """ - registration_number: NotRequired["str"] + registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). """ @@ -2329,15 +2335,15 @@ class UpdateParamsCompany(TypedDict): """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ - tax_id: NotRequired["str"] + tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) """ - tax_id_registrar: NotRequired["str"] + tax_id_registrar: NotRequired[str] """ The jurisdiction in which the `tax_id` is registered (Germany-based companies only). """ - vat_id: NotRequired["str"] + vat_id: NotRequired[str] """ The VAT number of the company. """ @@ -2349,101 +2355,101 @@ class UpdateParamsCompany(TypedDict): """ class UpdateParamsCompanyAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsCompanyAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class UpdateParamsCompanyAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class UpdateParamsCompanyOwnershipDeclaration(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the beneficial owner attestation was made. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the beneficial owner attestation was made. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the beneficial owner attestation was made. """ @@ -2457,11 +2463,11 @@ class UpdateParamsCompanyVerification(TypedDict): """ class UpdateParamsCompanyVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -2511,43 +2517,43 @@ class UpdateParamsDocuments(TypedDict): """ class UpdateParamsDocumentsBankAccountOwnershipVerification(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsCompanyLicense(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsCompanyMemorandumOfAssociation(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsCompanyMinisterialDecree(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsCompanyRegistrationVerification(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsCompanyTaxIdVerification(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsProofOfRegistration(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -2575,19 +2581,19 @@ class UpdateParamsIndividual(TypedDict): """ The individual's date of birth. """ - email: NotRequired["str"] + email: NotRequired[str] """ The individual's email address. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The individual's first name. """ - first_name_kana: NotRequired["str"] + first_name_kana: NotRequired[str] """ The Kana variation of the the individual's first name (Japan only). """ - first_name_kanji: NotRequired["str"] + first_name_kanji: NotRequired[str] """ The Kanji variation of the individual's first name (Japan only). """ @@ -2595,31 +2601,31 @@ class UpdateParamsIndividual(TypedDict): """ A list of alternate names or aliases that the individual is known by. """ - gender: NotRequired["str"] + gender: NotRequired[str] """ The individual's gender (International regulations require either "male" or "female"). """ - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - id_number_secondary: NotRequired["str"] + id_number_secondary: NotRequired[str] """ The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The individual's last name. """ - last_name_kana: NotRequired["str"] + last_name_kana: NotRequired[str] """ The Kana variation of the individual's last name (Japan only). """ - last_name_kanji: NotRequired["str"] + last_name_kanji: NotRequired[str] """ The Kanji variation of the individual's last name (Japan only). """ - maiden_name: NotRequired["str"] + maiden_name: NotRequired[str] """ The individual's maiden name. """ @@ -2627,11 +2633,11 @@ class UpdateParamsIndividual(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The individual's phone number. """ - political_exposure: NotRequired["Literal['existing', 'none']"] + political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -2647,7 +2653,7 @@ class UpdateParamsIndividual(TypedDict): """ Describes the person's relationship to the account. """ - ssn_last_4: NotRequired["str"] + ssn_last_4: NotRequired[str] """ The last four digits of the individual's Social Security Number (U.S. only). """ @@ -2659,87 +2665,87 @@ class UpdateParamsIndividual(TypedDict): """ class UpdateParamsIndividualAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsIndividualAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class UpdateParamsIndividualAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ @@ -2759,41 +2765,41 @@ class UpdateParamsIndividualDob(TypedDict): """ class UpdateParamsIndividualRegisteredAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsIndividualRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ @@ -2801,7 +2807,7 @@ class UpdateParamsIndividualRelationship(TypedDict): """ The percent owned by the person of the account's legal entity. """ - title: NotRequired["str"] + title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ @@ -2821,21 +2827,21 @@ class UpdateParamsIndividualVerification(TypedDict): """ class UpdateParamsIndividualVerificationAdditionalDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class UpdateParamsIndividualVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -2881,25 +2887,25 @@ class UpdateParamsSettings(TypedDict): """ class UpdateParamsSettingsBacsDebitPayments(TypedDict): - display_name: NotRequired["str"] + display_name: NotRequired[str] """ The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ class UpdateParamsSettingsBranding(TypedDict): - icon: NotRequired["str"] + icon: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. """ - logo: NotRequired["str"] + logo: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. """ - primary_color: NotRequired["str"] + primary_color: NotRequired[str] """ A CSS hex color value representing the primary branding color for this account. """ - secondary_color: NotRequired["str"] + secondary_color: NotRequired[str] """ A CSS hex color value representing the secondary branding color for this account. """ @@ -2913,11 +2919,11 @@ class UpdateParamsSettingsCardIssuing(TypedDict): """ class UpdateParamsSettingsCardIssuingTosAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ @@ -2933,7 +2939,7 @@ class UpdateParamsSettingsCardPayments(TypedDict): """ Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. """ - statement_descriptor_prefix: NotRequired["str"] + statement_descriptor_prefix: NotRequired[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. """ @@ -2947,11 +2953,11 @@ class UpdateParamsSettingsCardPayments(TypedDict): """ class UpdateParamsSettingsCardPaymentsDeclineOn(TypedDict): - avs_failure: NotRequired["bool"] + avs_failure: NotRequired[bool] """ Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. """ - cvc_failure: NotRequired["bool"] + cvc_failure: NotRequired[bool] """ Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. """ @@ -2963,21 +2969,21 @@ class UpdateParamsSettingsInvoices(TypedDict): """ class UpdateParamsSettingsPayments(TypedDict): - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. """ - statement_descriptor_kana: NotRequired["str"] + statement_descriptor_kana: NotRequired[str] """ The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). """ - statement_descriptor_kanji: NotRequired["str"] + statement_descriptor_kanji: NotRequired[str] """ The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). """ class UpdateParamsSettingsPayouts(TypedDict): - debit_negative_balances: NotRequired["bool"] + debit_negative_balances: NotRequired[bool] """ A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). """ @@ -2987,7 +2993,7 @@ class UpdateParamsSettingsPayouts(TypedDict): """ Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. """ @@ -2997,18 +3003,24 @@ class UpdateParamsSettingsPayoutsSchedule(TypedDict): """ The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). """ - interval: NotRequired[ - "Literal['daily', 'manual', 'monthly', 'weekly']" - ] + interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] """ How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. """ - monthly_anchor: NotRequired["int"] + monthly_anchor: NotRequired[int] """ The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ weekly_anchor: NotRequired[ - "Literal['friday', 'monday', 'saturday', 'sunday', 'thursday', 'tuesday', 'wednesday']" + Literal[ + "friday", + "monday", + "saturday", + "sunday", + "thursday", + "tuesday", + "wednesday", + ] ] """ The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) @@ -3023,11 +3035,11 @@ class UpdateParamsSettingsTreasury(TypedDict): """ class UpdateParamsSettingsTreasuryTosAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ @@ -3037,19 +3049,19 @@ class UpdateParamsSettingsTreasuryTosAcceptance(TypedDict): """ class UpdateParamsTosAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted their service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted their service agreement. """ - service_agreement: NotRequired["str"] + service_agreement: NotRequired[str] """ The user's service agreement type. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the account representative accepted their service agreement. """ diff --git a/stripe/_account_session.py b/stripe/_account_session.py index 811687089..dac4f63b0 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -131,7 +131,7 @@ class CreateParams(RequestOptions): """ Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -207,15 +207,15 @@ class CreateParamsComponentsPaymentDetails(TypedDict): """ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict): - capture_payments: NotRequired["bool"] + capture_payments: NotRequired[bool] """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ - dispute_management: NotRequired["bool"] + dispute_management: NotRequired[bool] """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. """ - refund_management: NotRequired["bool"] + refund_management: NotRequired[bool] """ Whether to allow sending refunds. This is `true` by default. """ @@ -233,15 +233,15 @@ class CreateParamsComponentsPayments(TypedDict): """ class CreateParamsComponentsPaymentsFeatures(TypedDict): - capture_payments: NotRequired["bool"] + capture_payments: NotRequired[bool] """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ - dispute_management: NotRequired["bool"] + dispute_management: NotRequired[bool] """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. """ - refund_management: NotRequired["bool"] + refund_management: NotRequired[bool] """ Whether to allow sending refunds. This is `true` by default. """ @@ -259,15 +259,15 @@ class CreateParamsComponentsPayouts(TypedDict): """ class CreateParamsComponentsPayoutsFeatures(TypedDict): - edit_payout_schedule: NotRequired["bool"] + edit_payout_schedule: NotRequired[bool] """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ - instant_payouts: NotRequired["bool"] + instant_payouts: NotRequired[bool] """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ - standard_payouts: NotRequired["bool"] + standard_payouts: NotRequired[bool] """ Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 081b7cd80..7fddc7700 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -17,7 +17,7 @@ class CreateParams(TypedDict): """ Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -97,15 +97,15 @@ class CreateParamsComponentsPaymentDetails(TypedDict): """ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict): - capture_payments: NotRequired["bool"] + capture_payments: NotRequired[bool] """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ - dispute_management: NotRequired["bool"] + dispute_management: NotRequired[bool] """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. """ - refund_management: NotRequired["bool"] + refund_management: NotRequired[bool] """ Whether to allow sending refunds. This is `true` by default. """ @@ -123,15 +123,15 @@ class CreateParamsComponentsPayments(TypedDict): """ class CreateParamsComponentsPaymentsFeatures(TypedDict): - capture_payments: NotRequired["bool"] + capture_payments: NotRequired[bool] """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ - dispute_management: NotRequired["bool"] + dispute_management: NotRequired[bool] """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. """ - refund_management: NotRequired["bool"] + refund_management: NotRequired[bool] """ Whether to allow sending refunds. This is `true` by default. """ @@ -149,15 +149,15 @@ class CreateParamsComponentsPayouts(TypedDict): """ class CreateParamsComponentsPayoutsFeatures(TypedDict): - edit_payout_schedule: NotRequired["bool"] + edit_payout_schedule: NotRequired[bool] """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ - instant_payouts: NotRequired["bool"] + instant_payouts: NotRequired[bool] """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ - standard_payouts: NotRequired["bool"] + standard_payouts: NotRequired[bool] """ Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ diff --git a/stripe/_apple_pay_domain.py b/stripe/_apple_pay_domain.py index ac0370412..c7842441f 100644 --- a/stripe/_apple_pay_domain.py +++ b/stripe/_apple_pay_domain.py @@ -19,7 +19,7 @@ class ApplePayDomain( class CreateParams(RequestOptions): domain_name: str - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -28,26 +28,26 @@ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): - domain_name: NotRequired["str"] - ending_before: NotRequired["str"] + domain_name: NotRequired[str] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_apple_pay_domain_service.py b/stripe/_apple_pay_domain_service.py index bf413cf6e..007d2d679 100644 --- a/stripe/_apple_pay_domain_service.py +++ b/stripe/_apple_pay_domain_service.py @@ -12,7 +12,7 @@ class ApplePayDomainService(StripeService): class CreateParams(TypedDict): domain_name: str - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -21,26 +21,26 @@ class DeleteParams(TypedDict): pass class ListParams(TypedDict): - domain_name: NotRequired["str"] - ending_before: NotRequired["str"] + domain_name: NotRequired[str] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_application_fee.py b/stripe/_application_fee.py index 65edc18ca..fa20c5433 100644 --- a/stripe/_application_fee.py +++ b/stripe/_application_fee.py @@ -28,21 +28,21 @@ class ApplicationFee(ListableAPIResource["ApplicationFee"]): OBJECT_NAME: ClassVar[Literal["application_fee"]] = "application_fee" class CreateRefundParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ class ListParams(RequestOptions): - charge: NotRequired["str"] + charge: NotRequired[str] """ Only return application fees for the charge specified by this charge ID. """ @@ -50,61 +50,61 @@ class ListParams(RequestOptions): """ Only return applications fees that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListRefundsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ModifyRefundParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -114,27 +114,27 @@ class ModifyRefundParams(RequestOptions): """ class RefundParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveRefundParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_application_fee_refund_service.py b/stripe/_application_fee_refund_service.py index c1cb6c10e..d96a68514 100644 --- a/stripe/_application_fee_refund_service.py +++ b/stripe/_application_fee_refund_service.py @@ -11,45 +11,45 @@ class ApplicationFeeRefundService(StripeService): class CreateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_application_fee_service.py b/stripe/_application_fee_service.py index ec6097625..799fe1f6d 100644 --- a/stripe/_application_fee_service.py +++ b/stripe/_application_fee_service.py @@ -16,7 +16,7 @@ def __init__(self, requestor): self.refunds = ApplicationFeeRefundService(self._requestor) class ListParams(TypedDict): - charge: NotRequired["str"] + charge: NotRequired[str] """ Only return application fees for the charge specified by this charge ID. """ @@ -24,43 +24,43 @@ class ListParams(TypedDict): """ Only return applications fees that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_balance.py b/stripe/_balance.py index f110d15d0..3921d42f0 100644 --- a/stripe/_balance.py +++ b/stripe/_balance.py @@ -162,7 +162,7 @@ class SourceTypes(StripeObject): _inner_class_types = {"source_types": SourceTypes} class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_balance_service.py b/stripe/_balance_service.py index 18c7cc7b0..49780a444 100644 --- a/stripe/_balance_service.py +++ b/stripe/_balance_service.py @@ -9,7 +9,7 @@ class BalanceService(StripeService): class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_balance_transaction.py b/stripe/_balance_transaction.py index 2dcb2ef9b..d75d48b4d 100644 --- a/stripe/_balance_transaction.py +++ b/stripe/_balance_transaction.py @@ -75,59 +75,59 @@ class ListParams(RequestOptions): """ Only return transactions that were created during the given date interval. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Only return transactions in a certain currency. 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). """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payout: NotRequired["str"] + payout: NotRequired[str] """ For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID. """ - source: NotRequired["str"] + source: NotRequired[str] """ Only returns the original transaction. """ - starting_after: NotRequired["str"] + 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: NotRequired["str"] + type: NotRequired[str] """ Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_balance_transaction_service.py b/stripe/_balance_transaction_service.py index ad5eb2e90..2c0412f33 100644 --- a/stripe/_balance_transaction_service.py +++ b/stripe/_balance_transaction_service.py @@ -15,59 +15,59 @@ class ListParams(TypedDict): """ Only return transactions that were created during the given date interval. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Only return transactions in a certain currency. 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). """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payout: NotRequired["str"] + payout: NotRequired[str] """ For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID. """ - source: NotRequired["str"] + source: NotRequired[str] """ Only returns the original transaction. """ - starting_after: NotRequired["str"] + 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: NotRequired["str"] + type: NotRequired[str] """ Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_charge.py b/stripe/_charge.py index 535fea913..6e8c9bcc4 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1720,31 +1720,31 @@ class TransferData(StripeObject): """ class CaptureParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount to capture, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. """ - application_fee: NotRequired["int"] + application_fee: NotRequired[int] """ An application fee to add on to this charge. """ - application_fee_amount: NotRequired["int"] + application_fee_amount: NotRequired[int] """ An application fee amount to add on to this charge, which must be less than or equal to the original amount. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - receipt_email: NotRequired["str"] + receipt_email: NotRequired[str] """ The email address to send this charge's receipt to. This will override the previously-specified email address for this charge, if one was set. Receipts will not be sent in test mode. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ @@ -1752,45 +1752,45 @@ class CaptureParams(RequestOptions): """ An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ class CaptureParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. """ class CreateParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). """ - application_fee: NotRequired["int"] - application_fee_amount: NotRequired["int"] + application_fee: NotRequired[int] + application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). """ - capture: NotRequired["bool"] + capture: NotRequired[bool] """ Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of an existing customer that will be charged in this request. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to a `Charge` object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. """ destination: NotRequired["Charge.CreateParamsDestination"] - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1798,7 +1798,7 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). """ @@ -1806,7 +1806,7 @@ class CreateParams(RequestOptions): """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ - receipt_email: NotRequired["str"] + receipt_email: NotRequired[str] """ The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ @@ -1814,15 +1814,15 @@ class CreateParams(RequestOptions): """ Shipping information for the charge. Helps prevent fraud on charges for physical goods. """ - source: NotRequired["str"] + source: NotRequired[str] """ A payment source to be charged. This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ @@ -1830,7 +1830,7 @@ class CreateParams(RequestOptions): """ An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options). """ @@ -1840,13 +1840,13 @@ class CreateParamsDestination(TypedDict): """ ID of an existing, connected Stripe account. """ - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount to transfer to the destination account without creating an `Application Fee` object. Cannot be combined with the `application_fee` parameter. Must be less than or equal to the charge amount. """ class CreateParamsRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -1856,7 +1856,7 @@ class CreateParamsShipping(TypedDict): """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ @@ -1864,43 +1864,43 @@ class CreateParamsShipping(TypedDict): """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. """ @@ -1914,81 +1914,81 @@ class ListParams(RequestOptions): """ Only return charges that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return charges for the customer specified by this customer ID. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. """ - starting_after: NotRequired["str"] + 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. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ Only return charges for this transfer group. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListRefundsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ModifyParams(RequestOptions): - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -2000,7 +2000,7 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - receipt_email: NotRequired["str"] + receipt_email: NotRequired[str] """ This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address. """ @@ -2008,7 +2008,7 @@ class ModifyParams(RequestOptions): """ Shipping information for the charge. Helps prevent fraud on charges for physical goods. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ @@ -2024,7 +2024,7 @@ class ModifyParamsShipping(TypedDict): """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ @@ -2032,63 +2032,63 @@ class ModifyParamsShipping(TypedDict): """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class ModifyParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveRefundParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index 672df3981..33f157ede 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -12,31 +12,31 @@ class ChargeService(StripeService): class CaptureParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount to capture, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. """ - application_fee: NotRequired["int"] + application_fee: NotRequired[int] """ An application fee to add on to this charge. """ - application_fee_amount: NotRequired["int"] + application_fee_amount: NotRequired[int] """ An application fee amount to add on to this charge, which must be less than or equal to the original amount. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - receipt_email: NotRequired["str"] + receipt_email: NotRequired[str] """ The email address to send this charge's receipt to. This will override the previously-specified email address for this charge, if one was set. Receipts will not be sent in test mode. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ @@ -44,45 +44,45 @@ class CaptureParams(TypedDict): """ An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ class CaptureParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. """ class CreateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). """ - application_fee: NotRequired["int"] - application_fee_amount: NotRequired["int"] + application_fee: NotRequired[int] + application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). """ - capture: NotRequired["bool"] + capture: NotRequired[bool] """ Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of an existing customer that will be charged in this request. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to a `Charge` object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. """ destination: NotRequired["ChargeService.CreateParamsDestination"] - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -90,7 +90,7 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). """ @@ -98,7 +98,7 @@ class CreateParams(TypedDict): """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ - receipt_email: NotRequired["str"] + receipt_email: NotRequired[str] """ The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ @@ -106,15 +106,15 @@ class CreateParams(TypedDict): """ Shipping information for the charge. Helps prevent fraud on charges for physical goods. """ - source: NotRequired["str"] + source: NotRequired[str] """ A payment source to be charged. This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ @@ -122,7 +122,7 @@ class CreateParams(TypedDict): """ An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options). """ @@ -132,13 +132,13 @@ class CreateParamsDestination(TypedDict): """ ID of an existing, connected Stripe account. """ - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount to transfer to the destination account without creating an `Application Fee` object. Cannot be combined with the `application_fee` parameter. Must be less than or equal to the charge amount. """ class CreateParamsRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -148,7 +148,7 @@ class CreateParamsShipping(TypedDict): """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ @@ -156,43 +156,43 @@ class CreateParamsShipping(TypedDict): """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. """ @@ -206,69 +206,69 @@ class ListParams(TypedDict): """ Only return charges that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return charges for the customer specified by this customer ID. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. """ - starting_after: NotRequired["str"] + 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. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ Only return charges for this transfer group. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ @@ -278,15 +278,15 @@ class SearchParams(TypedDict): """ class UpdateParams(TypedDict): - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -298,7 +298,7 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - receipt_email: NotRequired["str"] + receipt_email: NotRequired[str] """ This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address. """ @@ -306,7 +306,7 @@ class UpdateParams(TypedDict): """ Shipping information for the charge. Helps prevent fraud on charges for physical goods. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ @@ -322,7 +322,7 @@ class UpdateParamsShipping(TypedDict): """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ @@ -330,37 +330,37 @@ class UpdateParamsShipping(TypedDict): """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class UpdateParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 723986260..db9f25f9c 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -1162,11 +1162,11 @@ class Address(StripeObject): _inner_class_types = {"address": Address} class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of an existing PaymentMethod. """ @@ -1176,11 +1176,11 @@ class CreateParams(RequestOptions): """ If provided, this hash will be used to create a PaymentMethod. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ Return URL used to confirm the Intent. """ - setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] + setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this ConfirmationToken's payment method. @@ -1314,7 +1314,7 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -1475,11 +1475,11 @@ class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -1508,27 +1508,27 @@ class CreateParamsPaymentMethodDataBillingDetails(TypedDict): """ class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -1550,14 +1550,43 @@ class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): class CreateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -1597,7 +1626,24 @@ class CreateParamsPaymentMethodDataGrabpay(TypedDict): class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -1642,7 +1688,34 @@ class CreateParamsPaymentMethodDataOxxo(TypedDict): class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -1661,7 +1734,7 @@ class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass class CreateParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -1685,23 +1758,23 @@ class CreateParamsPaymentMethodDataSwish(TypedDict): pass class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -1727,33 +1800,33 @@ class CreateParamsShipping(TypedDict): """ class CreateParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_confirmation_token_service.py b/stripe/_confirmation_token_service.py index 92a80564b..768ac0a2d 100644 --- a/stripe/_confirmation_token_service.py +++ b/stripe/_confirmation_token_service.py @@ -10,7 +10,7 @@ class ConfirmationTokenService(StripeService): class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_country_spec.py b/stripe/_country_spec.py index 6ca8a1433..94a861e99 100644 --- a/stripe/_country_spec.py +++ b/stripe/_country_spec.py @@ -46,25 +46,25 @@ class Individual(StripeObject): _inner_class_types = {"company": Company, "individual": Individual} class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_country_spec_service.py b/stripe/_country_spec_service.py index ecd6bf8a4..959a6a517 100644 --- a/stripe/_country_spec_service.py +++ b/stripe/_country_spec_service.py @@ -11,25 +11,25 @@ class CountrySpecService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_coupon.py b/stripe/_coupon.py index 65f565558..24573b5f8 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -39,7 +39,7 @@ class CurrencyOptions(StripeObject): """ class CreateParams(RequestOptions): - amount_off: NotRequired["int"] + amount_off: NotRequired[int] """ A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed). """ @@ -47,33 +47,33 @@ class CreateParams(RequestOptions): """ A hash containing directions for what this Coupon will apply discounts to. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed). """ currency_options: NotRequired[ - "Dict[str, Coupon.CreateParamsCurrencyOptions]" + Dict[str, "Coupon.CreateParamsCurrencyOptions"] ] """ Coupons defined in each available currency option (only supported if `amount_off` is passed). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ - duration: NotRequired["Literal['forever', 'once', 'repeating']"] + duration: NotRequired[Literal["forever", "once", "repeating"]] """ Specifies how long the discount will be in effect if used on a subscription. Defaults to `once`. """ - duration_in_months: NotRequired["int"] + duration_in_months: NotRequired[int] """ Required only if `duration` is `repeating`, in which case it must be a positive integer that specifies the number of months the discount will be in effect. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - id: NotRequired["str"] + id: NotRequired[str] """ Unique string of your choice that will be used to identify this coupon when applying it to a customer. If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you. """ - max_redemptions: NotRequired["int"] + max_redemptions: NotRequired[int] """ A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. For example, you might have a 50% off coupon that the first 20 readers of your blog can use. """ @@ -81,21 +81,21 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set. """ - percent_off: NotRequired["float"] + percent_off: NotRequired[float] """ A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if `amount_off` is not passed). """ - redeem_by: NotRequired["int"] + redeem_by: NotRequired[int] """ Unix timestamp specifying the last time at which the coupon can be redeemed. After the redeem_by date, the coupon can no longer be applied to new customers. """ class CreateParamsAppliesTo(TypedDict): - products: NotRequired["List[str]"] + products: NotRequired[List[str]] """ An array of Product IDs that this Coupon will apply to. """ @@ -114,49 +114,49 @@ class ListParams(RequestOptions): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): currency_options: NotRequired[ - "Dict[str, Coupon.ModifyParamsCurrencyOptions]" + Dict[str, "Coupon.ModifyParamsCurrencyOptions"] ] """ Coupons defined in each available currency option (only supported if the coupon is amount-based). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -164,7 +164,7 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set. """ @@ -176,7 +176,7 @@ class ModifyParamsCurrencyOptions(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_coupon_service.py b/stripe/_coupon_service.py index 4e9c79e73..b66efcae3 100644 --- a/stripe/_coupon_service.py +++ b/stripe/_coupon_service.py @@ -11,7 +11,7 @@ class CouponService(StripeService): class CreateParams(TypedDict): - amount_off: NotRequired["int"] + amount_off: NotRequired[int] """ A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed). """ @@ -19,33 +19,33 @@ class CreateParams(TypedDict): """ A hash containing directions for what this Coupon will apply discounts to. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed). """ currency_options: NotRequired[ - "Dict[str, CouponService.CreateParamsCurrencyOptions]" + Dict[str, "CouponService.CreateParamsCurrencyOptions"] ] """ Coupons defined in each available currency option (only supported if `amount_off` is passed). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ - duration: NotRequired["Literal['forever', 'once', 'repeating']"] + duration: NotRequired[Literal["forever", "once", "repeating"]] """ Specifies how long the discount will be in effect if used on a subscription. Defaults to `once`. """ - duration_in_months: NotRequired["int"] + duration_in_months: NotRequired[int] """ Required only if `duration` is `repeating`, in which case it must be a positive integer that specifies the number of months the discount will be in effect. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - id: NotRequired["str"] + id: NotRequired[str] """ Unique string of your choice that will be used to identify this coupon when applying it to a customer. If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you. """ - max_redemptions: NotRequired["int"] + max_redemptions: NotRequired[int] """ A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. For example, you might have a 50% off coupon that the first 20 readers of your blog can use. """ @@ -53,21 +53,21 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set. """ - percent_off: NotRequired["float"] + percent_off: NotRequired[float] """ A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if `amount_off` is not passed). """ - redeem_by: NotRequired["int"] + redeem_by: NotRequired[int] """ Unix timestamp specifying the last time at which the coupon can be redeemed. After the redeem_by date, the coupon can no longer be applied to new customers. """ class CreateParamsAppliesTo(TypedDict): - products: NotRequired["List[str]"] + products: NotRequired[List[str]] """ An array of Product IDs that this Coupon will apply to. """ @@ -86,55 +86,55 @@ class ListParams(TypedDict): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): currency_options: NotRequired[ - "Dict[str, CouponService.UpdateParamsCurrencyOptions]" + Dict[str, "CouponService.UpdateParamsCurrencyOptions"] ] """ Coupons defined in each available currency option (only supported if the coupon is amount-based). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -142,7 +142,7 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set. """ diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 0a257fa66..e5b672bfe 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -155,19 +155,19 @@ class TaxAmount(StripeObject): """ class CreateParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note. """ - credit_amount: NotRequired["int"] + credit_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. """ - effective_at: NotRequired["int"] + effective_at: NotRequired[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -175,33 +175,38 @@ class CreateParams(RequestOptions): """ ID of the invoice. """ - lines: NotRequired["List[CreditNote.CreateParamsLine]"] + lines: NotRequired[List["CreditNote.CreateParamsLine"]] """ Line items that make up the credit note. """ - memo: NotRequired["str"] + memo: NotRequired[str] """ The credit note's memo appears on the credit note PDF. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - out_of_band_amount: NotRequired["int"] + out_of_band_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ - "Literal['duplicate', 'fraudulent', 'order_change', 'product_unsatisfactory']" + Literal[ + "duplicate", + "fraudulent", + "order_change", + "product_unsatisfactory", + ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: NotRequired["str"] + refund: NotRequired[str] """ ID of an existing refund to link this credit note to. """ - refund_amount: NotRequired["int"] + refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ @@ -211,19 +216,19 @@ class CreateParams(RequestOptions): """ class CreateParamsLine(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The line item amount to credit. Only valid when `type` is `invoice_line_item`. """ - description: NotRequired["str"] + description: NotRequired[str] """ The description of the credit note line item. Only valid when the `type` is `custom_line_item`. """ - invoice_line_item: NotRequired["str"] + invoice_line_item: NotRequired[str] """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The line item quantity to credit. """ @@ -241,11 +246,11 @@ class CreateParamsLine(TypedDict): """ Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -265,25 +270,25 @@ class CreateParamsLineTaxAmount(TypedDict): """ class CreateParamsShippingCost(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ class ListLinesParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ @@ -293,81 +298,81 @@ class ListParams(RequestOptions): """ Only return credit notes that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return credit notes for the customer specified by this customer ID. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice: NotRequired["str"] + invoice: NotRequired[str] """ Only return credit notes for the invoice specified by this invoice ID. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - memo: NotRequired["str"] + memo: NotRequired[str] """ Credit note memo. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ class PreviewLinesParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note. """ - credit_amount: NotRequired["int"] + credit_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. """ - effective_at: NotRequired["int"] + effective_at: NotRequired[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -375,37 +380,42 @@ class PreviewLinesParams(RequestOptions): """ ID of the invoice. """ - limit: NotRequired["int"] + 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. """ - lines: NotRequired["List[CreditNote.PreviewLinesParamsLine]"] + lines: NotRequired[List["CreditNote.PreviewLinesParamsLine"]] """ Line items that make up the credit note. """ - memo: NotRequired["str"] + memo: NotRequired[str] """ The credit note's memo appears on the credit note PDF. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - out_of_band_amount: NotRequired["int"] + out_of_band_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ - "Literal['duplicate', 'fraudulent', 'order_change', 'product_unsatisfactory']" + Literal[ + "duplicate", + "fraudulent", + "order_change", + "product_unsatisfactory", + ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: NotRequired["str"] + refund: NotRequired[str] """ ID of an existing refund to link this credit note to. """ - refund_amount: NotRequired["int"] + refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ @@ -413,25 +423,25 @@ class PreviewLinesParams(RequestOptions): """ When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. """ - starting_after: NotRequired["str"] + 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. """ class PreviewLinesParamsLine(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The line item amount to credit. Only valid when `type` is `invoice_line_item`. """ - description: NotRequired["str"] + description: NotRequired[str] """ The description of the credit note line item. Only valid when the `type` is `custom_line_item`. """ - invoice_line_item: NotRequired["str"] + invoice_line_item: NotRequired[str] """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The line item quantity to credit. """ @@ -449,11 +459,11 @@ class PreviewLinesParamsLine(TypedDict): """ Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -473,25 +483,25 @@ class PreviewLinesParamsLineTaxAmount(TypedDict): """ class PreviewLinesParamsShippingCost(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ class PreviewParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note. """ - credit_amount: NotRequired["int"] + credit_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. """ - effective_at: NotRequired["int"] + effective_at: NotRequired[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -499,33 +509,38 @@ class PreviewParams(RequestOptions): """ ID of the invoice. """ - lines: NotRequired["List[CreditNote.PreviewParamsLine]"] + lines: NotRequired[List["CreditNote.PreviewParamsLine"]] """ Line items that make up the credit note. """ - memo: NotRequired["str"] + memo: NotRequired[str] """ The credit note's memo appears on the credit note PDF. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - out_of_band_amount: NotRequired["int"] + out_of_band_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ - "Literal['duplicate', 'fraudulent', 'order_change', 'product_unsatisfactory']" + Literal[ + "duplicate", + "fraudulent", + "order_change", + "product_unsatisfactory", + ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: NotRequired["str"] + refund: NotRequired[str] """ ID of an existing refund to link this credit note to. """ - refund_amount: NotRequired["int"] + refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ @@ -535,19 +550,19 @@ class PreviewParams(RequestOptions): """ class PreviewParamsLine(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The line item amount to credit. Only valid when `type` is `invoice_line_item`. """ - description: NotRequired["str"] + description: NotRequired[str] """ The description of the credit note line item. Only valid when the `type` is `custom_line_item`. """ - invoice_line_item: NotRequired["str"] + invoice_line_item: NotRequired[str] """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The line item quantity to credit. """ @@ -565,11 +580,11 @@ class PreviewParamsLine(TypedDict): """ Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -589,19 +604,19 @@ class PreviewParamsLineTaxAmount(TypedDict): """ class PreviewParamsShippingCost(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class VoidCreditNoteParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_credit_note_line_item_service.py b/stripe/_credit_note_line_item_service.py index 375a08746..53d4109a0 100644 --- a/stripe/_credit_note_line_item_service.py +++ b/stripe/_credit_note_line_item_service.py @@ -11,19 +11,19 @@ class CreditNoteLineItemService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ diff --git a/stripe/_credit_note_preview_lines_service.py b/stripe/_credit_note_preview_lines_service.py index 463a8238c..b2a4a73c0 100644 --- a/stripe/_credit_note_preview_lines_service.py +++ b/stripe/_credit_note_preview_lines_service.py @@ -10,23 +10,23 @@ class CreditNotePreviewLinesService(StripeService): class ListParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note. """ - credit_amount: NotRequired["int"] + credit_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. """ - effective_at: NotRequired["int"] + effective_at: NotRequired[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -34,39 +34,44 @@ class ListParams(TypedDict): """ ID of the invoice. """ - limit: NotRequired["int"] + 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. """ lines: NotRequired[ - "List[CreditNotePreviewLinesService.ListParamsLine]" + List["CreditNotePreviewLinesService.ListParamsLine"] ] """ Line items that make up the credit note. """ - memo: NotRequired["str"] + memo: NotRequired[str] """ The credit note's memo appears on the credit note PDF. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - out_of_band_amount: NotRequired["int"] + out_of_band_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ - "Literal['duplicate', 'fraudulent', 'order_change', 'product_unsatisfactory']" + Literal[ + "duplicate", + "fraudulent", + "order_change", + "product_unsatisfactory", + ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: NotRequired["str"] + refund: NotRequired[str] """ ID of an existing refund to link this credit note to. """ - refund_amount: NotRequired["int"] + refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ @@ -76,25 +81,25 @@ class ListParams(TypedDict): """ When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsLine(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The line item amount to credit. Only valid when `type` is `invoice_line_item`. """ - description: NotRequired["str"] + description: NotRequired[str] """ The description of the credit note line item. Only valid when the `type` is `custom_line_item`. """ - invoice_line_item: NotRequired["str"] + invoice_line_item: NotRequired[str] """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The line item quantity to credit. """ @@ -112,11 +117,11 @@ class ListParamsLine(TypedDict): """ Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -136,7 +141,7 @@ class ListParamsLineTaxAmount(TypedDict): """ class ListParamsShippingCost(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index 389fff7e4..92210819d 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -20,19 +20,19 @@ def __init__(self, requestor): self.preview_lines = CreditNotePreviewLinesService(self._requestor) class CreateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note. """ - credit_amount: NotRequired["int"] + credit_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. """ - effective_at: NotRequired["int"] + effective_at: NotRequired[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -40,33 +40,38 @@ class CreateParams(TypedDict): """ ID of the invoice. """ - lines: NotRequired["List[CreditNoteService.CreateParamsLine]"] + lines: NotRequired[List["CreditNoteService.CreateParamsLine"]] """ Line items that make up the credit note. """ - memo: NotRequired["str"] + memo: NotRequired[str] """ The credit note's memo appears on the credit note PDF. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - out_of_band_amount: NotRequired["int"] + out_of_band_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ - "Literal['duplicate', 'fraudulent', 'order_change', 'product_unsatisfactory']" + Literal[ + "duplicate", + "fraudulent", + "order_change", + "product_unsatisfactory", + ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: NotRequired["str"] + refund: NotRequired[str] """ ID of an existing refund to link this credit note to. """ - refund_amount: NotRequired["int"] + refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ @@ -78,19 +83,19 @@ class CreateParams(TypedDict): """ class CreateParamsLine(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The line item amount to credit. Only valid when `type` is `invoice_line_item`. """ - description: NotRequired["str"] + description: NotRequired[str] """ The description of the credit note line item. Only valid when the `type` is `custom_line_item`. """ - invoice_line_item: NotRequired["str"] + invoice_line_item: NotRequired[str] """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The line item quantity to credit. """ @@ -108,11 +113,11 @@ class CreateParamsLine(TypedDict): """ Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -132,7 +137,7 @@ class CreateParamsLineTaxAmount(TypedDict): """ class CreateParamsShippingCost(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ @@ -142,63 +147,63 @@ class ListParams(TypedDict): """ Only return credit notes that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return credit notes for the customer specified by this customer ID. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice: NotRequired["str"] + invoice: NotRequired[str] """ Only return credit notes for the invoice specified by this invoice ID. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class PreviewParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note. """ - credit_amount: NotRequired["int"] + credit_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. """ - effective_at: NotRequired["int"] + effective_at: NotRequired[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -206,33 +211,38 @@ class PreviewParams(TypedDict): """ ID of the invoice. """ - lines: NotRequired["List[CreditNoteService.PreviewParamsLine]"] + lines: NotRequired[List["CreditNoteService.PreviewParamsLine"]] """ Line items that make up the credit note. """ - memo: NotRequired["str"] + memo: NotRequired[str] """ The credit note's memo appears on the credit note PDF. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - out_of_band_amount: NotRequired["int"] + out_of_band_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ - "Literal['duplicate', 'fraudulent', 'order_change', 'product_unsatisfactory']" + Literal[ + "duplicate", + "fraudulent", + "order_change", + "product_unsatisfactory", + ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: NotRequired["str"] + refund: NotRequired[str] """ ID of an existing refund to link this credit note to. """ - refund_amount: NotRequired["int"] + refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ @@ -244,19 +254,19 @@ class PreviewParams(TypedDict): """ class PreviewParamsLine(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The line item amount to credit. Only valid when `type` is `invoice_line_item`. """ - description: NotRequired["str"] + description: NotRequired[str] """ The description of the credit note line item. Only valid when the `type` is `custom_line_item`. """ - invoice_line_item: NotRequired["str"] + invoice_line_item: NotRequired[str] """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The line item quantity to credit. """ @@ -274,11 +284,11 @@ class PreviewParamsLine(TypedDict): """ Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -298,33 +308,33 @@ class PreviewParamsLineTaxAmount(TypedDict): """ class PreviewParamsShippingCost(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - memo: NotRequired["str"] + memo: NotRequired[str] """ Credit note memo. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ class VoidCreditNoteParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_customer.py b/stripe/_customer.py index 95dfe9190..9ae66eeb7 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -224,11 +224,11 @@ class CreateBalanceTransactionParams(RequestOptions): """ 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). Specifies the [`invoice_credit_balance`](https://stripe.com/docs/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -246,7 +246,7 @@ class CreateFundingInstructionsParams(RequestOptions): """ 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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -263,7 +263,7 @@ class CreateFundingInstructionsParamsBankTransfer(TypedDict): Configuration for eu_bank_transfer funding type. """ requested_address_types: NotRequired[ - "List[Literal['iban', 'sort_code', 'spei', 'zengin']]" + List[Literal["iban", "sort_code", "spei", "zengin"]] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. @@ -292,7 +292,7 @@ class CreateParams(RequestOptions): """ The customer's address. """ - balance: NotRequired["int"] + balance: NotRequired[int] """ An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. """ @@ -300,20 +300,20 @@ class CreateParams(RequestOptions): """ Balance information and default balance settings for this customer. """ - coupon: NotRequired["str"] - description: NotRequired["str"] + coupon: NotRequired[str] + description: NotRequired[str] """ An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. """ - email: NotRequired["str"] + email: NotRequired[str] """ Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice_prefix: NotRequired["str"] + invoice_prefix: NotRequired[str] """ The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. """ @@ -325,24 +325,24 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ The customer's full name or business name. """ - next_invoice_sequence: NotRequired["int"] + next_invoice_sequence: NotRequired[int] """ The sequence to be used on the customer's next invoice. Defaults to 1. """ - payment_method: NotRequired["str"] - phone: NotRequired["str"] + payment_method: NotRequired[str] + phone: NotRequired[str] """ The customer's phone number. """ - preferred_locales: NotRequired["List[str]"] + preferred_locales: NotRequired[List[str]] """ Customer's preferred languages, ordered by preference. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. """ @@ -350,7 +350,7 @@ class CreateParams(RequestOptions): """ The customer's shipping information. Appears on invoices emailed to this customer. """ - source: NotRequired["str"] + source: NotRequired[str] tax: NotRequired["Customer.CreateParamsTax"] """ Tax details about the customer. @@ -361,38 +361,38 @@ class CreateParams(RequestOptions): """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ - tax_id_data: NotRequired["List[Customer.CreateParamsTaxIdDatum]"] + tax_id_data: NotRequired[List["Customer.CreateParamsTaxIdDatum"]] """ The customer's tax IDs. """ - test_clock: NotRequired["str"] + test_clock: NotRequired[str] """ ID of the test clock to attach to the customer. """ - validate: NotRequired["bool"] + validate: NotRequired[bool] class CreateParamsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -406,7 +406,7 @@ class CreateParamsCashBalance(TypedDict): class CreateParamsCashBalanceSettings(TypedDict): reconciliation_mode: NotRequired[ - "Literal['automatic', 'manual', 'merchant_default']" + Literal["automatic", "manual", "merchant_default"] ] """ Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic`, `manual`, or `merchant_default`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). @@ -419,11 +419,11 @@ class CreateParamsInvoiceSettings(TypedDict): """ The list of up to 4 default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ @@ -461,33 +461,33 @@ class CreateParamsShipping(TypedDict): """ Customer name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Customer phone (including extension). """ class CreateParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -497,7 +497,7 @@ class CreateParamsTax(TypedDict): """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ - validate_location: NotRequired["Literal['deferred', 'immediately']"] + validate_location: NotRequired[Literal["deferred", "immediately"]] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. """ @@ -581,11 +581,11 @@ class CreateParamsTaxIdDatum(TypedDict): """ class CreateSourceParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -593,10 +593,10 @@ class CreateSourceParams(RequestOptions): """ Please refer to full [documentation](https://stripe.com/docs/api) instead. """ - validate: NotRequired["bool"] + validate: NotRequired[bool] class CreateTaxIdParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -684,7 +684,7 @@ class DeleteParams(RequestOptions): pass class DeleteSourceParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -701,47 +701,47 @@ class FundCashBalanceParams(RequestOptions): """ 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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A description of the test funding. This simulates free-text references supplied by customers when making bank transfers to their cash balance. You can use this to test how Stripe's [reconciliation algorithm](https://stripe.com/docs/payments/customer-balance/reconciliation) applies to different user inputs. """ class ListBalanceTransactionsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListCashBalanceTransactionsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ @@ -751,119 +751,154 @@ class ListParams(RequestOptions): """ Only return customers that were created during the given date interval. """ - email: NotRequired["str"] + email: NotRequired[str] """ A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ - test_clock: NotRequired["str"] + test_clock: NotRequired[str] """ Provides a list of customers that are associated with the specified test clock. The response will not include customers with test clocks if this parameter is not set. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListPaymentMethodsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "card", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "mobilepay", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "revolut_pay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + "zip", + ] ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. """ class ListSourcesParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - object: NotRequired["str"] + object: NotRequired[str] """ Filter sources according to a particular object type. """ - starting_after: NotRequired["str"] + 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. """ class ListTaxIdsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ModifyBalanceTransactionParams(RequestOptions): - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -873,7 +908,7 @@ class ModifyBalanceTransactionParams(RequestOptions): """ class ModifyCashBalanceParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -884,7 +919,7 @@ class ModifyCashBalanceParams(RequestOptions): class ModifyCashBalanceParamsSettings(TypedDict): reconciliation_mode: NotRequired[ - "Literal['automatic', 'manual', 'merchant_default']" + Literal["automatic", "manual", "merchant_default"] ] """ Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic`, `manual`, or `merchant_default`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). @@ -895,7 +930,7 @@ class ModifyParams(RequestOptions): """ The customer's address. """ - balance: NotRequired["int"] + balance: NotRequired[int] """ An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. """ @@ -903,8 +938,8 @@ class ModifyParams(RequestOptions): """ Balance information and default balance settings for this customer. """ - coupon: NotRequired["str"] - default_source: NotRequired["str"] + coupon: NotRequired[str] + default_source: NotRequired[str] """ If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. @@ -912,19 +947,19 @@ class ModifyParams(RequestOptions): If you want to add a new payment source and make it the default, see the [source](https://stripe.com/docs/api/customers/update#update_customer-source) property. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. """ - email: NotRequired["str"] + email: NotRequired[str] """ Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice_prefix: NotRequired["str"] + invoice_prefix: NotRequired[str] """ The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. """ @@ -936,23 +971,23 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ The customer's full name or business name. """ - next_invoice_sequence: NotRequired["int"] + next_invoice_sequence: NotRequired[int] """ The sequence to be used on the customer's next invoice. Defaults to 1. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The customer's phone number. """ - preferred_locales: NotRequired["List[str]"] + preferred_locales: NotRequired[List[str]] """ Customer's preferred languages, ordered by preference. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. """ @@ -960,7 +995,7 @@ class ModifyParams(RequestOptions): """ The customer's shipping information. Appears on invoices emailed to this customer. """ - source: NotRequired["str"] + source: NotRequired[str] tax: NotRequired["Customer.ModifyParamsTax"] """ Tax details about the customer. @@ -971,30 +1006,30 @@ class ModifyParams(RequestOptions): """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ - validate: NotRequired["bool"] + validate: NotRequired[bool] class ModifyParamsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -1008,7 +1043,7 @@ class ModifyParamsCashBalance(TypedDict): class ModifyParamsCashBalanceSettings(TypedDict): reconciliation_mode: NotRequired[ - "Literal['automatic', 'manual', 'merchant_default']" + Literal["automatic", "manual", "merchant_default"] ] """ Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic`, `manual`, or `merchant_default`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). @@ -1021,11 +1056,11 @@ class ModifyParamsInvoiceSettings(TypedDict): """ The list of up to 4 default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ @@ -1063,33 +1098,33 @@ class ModifyParamsShipping(TypedDict): """ Customer name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Customer phone (including extension). """ class ModifyParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -1099,53 +1134,53 @@ class ModifyParamsTax(TypedDict): """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ - validate_location: NotRequired["Literal['deferred', 'immediately']"] + validate_location: NotRequired[Literal["deferred", "immediately"]] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. """ class ModifySourceParams(RequestOptions): - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account. """ - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. This can be either `individual` or `company`. """ - address_city: NotRequired["str"] + address_city: NotRequired[str] """ City/District/Suburb/Town/Village. """ - address_country: NotRequired["str"] + address_country: NotRequired[str] """ Billing address country, if provided when creating card. """ - address_line1: NotRequired["str"] + address_line1: NotRequired[str] """ Address line 1 (Street address/PO Box/Company name). """ - address_line2: NotRequired["str"] + address_line2: NotRequired[str] """ Address line 2 (Apartment/Suite/Unit/Building). """ - address_state: NotRequired["str"] + address_state: NotRequired[str] """ State/County/Province/Region. """ - address_zip: NotRequired["str"] + address_zip: NotRequired[str] """ ZIP or postal code. """ - exp_month: NotRequired["str"] + exp_month: NotRequired[str] """ Two digit number representing the card's expiration month. """ - exp_year: NotRequired["str"] + exp_year: NotRequired[str] """ Four digit number representing the card's expiration year. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1153,7 +1188,7 @@ class ModifySourceParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ Cardholder name. """ @@ -1164,97 +1199,97 @@ class ModifySourceParamsOwner(TypedDict): """ Owner's address. """ - email: NotRequired["str"] + email: NotRequired[str] """ Owner's email address. """ - name: NotRequired["str"] + name: NotRequired[str] """ Owner's full name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Owner's phone number. """ class ModifySourceParamsOwnerAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class RetrieveBalanceTransactionParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveCashBalanceParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveCashBalanceTransactionParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrievePaymentMethodParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveSourceParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveTaxIdParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ diff --git a/stripe/_customer_balance_transaction_service.py b/stripe/_customer_balance_transaction_service.py index ce8948daf..8f03d1edf 100644 --- a/stripe/_customer_balance_transaction_service.py +++ b/stripe/_customer_balance_transaction_service.py @@ -19,11 +19,11 @@ class CreateParams(TypedDict): """ 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). Specifies the [`invoice_credit_balance`](https://stripe.com/docs/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -33,35 +33,35 @@ class CreateParams(TypedDict): """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_customer_cash_balance_service.py b/stripe/_customer_cash_balance_service.py index 86c73a7f9..7c6640e8b 100644 --- a/stripe/_customer_cash_balance_service.py +++ b/stripe/_customer_cash_balance_service.py @@ -10,13 +10,13 @@ class CustomerCashBalanceService(StripeService): class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -29,7 +29,7 @@ class UpdateParams(TypedDict): class UpdateParamsSettings(TypedDict): reconciliation_mode: NotRequired[ - "Literal['automatic', 'manual', 'merchant_default']" + Literal["automatic", "manual", "merchant_default"] ] """ Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic`, `manual`, or `merchant_default`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). diff --git a/stripe/_customer_cash_balance_transaction_service.py b/stripe/_customer_cash_balance_transaction_service.py index a7dcb76c3..eef64ebd4 100644 --- a/stripe/_customer_cash_balance_transaction_service.py +++ b/stripe/_customer_cash_balance_transaction_service.py @@ -13,25 +13,25 @@ class CustomerCashBalanceTransactionService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_customer_funding_instructions_service.py b/stripe/_customer_funding_instructions_service.py index 9a59012f7..3085eb0aa 100644 --- a/stripe/_customer_funding_instructions_service.py +++ b/stripe/_customer_funding_instructions_service.py @@ -18,7 +18,7 @@ class CreateParams(TypedDict): """ 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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -35,7 +35,7 @@ class CreateParamsBankTransfer(TypedDict): Configuration for eu_bank_transfer funding type. """ requested_address_types: NotRequired[ - "List[Literal['iban', 'sort_code', 'spei', 'zengin']]" + List[Literal["iban", "sort_code", "spei", "zengin"]] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 83cfa1712..fd13c63dc 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -11,31 +11,66 @@ class CustomerPaymentMethodService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "card", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "mobilepay", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "revolut_pay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + "zip", + ] ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_customer_payment_source_service.py b/stripe/_customer_payment_source_service.py index 99f1bce29..6be1c22a4 100644 --- a/stripe/_customer_payment_source_service.py +++ b/stripe/_customer_payment_source_service.py @@ -14,11 +14,11 @@ class CustomerPaymentSourceService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -26,84 +26,84 @@ class CreateParams(TypedDict): """ Please refer to full [documentation](https://stripe.com/docs/api) instead. """ - validate: NotRequired["bool"] + validate: NotRequired[bool] class DeleteParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - object: NotRequired["str"] + object: NotRequired[str] """ Filter sources according to a particular object type. """ - starting_after: NotRequired["str"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account. """ - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. This can be either `individual` or `company`. """ - address_city: NotRequired["str"] + address_city: NotRequired[str] """ City/District/Suburb/Town/Village. """ - address_country: NotRequired["str"] + address_country: NotRequired[str] """ Billing address country, if provided when creating card. """ - address_line1: NotRequired["str"] + address_line1: NotRequired[str] """ Address line 1 (Street address/PO Box/Company name). """ - address_line2: NotRequired["str"] + address_line2: NotRequired[str] """ Address line 2 (Apartment/Suite/Unit/Building). """ - address_state: NotRequired["str"] + address_state: NotRequired[str] """ State/County/Province/Region. """ - address_zip: NotRequired["str"] + address_zip: NotRequired[str] """ ZIP or postal code. """ - exp_month: NotRequired["str"] + exp_month: NotRequired[str] """ Two digit number representing the card's expiration month. """ - exp_year: NotRequired["str"] + exp_year: NotRequired[str] """ Four digit number representing the card's expiration year. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -111,7 +111,7 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ Cardholder name. """ @@ -124,51 +124,51 @@ class UpdateParamsOwner(TypedDict): """ Owner's address. """ - email: NotRequired["str"] + email: NotRequired[str] """ Owner's email address. """ - name: NotRequired["str"] + name: NotRequired[str] """ Owner's full name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Owner's phone number. """ class UpdateParamsOwnerAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class VerifyParams(TypedDict): - amounts: NotRequired["List[int]"] + amounts: NotRequired[List[int]] """ Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 20b93bc53..ec9fbb6c9 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -50,7 +50,7 @@ class CreateParams(TypedDict): """ The customer's address. """ - balance: NotRequired["int"] + balance: NotRequired[int] """ An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. """ @@ -58,20 +58,20 @@ class CreateParams(TypedDict): """ Balance information and default balance settings for this customer. """ - coupon: NotRequired["str"] - description: NotRequired["str"] + coupon: NotRequired[str] + description: NotRequired[str] """ An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. """ - email: NotRequired["str"] + email: NotRequired[str] """ Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice_prefix: NotRequired["str"] + invoice_prefix: NotRequired[str] """ The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. """ @@ -85,24 +85,24 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ The customer's full name or business name. """ - next_invoice_sequence: NotRequired["int"] + next_invoice_sequence: NotRequired[int] """ The sequence to be used on the customer's next invoice. Defaults to 1. """ - payment_method: NotRequired["str"] - phone: NotRequired["str"] + payment_method: NotRequired[str] + phone: NotRequired[str] """ The customer's phone number. """ - preferred_locales: NotRequired["List[str]"] + preferred_locales: NotRequired[List[str]] """ Customer's preferred languages, ordered by preference. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. """ @@ -112,7 +112,7 @@ class CreateParams(TypedDict): """ The customer's shipping information. Appears on invoices emailed to this customer. """ - source: NotRequired["str"] + source: NotRequired[str] tax: NotRequired["CustomerService.CreateParamsTax"] """ Tax details about the customer. @@ -124,39 +124,39 @@ class CreateParams(TypedDict): The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_id_data: NotRequired[ - "List[CustomerService.CreateParamsTaxIdDatum]" + List["CustomerService.CreateParamsTaxIdDatum"] ] """ The customer's tax IDs. """ - test_clock: NotRequired["str"] + test_clock: NotRequired[str] """ ID of the test clock to attach to the customer. """ - validate: NotRequired["bool"] + validate: NotRequired[bool] class CreateParamsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -172,7 +172,7 @@ class CreateParamsCashBalance(TypedDict): class CreateParamsCashBalanceSettings(TypedDict): reconciliation_mode: NotRequired[ - "Literal['automatic', 'manual', 'merchant_default']" + Literal["automatic", "manual", "merchant_default"] ] """ Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic`, `manual`, or `merchant_default`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). @@ -185,11 +185,11 @@ class CreateParamsInvoiceSettings(TypedDict): """ The list of up to 4 default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ @@ -227,33 +227,33 @@ class CreateParamsShipping(TypedDict): """ Customer name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Customer phone (including extension). """ class CreateParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -263,7 +263,7 @@ class CreateParamsTax(TypedDict): """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ - validate_location: NotRequired["Literal['deferred', 'immediately']"] + validate_location: NotRequired[Literal["deferred", "immediately"]] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. """ @@ -357,65 +357,65 @@ class ListParams(TypedDict): """ Only return customers that were created during the given date interval. """ - email: NotRequired["str"] + email: NotRequired[str] """ A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ - test_clock: NotRequired["str"] + test_clock: NotRequired[str] """ Provides a list of customers that are associated with the specified test clock. The response will not include customers with test clocks if this parameter is not set. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ @@ -429,7 +429,7 @@ class UpdateParams(TypedDict): """ The customer's address. """ - balance: NotRequired["int"] + balance: NotRequired[int] """ An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. """ @@ -437,8 +437,8 @@ class UpdateParams(TypedDict): """ Balance information and default balance settings for this customer. """ - coupon: NotRequired["str"] - default_source: NotRequired["str"] + coupon: NotRequired[str] + default_source: NotRequired[str] """ If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. @@ -446,19 +446,19 @@ class UpdateParams(TypedDict): If you want to add a new payment source and make it the default, see the [source](https://stripe.com/docs/api/customers/update#update_customer-source) property. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. """ - email: NotRequired["str"] + email: NotRequired[str] """ Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice_prefix: NotRequired["str"] + invoice_prefix: NotRequired[str] """ The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. """ @@ -472,23 +472,23 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ The customer's full name or business name. """ - next_invoice_sequence: NotRequired["int"] + next_invoice_sequence: NotRequired[int] """ The sequence to be used on the customer's next invoice. Defaults to 1. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The customer's phone number. """ - preferred_locales: NotRequired["List[str]"] + preferred_locales: NotRequired[List[str]] """ Customer's preferred languages, ordered by preference. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. """ @@ -498,7 +498,7 @@ class UpdateParams(TypedDict): """ The customer's shipping information. Appears on invoices emailed to this customer. """ - source: NotRequired["str"] + source: NotRequired[str] tax: NotRequired["CustomerService.UpdateParamsTax"] """ Tax details about the customer. @@ -509,30 +509,30 @@ class UpdateParams(TypedDict): """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ - validate: NotRequired["bool"] + validate: NotRequired[bool] class UpdateParamsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -548,7 +548,7 @@ class UpdateParamsCashBalance(TypedDict): class UpdateParamsCashBalanceSettings(TypedDict): reconciliation_mode: NotRequired[ - "Literal['automatic', 'manual', 'merchant_default']" + Literal["automatic", "manual", "merchant_default"] ] """ Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic`, `manual`, or `merchant_default`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). @@ -561,11 +561,11 @@ class UpdateParamsInvoiceSettings(TypedDict): """ The list of up to 4 default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ @@ -603,33 +603,33 @@ class UpdateParamsShipping(TypedDict): """ Customer name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Customer phone (including extension). """ class UpdateParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -639,7 +639,7 @@ class UpdateParamsTax(TypedDict): """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ - validate_location: NotRequired["Literal['deferred', 'immediately']"] + validate_location: NotRequired[Literal["deferred", "immediately"]] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. """ diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index 23c33399c..b91f74a20 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -60,7 +60,7 @@ class CreateParams(RequestOptions): """ The ID of an existing customer for which to create the customer session. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_customer_session_service.py b/stripe/_customer_session_service.py index a9ee4bd50..0658ceba0 100644 --- a/stripe/_customer_session_service.py +++ b/stripe/_customer_session_service.py @@ -17,7 +17,7 @@ class CreateParams(TypedDict): """ The ID of an existing customer for which to create the customer session. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index 839c6c2fc..6f9e9114c 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -11,7 +11,7 @@ class CustomerTaxIdService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -96,25 +96,25 @@ class DeleteParams(TypedDict): pass class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_dispute.py b/stripe/_dispute.py index 4ecc4236e..9e8aac29d 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -186,52 +186,52 @@ class Card(StripeObject): _inner_class_types = {"card": Card} class CloseParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): - charge: NotRequired["str"] + charge: NotRequired[str] """ Only return disputes associated to the charge specified by this charge ID. """ created: NotRequired["Dispute.ListParamsCreated|int"] - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ Only return disputes associated to the PaymentIntent specified by this PaymentIntent ID. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ @@ -241,7 +241,7 @@ class ModifyParams(RequestOptions): """ Evidence to upload, to respond to a dispute. Updating any field in the hash will submit all fields in the hash for review. The combined character count of all fields is limited to 150,000. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -249,123 +249,123 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - submit: NotRequired["bool"] + submit: NotRequired[bool] """ Whether to immediately submit evidence to the bank. If `false`, evidence is staged on the dispute. Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default). """ class ModifyParamsEvidence(TypedDict): - access_activity_log: NotRequired["str"] + access_activity_log: NotRequired[str] """ Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. Has a maximum character count of 20,000. """ - billing_address: NotRequired["str"] + billing_address: NotRequired[str] """ The billing address provided by the customer. """ - cancellation_policy: NotRequired["str"] + cancellation_policy: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. """ - cancellation_policy_disclosure: NotRequired["str"] + cancellation_policy_disclosure: NotRequired[str] """ An explanation of how and when the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000. """ - cancellation_rebuttal: NotRequired["str"] + cancellation_rebuttal: NotRequired[str] """ A justification for why the customer's subscription was not canceled. Has a maximum character count of 20,000. """ - customer_communication: NotRequired["str"] + customer_communication: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. """ - customer_email_address: NotRequired["str"] + customer_email_address: NotRequired[str] """ The email address of the customer. """ - customer_name: NotRequired["str"] + customer_name: NotRequired[str] """ The name of the customer. """ - customer_purchase_ip: NotRequired["str"] + customer_purchase_ip: NotRequired[str] """ The IP address that the customer used when making the purchase. """ - customer_signature: NotRequired["str"] + customer_signature: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. """ - duplicate_charge_documentation: NotRequired["str"] + duplicate_charge_documentation: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. This document should be paired with a similar document from the disputed payment that proves the two payments are separate. """ - duplicate_charge_explanation: NotRequired["str"] + duplicate_charge_explanation: NotRequired[str] """ An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. Has a maximum character count of 20,000. """ - duplicate_charge_id: NotRequired["str"] + duplicate_charge_id: NotRequired[str] """ The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. """ - product_description: NotRequired["str"] + product_description: NotRequired[str] """ A description of the product or service that was sold. Has a maximum character count of 20,000. """ - receipt: NotRequired["str"] + receipt: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. """ - refund_policy: NotRequired["str"] + refund_policy: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. """ - refund_policy_disclosure: NotRequired["str"] + refund_policy_disclosure: NotRequired[str] """ Documentation demonstrating that the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000. """ - refund_refusal_explanation: NotRequired["str"] + refund_refusal_explanation: NotRequired[str] """ A justification for why the customer is not entitled to a refund. Has a maximum character count of 20,000. """ - service_date: NotRequired["str"] + service_date: NotRequired[str] """ The date on which the customer received or began receiving the purchased service, in a clear human-readable format. """ - service_documentation: NotRequired["str"] + service_documentation: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. This could include a copy of a signed contract, work order, or other form of written agreement. """ - shipping_address: NotRequired["str"] + shipping_address: NotRequired[str] """ The address to which a physical product was shipped. You should try to include as complete address information as possible. """ - shipping_carrier: NotRequired["str"] + shipping_carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. If multiple carriers were used for this purchase, please separate them with commas. """ - shipping_date: NotRequired["str"] + shipping_date: NotRequired[str] """ The date on which a physical product began its route to the shipping address, in a clear human-readable format. """ - shipping_documentation: NotRequired["str"] + shipping_documentation: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. This could include a copy of the shipment receipt, shipping label, etc. It should show the customer's full shipping address, if possible. """ - shipping_tracking_number: NotRequired["str"] + shipping_tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ - uncategorized_file: NotRequired["str"] + uncategorized_file: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. """ - uncategorized_text: NotRequired["str"] + uncategorized_text: NotRequired[str] """ Any additional evidence or statements. Has a maximum character count of 20,000. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_dispute_service.py b/stripe/_dispute_service.py index 991a04d61..b586cfa6f 100644 --- a/stripe/_dispute_service.py +++ b/stripe/_dispute_service.py @@ -11,58 +11,58 @@ class DisputeService(StripeService): class CloseParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): - charge: NotRequired["str"] + charge: NotRequired[str] """ Only return disputes associated to the charge specified by this charge ID. """ created: NotRequired["DisputeService.ListParamsCreated|int"] - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ Only return disputes associated to the PaymentIntent specified by this PaymentIntent ID. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -72,7 +72,7 @@ class UpdateParams(TypedDict): """ Evidence to upload, to respond to a dispute. Updating any field in the hash will submit all fields in the hash for review. The combined character count of all fields is limited to 150,000. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -80,117 +80,117 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - submit: NotRequired["bool"] + submit: NotRequired[bool] """ Whether to immediately submit evidence to the bank. If `false`, evidence is staged on the dispute. Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default). """ class UpdateParamsEvidence(TypedDict): - access_activity_log: NotRequired["str"] + access_activity_log: NotRequired[str] """ Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. Has a maximum character count of 20,000. """ - billing_address: NotRequired["str"] + billing_address: NotRequired[str] """ The billing address provided by the customer. """ - cancellation_policy: NotRequired["str"] + cancellation_policy: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. """ - cancellation_policy_disclosure: NotRequired["str"] + cancellation_policy_disclosure: NotRequired[str] """ An explanation of how and when the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000. """ - cancellation_rebuttal: NotRequired["str"] + cancellation_rebuttal: NotRequired[str] """ A justification for why the customer's subscription was not canceled. Has a maximum character count of 20,000. """ - customer_communication: NotRequired["str"] + customer_communication: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. """ - customer_email_address: NotRequired["str"] + customer_email_address: NotRequired[str] """ The email address of the customer. """ - customer_name: NotRequired["str"] + customer_name: NotRequired[str] """ The name of the customer. """ - customer_purchase_ip: NotRequired["str"] + customer_purchase_ip: NotRequired[str] """ The IP address that the customer used when making the purchase. """ - customer_signature: NotRequired["str"] + customer_signature: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. """ - duplicate_charge_documentation: NotRequired["str"] + duplicate_charge_documentation: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. This document should be paired with a similar document from the disputed payment that proves the two payments are separate. """ - duplicate_charge_explanation: NotRequired["str"] + duplicate_charge_explanation: NotRequired[str] """ An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. Has a maximum character count of 20,000. """ - duplicate_charge_id: NotRequired["str"] + duplicate_charge_id: NotRequired[str] """ The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. """ - product_description: NotRequired["str"] + product_description: NotRequired[str] """ A description of the product or service that was sold. Has a maximum character count of 20,000. """ - receipt: NotRequired["str"] + receipt: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. """ - refund_policy: NotRequired["str"] + refund_policy: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. """ - refund_policy_disclosure: NotRequired["str"] + refund_policy_disclosure: NotRequired[str] """ Documentation demonstrating that the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000. """ - refund_refusal_explanation: NotRequired["str"] + refund_refusal_explanation: NotRequired[str] """ A justification for why the customer is not entitled to a refund. Has a maximum character count of 20,000. """ - service_date: NotRequired["str"] + service_date: NotRequired[str] """ The date on which the customer received or began receiving the purchased service, in a clear human-readable format. """ - service_documentation: NotRequired["str"] + service_documentation: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. This could include a copy of a signed contract, work order, or other form of written agreement. """ - shipping_address: NotRequired["str"] + shipping_address: NotRequired[str] """ The address to which a physical product was shipped. You should try to include as complete address information as possible. """ - shipping_carrier: NotRequired["str"] + shipping_carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. If multiple carriers were used for this purchase, please separate them with commas. """ - shipping_date: NotRequired["str"] + shipping_date: NotRequired[str] """ The date on which a physical product began its route to the shipping address, in a clear human-readable format. """ - shipping_documentation: NotRequired["str"] + shipping_documentation: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. This could include a copy of the shipment receipt, shipping label, etc. It should show the customer's full shipping address, if possible. """ - shipping_tracking_number: NotRequired["str"] + shipping_tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ - uncategorized_file: NotRequired["str"] + uncategorized_file: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. """ - uncategorized_text: NotRequired["str"] + uncategorized_text: NotRequired[str] """ Any additional evidence or statements. Has a maximum character count of 20,000. """ diff --git a/stripe/_ephemeral_key.py b/stripe/_ephemeral_key.py index 581912159..26a6acf0a 100644 --- a/stripe/_ephemeral_key.py +++ b/stripe/_ephemeral_key.py @@ -15,7 +15,7 @@ class EphemeralKey( OBJECT_NAME: ClassVar[Literal["ephemeral_key"]] = "ephemeral_key" class DeleteParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_ephemeral_key_service.py b/stripe/_ephemeral_key_service.py index 451ff03e0..db984fa10 100644 --- a/stripe/_ephemeral_key_service.py +++ b/stripe/_ephemeral_key_service.py @@ -10,29 +10,29 @@ class EphemeralKeyService(StripeService): class CreateParams(TypedDict): - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the Customer you'd like to modify using the resulting ephemeral key. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - issuing_card: NotRequired["str"] + issuing_card: NotRequired[str] """ The ID of the Issuing Card you'd like to access using the resulting ephemeral key. """ - nonce: NotRequired["str"] + nonce: NotRequired[str] """ A single-use token, created by Stripe.js, used for creating ephemeral keys for Issuing Cards without exchanging sensitive information. """ - verification_session: NotRequired["str"] + verification_session: NotRequired[str] """ The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral key """ class DeleteParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_event.py b/stripe/_event.py index 49fca07ec..fc2c2d936 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -69,55 +69,55 @@ class ListParams(RequestOptions): """ Only return events that were created during the given date interval. """ - delivery_success: NotRequired["bool"] + delivery_success: NotRequired[bool] """ Filter events by whether all webhooks were successfully delivered. If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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: NotRequired["str"] + type: NotRequired[str] """ A string containing a specific event name, or group of events using * as a wildcard. The list will be filtered to include only events with a matching event property. """ - types: NotRequired["List[str]"] + types: NotRequired[List[str]] """ An array of up to 20 strings containing specific event names. The list will be filtered to include only events with a matching event property. You may pass either `type` or `types`, but not both. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_event_service.py b/stripe/_event_service.py index 694153301..52ca9768e 100644 --- a/stripe/_event_service.py +++ b/stripe/_event_service.py @@ -15,55 +15,55 @@ class ListParams(TypedDict): """ Only return events that were created during the given date interval. """ - delivery_success: NotRequired["bool"] + delivery_success: NotRequired[bool] """ Filter events by whether all webhooks were successfully delivered. If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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: NotRequired["str"] + type: NotRequired[str] """ A string containing a specific event name, or group of events using * as a wildcard. The list will be filtered to include only events with a matching event property. """ - types: NotRequired["List[str]"] + types: NotRequired[List[str]] """ An array of up to 20 strings containing specific event names. The list will be filtered to include only events with a matching event property. You may pass either `type` or `types`, but not both. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_exchange_rate.py b/stripe/_exchange_rate.py index 2d00d42d0..e352dff1e 100644 --- a/stripe/_exchange_rate.py +++ b/stripe/_exchange_rate.py @@ -40,25 +40,25 @@ class ExchangeRate(ListableAPIResource["ExchangeRate"]): OBJECT_NAME: ClassVar[Literal["exchange_rate"]] = "exchange_rate" class ListParams(RequestOptions): - ending_before: NotRequired["str"] + ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is the currency that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with the exchange rate for currency X your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and total number of supported payout currencies, and the default is the max. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is the currency that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with the exchange rate for currency X, your subsequent call can include `starting_after=X` in order to fetch the next page of the list. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_exchange_rate_service.py b/stripe/_exchange_rate_service.py index 2927df40b..4285867e9 100644 --- a/stripe/_exchange_rate_service.py +++ b/stripe/_exchange_rate_service.py @@ -11,25 +11,25 @@ class ExchangeRateService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is the currency that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with the exchange rate for currency X your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and total number of supported payout currencies, and the default is the max. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is the currency that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with the exchange rate for currency X, your subsequent call can include `starting_after=X` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_file.py b/stripe/_file.py index f2309b4f3..e8cef02bb 100644 --- a/stripe/_file.py +++ b/stripe/_file.py @@ -31,7 +31,7 @@ class File(CreateableAPIResource["File"], ListableAPIResource["File"]): OBJECT_NAME: ClassVar[Literal["file"]] = "file" class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -64,7 +64,7 @@ class CreateParamsFileLinkData(TypedDict): """ Set this to `true` to create a file link for the newly created file. Creating a link is only possible when the file's `purpose` is one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `pci_document`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The link isn't available after this future timestamp. """ @@ -78,49 +78,65 @@ class ListParams(RequestOptions): """ Only return files that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ purpose: NotRequired[ - "Literal['account_requirement', 'additional_verification', 'business_icon', 'business_logo', 'customer_signature', 'dispute_evidence', 'document_provider_identity_document', 'finance_report_run', 'identity_document', 'identity_document_downloadable', 'pci_document', 'selfie', 'sigma_scheduled_query', 'tax_document_user_upload', 'terminal_reader_splashscreen']" + Literal[ + "account_requirement", + "additional_verification", + "business_icon", + "business_logo", + "customer_signature", + "dispute_evidence", + "document_provider_identity_document", + "finance_report_run", + "identity_document", + "identity_document_downloadable", + "pci_document", + "selfie", + "sigma_scheduled_query", + "tax_document_user_upload", + "terminal_reader_splashscreen", + ] ] """ Filter queries by the file purpose. If you don't provide a purpose, the queries return unfiltered files. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_file_link.py b/stripe/_file_link.py index 37f0f770e..a7230ffbf 100644 --- a/stripe/_file_link.py +++ b/stripe/_file_link.py @@ -34,11 +34,11 @@ class FileLink( OBJECT_NAME: ClassVar[Literal["file_link"]] = "file_link" class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The link isn't usable after this future timestamp. """ @@ -56,51 +56,51 @@ class ListParams(RequestOptions): """ Only return links that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expired: NotRequired["bool"] + expired: NotRequired[bool] """ Filter links by their expiration status. By default, Stripe returns all links. """ - file: NotRequired["str"] + file: NotRequired[str] """ Only return links for the given file. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -114,7 +114,7 @@ class ModifyParams(RequestOptions): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_file_link_service.py b/stripe/_file_link_service.py index a98bdbc08..c7724fbf1 100644 --- a/stripe/_file_link_service.py +++ b/stripe/_file_link_service.py @@ -11,11 +11,11 @@ class FileLinkService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The link isn't usable after this future timestamp. """ @@ -33,57 +33,57 @@ class ListParams(TypedDict): """ Only return links that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expired: NotRequired["bool"] + expired: NotRequired[bool] """ Filter links by their expiration status. By default, Stripe returns all links. """ - file: NotRequired["str"] + file: NotRequired[str] """ Only return links for the given file. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_file_service.py b/stripe/_file_service.py index 70a68b205..f315c8ec5 100644 --- a/stripe/_file_service.py +++ b/stripe/_file_service.py @@ -11,7 +11,7 @@ class FileService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -44,7 +44,7 @@ class CreateParamsFileLinkData(TypedDict): """ Set this to `true` to create a file link for the newly created file. Creating a link is only possible when the file's `purpose` is one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `pci_document`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The link isn't available after this future timestamp. """ @@ -58,49 +58,65 @@ class ListParams(TypedDict): """ Only return files that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ purpose: NotRequired[ - "Literal['account_requirement', 'additional_verification', 'business_icon', 'business_logo', 'customer_signature', 'dispute_evidence', 'document_provider_identity_document', 'finance_report_run', 'identity_document', 'identity_document_downloadable', 'pci_document', 'selfie', 'sigma_scheduled_query', 'tax_document_user_upload', 'terminal_reader_splashscreen']" + Literal[ + "account_requirement", + "additional_verification", + "business_icon", + "business_logo", + "customer_signature", + "dispute_evidence", + "document_provider_identity_document", + "finance_report_run", + "identity_document", + "identity_document_downloadable", + "pci_document", + "selfie", + "sigma_scheduled_query", + "tax_document_user_upload", + "terminal_reader_splashscreen", + ] ] """ Filter queries by the file purpose. If you don't provide a purpose, the queries return unfiltered files. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index d485a3f5b..69434b0a2 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -986,11 +986,11 @@ class CreateParams(RequestOptions): """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ - application_fee_amount: NotRequired["int"] + application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). """ - auto_advance: NotRequired["bool"] + auto_advance: NotRequired[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. """ @@ -999,12 +999,12 @@ class CreateParams(RequestOptions): Settings for automatic tax lookup for this invoice. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency to create this invoice in. Defaults to that of `customer` if not specified. """ @@ -1014,27 +1014,27 @@ class CreateParams(RequestOptions): """ A list of up to 4 custom fields to be displayed on the invoice. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the customer who will be billed. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. """ - default_source: NotRequired["str"] + default_source: NotRequired[str] """ ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. """ - default_tax_rates: NotRequired["List[str]"] + default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any line item that does not have `tax_rates` set. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. """ @@ -1044,19 +1044,19 @@ class CreateParams(RequestOptions): """ The coupons to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts. """ - due_date: NotRequired["int"] + due_date: NotRequired[int] """ The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`. """ - effective_at: NotRequired["int"] + effective_at: NotRequired[int] """ The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Footer to be displayed on the invoice. """ @@ -1072,11 +1072,11 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - number: NotRequired["str"] + number: NotRequired[str] """ Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ @@ -1085,7 +1085,7 @@ class CreateParams(RequestOptions): Configuration settings for the PaymentIntent that is generated when the invoice is finalized. """ pending_invoice_items_behavior: NotRequired[ - "Literal['exclude', 'include', 'include_and_require']" + Literal["exclude", "include", "include_and_require"] ] """ How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted. @@ -1108,11 +1108,11 @@ class CreateParams(RequestOptions): """ Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. """ - subscription: NotRequired["str"] + subscription: NotRequired[str] """ The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected. """ @@ -1132,7 +1132,7 @@ class CreateParamsAutomaticTax(TypedDict): """ class CreateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1152,11 +1152,11 @@ class CreateParamsCustomField(TypedDict): """ class CreateParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ @@ -1172,7 +1172,7 @@ class CreateParamsFromInvoice(TypedDict): """ class CreateParamsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1251,7 +1251,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -1260,13 +1260,13 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -1281,7 +1281,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1290,7 +1290,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallments( TypedDict, ): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Setting to true enables installments for this invoice. Setting to false will prevent any selected plan from applying to a payment. @@ -1328,7 +1328,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["str"] + funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ @@ -1342,7 +1342,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer """ Configuration for eu_bank_transfer funding type. """ - type: NotRequired["str"] + type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ @@ -1371,7 +1371,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -1381,12 +1381,16 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ @@ -1412,7 +1416,7 @@ class CreateParamsRenderingOptions(TypedDict): """ class CreateParamsRenderingPdf(TypedDict): - page_size: NotRequired["Literal['a4', 'auto', 'letter']"] + page_size: NotRequired[Literal["a4", "auto", "letter"]] """ Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with @@ -1420,7 +1424,7 @@ class CreateParamsRenderingPdf(TypedDict): """ class CreateParamsShippingCost(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ @@ -1448,21 +1452,21 @@ class CreateParamsShippingCostShippingRateData(TypedDict): """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ - type: NotRequired["Literal['fixed_amount']"] + type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. """ @@ -1515,7 +1519,10 @@ class CreateParamsShippingCostShippingRateDataFixedAmount(TypedDict): 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). """ currency_options: NotRequired[ - "Dict[str, Invoice.CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions]" + Dict[ + str, + "Invoice.CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", + ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). @@ -1529,7 +1536,7 @@ class CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. @@ -1550,33 +1557,33 @@ class CreateParamsShippingDetails(TypedDict): """ class CreateParamsShippingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. """ @@ -1589,18 +1596,18 @@ class DeleteParams(RequestOptions): pass class FinalizeInvoiceParams(RequestOptions): - auto_advance: NotRequired["bool"] + auto_advance: NotRequired[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. @@ -1609,76 +1616,76 @@ class ListParams(RequestOptions): """ Only return invoices that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return invoices for the customer specified by this customer ID. """ due_date: NotRequired["Invoice.ListParamsDueDate|int"] - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['draft', 'open', 'paid', 'uncollectible', 'void']" + Literal["draft", "open", "paid", "uncollectible", "void"] ] """ The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) """ - subscription: NotRequired["str"] + subscription: NotRequired[str] """ Only return invoices for the subscription specified by this subscription ID. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsDueDate(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class MarkUncollectibleParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1688,11 +1695,11 @@ class ModifyParams(RequestOptions): """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ - application_fee_amount: NotRequired["int"] + application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). """ - auto_advance: NotRequired["bool"] + auto_advance: NotRequired[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. """ @@ -1701,7 +1708,7 @@ class ModifyParams(RequestOptions): Settings for automatic tax lookup for this invoice. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices. @@ -1712,11 +1719,11 @@ class ModifyParams(RequestOptions): """ A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. """ @@ -1728,7 +1735,7 @@ class ModifyParams(RequestOptions): """ The tax rates that will apply to any line item that does not have `tax_rates` set. Pass an empty string to remove previously-defined tax rates. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. """ @@ -1738,7 +1745,7 @@ class ModifyParams(RequestOptions): """ The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts. """ - due_date: NotRequired["int"] + due_date: NotRequired[int] """ The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. """ @@ -1746,11 +1753,11 @@ class ModifyParams(RequestOptions): """ The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Footer to be displayed on the invoice. """ @@ -1796,7 +1803,7 @@ class ModifyParams(RequestOptions): """ Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. """ @@ -1818,7 +1825,7 @@ class ModifyParamsAutomaticTax(TypedDict): """ class ModifyParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1838,17 +1845,17 @@ class ModifyParamsCustomField(TypedDict): """ class ModifyParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ class ModifyParamsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1927,7 +1934,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -1936,13 +1943,13 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -1957,7 +1964,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1966,7 +1973,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): class ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallments( TypedDict, ): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Setting to true enables installments for this invoice. Setting to false will prevent any selected plan from applying to a payment. @@ -2004,7 +2011,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["str"] + funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ @@ -2018,7 +2025,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer """ Configuration for eu_bank_transfer funding type. """ - type: NotRequired["str"] + type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ @@ -2047,7 +2054,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -2057,12 +2064,16 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ @@ -2088,7 +2099,7 @@ class ModifyParamsRenderingOptions(TypedDict): """ class ModifyParamsRenderingPdf(TypedDict): - page_size: NotRequired["Literal['a4', 'auto', 'letter']"] + page_size: NotRequired[Literal["a4", "auto", "letter"]] """ Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with @@ -2096,7 +2107,7 @@ class ModifyParamsRenderingPdf(TypedDict): """ class ModifyParamsShippingCost(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ @@ -2124,21 +2135,21 @@ class ModifyParamsShippingCostShippingRateData(TypedDict): """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ - type: NotRequired["Literal['fixed_amount']"] + type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. """ @@ -2191,7 +2202,10 @@ class ModifyParamsShippingCostShippingRateDataFixedAmount(TypedDict): 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). """ currency_options: NotRequired[ - "Dict[str, Invoice.ModifyParamsShippingCostShippingRateDataFixedAmountCurrencyOptions]" + Dict[ + str, + "Invoice.ModifyParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", + ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). @@ -2205,7 +2219,7 @@ class ModifyParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. @@ -2226,33 +2240,33 @@ class ModifyParamsShippingDetails(TypedDict): """ class ModifyParamsShippingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. """ @@ -2262,11 +2276,11 @@ class ModifyParamsTransferData(TypedDict): """ class PayParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - forgive: NotRequired["bool"] + forgive: NotRequired[bool] """ In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. @@ -2276,39 +2290,39 @@ class PayParams(RequestOptions): """ ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. """ - off_session: NotRequired["bool"] + off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). """ - paid_out_of_band: NotRequired["bool"] + paid_out_of_band: NotRequired[bool] """ Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. """ - source: NotRequired["str"] + source: NotRequired[str] """ A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ @@ -2318,7 +2332,7 @@ class SearchParams(RequestOptions): """ class SendInvoiceParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -2328,15 +2342,15 @@ class UpcomingLinesParams(RequestOptions): """ Settings for automatic tax lookup for this invoice preview. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency to preview this invoice in. Defaults to that of `customer` if not specified. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ @@ -2352,16 +2366,16 @@ class UpcomingLinesParams(RequestOptions): """ The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_items: NotRequired[ - "List[Invoice.UpcomingLinesParamsInvoiceItem]" + List["Invoice.UpcomingLinesParamsInvoiceItem"] ] """ List of invoice items to add or update in the upcoming invoice preview. @@ -2370,7 +2384,7 @@ class UpcomingLinesParams(RequestOptions): """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ - limit: NotRequired["int"] + 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. """ @@ -2378,15 +2392,15 @@ class UpcomingLinesParams(RequestOptions): """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ - schedule: NotRequired["str"] + schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. """ - starting_after: NotRequired["str"] + 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. """ - subscription: NotRequired["str"] + subscription: NotRequired[str] """ The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ @@ -2400,11 +2414,11 @@ class UpcomingLinesParams(RequestOptions): """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ - subscription_cancel_at_period_end: NotRequired["bool"] + subscription_cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ - subscription_cancel_now: NotRequired["bool"] + subscription_cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. """ @@ -2413,26 +2427,26 @@ class UpcomingLinesParams(RequestOptions): If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. """ subscription_items: NotRequired[ - "List[Invoice.UpcomingLinesParamsSubscriptionItem]" + List["Invoice.UpcomingLinesParamsSubscriptionItem"] ] """ A list of up to 20 subscription items, each with an attached price. """ subscription_proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - subscription_proration_date: NotRequired["int"] + subscription_proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. """ - subscription_resume_at: NotRequired["Literal['now']"] + subscription_resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ - subscription_start_date: NotRequired["int"] + subscription_start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). """ @@ -2440,7 +2454,7 @@ class UpcomingLinesParams(RequestOptions): """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. """ - subscription_trial_from_plan: NotRequired["bool"] + subscription_trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ @@ -2458,7 +2472,7 @@ class UpcomingLinesParamsAutomaticTax(TypedDict): """ class UpcomingLinesParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -2491,34 +2505,34 @@ class UpcomingLinesParamsCustomerDetails(TypedDict): The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_ids: NotRequired[ - "List[Invoice.UpcomingLinesParamsCustomerDetailsTaxId]" + List["Invoice.UpcomingLinesParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. """ class UpcomingLinesParamsCustomerDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -2532,33 +2546,33 @@ class UpcomingLinesParamsCustomerDetailsShipping(TypedDict): """ Customer name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Customer phone (including extension). """ class UpcomingLinesParamsCustomerDetailsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -2648,33 +2662,33 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): """ class UpcomingLinesParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingLinesParamsInvoiceItem(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of previewed invoice item. """ - currency: NotRequired["str"] + currency: NotRequired[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). Only applicable to new invoice items. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ - discountable: NotRequired["bool"] + discountable: NotRequired[bool] """ Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. """ @@ -2684,7 +2698,7 @@ class UpcomingLinesParamsInvoiceItem(TypedDict): """ The coupons to redeem into discounts for the invoice item in the preview. """ - invoiceitem: NotRequired["str"] + invoiceitem: NotRequired[str] """ The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. """ @@ -2696,7 +2710,7 @@ class UpcomingLinesParamsInvoiceItem(TypedDict): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -2706,12 +2720,12 @@ class UpcomingLinesParamsInvoiceItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. @@ -2724,25 +2738,25 @@ class UpcomingLinesParamsInvoiceItem(TypedDict): """ The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingLinesParamsInvoiceItemDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ @@ -2767,22 +2781,22 @@ class UpcomingLinesParamsInvoiceItemPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingLinesParamsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -2798,15 +2812,15 @@ class UpcomingLinesParamsSubscriptionItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - clear_usage: NotRequired["bool"] + clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ - deleted: NotRequired["bool"] + deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ - id: NotRequired["str"] + id: NotRequired[str] """ Subscription item to update. """ @@ -2814,11 +2828,11 @@ class UpcomingLinesParamsSubscriptionItem(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ Plan ID for this item, as a string. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ @@ -2828,7 +2842,7 @@ class UpcomingLinesParamsSubscriptionItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. """ @@ -2857,16 +2871,16 @@ class UpcomingLinesParamsSubscriptionItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -2876,7 +2890,7 @@ class UpcomingLinesParamsSubscriptionItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ @@ -2886,15 +2900,15 @@ class UpcomingParams(RequestOptions): """ Settings for automatic tax lookup for this invoice preview. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency to preview this invoice in. Defaults to that of `customer` if not specified. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ @@ -2908,11 +2922,11 @@ class UpcomingParams(RequestOptions): """ The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice_items: NotRequired["List[Invoice.UpcomingParamsInvoiceItem]"] + invoice_items: NotRequired[List["Invoice.UpcomingParamsInvoiceItem"]] """ List of invoice items to add or update in the upcoming invoice preview. """ @@ -2924,11 +2938,11 @@ class UpcomingParams(RequestOptions): """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ - schedule: NotRequired["str"] + schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. """ - subscription: NotRequired["str"] + subscription: NotRequired[str] """ The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ @@ -2942,11 +2956,11 @@ class UpcomingParams(RequestOptions): """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ - subscription_cancel_at_period_end: NotRequired["bool"] + subscription_cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ - subscription_cancel_now: NotRequired["bool"] + subscription_cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. """ @@ -2955,26 +2969,26 @@ class UpcomingParams(RequestOptions): If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. """ subscription_items: NotRequired[ - "List[Invoice.UpcomingParamsSubscriptionItem]" + List["Invoice.UpcomingParamsSubscriptionItem"] ] """ A list of up to 20 subscription items, each with an attached price. """ subscription_proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - subscription_proration_date: NotRequired["int"] + subscription_proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. """ - subscription_resume_at: NotRequired["Literal['now']"] + subscription_resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ - subscription_start_date: NotRequired["int"] + subscription_start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). """ @@ -2982,7 +2996,7 @@ class UpcomingParams(RequestOptions): """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. """ - subscription_trial_from_plan: NotRequired["bool"] + subscription_trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ @@ -2998,7 +3012,7 @@ class UpcomingParamsAutomaticTax(TypedDict): """ class UpcomingParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -3031,34 +3045,34 @@ class UpcomingParamsCustomerDetails(TypedDict): The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_ids: NotRequired[ - "List[Invoice.UpcomingParamsCustomerDetailsTaxId]" + List["Invoice.UpcomingParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. """ class UpcomingParamsCustomerDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -3072,33 +3086,33 @@ class UpcomingParamsCustomerDetailsShipping(TypedDict): """ Customer name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Customer phone (including extension). """ class UpcomingParamsCustomerDetailsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -3188,33 +3202,33 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): """ class UpcomingParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsInvoiceItem(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of previewed invoice item. """ - currency: NotRequired["str"] + currency: NotRequired[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). Only applicable to new invoice items. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ - discountable: NotRequired["bool"] + discountable: NotRequired[bool] """ Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. """ @@ -3224,7 +3238,7 @@ class UpcomingParamsInvoiceItem(TypedDict): """ The coupons to redeem into discounts for the invoice item in the preview. """ - invoiceitem: NotRequired["str"] + invoiceitem: NotRequired[str] """ The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. """ @@ -3236,7 +3250,7 @@ class UpcomingParamsInvoiceItem(TypedDict): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -3244,12 +3258,12 @@ class UpcomingParamsInvoiceItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. @@ -3262,25 +3276,25 @@ class UpcomingParamsInvoiceItem(TypedDict): """ The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsInvoiceItemDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ @@ -3305,22 +3319,22 @@ class UpcomingParamsInvoiceItemPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -3336,15 +3350,15 @@ class UpcomingParamsSubscriptionItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - clear_usage: NotRequired["bool"] + clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ - deleted: NotRequired["bool"] + deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ - id: NotRequired["str"] + id: NotRequired[str] """ Subscription item to update. """ @@ -3352,11 +3366,11 @@ class UpcomingParamsSubscriptionItem(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ Plan ID for this item, as a string. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ @@ -3366,7 +3380,7 @@ class UpcomingParamsSubscriptionItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. """ @@ -3395,16 +3409,16 @@ class UpcomingParamsSubscriptionItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -3414,13 +3428,13 @@ class UpcomingParamsSubscriptionItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class VoidInvoiceParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index 1d3b0d10d..8ee40ee7a 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -62,11 +62,11 @@ class Period(StripeObject): """ class CreateParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. Passing in a negative `amount` will reduce the `amount_due` on the invoice. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ @@ -74,11 +74,11 @@ class CreateParams(RequestOptions): """ The ID of the customer who will be billed when this invoice item is billed. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ - discountable: NotRequired["bool"] + discountable: NotRequired[bool] """ Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. """ @@ -88,11 +88,11 @@ class CreateParams(RequestOptions): """ The coupons to redeem into discounts for the invoice item or invoice line item. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice: NotRequired["str"] + invoice: NotRequired[str] """ The ID of an existing invoice to add this invoice item to. When left blank, the invoice item will be added to the next upcoming scheduled invoice. This is useful when adding invoice items in response to an invoice.created webhook. You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice. """ @@ -104,7 +104,7 @@ class CreateParams(RequestOptions): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -112,16 +112,16 @@ class CreateParams(RequestOptions): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ - subscription: NotRequired["str"] + subscription: NotRequired[str] """ The ID of a subscription to add this invoice item to. When left blank, the invoice item will be be added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. @@ -130,25 +130,25 @@ class CreateParams(RequestOptions): """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ - tax_rates: NotRequired["List[str]"] + tax_rates: NotRequired[List[str]] """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ @@ -173,16 +173,16 @@ class CreateParamsPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -195,63 +195,63 @@ class ListParams(RequestOptions): """ Only return invoice items that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The identifier of the customer whose invoice items to return. If none is provided, all invoice items will be returned. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice: NotRequired["str"] + invoice: NotRequired[str] """ Only return invoice items belonging to this invoice. If none is provided, all invoice items will be returned. If specifying an invoice, no customer identifier is needed. """ - limit: NotRequired["int"] + 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. """ - pending: NotRequired["bool"] + pending: NotRequired[bool] """ Set to `true` to only show pending invoice items, which are not yet attached to any invoices. Set to `false` to only show invoice items already attached to invoices. If unspecified, no filter is applied. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ - discountable: NotRequired["bool"] + discountable: NotRequired[bool] """ Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. Cannot be set to true for prorations. """ @@ -261,7 +261,7 @@ class ModifyParams(RequestOptions): """ The coupons & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -273,7 +273,7 @@ class ModifyParams(RequestOptions): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -281,12 +281,12 @@ class ModifyParams(RequestOptions): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. @@ -299,21 +299,21 @@ class ModifyParams(RequestOptions): """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ModifyParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ @@ -338,22 +338,22 @@ class ModifyParamsPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_invoice_item_service.py b/stripe/_invoice_item_service.py index c097edb20..5305d2e8b 100644 --- a/stripe/_invoice_item_service.py +++ b/stripe/_invoice_item_service.py @@ -11,11 +11,11 @@ class InvoiceItemService(StripeService): class CreateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. Passing in a negative `amount` will reduce the `amount_due` on the invoice. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ @@ -23,11 +23,11 @@ class CreateParams(TypedDict): """ The ID of the customer who will be billed when this invoice item is billed. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ - discountable: NotRequired["bool"] + discountable: NotRequired[bool] """ Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. """ @@ -37,11 +37,11 @@ class CreateParams(TypedDict): """ The coupons to redeem into discounts for the invoice item or invoice line item. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice: NotRequired["str"] + invoice: NotRequired[str] """ The ID of an existing invoice to add this invoice item to. When left blank, the invoice item will be added to the next upcoming scheduled invoice. This is useful when adding invoice items in response to an invoice.created webhook. You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice. """ @@ -53,7 +53,7 @@ class CreateParams(TypedDict): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -61,16 +61,16 @@ class CreateParams(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ - subscription: NotRequired["str"] + subscription: NotRequired[str] """ The ID of a subscription to add this invoice item to. When left blank, the invoice item will be be added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. @@ -79,25 +79,25 @@ class CreateParams(TypedDict): """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ - tax_rates: NotRequired["List[str]"] + tax_rates: NotRequired[List[str]] """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ @@ -122,16 +122,16 @@ class CreateParamsPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -144,69 +144,69 @@ class ListParams(TypedDict): """ Only return invoice items that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The identifier of the customer whose invoice items to return. If none is provided, all invoice items will be returned. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice: NotRequired["str"] + invoice: NotRequired[str] """ Only return invoice items belonging to this invoice. If none is provided, all invoice items will be returned. If specifying an invoice, no customer identifier is needed. """ - limit: NotRequired["int"] + 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. """ - pending: NotRequired["bool"] + pending: NotRequired[bool] """ Set to `true` to only show pending invoice items, which are not yet attached to any invoices. Set to `false` to only show invoice items already attached to invoices. If unspecified, no filter is applied. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ - discountable: NotRequired["bool"] + discountable: NotRequired[bool] """ Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. Cannot be set to true for prorations. """ @@ -216,7 +216,7 @@ class UpdateParams(TypedDict): """ The coupons & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -228,7 +228,7 @@ class UpdateParams(TypedDict): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -236,12 +236,12 @@ class UpdateParams(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. @@ -254,21 +254,21 @@ class UpdateParams(TypedDict): """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpdateParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ @@ -293,16 +293,16 @@ class UpdateParamsPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 28d6ecdb1..8e177a54d 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -105,15 +105,15 @@ class TaxAmount(StripeObject): """ class ModifyParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ - discountable: NotRequired["bool"] + discountable: NotRequired[bool] """ Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. """ @@ -123,7 +123,7 @@ class ModifyParams(RequestOptions): """ The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -135,7 +135,7 @@ class ModifyParams(RequestOptions): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -143,7 +143,7 @@ class ModifyParams(RequestOptions): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the line item. """ @@ -159,11 +159,11 @@ class ModifyParams(RequestOptions): """ class ModifyParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ @@ -183,7 +183,7 @@ class ModifyParamsPriceData(TypedDict): """ 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). """ - product: NotRequired["str"] + product: NotRequired[str] """ The ID of the product that this price will belong to. One of `product` or `product_data` is required. """ @@ -194,30 +194,30 @@ class ModifyParamsPriceData(TypedDict): Data used to generate a new product object inline. One of `product` or `product_data` is required. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ModifyParamsPriceDataProductData(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ - images: NotRequired["List[str]"] + images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -225,7 +225,7 @@ class ModifyParamsPriceDataProductData(TypedDict): """ The product's name, meant to be displayable to the customer. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ @@ -247,11 +247,11 @@ class ModifyParamsTaxAmount(TypedDict): """ class ModifyParamsTaxAmountTaxRateData(TypedDict): - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ @@ -263,7 +263,7 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): """ This specifies if the tax rate is inclusive or exclusive. """ - jurisdiction: NotRequired["str"] + jurisdiction: NotRequired[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ @@ -271,12 +271,26 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): """ The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. """ - state: NotRequired["str"] + state: NotRequired[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'vat', 'service_tax']" + Literal[ + "amusement_tax", + "communications_tax", + "gst", + "hst", + "igst", + "jct", + "lease_tax", + "pst", + "qst", + "rst", + "sales_tax", + "vat", + "service_tax", + ] ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index af42968d7..fa0f3d35b 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -11,33 +11,33 @@ class InvoiceLineItemService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class UpdateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ - discountable: NotRequired["bool"] + discountable: NotRequired[bool] """ Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. """ @@ -47,7 +47,7 @@ class UpdateParams(TypedDict): """ The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -59,7 +59,7 @@ class UpdateParams(TypedDict): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -67,7 +67,7 @@ class UpdateParams(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the line item. """ @@ -83,11 +83,11 @@ class UpdateParams(TypedDict): """ class UpdateParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ @@ -107,7 +107,7 @@ class UpdateParamsPriceData(TypedDict): """ 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). """ - product: NotRequired["str"] + product: NotRequired[str] """ The ID of the product that this price will belong to. One of `product` or `product_data` is required. """ @@ -118,30 +118,30 @@ class UpdateParamsPriceData(TypedDict): Data used to generate a new product object inline. One of `product` or `product_data` is required. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpdateParamsPriceDataProductData(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ - images: NotRequired["List[str]"] + images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -149,7 +149,7 @@ class UpdateParamsPriceDataProductData(TypedDict): """ The product's name, meant to be displayable to the customer. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ @@ -171,11 +171,11 @@ class UpdateParamsTaxAmount(TypedDict): """ class UpdateParamsTaxAmountTaxRateData(TypedDict): - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ @@ -187,7 +187,7 @@ class UpdateParamsTaxAmountTaxRateData(TypedDict): """ This specifies if the tax rate is inclusive or exclusive. """ - jurisdiction: NotRequired["str"] + jurisdiction: NotRequired[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ @@ -195,12 +195,26 @@ class UpdateParamsTaxAmountTaxRateData(TypedDict): """ The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. """ - state: NotRequired["str"] + state: NotRequired[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'vat', 'service_tax']" + Literal[ + "amusement_tax", + "communications_tax", + "gst", + "hst", + "igst", + "jct", + "lease_tax", + "pst", + "qst", + "rst", + "sales_tax", + "vat", + "service_tax", + ] ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index fa041ba57..e64dd5ac3 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -23,11 +23,11 @@ class CreateParams(TypedDict): """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ - application_fee_amount: NotRequired["int"] + application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). """ - auto_advance: NotRequired["bool"] + auto_advance: NotRequired[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. """ @@ -36,12 +36,12 @@ class CreateParams(TypedDict): Settings for automatic tax lookup for this invoice. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency to create this invoice in. Defaults to that of `customer` if not specified. """ @@ -51,27 +51,27 @@ class CreateParams(TypedDict): """ A list of up to 4 custom fields to be displayed on the invoice. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the customer who will be billed. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. """ - default_source: NotRequired["str"] + default_source: NotRequired[str] """ ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. """ - default_tax_rates: NotRequired["List[str]"] + default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any line item that does not have `tax_rates` set. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. """ @@ -81,19 +81,19 @@ class CreateParams(TypedDict): """ The coupons to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts. """ - due_date: NotRequired["int"] + due_date: NotRequired[int] """ The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`. """ - effective_at: NotRequired["int"] + effective_at: NotRequired[int] """ The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Footer to be displayed on the invoice. """ @@ -109,11 +109,11 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - number: NotRequired["str"] + number: NotRequired[str] """ Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ @@ -124,7 +124,7 @@ class CreateParams(TypedDict): Configuration settings for the PaymentIntent that is generated when the invoice is finalized. """ pending_invoice_items_behavior: NotRequired[ - "Literal['exclude', 'include', 'include_and_require']" + Literal["exclude", "include", "include_and_require"] ] """ How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted. @@ -149,11 +149,11 @@ class CreateParams(TypedDict): """ Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. """ - subscription: NotRequired["str"] + subscription: NotRequired[str] """ The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected. """ @@ -175,7 +175,7 @@ class CreateParamsAutomaticTax(TypedDict): """ class CreateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -195,11 +195,11 @@ class CreateParamsCustomField(TypedDict): """ class CreateParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ @@ -215,7 +215,7 @@ class CreateParamsFromInvoice(TypedDict): """ class CreateParamsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -294,7 +294,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -303,13 +303,13 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -324,7 +324,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -333,7 +333,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallments( TypedDict, ): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Setting to true enables installments for this invoice. Setting to false will prevent any selected plan from applying to a payment. @@ -371,7 +371,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["str"] + funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ @@ -385,7 +385,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer """ Configuration for eu_bank_transfer funding type. """ - type: NotRequired["str"] + type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ @@ -414,7 +414,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -424,12 +424,16 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ @@ -455,7 +459,7 @@ class CreateParamsRenderingOptions(TypedDict): """ class CreateParamsRenderingPdf(TypedDict): - page_size: NotRequired["Literal['a4', 'auto', 'letter']"] + page_size: NotRequired[Literal["a4", "auto", "letter"]] """ Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with @@ -463,7 +467,7 @@ class CreateParamsRenderingPdf(TypedDict): """ class CreateParamsShippingCost(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ @@ -491,21 +495,21 @@ class CreateParamsShippingCostShippingRateData(TypedDict): """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ - type: NotRequired["Literal['fixed_amount']"] + type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. """ @@ -558,7 +562,10 @@ class CreateParamsShippingCostShippingRateDataFixedAmount(TypedDict): 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). """ currency_options: NotRequired[ - "Dict[str, InvoiceService.CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions]" + Dict[ + str, + "InvoiceService.CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", + ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). @@ -572,7 +579,7 @@ class CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. @@ -593,33 +600,33 @@ class CreateParamsShippingDetails(TypedDict): """ class CreateParamsShippingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. """ @@ -632,18 +639,18 @@ class DeleteParams(TypedDict): pass class FinalizeInvoiceParams(TypedDict): - auto_advance: NotRequired["bool"] + auto_advance: NotRequired[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. @@ -652,86 +659,86 @@ class ListParams(TypedDict): """ Only return invoices that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return invoices for the customer specified by this customer ID. """ due_date: NotRequired["InvoiceService.ListParamsDueDate|int"] - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['draft', 'open', 'paid', 'uncollectible', 'void']" + Literal["draft", "open", "paid", "uncollectible", "void"] ] """ The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) """ - subscription: NotRequired["str"] + subscription: NotRequired[str] """ Only return invoices for the subscription specified by this subscription ID. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsDueDate(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class MarkUncollectibleParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class PayParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - forgive: NotRequired["bool"] + forgive: NotRequired[bool] """ In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. @@ -741,39 +748,39 @@ class PayParams(TypedDict): """ ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. """ - off_session: NotRequired["bool"] + off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). """ - paid_out_of_band: NotRequired["bool"] + paid_out_of_band: NotRequired[bool] """ Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. """ - source: NotRequired["str"] + source: NotRequired[str] """ A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ @@ -783,7 +790,7 @@ class SearchParams(TypedDict): """ class SendInvoiceParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -793,15 +800,15 @@ class UpcomingParams(TypedDict): """ Settings for automatic tax lookup for this invoice preview. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency to preview this invoice in. Defaults to that of `customer` if not specified. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ @@ -817,12 +824,12 @@ class UpcomingParams(TypedDict): """ The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_items: NotRequired[ - "List[InvoiceService.UpcomingParamsInvoiceItem]" + List["InvoiceService.UpcomingParamsInvoiceItem"] ] """ List of invoice items to add or update in the upcoming invoice preview. @@ -835,11 +842,11 @@ class UpcomingParams(TypedDict): """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ - schedule: NotRequired["str"] + schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. """ - subscription: NotRequired["str"] + subscription: NotRequired[str] """ The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ @@ -853,11 +860,11 @@ class UpcomingParams(TypedDict): """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ - subscription_cancel_at_period_end: NotRequired["bool"] + subscription_cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ - subscription_cancel_now: NotRequired["bool"] + subscription_cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. """ @@ -866,26 +873,26 @@ class UpcomingParams(TypedDict): If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. """ subscription_items: NotRequired[ - "List[InvoiceService.UpcomingParamsSubscriptionItem]" + List["InvoiceService.UpcomingParamsSubscriptionItem"] ] """ A list of up to 20 subscription items, each with an attached price. """ subscription_proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - subscription_proration_date: NotRequired["int"] + subscription_proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. """ - subscription_resume_at: NotRequired["Literal['now']"] + subscription_resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ - subscription_start_date: NotRequired["int"] + subscription_start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). """ @@ -893,7 +900,7 @@ class UpcomingParams(TypedDict): """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. """ - subscription_trial_from_plan: NotRequired["bool"] + subscription_trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ @@ -911,7 +918,7 @@ class UpcomingParamsAutomaticTax(TypedDict): """ class UpcomingParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -944,34 +951,34 @@ class UpcomingParamsCustomerDetails(TypedDict): The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_ids: NotRequired[ - "List[InvoiceService.UpcomingParamsCustomerDetailsTaxId]" + List["InvoiceService.UpcomingParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. """ class UpcomingParamsCustomerDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -985,33 +992,33 @@ class UpcomingParamsCustomerDetailsShipping(TypedDict): """ Customer name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Customer phone (including extension). """ class UpcomingParamsCustomerDetailsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -1101,33 +1108,33 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): """ class UpcomingParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsInvoiceItem(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of previewed invoice item. """ - currency: NotRequired["str"] + currency: NotRequired[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). Only applicable to new invoice items. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ - discountable: NotRequired["bool"] + discountable: NotRequired[bool] """ Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. """ @@ -1137,7 +1144,7 @@ class UpcomingParamsInvoiceItem(TypedDict): """ The coupons to redeem into discounts for the invoice item in the preview. """ - invoiceitem: NotRequired["str"] + invoiceitem: NotRequired[str] """ The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. """ @@ -1149,7 +1156,7 @@ class UpcomingParamsInvoiceItem(TypedDict): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -1159,12 +1166,12 @@ class UpcomingParamsInvoiceItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. @@ -1177,25 +1184,25 @@ class UpcomingParamsInvoiceItem(TypedDict): """ The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsInvoiceItemDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ @@ -1220,22 +1227,22 @@ class UpcomingParamsInvoiceItemPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1251,15 +1258,15 @@ class UpcomingParamsSubscriptionItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - clear_usage: NotRequired["bool"] + clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ - deleted: NotRequired["bool"] + deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ - id: NotRequired["str"] + id: NotRequired[str] """ Subscription item to update. """ @@ -1267,11 +1274,11 @@ class UpcomingParamsSubscriptionItem(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ Plan ID for this item, as a string. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ @@ -1281,7 +1288,7 @@ class UpcomingParamsSubscriptionItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. """ @@ -1310,16 +1317,16 @@ class UpcomingParamsSubscriptionItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -1329,7 +1336,7 @@ class UpcomingParamsSubscriptionItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ @@ -1339,11 +1346,11 @@ class UpdateParams(TypedDict): """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ - application_fee_amount: NotRequired["int"] + application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). """ - auto_advance: NotRequired["bool"] + auto_advance: NotRequired[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. """ @@ -1352,7 +1359,7 @@ class UpdateParams(TypedDict): Settings for automatic tax lookup for this invoice. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices. @@ -1363,11 +1370,11 @@ class UpdateParams(TypedDict): """ A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. """ @@ -1379,7 +1386,7 @@ class UpdateParams(TypedDict): """ The tax rates that will apply to any line item that does not have `tax_rates` set. Pass an empty string to remove previously-defined tax rates. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. """ @@ -1389,7 +1396,7 @@ class UpdateParams(TypedDict): """ The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts. """ - due_date: NotRequired["int"] + due_date: NotRequired[int] """ The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. """ @@ -1397,11 +1404,11 @@ class UpdateParams(TypedDict): """ The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Footer to be displayed on the invoice. """ @@ -1449,7 +1456,7 @@ class UpdateParams(TypedDict): """ Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. """ @@ -1473,7 +1480,7 @@ class UpdateParamsAutomaticTax(TypedDict): """ class UpdateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1493,17 +1500,17 @@ class UpdateParamsCustomField(TypedDict): """ class UpdateParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ class UpdateParamsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1582,7 +1589,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -1591,13 +1598,13 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): class UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -1612,7 +1619,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1621,7 +1628,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): class UpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallments( TypedDict, ): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Setting to true enables installments for this invoice. Setting to false will prevent any selected plan from applying to a payment. @@ -1659,7 +1666,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["str"] + funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ @@ -1673,7 +1680,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer """ Configuration for eu_bank_transfer funding type. """ - type: NotRequired["str"] + type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ @@ -1702,7 +1709,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -1712,12 +1719,16 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ @@ -1743,7 +1754,7 @@ class UpdateParamsRenderingOptions(TypedDict): """ class UpdateParamsRenderingPdf(TypedDict): - page_size: NotRequired["Literal['a4', 'auto', 'letter']"] + page_size: NotRequired[Literal["a4", "auto", "letter"]] """ Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with @@ -1751,7 +1762,7 @@ class UpdateParamsRenderingPdf(TypedDict): """ class UpdateParamsShippingCost(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ @@ -1779,21 +1790,21 @@ class UpdateParamsShippingCostShippingRateData(TypedDict): """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ - type: NotRequired["Literal['fixed_amount']"] + type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. """ @@ -1846,7 +1857,10 @@ class UpdateParamsShippingCostShippingRateDataFixedAmount(TypedDict): 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). """ currency_options: NotRequired[ - "Dict[str, InvoiceService.UpdateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions]" + Dict[ + str, + "InvoiceService.UpdateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", + ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). @@ -1860,7 +1874,7 @@ class UpdateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. @@ -1881,33 +1895,33 @@ class UpdateParamsShippingDetails(TypedDict): """ class UpdateParamsShippingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. """ @@ -1917,7 +1931,7 @@ class UpdateParamsTransferData(TypedDict): """ class VoidInvoiceParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index 5ed8a439f..e147bc6f5 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -16,15 +16,15 @@ class ListParams(TypedDict): """ Settings for automatic tax lookup for this invoice preview. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency to preview this invoice in. Defaults to that of `customer` if not specified. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ @@ -40,16 +40,16 @@ class ListParams(TypedDict): """ The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_items: NotRequired[ - "List[InvoiceUpcomingLinesService.ListParamsInvoiceItem]" + List["InvoiceUpcomingLinesService.ListParamsInvoiceItem"] ] """ List of invoice items to add or update in the upcoming invoice preview. @@ -58,7 +58,7 @@ class ListParams(TypedDict): """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ - limit: NotRequired["int"] + 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. """ @@ -66,15 +66,15 @@ class ListParams(TypedDict): """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ - schedule: NotRequired["str"] + schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. """ - starting_after: NotRequired["str"] + 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. """ - subscription: NotRequired["str"] + subscription: NotRequired[str] """ The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ @@ -88,11 +88,11 @@ class ListParams(TypedDict): """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ - subscription_cancel_at_period_end: NotRequired["bool"] + subscription_cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ - subscription_cancel_now: NotRequired["bool"] + subscription_cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. """ @@ -101,26 +101,26 @@ class ListParams(TypedDict): If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. """ subscription_items: NotRequired[ - "List[InvoiceUpcomingLinesService.ListParamsSubscriptionItem]" + List["InvoiceUpcomingLinesService.ListParamsSubscriptionItem"] ] """ A list of up to 20 subscription items, each with an attached price. """ subscription_proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - subscription_proration_date: NotRequired["int"] + subscription_proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. """ - subscription_resume_at: NotRequired["Literal['now']"] + subscription_resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ - subscription_start_date: NotRequired["int"] + subscription_start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). """ @@ -128,7 +128,7 @@ class ListParams(TypedDict): """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. """ - subscription_trial_from_plan: NotRequired["bool"] + subscription_trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ @@ -146,7 +146,7 @@ class ListParamsAutomaticTax(TypedDict): """ class ListParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -181,34 +181,34 @@ class ListParamsCustomerDetails(TypedDict): The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_ids: NotRequired[ - "List[InvoiceUpcomingLinesService.ListParamsCustomerDetailsTaxId]" + List["InvoiceUpcomingLinesService.ListParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. """ class ListParamsCustomerDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -222,33 +222,33 @@ class ListParamsCustomerDetailsShipping(TypedDict): """ Customer name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Customer phone (including extension). """ class ListParamsCustomerDetailsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -338,33 +338,33 @@ class ListParamsCustomerDetailsTaxId(TypedDict): """ class ListParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ListParamsInvoiceItem(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of previewed invoice item. """ - currency: NotRequired["str"] + currency: NotRequired[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). Only applicable to new invoice items. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ - discountable: NotRequired["bool"] + discountable: NotRequired[bool] """ Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. """ @@ -374,7 +374,7 @@ class ListParamsInvoiceItem(TypedDict): """ The coupons to redeem into discounts for the invoice item in the preview. """ - invoiceitem: NotRequired["str"] + invoiceitem: NotRequired[str] """ The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. """ @@ -388,7 +388,7 @@ class ListParamsInvoiceItem(TypedDict): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -398,12 +398,12 @@ class ListParamsInvoiceItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. @@ -416,25 +416,25 @@ class ListParamsInvoiceItem(TypedDict): """ The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ListParamsInvoiceItemDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ @@ -459,22 +459,22 @@ class ListParamsInvoiceItemPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ListParamsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -490,15 +490,15 @@ class ListParamsSubscriptionItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - clear_usage: NotRequired["bool"] + clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ - deleted: NotRequired["bool"] + deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ - id: NotRequired["str"] + id: NotRequired[str] """ Subscription item to update. """ @@ -506,11 +506,11 @@ class ListParamsSubscriptionItem(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ Plan ID for this item, as a string. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ @@ -520,7 +520,7 @@ class ListParamsSubscriptionItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. """ @@ -549,16 +549,16 @@ class ListParamsSubscriptionItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -568,7 +568,7 @@ class ListParamsSubscriptionItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ diff --git a/stripe/_mandate.py b/stripe/_mandate.py index bda47f912..ea611d0aa 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -171,7 +171,7 @@ class SingleUse(StripeObject): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_mandate_service.py b/stripe/_mandate_service.py index f19beb1c2..7c20daf4f 100644 --- a/stripe/_mandate_service.py +++ b/stripe/_mandate_service.py @@ -10,7 +10,7 @@ class MandateService(StripeService): class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index ca6739a74..c071514a7 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1847,7 +1847,7 @@ class TransferData(StripeObject): """ class ApplyCustomerBalanceParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount that you intend to apply to this PaymentIntent from the customer's cash balance. @@ -1857,41 +1857,43 @@ class ApplyCustomerBalanceParams(RequestOptions): When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CancelParams(RequestOptions): cancellation_reason: NotRequired[ - "Literal['abandoned', 'duplicate', 'fraudulent', 'requested_by_customer']" + Literal[ + "abandoned", "duplicate", "fraudulent", "requested_by_customer" + ] ] """ Reason for canceling this PaymentIntent. Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned` """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CaptureParams(RequestOptions): - amount_to_capture: NotRequired["int"] + amount_to_capture: NotRequired[int] """ The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount is automatically refunded. Defaults to the full `amount_capturable` if it's not provided. """ - application_fee_amount: NotRequired["int"] + 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - final_capture: NotRequired["bool"] + final_capture: NotRequired[bool] """ Defaults to `true`. When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they're captured in future requests. You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents. """ @@ -1899,11 +1901,11 @@ class CaptureParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must be 1-22 characters long. """ @@ -1914,33 +1916,33 @@ class CaptureParams(RequestOptions): """ class CaptureParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ class ConfirmParams(RequestOptions): capture_method: NotRequired[ - "Literal['automatic', 'automatic_async', 'manual']" + Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ - confirmation_token: NotRequired["str"] + confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this PaymentIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ - error_on_requires_action: NotRequired["bool"] + error_on_requires_action: NotRequired[bool] """ 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://stripe.com/docs/payments/save-card-without-authentication). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - mandate: NotRequired["str"] + mandate: NotRequired[str] """ ID of the mandate that's used for this payment. """ @@ -1951,7 +1953,7 @@ class ConfirmParams(RequestOptions): """ Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. """ @@ -1977,7 +1979,7 @@ class ConfirmParams(RequestOptions): """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. @@ -2001,7 +2003,7 @@ class ConfirmParams(RequestOptions): """ Shipping information for this PaymentIntent. """ - use_stripe_sdk: NotRequired["bool"] + use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ @@ -2015,7 +2017,7 @@ class ConfirmParamsMandateData(TypedDict): """ class ConfirmParamsMandateDataCustomerAcceptance(TypedDict): - accepted_at: NotRequired["int"] + accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ @@ -2040,11 +2042,11 @@ class ConfirmParamsMandateDataCustomerAcceptanceOffline(TypedDict): pass class ConfirmParamsMandateDataCustomerAcceptanceOnline(TypedDict): - ip_address: NotRequired["str"] + ip_address: NotRequired[str] """ The IP address from which the Mandate was accepted by the customer. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the Mandate was accepted by the customer. """ @@ -2166,7 +2168,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -2323,11 +2325,11 @@ class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -2356,27 +2358,27 @@ class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): """ class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -2398,14 +2400,43 @@ class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): class ConfirmParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -2445,7 +2476,24 @@ class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -2490,7 +2538,34 @@ class ConfirmParamsPaymentMethodDataOxxo(TypedDict): class ConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -2509,7 +2584,7 @@ class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): pass class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -2533,23 +2608,23 @@ class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -2798,7 +2873,7 @@ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -2811,17 +2886,17 @@ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ @@ -2835,11 +2910,11 @@ class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - preferred_locale: NotRequired["str"] + preferred_locale: NotRequired[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2859,12 +2934,12 @@ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2918,7 +2993,7 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -2936,7 +3011,7 @@ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): """ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): - code: NotRequired["str"] + code: NotRequired[str] """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ @@ -2952,7 +3027,7 @@ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): """ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ @@ -2978,7 +3053,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - cvc_token: NotRequired["str"] + cvc_token: NotRequired[str] """ A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ @@ -2996,45 +3071,57 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ Configuration options for setting up an eMandate for cards issued in India. """ - moto: NotRequired["bool"] + moto: NotRequired[bool] """ When specified, this parameter indicates that a transaction will be marked as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ - request_multicapture: NotRequired["Literal['if_available', 'never']"] + request_multicapture: NotRequired[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ - request_overcapture: NotRequired["Literal['if_available', 'never']"] + request_overcapture: NotRequired[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ - require_cvc_recollection: NotRequired["bool"] + require_cvc_recollection: NotRequired[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ @@ -3067,7 +3154,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ class ConfirmParamsPaymentMethodOptionsCardInstallments(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Setting to true enables installments for this PaymentIntent. This will cause the response to contain a list of available installment plans. @@ -3105,11 +3192,11 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ 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"] + 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: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ @@ -3117,7 +3204,7 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ @@ -3129,22 +3216,22 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - supported_types: NotRequired["List[Literal['india']]"] + supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): - request_extended_authorization: NotRequired["bool"] + request_extended_authorization: NotRequired[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ - request_incremental_authorization_support: NotRequired["bool"] + request_incremental_authorization_support: NotRequired[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ request_incremental_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ This field was released by mistake and will be removed in the next major version @@ -3152,7 +3239,7 @@ class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ - "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. @@ -3165,13 +3252,13 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - "Literal['01', '02', '05', '06', '07']" + Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ - exemption_indicator: NotRequired["Literal['low_risk', 'none']"] + exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ @@ -3183,7 +3270,7 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ - requestor_challenge_indicator: NotRequired["str"] + requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. @@ -3217,14 +3304,14 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBanca to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ - cb_exemption: NotRequired["str"] + cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ - cb_score: NotRequired["int"] + cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 @@ -3259,11 +3346,11 @@ class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["Literal['bank_transfer']"] + funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3284,7 +3371,17 @@ class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Configuration for the eu_bank_transfer funding type. """ requested_address_types: NotRequired[ - "List[Literal['aba', 'iban', 'sepa', 'sort_code', 'spei', 'swift', 'zengin']]" + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. @@ -3311,7 +3408,7 @@ class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer """ class ConfirmParamsPaymentMethodOptionsEps(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3323,7 +3420,7 @@ class ConfirmParamsPaymentMethodOptionsEps(TypedDict): """ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3335,7 +3432,7 @@ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): """ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3347,7 +3444,7 @@ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): """ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3385,12 +3482,57 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sv-FI', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sv-FI", + "sv-SE", + ] ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3418,7 +3560,7 @@ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3438,7 +3580,7 @@ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - persistent_token: NotRequired["str"] + persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ @@ -3464,7 +3606,7 @@ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3476,11 +3618,11 @@ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): """ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3492,7 +3634,7 @@ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): """ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3502,13 +3644,13 @@ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ - tos_shown_and_accepted: NotRequired["bool"] + tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3525,16 +3667,38 @@ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ - risk_correlation_id: NotRequired["str"] + risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ @@ -3552,15 +3716,15 @@ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): """ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): - expires_after_seconds: NotRequired["int"] + expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3572,7 +3736,7 @@ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): """ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3643,7 +3807,7 @@ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): """ The order ID displayed in the Swish app after the payment is authorized. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3692,7 +3856,7 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -3702,16 +3866,20 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ @@ -3725,13 +3893,13 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( """ class ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired["List[Literal['ach', 'us_domestic_wire']]"] + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): - app_id: NotRequired["str"] + app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ @@ -3739,7 +3907,7 @@ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3751,7 +3919,7 @@ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): """ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3763,7 +3931,7 @@ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): """ class ConfirmParamsRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -3773,7 +3941,7 @@ class ConfirmParamsShipping(TypedDict): """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ @@ -3781,37 +3949,37 @@ class ConfirmParamsShipping(TypedDict): """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class ConfirmParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -3821,7 +3989,7 @@ class CreateParams(RequestOptions): """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). """ - application_fee_amount: NotRequired["int"] + 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ @@ -3832,20 +4000,20 @@ class CreateParams(RequestOptions): When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. """ capture_method: NotRequired[ - "Literal['automatic', 'automatic_async', 'manual']" + Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ - confirm: NotRequired["bool"] + confirm: NotRequired[bool] """ Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). """ - confirmation_method: NotRequired["Literal['automatic', 'manual']"] + confirmation_method: NotRequired[Literal["automatic", "manual"]] """ Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. """ - confirmation_token: NotRequired["str"] + confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this PaymentIntent. @@ -3855,7 +4023,7 @@ class CreateParams(RequestOptions): """ 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). """ - customer: NotRequired["str"] + customer: NotRequired[str] """ ID of the Customer this PaymentIntent belongs to, if one exists. @@ -3863,19 +4031,19 @@ class CreateParams(RequestOptions): If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - error_on_requires_action: NotRequired["bool"] + error_on_requires_action: NotRequired[bool] """ Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - mandate: NotRequired["str"] + mandate: NotRequired[str] """ ID of the mandate that's used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ @@ -3885,7 +4053,7 @@ class CreateParams(RequestOptions): """ This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -3893,17 +4061,17 @@ class CreateParams(RequestOptions): """ Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The Stripe account ID that these funds are intended for. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API. We recommend that you explicitly provide the `payment_method` moving forward. """ - payment_method_configuration: NotRequired["str"] + payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this PaymentIntent. """ @@ -3921,7 +4089,7 @@ class CreateParams(RequestOptions): """ Payment method-specific configuration for this PaymentIntent. """ - payment_method_types: NotRequired["List[str]"] + payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, it defaults to ["card"]. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). """ @@ -3929,15 +4097,15 @@ class CreateParams(RequestOptions): """ Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). """ - receipt_email: NotRequired["str"] + receipt_email: NotRequired[str] """ Email address to send the receipt to. If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ - setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] + setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3949,11 +4117,11 @@ class CreateParams(RequestOptions): """ Shipping information for this PaymentIntent. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must contain 1-22 characters. """ @@ -3962,17 +4130,17 @@ class CreateParams(RequestOptions): The parameters that you can use to automatically create a Transfer. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). """ - use_stripe_sdk: NotRequired["bool"] + use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ class CreateParamsAutomaticPaymentMethods(TypedDict): - allow_redirects: NotRequired["Literal['always', 'never']"] + allow_redirects: NotRequired[Literal["always", "never"]] """ Controls whether this PaymentIntent will accept redirect-based payment methods. @@ -3990,7 +4158,7 @@ class CreateParamsMandateData(TypedDict): """ class CreateParamsMandateDataCustomerAcceptance(TypedDict): - accepted_at: NotRequired["int"] + accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ @@ -4141,7 +4309,7 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -4298,11 +4466,11 @@ class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -4331,27 +4499,27 @@ class CreateParamsPaymentMethodDataBillingDetails(TypedDict): """ class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -4373,14 +4541,43 @@ class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): class CreateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -4420,7 +4617,24 @@ class CreateParamsPaymentMethodDataGrabpay(TypedDict): class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -4465,7 +4679,34 @@ class CreateParamsPaymentMethodDataOxxo(TypedDict): class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -4484,7 +4725,7 @@ class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass class CreateParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -4508,23 +4749,23 @@ class CreateParamsPaymentMethodDataSwish(TypedDict): pass class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -4773,7 +5014,7 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -4786,17 +5027,17 @@ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ @@ -4810,11 +5051,11 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - preferred_locale: NotRequired["str"] + preferred_locale: NotRequired[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4834,12 +5075,12 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4893,7 +5134,7 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -4911,7 +5152,7 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): """ class CreateParamsPaymentMethodOptionsBlik(TypedDict): - code: NotRequired["str"] + code: NotRequired[str] """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ @@ -4927,7 +5168,7 @@ class CreateParamsPaymentMethodOptionsBlik(TypedDict): """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ @@ -4953,7 +5194,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - cvc_token: NotRequired["str"] + cvc_token: NotRequired[str] """ A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ @@ -4971,45 +5212,57 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Configuration options for setting up an eMandate for cards issued in India. """ - moto: NotRequired["bool"] + moto: NotRequired[bool] """ When specified, this parameter indicates that a transaction will be marked as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ - request_multicapture: NotRequired["Literal['if_available', 'never']"] + request_multicapture: NotRequired[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ - request_overcapture: NotRequired["Literal['if_available', 'never']"] + request_overcapture: NotRequired[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ - require_cvc_recollection: NotRequired["bool"] + require_cvc_recollection: NotRequired[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ @@ -5042,7 +5295,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Setting to true enables installments for this PaymentIntent. This will cause the response to contain a list of available installment plans. @@ -5080,11 +5333,11 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ 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"] + 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: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ @@ -5092,7 +5345,7 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ @@ -5104,22 +5357,22 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - supported_types: NotRequired["List[Literal['india']]"] + supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): - request_extended_authorization: NotRequired["bool"] + request_extended_authorization: NotRequired[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ - request_incremental_authorization_support: NotRequired["bool"] + request_incremental_authorization_support: NotRequired[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ request_incremental_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ This field was released by mistake and will be removed in the next major version @@ -5127,7 +5380,7 @@ class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ - "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. @@ -5140,13 +5393,13 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - "Literal['01', '02', '05', '06', '07']" + Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ - exemption_indicator: NotRequired["Literal['low_risk', 'none']"] + exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ @@ -5158,7 +5411,7 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ - requestor_challenge_indicator: NotRequired["str"] + requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. @@ -5192,14 +5445,14 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ - cb_exemption: NotRequired["str"] + cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ - cb_score: NotRequired["int"] + cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 @@ -5234,11 +5487,11 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["Literal['bank_transfer']"] + funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5259,7 +5512,17 @@ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Configuration for the eu_bank_transfer funding type. """ requested_address_types: NotRequired[ - "List[Literal['aba', 'iban', 'sepa', 'sort_code', 'spei', 'swift', 'zengin']]" + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. @@ -5286,7 +5549,7 @@ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( """ class CreateParamsPaymentMethodOptionsEps(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5298,7 +5561,7 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5310,7 +5573,7 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5322,7 +5585,7 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5360,12 +5623,57 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sv-FI', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sv-FI", + "sv-SE", + ] ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5393,7 +5701,7 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5413,7 +5721,7 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - persistent_token: NotRequired["str"] + persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ @@ -5439,7 +5747,7 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5451,11 +5759,11 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5467,7 +5775,7 @@ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): """ class CreateParamsPaymentMethodOptionsP24(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5477,13 +5785,13 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ - tos_shown_and_accepted: NotRequired["bool"] + tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5500,16 +5808,38 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ - risk_correlation_id: NotRequired["str"] + risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ @@ -5527,15 +5857,15 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): """ class CreateParamsPaymentMethodOptionsPix(TypedDict): - expires_after_seconds: NotRequired["int"] + expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5547,7 +5877,7 @@ class CreateParamsPaymentMethodOptionsPix(TypedDict): """ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5618,7 +5948,7 @@ class CreateParamsPaymentMethodOptionsSwish(TypedDict): """ The order ID displayed in the Swish app after the payment is authorized. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5667,7 +5997,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -5677,16 +6007,20 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ @@ -5700,13 +6034,13 @@ class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( """ class CreateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired["List[Literal['ach', 'us_domestic_wire']]"] + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): - app_id: NotRequired["str"] + app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ @@ -5714,7 +6048,7 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5726,7 +6060,7 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ class CreateParamsPaymentMethodOptionsZip(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5738,7 +6072,7 @@ class CreateParamsPaymentMethodOptionsZip(TypedDict): """ class CreateParamsRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -5748,7 +6082,7 @@ class CreateParamsShipping(TypedDict): """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ @@ -5756,43 +6090,43 @@ class CreateParamsShipping(TypedDict): """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. The amount is capped at the total transaction amount and if no amount is set, @@ -5815,23 +6149,23 @@ class IncrementAuthorizationParams(RequestOptions): """ The updated total amount that you intend to collect from the cardholder. This amount must be greater than the currently authorized amount. """ - application_fee_amount: NotRequired["int"] + 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ @@ -5844,7 +6178,7 @@ class IncrementAuthorizationParams(RequestOptions): """ class IncrementAuthorizationParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ @@ -5854,47 +6188,47 @@ class ListParams(RequestOptions): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return PaymentIntents for the customer that this customer ID specifies. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). """ @@ -5903,16 +6237,16 @@ class ModifyParams(RequestOptions): 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ capture_method: NotRequired[ - "Literal['automatic', 'automatic_async', 'manual']" + Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ - customer: NotRequired["str"] + customer: NotRequired[str] """ ID of the Customer this PaymentIntent belongs to, if one exists. @@ -5920,11 +6254,11 @@ class ModifyParams(RequestOptions): If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -5932,11 +6266,11 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. """ - payment_method_configuration: NotRequired["str"] + payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this PaymentIntent. """ @@ -5954,7 +6288,7 @@ class ModifyParams(RequestOptions): """ Payment-method-specific configuration for this PaymentIntent. """ - payment_method_types: NotRequired["List[str]"] + payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). """ @@ -5978,11 +6312,11 @@ class ModifyParams(RequestOptions): """ Shipping information for this PaymentIntent. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ @@ -5990,7 +6324,7 @@ class ModifyParams(RequestOptions): """ Use this parameter to automatically create a Transfer when the payment succeeds. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. You can only provide `transfer_group` if it hasn't been set. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ @@ -6112,7 +6446,7 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -6269,11 +6603,11 @@ class ModifyParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class ModifyParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -6302,27 +6636,27 @@ class ModifyParamsPaymentMethodDataBillingDetails(TypedDict): """ class ModifyParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -6344,14 +6678,43 @@ class ModifyParamsPaymentMethodDataCustomerBalance(TypedDict): class ModifyParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class ModifyParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -6391,7 +6754,24 @@ class ModifyParamsPaymentMethodDataGrabpay(TypedDict): class ModifyParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -6436,7 +6816,34 @@ class ModifyParamsPaymentMethodDataOxxo(TypedDict): class ModifyParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -6455,7 +6862,7 @@ class ModifyParamsPaymentMethodDataPromptpay(TypedDict): pass class ModifyParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -6479,23 +6886,23 @@ class ModifyParamsPaymentMethodDataSwish(TypedDict): pass class ModifyParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -6744,7 +7151,7 @@ class ModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -6757,17 +7164,17 @@ class ModifyParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ @@ -6781,11 +7188,11 @@ class ModifyParamsPaymentMethodOptionsAffirm(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - preferred_locale: NotRequired["str"] + preferred_locale: NotRequired[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -6805,12 +7212,12 @@ class ModifyParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -6864,7 +7271,7 @@ class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class ModifyParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -6882,7 +7289,7 @@ class ModifyParamsPaymentMethodOptionsBancontact(TypedDict): """ class ModifyParamsPaymentMethodOptionsBlik(TypedDict): - code: NotRequired["str"] + code: NotRequired[str] """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ @@ -6898,7 +7305,7 @@ class ModifyParamsPaymentMethodOptionsBlik(TypedDict): """ class ModifyParamsPaymentMethodOptionsBoleto(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ @@ -6924,7 +7331,7 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - cvc_token: NotRequired["str"] + cvc_token: NotRequired[str] """ A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ @@ -6942,45 +7349,57 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ Configuration options for setting up an eMandate for cards issued in India. """ - moto: NotRequired["bool"] + moto: NotRequired[bool] """ When specified, this parameter indicates that a transaction will be marked as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ - request_multicapture: NotRequired["Literal['if_available', 'never']"] + request_multicapture: NotRequired[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ - request_overcapture: NotRequired["Literal['if_available', 'never']"] + request_overcapture: NotRequired[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ - require_cvc_recollection: NotRequired["bool"] + require_cvc_recollection: NotRequired[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ @@ -7013,7 +7432,7 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ class ModifyParamsPaymentMethodOptionsCardInstallments(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Setting to true enables installments for this PaymentIntent. This will cause the response to contain a list of available installment plans. @@ -7051,11 +7470,11 @@ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ 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"] + 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: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ @@ -7063,7 +7482,7 @@ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ @@ -7075,22 +7494,22 @@ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - supported_types: NotRequired["List[Literal['india']]"] + supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class ModifyParamsPaymentMethodOptionsCardPresent(TypedDict): - request_extended_authorization: NotRequired["bool"] + request_extended_authorization: NotRequired[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ - request_incremental_authorization_support: NotRequired["bool"] + request_incremental_authorization_support: NotRequired[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ request_incremental_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ This field was released by mistake and will be removed in the next major version @@ -7098,7 +7517,7 @@ class ModifyParamsPaymentMethodOptionsCardPresent(TypedDict): class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ - "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. @@ -7111,13 +7530,13 @@ class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - "Literal['01', '02', '05', '06', '07']" + Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ - exemption_indicator: NotRequired["Literal['low_risk', 'none']"] + exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ @@ -7129,7 +7548,7 @@ class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ - requestor_challenge_indicator: NotRequired["str"] + requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. @@ -7163,14 +7582,14 @@ class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ - cb_exemption: NotRequired["str"] + cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ - cb_score: NotRequired["int"] + cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 @@ -7205,11 +7624,11 @@ class ModifyParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["Literal['bank_transfer']"] + funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7230,7 +7649,17 @@ class ModifyParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Configuration for the eu_bank_transfer funding type. """ requested_address_types: NotRequired[ - "List[Literal['aba', 'iban', 'sepa', 'sort_code', 'spei', 'swift', 'zengin']]" + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. @@ -7257,7 +7686,7 @@ class ModifyParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( """ class ModifyParamsPaymentMethodOptionsEps(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7269,7 +7698,7 @@ class ModifyParamsPaymentMethodOptionsEps(TypedDict): """ class ModifyParamsPaymentMethodOptionsFpx(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7281,7 +7710,7 @@ class ModifyParamsPaymentMethodOptionsFpx(TypedDict): """ class ModifyParamsPaymentMethodOptionsGiropay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7293,7 +7722,7 @@ class ModifyParamsPaymentMethodOptionsGiropay(TypedDict): """ class ModifyParamsPaymentMethodOptionsGrabpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7331,12 +7760,57 @@ class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sv-FI', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sv-FI", + "sv-SE", + ] ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7364,7 +7838,7 @@ class ModifyParamsPaymentMethodOptionsKonbini(TypedDict): """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7384,7 +7858,7 @@ class ModifyParamsPaymentMethodOptionsLink(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - persistent_token: NotRequired["str"] + persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ @@ -7410,7 +7884,7 @@ class ModifyParamsPaymentMethodOptionsMobilepay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7422,11 +7896,11 @@ class ModifyParamsPaymentMethodOptionsMobilepay(TypedDict): """ class ModifyParamsPaymentMethodOptionsOxxo(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7438,7 +7912,7 @@ class ModifyParamsPaymentMethodOptionsOxxo(TypedDict): """ class ModifyParamsPaymentMethodOptionsP24(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7448,13 +7922,13 @@ class ModifyParamsPaymentMethodOptionsP24(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ - tos_shown_and_accepted: NotRequired["bool"] + tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class ModifyParamsPaymentMethodOptionsPaynow(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7471,16 +7945,38 @@ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ - risk_correlation_id: NotRequired["str"] + risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ @@ -7498,15 +7994,15 @@ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): """ class ModifyParamsPaymentMethodOptionsPix(TypedDict): - expires_after_seconds: NotRequired["int"] + expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7518,7 +8014,7 @@ class ModifyParamsPaymentMethodOptionsPix(TypedDict): """ class ModifyParamsPaymentMethodOptionsPromptpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7589,7 +8085,7 @@ class ModifyParamsPaymentMethodOptionsSwish(TypedDict): """ The order ID displayed in the Swish app after the payment is authorized. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7638,7 +8134,7 @@ class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -7648,16 +8144,20 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ @@ -7671,13 +8171,13 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountMandateOptions( """ class ModifyParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired["List[Literal['ach', 'us_domestic_wire']]"] + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class ModifyParamsPaymentMethodOptionsWechatPay(TypedDict): - app_id: NotRequired["str"] + app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ @@ -7685,7 +8185,7 @@ class ModifyParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7697,7 +8197,7 @@ class ModifyParamsPaymentMethodOptionsWechatPay(TypedDict): """ class ModifyParamsPaymentMethodOptionsZip(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7713,7 +8213,7 @@ class ModifyParamsShipping(TypedDict): """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ @@ -7721,67 +8221,67 @@ class ModifyParamsShipping(TypedDict): """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class ModifyParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ class RetrieveParams(RequestOptions): - client_secret: NotRequired["str"] + client_secret: NotRequired[str] """ The client secret of the PaymentIntent. We require it if you use a publishable key to retrieve the source. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ @@ -7791,15 +8291,15 @@ class SearchParams(RequestOptions): """ class VerifyMicrodepositsParams(RequestOptions): - amounts: NotRequired["List[int]"] + amounts: NotRequired[List[int]] """ Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. """ - descriptor_code: NotRequired["str"] + descriptor_code: NotRequired[str] """ A six-character code starting with SM present in the microdeposit sent to the bank account. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 12ffa0d2b..525022225 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -12,7 +12,7 @@ class PaymentIntentService(StripeService): class ApplyCustomerBalanceParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount that you intend to apply to this PaymentIntent from the customer's cash balance. @@ -22,41 +22,43 @@ class ApplyCustomerBalanceParams(TypedDict): When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CancelParams(TypedDict): cancellation_reason: NotRequired[ - "Literal['abandoned', 'duplicate', 'fraudulent', 'requested_by_customer']" + Literal[ + "abandoned", "duplicate", "fraudulent", "requested_by_customer" + ] ] """ Reason for canceling this PaymentIntent. Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned` """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CaptureParams(TypedDict): - amount_to_capture: NotRequired["int"] + amount_to_capture: NotRequired[int] """ The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount is automatically refunded. Defaults to the full `amount_capturable` if it's not provided. """ - application_fee_amount: NotRequired["int"] + 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - final_capture: NotRequired["bool"] + final_capture: NotRequired[bool] """ Defaults to `true`. When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they're captured in future requests. You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents. """ @@ -64,11 +66,11 @@ class CaptureParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must be 1-22 characters long. """ @@ -81,33 +83,33 @@ class CaptureParams(TypedDict): """ class CaptureParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ class ConfirmParams(TypedDict): capture_method: NotRequired[ - "Literal['automatic', 'automatic_async', 'manual']" + Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ - confirmation_token: NotRequired["str"] + confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this PaymentIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ - error_on_requires_action: NotRequired["bool"] + error_on_requires_action: NotRequired[bool] """ 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://stripe.com/docs/payments/save-card-without-authentication). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - mandate: NotRequired["str"] + mandate: NotRequired[str] """ ID of the mandate that's used for this payment. """ @@ -118,7 +120,7 @@ class ConfirmParams(TypedDict): """ Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. """ @@ -146,7 +148,7 @@ class ConfirmParams(TypedDict): """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. @@ -170,7 +172,7 @@ class ConfirmParams(TypedDict): """ Shipping information for this PaymentIntent. """ - use_stripe_sdk: NotRequired["bool"] + use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ @@ -184,7 +186,7 @@ class ConfirmParamsMandateData(TypedDict): """ class ConfirmParamsMandateDataCustomerAcceptance(TypedDict): - accepted_at: NotRequired["int"] + accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ @@ -209,11 +211,11 @@ class ConfirmParamsMandateDataCustomerAcceptanceOffline(TypedDict): pass class ConfirmParamsMandateDataCustomerAcceptanceOnline(TypedDict): - ip_address: NotRequired["str"] + ip_address: NotRequired[str] """ The IP address from which the Mandate was accepted by the customer. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the Mandate was accepted by the customer. """ @@ -345,7 +347,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -512,11 +514,11 @@ class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -545,27 +547,27 @@ class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): """ class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -587,14 +589,43 @@ class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): class ConfirmParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -634,7 +665,24 @@ class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -679,7 +727,34 @@ class ConfirmParamsPaymentMethodDataOxxo(TypedDict): class ConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -698,7 +773,7 @@ class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): pass class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -722,23 +797,23 @@ class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -987,7 +1062,7 @@ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -1000,17 +1075,17 @@ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ @@ -1024,11 +1099,11 @@ class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - preferred_locale: NotRequired["str"] + preferred_locale: NotRequired[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1048,12 +1123,12 @@ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1107,7 +1182,7 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -1125,7 +1200,7 @@ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): """ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): - code: NotRequired["str"] + code: NotRequired[str] """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ @@ -1141,7 +1216,7 @@ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): """ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ @@ -1167,7 +1242,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - cvc_token: NotRequired["str"] + cvc_token: NotRequired[str] """ A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ @@ -1185,45 +1260,57 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ Configuration options for setting up an eMandate for cards issued in India. """ - moto: NotRequired["bool"] + moto: NotRequired[bool] """ When specified, this parameter indicates that a transaction will be marked as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ - request_multicapture: NotRequired["Literal['if_available', 'never']"] + request_multicapture: NotRequired[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ - request_overcapture: NotRequired["Literal['if_available', 'never']"] + request_overcapture: NotRequired[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ - require_cvc_recollection: NotRequired["bool"] + require_cvc_recollection: NotRequired[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ @@ -1256,7 +1343,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ class ConfirmParamsPaymentMethodOptionsCardInstallments(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Setting to true enables installments for this PaymentIntent. This will cause the response to contain a list of available installment plans. @@ -1294,11 +1381,11 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ 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"] + 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: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ @@ -1306,7 +1393,7 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ @@ -1318,22 +1405,22 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - supported_types: NotRequired["List[Literal['india']]"] + supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): - request_extended_authorization: NotRequired["bool"] + request_extended_authorization: NotRequired[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ - request_incremental_authorization_support: NotRequired["bool"] + request_incremental_authorization_support: NotRequired[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ request_incremental_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ This field was released by mistake and will be removed in the next major version @@ -1341,7 +1428,7 @@ class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ - "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. @@ -1354,13 +1441,13 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - "Literal['01', '02', '05', '06', '07']" + Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ - exemption_indicator: NotRequired["Literal['low_risk', 'none']"] + exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ @@ -1372,7 +1459,7 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ - requestor_challenge_indicator: NotRequired["str"] + requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. @@ -1406,14 +1493,14 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBanca to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ - cb_exemption: NotRequired["str"] + cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ - cb_score: NotRequired["int"] + cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 @@ -1448,11 +1535,11 @@ class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["Literal['bank_transfer']"] + funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1473,7 +1560,17 @@ class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Configuration for the eu_bank_transfer funding type. """ requested_address_types: NotRequired[ - "List[Literal['aba', 'iban', 'sepa', 'sort_code', 'spei', 'swift', 'zengin']]" + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. @@ -1500,7 +1597,7 @@ class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer """ class ConfirmParamsPaymentMethodOptionsEps(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1512,7 +1609,7 @@ class ConfirmParamsPaymentMethodOptionsEps(TypedDict): """ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1524,7 +1621,7 @@ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): """ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1536,7 +1633,7 @@ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): """ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1574,12 +1671,57 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sv-FI', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sv-FI", + "sv-SE", + ] ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1607,7 +1749,7 @@ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1627,7 +1769,7 @@ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - persistent_token: NotRequired["str"] + persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ @@ -1653,7 +1795,7 @@ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1665,11 +1807,11 @@ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): """ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1681,7 +1823,7 @@ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): """ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1691,13 +1833,13 @@ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ - tos_shown_and_accepted: NotRequired["bool"] + tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1714,16 +1856,38 @@ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ - risk_correlation_id: NotRequired["str"] + risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ @@ -1741,15 +1905,15 @@ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): """ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): - expires_after_seconds: NotRequired["int"] + expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1761,7 +1925,7 @@ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): """ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1832,7 +1996,7 @@ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): """ The order ID displayed in the Swish app after the payment is authorized. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1881,7 +2045,7 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -1891,16 +2055,20 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ @@ -1914,13 +2082,13 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( """ class ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired["List[Literal['ach', 'us_domestic_wire']]"] + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): - app_id: NotRequired["str"] + app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ @@ -1928,7 +2096,7 @@ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1940,7 +2108,7 @@ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): """ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1952,7 +2120,7 @@ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): """ class ConfirmParamsRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -1962,7 +2130,7 @@ class ConfirmParamsShipping(TypedDict): """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ @@ -1970,37 +2138,37 @@ class ConfirmParamsShipping(TypedDict): """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class ConfirmParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -2010,7 +2178,7 @@ class CreateParams(TypedDict): """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). """ - application_fee_amount: NotRequired["int"] + 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ @@ -2021,20 +2189,20 @@ class CreateParams(TypedDict): When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. """ capture_method: NotRequired[ - "Literal['automatic', 'automatic_async', 'manual']" + Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ - confirm: NotRequired["bool"] + confirm: NotRequired[bool] """ Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). """ - confirmation_method: NotRequired["Literal['automatic', 'manual']"] + confirmation_method: NotRequired[Literal["automatic", "manual"]] """ Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. """ - confirmation_token: NotRequired["str"] + confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this PaymentIntent. @@ -2044,7 +2212,7 @@ class CreateParams(TypedDict): """ 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). """ - customer: NotRequired["str"] + customer: NotRequired[str] """ ID of the Customer this PaymentIntent belongs to, if one exists. @@ -2052,19 +2220,19 @@ class CreateParams(TypedDict): If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - error_on_requires_action: NotRequired["bool"] + error_on_requires_action: NotRequired[bool] """ Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - mandate: NotRequired["str"] + mandate: NotRequired[str] """ ID of the mandate that's used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ @@ -2074,7 +2242,7 @@ class CreateParams(TypedDict): """ This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -2082,17 +2250,17 @@ class CreateParams(TypedDict): """ Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The Stripe account ID that these funds are intended for. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API. We recommend that you explicitly provide the `payment_method` moving forward. """ - payment_method_configuration: NotRequired["str"] + payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this PaymentIntent. """ @@ -2110,7 +2278,7 @@ class CreateParams(TypedDict): """ Payment method-specific configuration for this PaymentIntent. """ - payment_method_types: NotRequired["List[str]"] + payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, it defaults to ["card"]. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). """ @@ -2120,15 +2288,15 @@ class CreateParams(TypedDict): """ Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). """ - receipt_email: NotRequired["str"] + receipt_email: NotRequired[str] """ Email address to send the receipt to. If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ - setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] + setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2140,11 +2308,11 @@ class CreateParams(TypedDict): """ Shipping information for this PaymentIntent. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must contain 1-22 characters. """ @@ -2155,17 +2323,17 @@ class CreateParams(TypedDict): The parameters that you can use to automatically create a Transfer. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). """ - use_stripe_sdk: NotRequired["bool"] + use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ class CreateParamsAutomaticPaymentMethods(TypedDict): - allow_redirects: NotRequired["Literal['always', 'never']"] + allow_redirects: NotRequired[Literal["always", "never"]] """ Controls whether this PaymentIntent will accept redirect-based payment methods. @@ -2183,7 +2351,7 @@ class CreateParamsMandateData(TypedDict): """ class CreateParamsMandateDataCustomerAcceptance(TypedDict): - accepted_at: NotRequired["int"] + accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ @@ -2344,7 +2512,7 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -2511,11 +2679,11 @@ class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -2544,27 +2712,27 @@ class CreateParamsPaymentMethodDataBillingDetails(TypedDict): """ class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -2586,14 +2754,43 @@ class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): class CreateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -2633,7 +2830,24 @@ class CreateParamsPaymentMethodDataGrabpay(TypedDict): class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -2678,7 +2892,34 @@ class CreateParamsPaymentMethodDataOxxo(TypedDict): class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -2697,7 +2938,7 @@ class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass class CreateParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -2721,23 +2962,23 @@ class CreateParamsPaymentMethodDataSwish(TypedDict): pass class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -2986,7 +3227,7 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -2999,17 +3240,17 @@ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ @@ -3023,11 +3264,11 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - preferred_locale: NotRequired["str"] + preferred_locale: NotRequired[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3047,12 +3288,12 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3106,7 +3347,7 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -3124,7 +3365,7 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): """ class CreateParamsPaymentMethodOptionsBlik(TypedDict): - code: NotRequired["str"] + code: NotRequired[str] """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ @@ -3140,7 +3381,7 @@ class CreateParamsPaymentMethodOptionsBlik(TypedDict): """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ @@ -3166,7 +3407,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - cvc_token: NotRequired["str"] + cvc_token: NotRequired[str] """ A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ @@ -3184,45 +3425,57 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Configuration options for setting up an eMandate for cards issued in India. """ - moto: NotRequired["bool"] + moto: NotRequired[bool] """ When specified, this parameter indicates that a transaction will be marked as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ - request_multicapture: NotRequired["Literal['if_available', 'never']"] + request_multicapture: NotRequired[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ - request_overcapture: NotRequired["Literal['if_available', 'never']"] + request_overcapture: NotRequired[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ - require_cvc_recollection: NotRequired["bool"] + require_cvc_recollection: NotRequired[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ @@ -3255,7 +3508,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Setting to true enables installments for this PaymentIntent. This will cause the response to contain a list of available installment plans. @@ -3293,11 +3546,11 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ 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"] + 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: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ @@ -3305,7 +3558,7 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ @@ -3317,22 +3570,22 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - supported_types: NotRequired["List[Literal['india']]"] + supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): - request_extended_authorization: NotRequired["bool"] + request_extended_authorization: NotRequired[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ - request_incremental_authorization_support: NotRequired["bool"] + request_incremental_authorization_support: NotRequired[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ request_incremental_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ This field was released by mistake and will be removed in the next major version @@ -3340,7 +3593,7 @@ class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ - "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. @@ -3353,13 +3606,13 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - "Literal['01', '02', '05', '06', '07']" + Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ - exemption_indicator: NotRequired["Literal['low_risk', 'none']"] + exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ @@ -3371,7 +3624,7 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ - requestor_challenge_indicator: NotRequired["str"] + requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. @@ -3405,14 +3658,14 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ - cb_exemption: NotRequired["str"] + cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ - cb_score: NotRequired["int"] + cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 @@ -3447,11 +3700,11 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["Literal['bank_transfer']"] + funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3472,7 +3725,17 @@ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Configuration for the eu_bank_transfer funding type. """ requested_address_types: NotRequired[ - "List[Literal['aba', 'iban', 'sepa', 'sort_code', 'spei', 'swift', 'zengin']]" + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. @@ -3499,7 +3762,7 @@ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( """ class CreateParamsPaymentMethodOptionsEps(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3511,7 +3774,7 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3523,7 +3786,7 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3535,7 +3798,7 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3573,12 +3836,57 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sv-FI', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sv-FI", + "sv-SE", + ] ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3606,7 +3914,7 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3626,7 +3934,7 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - persistent_token: NotRequired["str"] + persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ @@ -3652,7 +3960,7 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3664,11 +3972,11 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3680,7 +3988,7 @@ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): """ class CreateParamsPaymentMethodOptionsP24(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3690,13 +3998,13 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ - tos_shown_and_accepted: NotRequired["bool"] + tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3713,16 +4021,38 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ - risk_correlation_id: NotRequired["str"] + risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ @@ -3740,15 +4070,15 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): """ class CreateParamsPaymentMethodOptionsPix(TypedDict): - expires_after_seconds: NotRequired["int"] + expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3760,7 +4090,7 @@ class CreateParamsPaymentMethodOptionsPix(TypedDict): """ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3831,7 +4161,7 @@ class CreateParamsPaymentMethodOptionsSwish(TypedDict): """ The order ID displayed in the Swish app after the payment is authorized. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3880,7 +4210,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -3890,16 +4220,20 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ @@ -3913,13 +4247,13 @@ class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( """ class CreateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired["List[Literal['ach', 'us_domestic_wire']]"] + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): - app_id: NotRequired["str"] + app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ @@ -3927,7 +4261,7 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3939,7 +4273,7 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ class CreateParamsPaymentMethodOptionsZip(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3951,7 +4285,7 @@ class CreateParamsPaymentMethodOptionsZip(TypedDict): """ class CreateParamsRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -3961,7 +4295,7 @@ class CreateParamsShipping(TypedDict): """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ @@ -3969,43 +4303,43 @@ class CreateParamsShipping(TypedDict): """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. The amount is capped at the total transaction amount and if no amount is set, @@ -4028,23 +4362,23 @@ class IncrementAuthorizationParams(TypedDict): """ The updated total amount that you intend to collect from the cardholder. This amount must be greater than the currently authorized amount. """ - application_fee_amount: NotRequired["int"] + 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ @@ -4057,7 +4391,7 @@ class IncrementAuthorizationParams(TypedDict): """ class IncrementAuthorizationParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ @@ -4067,65 +4401,65 @@ class ListParams(TypedDict): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return PaymentIntents for the customer that this customer ID specifies. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - client_secret: NotRequired["str"] + client_secret: NotRequired[str] """ The client secret of the PaymentIntent. We require it if you use a publishable key to retrieve the source. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ @@ -4135,7 +4469,7 @@ class SearchParams(TypedDict): """ class UpdateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). """ @@ -4144,16 +4478,16 @@ class UpdateParams(TypedDict): 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ capture_method: NotRequired[ - "Literal['automatic', 'automatic_async', 'manual']" + Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ - customer: NotRequired["str"] + customer: NotRequired[str] """ ID of the Customer this PaymentIntent belongs to, if one exists. @@ -4161,11 +4495,11 @@ class UpdateParams(TypedDict): If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -4173,11 +4507,11 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. """ - payment_method_configuration: NotRequired["str"] + payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this PaymentIntent. """ @@ -4195,7 +4529,7 @@ class UpdateParams(TypedDict): """ Payment-method-specific configuration for this PaymentIntent. """ - payment_method_types: NotRequired["List[str]"] + payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). """ @@ -4221,11 +4555,11 @@ class UpdateParams(TypedDict): """ Shipping information for this PaymentIntent. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ @@ -4235,7 +4569,7 @@ class UpdateParams(TypedDict): """ Use this parameter to automatically create a Transfer when the payment succeeds. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. You can only provide `transfer_group` if it hasn't been set. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ @@ -4367,7 +4701,7 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -4534,11 +4868,11 @@ class UpdateParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class UpdateParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -4567,27 +4901,27 @@ class UpdateParamsPaymentMethodDataBillingDetails(TypedDict): """ class UpdateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -4609,14 +4943,43 @@ class UpdateParamsPaymentMethodDataCustomerBalance(TypedDict): class UpdateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class UpdateParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -4656,7 +5019,24 @@ class UpdateParamsPaymentMethodDataGrabpay(TypedDict): class UpdateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -4701,7 +5081,34 @@ class UpdateParamsPaymentMethodDataOxxo(TypedDict): class UpdateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -4720,7 +5127,7 @@ class UpdateParamsPaymentMethodDataPromptpay(TypedDict): pass class UpdateParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -4744,23 +5151,23 @@ class UpdateParamsPaymentMethodDataSwish(TypedDict): pass class UpdateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -5009,7 +5416,7 @@ class UpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -5022,17 +5429,17 @@ class UpdateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ @@ -5046,11 +5453,11 @@ class UpdateParamsPaymentMethodOptionsAffirm(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - preferred_locale: NotRequired["str"] + preferred_locale: NotRequired[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5070,12 +5477,12 @@ class UpdateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5129,7 +5536,7 @@ class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class UpdateParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -5147,7 +5554,7 @@ class UpdateParamsPaymentMethodOptionsBancontact(TypedDict): """ class UpdateParamsPaymentMethodOptionsBlik(TypedDict): - code: NotRequired["str"] + code: NotRequired[str] """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ @@ -5163,7 +5570,7 @@ class UpdateParamsPaymentMethodOptionsBlik(TypedDict): """ class UpdateParamsPaymentMethodOptionsBoleto(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ @@ -5189,7 +5596,7 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - cvc_token: NotRequired["str"] + cvc_token: NotRequired[str] """ A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ @@ -5207,45 +5614,57 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): """ Configuration options for setting up an eMandate for cards issued in India. """ - moto: NotRequired["bool"] + moto: NotRequired[bool] """ When specified, this parameter indicates that a transaction will be marked as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ - request_multicapture: NotRequired["Literal['if_available', 'never']"] + request_multicapture: NotRequired[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ - request_overcapture: NotRequired["Literal['if_available', 'never']"] + request_overcapture: NotRequired[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ - require_cvc_recollection: NotRequired["bool"] + require_cvc_recollection: NotRequired[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ @@ -5278,7 +5697,7 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): """ class UpdateParamsPaymentMethodOptionsCardInstallments(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Setting to true enables installments for this PaymentIntent. This will cause the response to contain a list of available installment plans. @@ -5316,11 +5735,11 @@ class UpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ 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"] + 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: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ @@ -5328,7 +5747,7 @@ class UpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ @@ -5340,22 +5759,22 @@ class UpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - supported_types: NotRequired["List[Literal['india']]"] + supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class UpdateParamsPaymentMethodOptionsCardPresent(TypedDict): - request_extended_authorization: NotRequired["bool"] + request_extended_authorization: NotRequired[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ - request_incremental_authorization_support: NotRequired["bool"] + request_incremental_authorization_support: NotRequired[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ request_incremental_authorization: NotRequired[ - "Literal['if_available', 'never']" + Literal["if_available", "never"] ] """ This field was released by mistake and will be removed in the next major version @@ -5363,7 +5782,7 @@ class UpdateParamsPaymentMethodOptionsCardPresent(TypedDict): class UpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ - "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. @@ -5376,13 +5795,13 @@ class UpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - "Literal['01', '02', '05', '06', '07']" + Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ - exemption_indicator: NotRequired["Literal['low_risk', 'none']"] + exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ @@ -5394,7 +5813,7 @@ class UpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ - requestor_challenge_indicator: NotRequired["str"] + requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. @@ -5428,14 +5847,14 @@ class UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ - cb_exemption: NotRequired["str"] + cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ - cb_score: NotRequired["int"] + cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 @@ -5470,11 +5889,11 @@ class UpdateParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["Literal['bank_transfer']"] + funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5495,7 +5914,17 @@ class UpdateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Configuration for the eu_bank_transfer funding type. """ requested_address_types: NotRequired[ - "List[Literal['aba', 'iban', 'sepa', 'sort_code', 'spei', 'swift', 'zengin']]" + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. @@ -5522,7 +5951,7 @@ class UpdateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( """ class UpdateParamsPaymentMethodOptionsEps(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5534,7 +5963,7 @@ class UpdateParamsPaymentMethodOptionsEps(TypedDict): """ class UpdateParamsPaymentMethodOptionsFpx(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5546,7 +5975,7 @@ class UpdateParamsPaymentMethodOptionsFpx(TypedDict): """ class UpdateParamsPaymentMethodOptionsGiropay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5558,7 +5987,7 @@ class UpdateParamsPaymentMethodOptionsGiropay(TypedDict): """ class UpdateParamsPaymentMethodOptionsGrabpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5596,12 +6025,57 @@ class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sv-FI', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sv-FI", + "sv-SE", + ] ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5629,7 +6103,7 @@ class UpdateParamsPaymentMethodOptionsKonbini(TypedDict): """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5649,7 +6123,7 @@ class UpdateParamsPaymentMethodOptionsLink(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - persistent_token: NotRequired["str"] + persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ @@ -5675,7 +6149,7 @@ class UpdateParamsPaymentMethodOptionsMobilepay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5687,11 +6161,11 @@ class UpdateParamsPaymentMethodOptionsMobilepay(TypedDict): """ class UpdateParamsPaymentMethodOptionsOxxo(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5703,7 +6177,7 @@ class UpdateParamsPaymentMethodOptionsOxxo(TypedDict): """ class UpdateParamsPaymentMethodOptionsP24(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5713,13 +6187,13 @@ class UpdateParamsPaymentMethodOptionsP24(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ - tos_shown_and_accepted: NotRequired["bool"] + tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class UpdateParamsPaymentMethodOptionsPaynow(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5736,16 +6210,38 @@ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ - risk_correlation_id: NotRequired["str"] + risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ @@ -5763,15 +6259,15 @@ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): """ class UpdateParamsPaymentMethodOptionsPix(TypedDict): - expires_after_seconds: NotRequired["int"] + expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5783,7 +6279,7 @@ class UpdateParamsPaymentMethodOptionsPix(TypedDict): """ class UpdateParamsPaymentMethodOptionsPromptpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5854,7 +6350,7 @@ class UpdateParamsPaymentMethodOptionsSwish(TypedDict): """ The order ID displayed in the Swish app after the payment is authorized. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5903,7 +6399,7 @@ class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -5913,16 +6409,20 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ @@ -5936,13 +6436,13 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountMandateOptions( """ class UpdateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired["List[Literal['ach', 'us_domestic_wire']]"] + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class UpdateParamsPaymentMethodOptionsWechatPay(TypedDict): - app_id: NotRequired["str"] + app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ @@ -5950,7 +6450,7 @@ class UpdateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5962,7 +6462,7 @@ class UpdateParamsPaymentMethodOptionsWechatPay(TypedDict): """ class UpdateParamsPaymentMethodOptionsZip(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5978,7 +6478,7 @@ class UpdateParamsShipping(TypedDict): """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ @@ -5986,57 +6486,57 @@ class UpdateParamsShipping(TypedDict): """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class UpdateParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ class VerifyMicrodepositsParams(TypedDict): - amounts: NotRequired["List[int]"] + amounts: NotRequired[List[int]] """ Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. """ - descriptor_code: NotRequired["str"] + descriptor_code: NotRequired[str] """ A six-character code starting with SM present in the microdeposit sent to the bank account. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index bae3f7821..f2dee5ab0 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -684,15 +684,15 @@ class CreateParams(RequestOptions): """ Behavior after the purchase is complete. """ - allow_promotion_codes: NotRequired["bool"] + allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes. """ - application_fee_amount: NotRequired["int"] + 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. Can only be applied when there are no line items with recurring prices. """ - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. """ @@ -700,7 +700,7 @@ class CreateParams(RequestOptions): """ Configuration for automatic tax collection. """ - billing_address_collection: NotRequired["Literal['auto', 'required']"] + billing_address_collection: NotRequired[Literal["auto", "required"]] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ @@ -710,11 +710,11 @@ class CreateParams(RequestOptions): """ Configure fields to gather active consent from customers. """ - currency: NotRequired["str"] + currency: NotRequired[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) and supported by each line item's price. """ - custom_fields: NotRequired["List[PaymentLink.CreateParamsCustomField]"] + custom_fields: NotRequired[List["PaymentLink.CreateParamsCustomField"]] """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. """ @@ -722,15 +722,15 @@ class CreateParams(RequestOptions): """ Display additional text for your customers using custom text. """ - customer_creation: NotRequired["Literal['always', 'if_required']"] + customer_creation: NotRequired[Literal["always", "if_required"]] """ Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - inactive_message: NotRequired["str"] + inactive_message: NotRequired[str] """ The custom message to be displayed to a customer when a payment link is no longer active. """ @@ -744,11 +744,11 @@ class CreateParams(RequestOptions): """ The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/api/checkout/sessions) created by this payment link. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The account on behalf of which to charge. """ @@ -759,7 +759,7 @@ class CreateParams(RequestOptions): A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ payment_method_collection: NotRequired[ - "Literal['always', 'if_required']" + Literal["always", "if_required"] ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. @@ -769,7 +769,39 @@ class CreateParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + List[ + Literal[ + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "card", + "cashapp", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + ] + ] ] """ The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). @@ -793,12 +825,12 @@ class CreateParams(RequestOptions): Configuration for collecting the customer's shipping address. """ shipping_options: NotRequired[ - "List[PaymentLink.CreateParamsShippingOption]" + List["PaymentLink.CreateParamsShippingOption"] ] """ The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. """ - submit_type: NotRequired["Literal['auto', 'book', 'donate', 'pay']"] + submit_type: NotRequired[Literal["auto", "book", "donate", "pay"]] """ Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). """ @@ -838,7 +870,7 @@ class CreateParamsAfterCompletion(TypedDict): """ class CreateParamsAfterCompletionHostedConfirmation(TypedDict): - custom_message: NotRequired["str"] + custom_message: NotRequired[str] """ A custom message to display to the customer after the purchase is complete. """ @@ -860,7 +892,7 @@ class CreateParamsAutomaticTax(TypedDict): """ class CreateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -876,13 +908,13 @@ class CreateParamsConsentCollection(TypedDict): """ Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. """ - promotions: NotRequired["Literal['auto', 'none']"] + promotions: NotRequired[Literal["auto", "none"]] """ If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. Only available to US merchants. """ - terms_of_service: NotRequired["Literal['none', 'required']"] + terms_of_service: NotRequired[Literal["none", "required"]] """ If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). @@ -912,7 +944,7 @@ class CreateParamsCustomField(TypedDict): """ Configuration for `type=numeric` fields. """ - optional: NotRequired["bool"] + optional: NotRequired[bool] """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ @@ -952,21 +984,21 @@ class CreateParamsCustomFieldLabel(TypedDict): """ class CreateParamsCustomFieldNumeric(TypedDict): - maximum_length: NotRequired["int"] + maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ - minimum_length: NotRequired["int"] + minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class CreateParamsCustomFieldText(TypedDict): - maximum_length: NotRequired["int"] + maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ - minimum_length: NotRequired["int"] + minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ @@ -1044,11 +1076,11 @@ class CreateParamsInvoiceCreationInvoiceData(TypedDict): """ Default custom fields to be displayed on invoices for this customer. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ @@ -1080,7 +1112,7 @@ class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): """ class CreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1118,31 +1150,31 @@ class CreateParamsLineItemAdjustableQuantity(TypedDict): """ Set to true if the quantity can be adjusted to any non-negative Integer. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. """ class CreateParamsPaymentIntentData(TypedDict): capture_method: NotRequired[ - "Literal['automatic', 'automatic_async', 'manual']" + Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ - setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] + setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. @@ -1156,15 +1188,15 @@ class CreateParamsPaymentIntentData(TypedDict): When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ @@ -1435,13 +1467,13 @@ class CreateParamsShippingAddressCollection(TypedDict): """ class CreateParamsShippingOption(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the Shipping Rate to use for this shipping option. """ class CreateParamsSubscriptionData(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ @@ -1451,11 +1483,11 @@ class CreateParamsSubscriptionData(TypedDict): """ All invoices will be billed using the specified settings. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ - trial_period_days: NotRequired["int"] + trial_period_days: NotRequired[int] """ Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. """ @@ -1475,7 +1507,7 @@ class CreateParamsSubscriptionDataInvoiceSettings(TypedDict): """ class CreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1503,7 +1535,7 @@ class CreateParamsTaxIdCollection(TypedDict): """ class CreateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ @@ -1516,47 +1548,47 @@ class CreateParamsTransferData(TypedDict): """ class ListLineItemsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links). """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ModifyParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. """ @@ -1566,7 +1598,7 @@ class ModifyParams(RequestOptions): """ Behavior after the purchase is complete. """ - allow_promotion_codes: NotRequired["bool"] + allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes. """ @@ -1574,7 +1606,7 @@ class ModifyParams(RequestOptions): """ Configuration for automatic tax collection. """ - billing_address_collection: NotRequired["Literal['auto', 'required']"] + billing_address_collection: NotRequired[Literal["auto", "required"]] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ @@ -1588,11 +1620,11 @@ class ModifyParams(RequestOptions): """ Display additional text for your customers using custom text. """ - customer_creation: NotRequired["Literal['always', 'if_required']"] + customer_creation: NotRequired[Literal["always", "if_required"]] """ Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1606,11 +1638,11 @@ class ModifyParams(RequestOptions): """ Generate a post-purchase Invoice for one-time payments. """ - line_items: NotRequired["List[PaymentLink.ModifyParamsLineItem]"] + line_items: NotRequired[List["PaymentLink.ModifyParamsLineItem"]] """ The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/api/checkout/sessions) created by this payment link. """ @@ -1621,7 +1653,7 @@ class ModifyParams(RequestOptions): A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ payment_method_collection: NotRequired[ - "Literal['always', 'if_required']" + Literal["always", "if_required"] ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. @@ -1674,7 +1706,7 @@ class ModifyParamsAfterCompletion(TypedDict): """ class ModifyParamsAfterCompletionHostedConfirmation(TypedDict): - custom_message: NotRequired["str"] + custom_message: NotRequired[str] """ A custom message to display to the customer after the purchase is complete. """ @@ -1696,7 +1728,7 @@ class ModifyParamsAutomaticTax(TypedDict): """ class ModifyParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1722,7 +1754,7 @@ class ModifyParamsCustomField(TypedDict): """ Configuration for `type=numeric` fields. """ - optional: NotRequired["bool"] + optional: NotRequired[bool] """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ @@ -1762,21 +1794,21 @@ class ModifyParamsCustomFieldLabel(TypedDict): """ class ModifyParamsCustomFieldNumeric(TypedDict): - maximum_length: NotRequired["int"] + maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ - minimum_length: NotRequired["int"] + minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class ModifyParamsCustomFieldText(TypedDict): - maximum_length: NotRequired["int"] + maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ - minimum_length: NotRequired["int"] + minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ @@ -1854,11 +1886,11 @@ class ModifyParamsInvoiceCreationInvoiceData(TypedDict): """ Default custom fields to be displayed on invoices for this customer. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ @@ -1890,7 +1922,7 @@ class ModifyParamsInvoiceCreationInvoiceDataCustomField(TypedDict): """ class ModifyParamsInvoiceCreationInvoiceDataIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1918,7 +1950,7 @@ class ModifyParamsLineItem(TypedDict): """ The ID of an existing line item on the payment link. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity of the line item being purchased. """ @@ -1928,11 +1960,11 @@ class ModifyParamsLineItemAdjustableQuantity(TypedDict): """ Set to true if the quantity can be adjusted to any non-negative Integer. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. """ @@ -2245,7 +2277,7 @@ class ModifyParamsSubscriptionDataInvoiceSettings(TypedDict): """ class ModifyParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -2267,7 +2299,7 @@ class ModifyParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_payment_link_line_item_service.py b/stripe/_payment_link_line_item_service.py index cd98827a4..655d77f79 100644 --- a/stripe/_payment_link_line_item_service.py +++ b/stripe/_payment_link_line_item_service.py @@ -11,19 +11,19 @@ class PaymentLinkLineItemService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 3242dfe95..3dd6d8a5b 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -22,15 +22,15 @@ class CreateParams(TypedDict): """ Behavior after the purchase is complete. """ - allow_promotion_codes: NotRequired["bool"] + allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes. """ - application_fee_amount: NotRequired["int"] + 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. Can only be applied when there are no line items with recurring prices. """ - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. """ @@ -40,7 +40,7 @@ class CreateParams(TypedDict): """ Configuration for automatic tax collection. """ - billing_address_collection: NotRequired["Literal['auto', 'required']"] + billing_address_collection: NotRequired[Literal["auto", "required"]] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ @@ -50,12 +50,12 @@ class CreateParams(TypedDict): """ Configure fields to gather active consent from customers. """ - currency: NotRequired["str"] + currency: NotRequired[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) and supported by each line item's price. """ custom_fields: NotRequired[ - "List[PaymentLinkService.CreateParamsCustomField]" + List["PaymentLinkService.CreateParamsCustomField"] ] """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. @@ -64,15 +64,15 @@ class CreateParams(TypedDict): """ Display additional text for your customers using custom text. """ - customer_creation: NotRequired["Literal['always', 'if_required']"] + customer_creation: NotRequired[Literal["always", "if_required"]] """ Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - inactive_message: NotRequired["str"] + inactive_message: NotRequired[str] """ The custom message to be displayed to a customer when a payment link is no longer active. """ @@ -86,11 +86,11 @@ class CreateParams(TypedDict): """ The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/api/checkout/sessions) created by this payment link. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The account on behalf of which to charge. """ @@ -101,7 +101,7 @@ class CreateParams(TypedDict): A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ payment_method_collection: NotRequired[ - "Literal['always', 'if_required']" + Literal["always", "if_required"] ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. @@ -111,7 +111,39 @@ class CreateParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + List[ + Literal[ + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "card", + "cashapp", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + ] + ] ] """ The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). @@ -137,12 +169,12 @@ class CreateParams(TypedDict): Configuration for collecting the customer's shipping address. """ shipping_options: NotRequired[ - "List[PaymentLinkService.CreateParamsShippingOption]" + List["PaymentLinkService.CreateParamsShippingOption"] ] """ The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. """ - submit_type: NotRequired["Literal['auto', 'book', 'donate', 'pay']"] + submit_type: NotRequired[Literal["auto", "book", "donate", "pay"]] """ Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). """ @@ -184,7 +216,7 @@ class CreateParamsAfterCompletion(TypedDict): """ class CreateParamsAfterCompletionHostedConfirmation(TypedDict): - custom_message: NotRequired["str"] + custom_message: NotRequired[str] """ A custom message to display to the customer after the purchase is complete. """ @@ -208,7 +240,7 @@ class CreateParamsAutomaticTax(TypedDict): """ class CreateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -224,13 +256,13 @@ class CreateParamsConsentCollection(TypedDict): """ Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. """ - promotions: NotRequired["Literal['auto', 'none']"] + promotions: NotRequired[Literal["auto", "none"]] """ If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. Only available to US merchants. """ - terms_of_service: NotRequired["Literal['none', 'required']"] + terms_of_service: NotRequired[Literal["none", "required"]] """ If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). @@ -264,7 +296,7 @@ class CreateParamsCustomField(TypedDict): """ Configuration for `type=numeric` fields. """ - optional: NotRequired["bool"] + optional: NotRequired[bool] """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ @@ -306,21 +338,21 @@ class CreateParamsCustomFieldLabel(TypedDict): """ class CreateParamsCustomFieldNumeric(TypedDict): - maximum_length: NotRequired["int"] + maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ - minimum_length: NotRequired["int"] + minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class CreateParamsCustomFieldText(TypedDict): - maximum_length: NotRequired["int"] + maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ - minimum_length: NotRequired["int"] + minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ @@ -398,11 +430,11 @@ class CreateParamsInvoiceCreationInvoiceData(TypedDict): """ Default custom fields to be displayed on invoices for this customer. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ @@ -434,7 +466,7 @@ class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): """ class CreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -472,31 +504,31 @@ class CreateParamsLineItemAdjustableQuantity(TypedDict): """ Set to true if the quantity can be adjusted to any non-negative Integer. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. """ class CreateParamsPaymentIntentData(TypedDict): capture_method: NotRequired[ - "Literal['automatic', 'automatic_async', 'manual']" + Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ - setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] + setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. @@ -510,15 +542,15 @@ class CreateParamsPaymentIntentData(TypedDict): When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ @@ -789,13 +821,13 @@ class CreateParamsShippingAddressCollection(TypedDict): """ class CreateParamsShippingOption(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the Shipping Rate to use for this shipping option. """ class CreateParamsSubscriptionData(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ @@ -805,11 +837,11 @@ class CreateParamsSubscriptionData(TypedDict): """ All invoices will be billed using the specified settings. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ - trial_period_days: NotRequired["int"] + trial_period_days: NotRequired[int] """ Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. """ @@ -829,7 +861,7 @@ class CreateParamsSubscriptionDataInvoiceSettings(TypedDict): """ class CreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -857,7 +889,7 @@ class CreateParamsTaxIdCollection(TypedDict): """ class CreateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ @@ -870,35 +902,35 @@ class CreateParamsTransferData(TypedDict): """ class ListParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links). """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. """ @@ -908,7 +940,7 @@ class UpdateParams(TypedDict): """ Behavior after the purchase is complete. """ - allow_promotion_codes: NotRequired["bool"] + allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes. """ @@ -918,7 +950,7 @@ class UpdateParams(TypedDict): """ Configuration for automatic tax collection. """ - billing_address_collection: NotRequired["Literal['auto', 'required']"] + billing_address_collection: NotRequired[Literal["auto", "required"]] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ @@ -932,11 +964,11 @@ class UpdateParams(TypedDict): """ Display additional text for your customers using custom text. """ - customer_creation: NotRequired["Literal['always', 'if_required']"] + customer_creation: NotRequired[Literal["always", "if_required"]] """ Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -951,12 +983,12 @@ class UpdateParams(TypedDict): Generate a post-purchase Invoice for one-time payments. """ line_items: NotRequired[ - "List[PaymentLinkService.UpdateParamsLineItem]" + List["PaymentLinkService.UpdateParamsLineItem"] ] """ The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/api/checkout/sessions) created by this payment link. """ @@ -967,7 +999,7 @@ class UpdateParams(TypedDict): A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ payment_method_collection: NotRequired[ - "Literal['always', 'if_required']" + Literal["always", "if_required"] ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. @@ -1020,7 +1052,7 @@ class UpdateParamsAfterCompletion(TypedDict): """ class UpdateParamsAfterCompletionHostedConfirmation(TypedDict): - custom_message: NotRequired["str"] + custom_message: NotRequired[str] """ A custom message to display to the customer after the purchase is complete. """ @@ -1044,7 +1076,7 @@ class UpdateParamsAutomaticTax(TypedDict): """ class UpdateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1074,7 +1106,7 @@ class UpdateParamsCustomField(TypedDict): """ Configuration for `type=numeric` fields. """ - optional: NotRequired["bool"] + optional: NotRequired[bool] """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ @@ -1116,21 +1148,21 @@ class UpdateParamsCustomFieldLabel(TypedDict): """ class UpdateParamsCustomFieldNumeric(TypedDict): - maximum_length: NotRequired["int"] + maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ - minimum_length: NotRequired["int"] + minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class UpdateParamsCustomFieldText(TypedDict): - maximum_length: NotRequired["int"] + maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ - minimum_length: NotRequired["int"] + minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ @@ -1208,11 +1240,11 @@ class UpdateParamsInvoiceCreationInvoiceData(TypedDict): """ Default custom fields to be displayed on invoices for this customer. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ @@ -1244,7 +1276,7 @@ class UpdateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): """ class UpdateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1272,7 +1304,7 @@ class UpdateParamsLineItem(TypedDict): """ The ID of an existing line item on the payment link. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity of the line item being purchased. """ @@ -1282,11 +1314,11 @@ class UpdateParamsLineItemAdjustableQuantity(TypedDict): """ Set to true if the quantity can be adjusted to any non-negative Integer. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. """ @@ -1599,7 +1631,7 @@ class UpdateParamsSubscriptionDataInvoiceSettings(TypedDict): """ class UpdateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 993551cab..8bb209daf 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -994,7 +994,7 @@ class AttachParams(RequestOptions): """ The ID of the customer to which to attach the PaymentMethod. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1052,7 +1052,7 @@ class CreateParams(RequestOptions): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The `Customer` to whom the original PaymentMethod is attached. """ @@ -1066,7 +1066,7 @@ class CreateParams(RequestOptions): """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1104,7 +1104,7 @@ class CreateParams(RequestOptions): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -1120,7 +1120,7 @@ class CreateParams(RequestOptions): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ The PaymentMethod to share. """ @@ -1161,7 +1161,42 @@ class CreateParams(RequestOptions): If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "card", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "mobilepay", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "revolut_pay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + "zip", + ] ] """ 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. @@ -1213,11 +1248,11 @@ class CreateParamsAuBecsDebit(TypedDict): """ class CreateParamsBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -1246,27 +1281,27 @@ class CreateParamsBillingDetails(TypedDict): """ class CreateParamsBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -1281,15 +1316,15 @@ class CreateParamsBoleto(TypedDict): """ class CreateParamsCard(TypedDict): - cvc: NotRequired["str"] + cvc: NotRequired[str] """ The card's CVC. It is highly recommended to always include this value. """ - exp_month: NotRequired["int"] + exp_month: NotRequired[int] """ Two-digit number representing the card's expiration month. """ - exp_year: NotRequired["int"] + exp_year: NotRequired[int] """ Four-digit number representing the card's expiration year. """ @@ -1297,18 +1332,18 @@ class CreateParamsCard(TypedDict): """ Contains information about card networks used to process the payment. """ - number: NotRequired["str"] + number: NotRequired[str] """ The card number, as a string without any separators. """ - token: NotRequired["str"] + token: NotRequired[str] """ For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}. """ class CreateParamsCardNetworks(TypedDict): preferred: NotRequired[ - "Literal['cartes_bancaires', 'mastercard', 'visa']" + Literal["cartes_bancaires", "mastercard", "visa"] ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. @@ -1322,14 +1357,43 @@ class CreateParamsCustomerBalance(TypedDict): class CreateParamsEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class CreateParamsFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -1369,7 +1433,24 @@ class CreateParamsGrabpay(TypedDict): class CreateParamsIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -1412,7 +1493,34 @@ class CreateParamsOxxo(TypedDict): class CreateParamsP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -1431,7 +1539,7 @@ class CreateParamsPromptpay(TypedDict): pass class CreateParamsRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -1455,23 +1563,23 @@ class CreateParamsSwish(TypedDict): pass class CreateParamsUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -1483,34 +1591,69 @@ class CreateParamsZip(TypedDict): pass class DetachParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the customer whose PaymentMethods will be retrieved. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "card", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "mobilepay", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "revolut_pay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + "zip", + ] ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. @@ -1527,7 +1670,7 @@ class ModifyParams(RequestOptions): """ If this is a `card` PaymentMethod, this hash contains the user's card details. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1565,37 +1708,37 @@ class ModifyParamsBillingDetails(TypedDict): """ class ModifyParamsBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsCard(TypedDict): - exp_month: NotRequired["int"] + exp_month: NotRequired[int] """ Two-digit number representing the card's expiration month. """ - exp_year: NotRequired["int"] + exp_year: NotRequired[int] """ Four-digit number representing the card's expiration year. """ @@ -1616,17 +1759,17 @@ class ModifyParamsLink(TypedDict): pass class ModifyParamsUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Bank account holder type. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Bank account type. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 97f6ac5ee..89bbeceeb 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -978,7 +978,7 @@ class CreateParams(RequestOptions): """ EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. Check this [page](https://stripe.com/docs/payments/eps) for more details. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1020,7 +1020,7 @@ class CreateParams(RequestOptions): """ [Link](https://stripe.com/docs/payments/link) is a payment method network. With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. """ - name: NotRequired["str"] + name: NotRequired[str] """ Configuration name. """ @@ -1032,7 +1032,7 @@ class CreateParams(RequestOptions): """ Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. Check this [page](https://stripe.com/docs/payments/p24) for more details. """ - parent: NotRequired["str"] + parent: NotRequired[str] """ Configuration's parent configuration. Specify to create a child configuration. """ @@ -1088,7 +1088,7 @@ class CreateParamsAcssDebit(TypedDict): """ class CreateParamsAcssDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1102,7 +1102,7 @@ class CreateParamsAffirm(TypedDict): """ class CreateParamsAffirmDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1116,7 +1116,7 @@ class CreateParamsAfterpayClearpay(TypedDict): """ class CreateParamsAfterpayClearpayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1130,7 +1130,7 @@ class CreateParamsAlipay(TypedDict): """ class CreateParamsAlipayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1144,7 +1144,7 @@ class CreateParamsApplePay(TypedDict): """ class CreateParamsApplePayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1158,7 +1158,7 @@ class CreateParamsApplePayLater(TypedDict): """ class CreateParamsApplePayLaterDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1172,7 +1172,7 @@ class CreateParamsAuBecsDebit(TypedDict): """ class CreateParamsAuBecsDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1186,7 +1186,7 @@ class CreateParamsBacsDebit(TypedDict): """ class CreateParamsBacsDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1200,7 +1200,7 @@ class CreateParamsBancontact(TypedDict): """ class CreateParamsBancontactDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1214,7 +1214,7 @@ class CreateParamsBlik(TypedDict): """ class CreateParamsBlikDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1228,7 +1228,7 @@ class CreateParamsBoleto(TypedDict): """ class CreateParamsBoletoDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1242,7 +1242,7 @@ class CreateParamsCard(TypedDict): """ class CreateParamsCardDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1256,7 +1256,7 @@ class CreateParamsCartesBancaires(TypedDict): """ class CreateParamsCartesBancairesDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1270,7 +1270,7 @@ class CreateParamsCashapp(TypedDict): """ class CreateParamsCashappDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1284,7 +1284,7 @@ class CreateParamsCustomerBalance(TypedDict): """ class CreateParamsCustomerBalanceDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1298,7 +1298,7 @@ class CreateParamsEps(TypedDict): """ class CreateParamsEpsDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1312,7 +1312,7 @@ class CreateParamsFpx(TypedDict): """ class CreateParamsFpxDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1326,7 +1326,7 @@ class CreateParamsGiropay(TypedDict): """ class CreateParamsGiropayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1340,7 +1340,7 @@ class CreateParamsGooglePay(TypedDict): """ class CreateParamsGooglePayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1354,7 +1354,7 @@ class CreateParamsGrabpay(TypedDict): """ class CreateParamsGrabpayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1368,7 +1368,7 @@ class CreateParamsIdeal(TypedDict): """ class CreateParamsIdealDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1382,7 +1382,7 @@ class CreateParamsJcb(TypedDict): """ class CreateParamsJcbDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1396,7 +1396,7 @@ class CreateParamsKlarna(TypedDict): """ class CreateParamsKlarnaDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1410,7 +1410,7 @@ class CreateParamsKonbini(TypedDict): """ class CreateParamsKonbiniDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1424,7 +1424,7 @@ class CreateParamsLink(TypedDict): """ class CreateParamsLinkDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1438,7 +1438,7 @@ class CreateParamsOxxo(TypedDict): """ class CreateParamsOxxoDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1452,7 +1452,7 @@ class CreateParamsP24(TypedDict): """ class CreateParamsP24DisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1466,7 +1466,7 @@ class CreateParamsPaynow(TypedDict): """ class CreateParamsPaynowDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1480,7 +1480,7 @@ class CreateParamsPaypal(TypedDict): """ class CreateParamsPaypalDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1494,7 +1494,7 @@ class CreateParamsPromptpay(TypedDict): """ class CreateParamsPromptpayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1508,7 +1508,7 @@ class CreateParamsRevolutPay(TypedDict): """ class CreateParamsRevolutPayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1522,7 +1522,7 @@ class CreateParamsSepaDebit(TypedDict): """ class CreateParamsSepaDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1536,7 +1536,7 @@ class CreateParamsSofort(TypedDict): """ class CreateParamsSofortDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1550,7 +1550,7 @@ class CreateParamsUsBankAccount(TypedDict): """ class CreateParamsUsBankAccountDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1564,7 +1564,7 @@ class CreateParamsWechatPay(TypedDict): """ class CreateParamsWechatPayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1574,7 +1574,7 @@ class ListParams(RequestOptions): """ The Connect application to filter by. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1586,7 +1586,7 @@ class ModifyParams(RequestOptions): """ Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. """ - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the configuration can be used for new payments. """ @@ -1666,7 +1666,7 @@ class ModifyParams(RequestOptions): """ EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. Check this [page](https://stripe.com/docs/payments/eps) for more details. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1708,7 +1708,7 @@ class ModifyParams(RequestOptions): """ [Link](https://stripe.com/docs/payments/link) is a payment method network. With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. """ - name: NotRequired["str"] + name: NotRequired[str] """ Configuration name. """ @@ -1772,7 +1772,7 @@ class ModifyParamsAcssDebit(TypedDict): """ class ModifyParamsAcssDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1786,7 +1786,7 @@ class ModifyParamsAffirm(TypedDict): """ class ModifyParamsAffirmDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1800,7 +1800,7 @@ class ModifyParamsAfterpayClearpay(TypedDict): """ class ModifyParamsAfterpayClearpayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1814,7 +1814,7 @@ class ModifyParamsAlipay(TypedDict): """ class ModifyParamsAlipayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1828,7 +1828,7 @@ class ModifyParamsApplePay(TypedDict): """ class ModifyParamsApplePayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1842,7 +1842,7 @@ class ModifyParamsApplePayLater(TypedDict): """ class ModifyParamsApplePayLaterDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1856,7 +1856,7 @@ class ModifyParamsAuBecsDebit(TypedDict): """ class ModifyParamsAuBecsDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1870,7 +1870,7 @@ class ModifyParamsBacsDebit(TypedDict): """ class ModifyParamsBacsDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1884,7 +1884,7 @@ class ModifyParamsBancontact(TypedDict): """ class ModifyParamsBancontactDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1898,7 +1898,7 @@ class ModifyParamsBlik(TypedDict): """ class ModifyParamsBlikDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1912,7 +1912,7 @@ class ModifyParamsBoleto(TypedDict): """ class ModifyParamsBoletoDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1926,7 +1926,7 @@ class ModifyParamsCard(TypedDict): """ class ModifyParamsCardDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1940,7 +1940,7 @@ class ModifyParamsCartesBancaires(TypedDict): """ class ModifyParamsCartesBancairesDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1954,7 +1954,7 @@ class ModifyParamsCashapp(TypedDict): """ class ModifyParamsCashappDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1968,7 +1968,7 @@ class ModifyParamsCustomerBalance(TypedDict): """ class ModifyParamsCustomerBalanceDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1982,7 +1982,7 @@ class ModifyParamsEps(TypedDict): """ class ModifyParamsEpsDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1996,7 +1996,7 @@ class ModifyParamsFpx(TypedDict): """ class ModifyParamsFpxDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2010,7 +2010,7 @@ class ModifyParamsGiropay(TypedDict): """ class ModifyParamsGiropayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2024,7 +2024,7 @@ class ModifyParamsGooglePay(TypedDict): """ class ModifyParamsGooglePayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2038,7 +2038,7 @@ class ModifyParamsGrabpay(TypedDict): """ class ModifyParamsGrabpayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2052,7 +2052,7 @@ class ModifyParamsIdeal(TypedDict): """ class ModifyParamsIdealDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2066,7 +2066,7 @@ class ModifyParamsJcb(TypedDict): """ class ModifyParamsJcbDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2080,7 +2080,7 @@ class ModifyParamsKlarna(TypedDict): """ class ModifyParamsKlarnaDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2094,7 +2094,7 @@ class ModifyParamsKonbini(TypedDict): """ class ModifyParamsKonbiniDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2108,7 +2108,7 @@ class ModifyParamsLink(TypedDict): """ class ModifyParamsLinkDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2122,7 +2122,7 @@ class ModifyParamsOxxo(TypedDict): """ class ModifyParamsOxxoDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2136,7 +2136,7 @@ class ModifyParamsP24(TypedDict): """ class ModifyParamsP24DisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2150,7 +2150,7 @@ class ModifyParamsPaynow(TypedDict): """ class ModifyParamsPaynowDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2164,7 +2164,7 @@ class ModifyParamsPaypal(TypedDict): """ class ModifyParamsPaypalDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2178,7 +2178,7 @@ class ModifyParamsPromptpay(TypedDict): """ class ModifyParamsPromptpayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2192,7 +2192,7 @@ class ModifyParamsRevolutPay(TypedDict): """ class ModifyParamsRevolutPayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2206,7 +2206,7 @@ class ModifyParamsSepaDebit(TypedDict): """ class ModifyParamsSepaDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2220,7 +2220,7 @@ class ModifyParamsSofort(TypedDict): """ class ModifyParamsSofortDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2234,7 +2234,7 @@ class ModifyParamsUsBankAccount(TypedDict): """ class ModifyParamsUsBankAccountDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -2248,13 +2248,13 @@ class ModifyParamsWechatPay(TypedDict): """ class ModifyParamsWechatPayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index 706c33d17..842dfee47 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -101,7 +101,7 @@ class CreateParams(TypedDict): """ EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. Check this [page](https://stripe.com/docs/payments/eps) for more details. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -153,7 +153,7 @@ class CreateParams(TypedDict): """ [Link](https://stripe.com/docs/payments/link) is a payment method network. With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. """ - name: NotRequired["str"] + name: NotRequired[str] """ Configuration name. """ @@ -165,7 +165,7 @@ class CreateParams(TypedDict): """ Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. Check this [page](https://stripe.com/docs/payments/p24) for more details. """ - parent: NotRequired["str"] + parent: NotRequired[str] """ Configuration's parent configuration. Specify to create a child configuration. """ @@ -227,7 +227,7 @@ class CreateParamsAcssDebit(TypedDict): """ class CreateParamsAcssDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -241,7 +241,7 @@ class CreateParamsAffirm(TypedDict): """ class CreateParamsAffirmDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -255,7 +255,7 @@ class CreateParamsAfterpayClearpay(TypedDict): """ class CreateParamsAfterpayClearpayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -269,7 +269,7 @@ class CreateParamsAlipay(TypedDict): """ class CreateParamsAlipayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -283,7 +283,7 @@ class CreateParamsApplePay(TypedDict): """ class CreateParamsApplePayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -297,7 +297,7 @@ class CreateParamsApplePayLater(TypedDict): """ class CreateParamsApplePayLaterDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -311,7 +311,7 @@ class CreateParamsAuBecsDebit(TypedDict): """ class CreateParamsAuBecsDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -325,7 +325,7 @@ class CreateParamsBacsDebit(TypedDict): """ class CreateParamsBacsDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -339,7 +339,7 @@ class CreateParamsBancontact(TypedDict): """ class CreateParamsBancontactDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -353,7 +353,7 @@ class CreateParamsBlik(TypedDict): """ class CreateParamsBlikDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -367,7 +367,7 @@ class CreateParamsBoleto(TypedDict): """ class CreateParamsBoletoDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -381,7 +381,7 @@ class CreateParamsCard(TypedDict): """ class CreateParamsCardDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -395,7 +395,7 @@ class CreateParamsCartesBancaires(TypedDict): """ class CreateParamsCartesBancairesDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -409,7 +409,7 @@ class CreateParamsCashapp(TypedDict): """ class CreateParamsCashappDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -423,7 +423,7 @@ class CreateParamsCustomerBalance(TypedDict): """ class CreateParamsCustomerBalanceDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -437,7 +437,7 @@ class CreateParamsEps(TypedDict): """ class CreateParamsEpsDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -451,7 +451,7 @@ class CreateParamsFpx(TypedDict): """ class CreateParamsFpxDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -465,7 +465,7 @@ class CreateParamsGiropay(TypedDict): """ class CreateParamsGiropayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -479,7 +479,7 @@ class CreateParamsGooglePay(TypedDict): """ class CreateParamsGooglePayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -493,7 +493,7 @@ class CreateParamsGrabpay(TypedDict): """ class CreateParamsGrabpayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -507,7 +507,7 @@ class CreateParamsIdeal(TypedDict): """ class CreateParamsIdealDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -521,7 +521,7 @@ class CreateParamsJcb(TypedDict): """ class CreateParamsJcbDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -535,7 +535,7 @@ class CreateParamsKlarna(TypedDict): """ class CreateParamsKlarnaDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -549,7 +549,7 @@ class CreateParamsKonbini(TypedDict): """ class CreateParamsKonbiniDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -563,7 +563,7 @@ class CreateParamsLink(TypedDict): """ class CreateParamsLinkDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -577,7 +577,7 @@ class CreateParamsOxxo(TypedDict): """ class CreateParamsOxxoDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -591,7 +591,7 @@ class CreateParamsP24(TypedDict): """ class CreateParamsP24DisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -605,7 +605,7 @@ class CreateParamsPaynow(TypedDict): """ class CreateParamsPaynowDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -619,7 +619,7 @@ class CreateParamsPaypal(TypedDict): """ class CreateParamsPaypalDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -633,7 +633,7 @@ class CreateParamsPromptpay(TypedDict): """ class CreateParamsPromptpayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -647,7 +647,7 @@ class CreateParamsRevolutPay(TypedDict): """ class CreateParamsRevolutPayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -661,7 +661,7 @@ class CreateParamsSepaDebit(TypedDict): """ class CreateParamsSepaDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -675,7 +675,7 @@ class CreateParamsSofort(TypedDict): """ class CreateParamsSofortDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -689,7 +689,7 @@ class CreateParamsUsBankAccount(TypedDict): """ class CreateParamsUsBankAccountDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -703,7 +703,7 @@ class CreateParamsWechatPay(TypedDict): """ class CreateParamsWechatPayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -713,13 +713,13 @@ class ListParams(TypedDict): """ The Connect application to filter by. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -731,7 +731,7 @@ class UpdateParams(TypedDict): """ Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. """ - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the configuration can be used for new payments. """ @@ -819,7 +819,7 @@ class UpdateParams(TypedDict): """ EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. Check this [page](https://stripe.com/docs/payments/eps) for more details. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -871,7 +871,7 @@ class UpdateParams(TypedDict): """ [Link](https://stripe.com/docs/payments/link) is a payment method network. With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. """ - name: NotRequired["str"] + name: NotRequired[str] """ Configuration name. """ @@ -941,7 +941,7 @@ class UpdateParamsAcssDebit(TypedDict): """ class UpdateParamsAcssDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -955,7 +955,7 @@ class UpdateParamsAffirm(TypedDict): """ class UpdateParamsAffirmDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -969,7 +969,7 @@ class UpdateParamsAfterpayClearpay(TypedDict): """ class UpdateParamsAfterpayClearpayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -983,7 +983,7 @@ class UpdateParamsAlipay(TypedDict): """ class UpdateParamsAlipayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -997,7 +997,7 @@ class UpdateParamsApplePay(TypedDict): """ class UpdateParamsApplePayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1011,7 +1011,7 @@ class UpdateParamsApplePayLater(TypedDict): """ class UpdateParamsApplePayLaterDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1025,7 +1025,7 @@ class UpdateParamsAuBecsDebit(TypedDict): """ class UpdateParamsAuBecsDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1039,7 +1039,7 @@ class UpdateParamsBacsDebit(TypedDict): """ class UpdateParamsBacsDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1053,7 +1053,7 @@ class UpdateParamsBancontact(TypedDict): """ class UpdateParamsBancontactDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1067,7 +1067,7 @@ class UpdateParamsBlik(TypedDict): """ class UpdateParamsBlikDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1081,7 +1081,7 @@ class UpdateParamsBoleto(TypedDict): """ class UpdateParamsBoletoDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1095,7 +1095,7 @@ class UpdateParamsCard(TypedDict): """ class UpdateParamsCardDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1109,7 +1109,7 @@ class UpdateParamsCartesBancaires(TypedDict): """ class UpdateParamsCartesBancairesDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1123,7 +1123,7 @@ class UpdateParamsCashapp(TypedDict): """ class UpdateParamsCashappDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1137,7 +1137,7 @@ class UpdateParamsCustomerBalance(TypedDict): """ class UpdateParamsCustomerBalanceDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1151,7 +1151,7 @@ class UpdateParamsEps(TypedDict): """ class UpdateParamsEpsDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1165,7 +1165,7 @@ class UpdateParamsFpx(TypedDict): """ class UpdateParamsFpxDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1179,7 +1179,7 @@ class UpdateParamsGiropay(TypedDict): """ class UpdateParamsGiropayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1193,7 +1193,7 @@ class UpdateParamsGooglePay(TypedDict): """ class UpdateParamsGooglePayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1207,7 +1207,7 @@ class UpdateParamsGrabpay(TypedDict): """ class UpdateParamsGrabpayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1221,7 +1221,7 @@ class UpdateParamsIdeal(TypedDict): """ class UpdateParamsIdealDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1235,7 +1235,7 @@ class UpdateParamsJcb(TypedDict): """ class UpdateParamsJcbDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1249,7 +1249,7 @@ class UpdateParamsKlarna(TypedDict): """ class UpdateParamsKlarnaDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1263,7 +1263,7 @@ class UpdateParamsKonbini(TypedDict): """ class UpdateParamsKonbiniDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1277,7 +1277,7 @@ class UpdateParamsLink(TypedDict): """ class UpdateParamsLinkDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1291,7 +1291,7 @@ class UpdateParamsOxxo(TypedDict): """ class UpdateParamsOxxoDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1305,7 +1305,7 @@ class UpdateParamsP24(TypedDict): """ class UpdateParamsP24DisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1319,7 +1319,7 @@ class UpdateParamsPaynow(TypedDict): """ class UpdateParamsPaynowDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1333,7 +1333,7 @@ class UpdateParamsPaypal(TypedDict): """ class UpdateParamsPaypalDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1347,7 +1347,7 @@ class UpdateParamsPromptpay(TypedDict): """ class UpdateParamsPromptpayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1361,7 +1361,7 @@ class UpdateParamsRevolutPay(TypedDict): """ class UpdateParamsRevolutPayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1375,7 +1375,7 @@ class UpdateParamsSepaDebit(TypedDict): """ class UpdateParamsSepaDebitDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1389,7 +1389,7 @@ class UpdateParamsSofort(TypedDict): """ class UpdateParamsSofortDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1403,7 +1403,7 @@ class UpdateParamsUsBankAccount(TypedDict): """ class UpdateParamsUsBankAccountDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ @@ -1417,7 +1417,7 @@ class UpdateParamsWechatPay(TypedDict): """ class UpdateParamsWechatPayDisplayPreference(TypedDict): - preference: NotRequired["Literal['none', 'off', 'on']"] + preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ diff --git a/stripe/_payment_method_domain.py b/stripe/_payment_method_domain.py index bce5ac13b..4f69771af 100644 --- a/stripe/_payment_method_domain.py +++ b/stripe/_payment_method_domain.py @@ -100,59 +100,59 @@ class CreateParams(RequestOptions): """ The domain name that this payment method domain object represents. """ - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): - domain_name: NotRequired["str"] + domain_name: NotRequired[str] """ The domain name that this payment method domain object represents. """ - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods will not appear in Elements """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ModifyParams(RequestOptions): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ValidateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_payment_method_domain_service.py b/stripe/_payment_method_domain_service.py index 41d40a51b..a4c0283dc 100644 --- a/stripe/_payment_method_domain_service.py +++ b/stripe/_payment_method_domain_service.py @@ -15,59 +15,59 @@ class CreateParams(TypedDict): """ The domain name that this payment method domain object represents. """ - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): - domain_name: NotRequired["str"] + domain_name: NotRequired[str] """ The domain name that this payment method domain object represents. """ - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods will not appear in Elements """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ValidateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 259fd7443..1094cf384 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -15,7 +15,7 @@ class AttachParams(TypedDict): """ The ID of the customer to which to attach the PaymentMethod. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -75,7 +75,7 @@ class CreateParams(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The `Customer` to whom the original PaymentMethod is attached. """ @@ -89,7 +89,7 @@ class CreateParams(TypedDict): """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -127,7 +127,7 @@ class CreateParams(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -143,7 +143,7 @@ class CreateParams(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ The PaymentMethod to share. """ @@ -186,7 +186,42 @@ class CreateParams(TypedDict): If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "card", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "mobilepay", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "revolut_pay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + "zip", + ] ] """ 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. @@ -240,11 +275,11 @@ class CreateParamsAuBecsDebit(TypedDict): """ class CreateParamsBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -273,27 +308,27 @@ class CreateParamsBillingDetails(TypedDict): """ class CreateParamsBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -308,15 +343,15 @@ class CreateParamsBoleto(TypedDict): """ class CreateParamsCard(TypedDict): - cvc: NotRequired["str"] + cvc: NotRequired[str] """ The card's CVC. It is highly recommended to always include this value. """ - exp_month: NotRequired["int"] + exp_month: NotRequired[int] """ Two-digit number representing the card's expiration month. """ - exp_year: NotRequired["int"] + exp_year: NotRequired[int] """ Four-digit number representing the card's expiration year. """ @@ -324,18 +359,18 @@ class CreateParamsCard(TypedDict): """ Contains information about card networks used to process the payment. """ - number: NotRequired["str"] + number: NotRequired[str] """ The card number, as a string without any separators. """ - token: NotRequired["str"] + token: NotRequired[str] """ For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}. """ class CreateParamsCardNetworks(TypedDict): preferred: NotRequired[ - "Literal['cartes_bancaires', 'mastercard', 'visa']" + Literal["cartes_bancaires", "mastercard", "visa"] ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. @@ -349,14 +384,43 @@ class CreateParamsCustomerBalance(TypedDict): class CreateParamsEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class CreateParamsFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -396,7 +460,24 @@ class CreateParamsGrabpay(TypedDict): class CreateParamsIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -439,7 +520,34 @@ class CreateParamsOxxo(TypedDict): class CreateParamsP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -458,7 +566,7 @@ class CreateParamsPromptpay(TypedDict): pass class CreateParamsRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -482,23 +590,23 @@ class CreateParamsSwish(TypedDict): pass class CreateParamsUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -510,41 +618,76 @@ class CreateParamsZip(TypedDict): pass class DetachParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the customer whose PaymentMethods will be retrieved. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']" + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "card", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "mobilepay", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "revolut_pay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + "zip", + ] ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -560,7 +703,7 @@ class UpdateParams(TypedDict): """ If this is a `card` PaymentMethod, this hash contains the user's card details. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -600,37 +743,37 @@ class UpdateParamsBillingDetails(TypedDict): """ class UpdateParamsBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsCard(TypedDict): - exp_month: NotRequired["int"] + exp_month: NotRequired[int] """ Two-digit number representing the card's expiration month. """ - exp_year: NotRequired["int"] + exp_year: NotRequired[int] """ Four-digit number representing the card's expiration year. """ @@ -651,11 +794,11 @@ class UpdateParamsLink(TypedDict): pass class UpdateParamsUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Bank account holder type. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Bank account type. """ diff --git a/stripe/_payout.py b/stripe/_payout.py index b86193c7f..10fbd4b8b 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -41,7 +41,7 @@ class Payout( OBJECT_NAME: ClassVar[Literal["payout"]] = "payout" class CancelParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -55,31 +55,31 @@ class CreateParams(RequestOptions): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - destination: NotRequired["str"] + destination: NotRequired[str] """ The ID of a bank account or a card to send the payout to. If you don't provide a destination, we use the default external account for the specified currency. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - method: NotRequired["Literal['instant', 'standard']"] + method: NotRequired[Literal["instant", "standard"]] """ The method used to send this payout, which is `standard` or `instant`. We support `instant` for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). """ - source_type: NotRequired["Literal['bank_account', 'card', 'fpx']"] + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] """ The balance type of your Stripe balance to draw this payout from. Balances for different payment sources are kept separately. You can find the amounts with the Balances API. One of `bank_account`, `card`, or `fpx`. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ A string that displays on the recipient's bank or card statement (up to 22 characters). A `statement_descriptor` that's longer than 22 characters return an error. Most banks truncate this information and display it inconsistently. Some banks might not display it at all. """ @@ -93,69 +93,69 @@ class ListParams(RequestOptions): """ Only return payouts that were created during the given date interval. """ - destination: NotRequired["str"] + destination: NotRequired[str] """ The ID of an external account - only return payouts sent to this external account. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["str"] + status: NotRequired[str] """ Only return payouts that have the given status: `pending`, `paid`, `failed`, or `canceled`. """ class ListParamsArrivalDate(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -165,17 +165,17 @@ class ModifyParams(RequestOptions): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReverseParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ diff --git a/stripe/_payout_service.py b/stripe/_payout_service.py index 68342b6e4..a4ccae75d 100644 --- a/stripe/_payout_service.py +++ b/stripe/_payout_service.py @@ -11,7 +11,7 @@ class PayoutService(StripeService): class CancelParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -25,31 +25,31 @@ class CreateParams(TypedDict): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - destination: NotRequired["str"] + destination: NotRequired[str] """ The ID of a bank account or a card to send the payout to. If you don't provide a destination, we use the default external account for the specified currency. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - method: NotRequired["Literal['instant', 'standard']"] + method: NotRequired[Literal["instant", "standard"]] """ The method used to send this payout, which is `standard` or `instant`. We support `instant` for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). """ - source_type: NotRequired["Literal['bank_account', 'card', 'fpx']"] + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] """ The balance type of your Stripe balance to draw this payout from. Balances for different payment sources are kept separately. You can find the amounts with the Balances API. One of `bank_account`, `card`, or `fpx`. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ A string that displays on the recipient's bank or card statement (up to 22 characters). A `statement_descriptor` that's longer than 22 characters return an error. Most banks truncate this information and display it inconsistently. Some banks might not display it at all. """ @@ -63,85 +63,85 @@ class ListParams(TypedDict): """ Only return payouts that were created during the given date interval. """ - destination: NotRequired["str"] + destination: NotRequired[str] """ The ID of an external account - only return payouts sent to this external account. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["str"] + status: NotRequired[str] """ Only return payouts that have the given status: `pending`, `paid`, `failed`, or `canceled`. """ class ListParamsArrivalDate(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReverseParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_plan.py b/stripe/_plan.py index 0fcfd06c0..65ce3506f 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -74,25 +74,25 @@ class TransformUsage(StripeObject): """ class CreateParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the plan is currently available for new subscriptions. Defaults to `true`. """ aggregate_usage: NotRequired[ - "Literal['last_during_period', 'last_ever', 'max', 'sum']" + Literal["last_during_period", "last_ever", "max", "sum"] ] """ Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. """ - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. """ - amount_decimal: NotRequired["str"] + amount_decimal: NotRequired[str] """ Same as `amount`, but accepts a decimal value with at most 12 decimal places. Only one of `amount` and `amount_decimal` can be set. """ - billing_scheme: NotRequired["Literal['per_unit', 'tiered']"] + billing_scheme: NotRequired[Literal["per_unit", "tiered"]] """ Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. """ @@ -100,11 +100,11 @@ class CreateParams(RequestOptions): """ 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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - id: NotRequired["str"] + id: NotRequired[str] """ An identifier randomly generated by Stripe. Used to identify this plan when subscribing a customer. You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. You can, however, use the same plan ID in both live and test modes. """ @@ -112,7 +112,7 @@ class CreateParams(RequestOptions): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ @@ -120,16 +120,16 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nickname: NotRequired["str"] + nickname: NotRequired[str] """ A brief description of the plan, hidden from customers. """ product: NotRequired["Plan.CreateParamsProduct|str"] - tiers: NotRequired["List[Plan.CreateParamsTier]"] + tiers: NotRequired[List["Plan.CreateParamsTier"]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ - tiers_mode: NotRequired["Literal['graduated', 'volume']"] + tiers_mode: NotRequired[Literal["graduated", "volume"]] """ Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. """ @@ -137,25 +137,25 @@ class CreateParams(RequestOptions): """ Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. """ - trial_period_days: NotRequired["int"] + trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ - usage_type: NotRequired["Literal['licensed', 'metered']"] + usage_type: NotRequired[Literal["licensed", "metered"]] """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ class CreateParamsProduct(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the product is currently available for purchase. Defaults to `true`. """ - id: NotRequired["str"] + id: NotRequired[str] """ The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -163,35 +163,35 @@ class CreateParamsProduct(TypedDict): """ The product's name, meant to be displayable to the customer. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ - unit_label: NotRequired["str"] + 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 CreateParamsTier(TypedDict): - flat_amount: NotRequired["int"] + flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired["str"] + flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -214,7 +214,7 @@ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Only return plans that are active or inactive (e.g., pass `false` to list all inactive plans). """ @@ -222,51 +222,51 @@ class ListParams(RequestOptions): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - product: NotRequired["str"] + product: NotRequired[str] """ Only return plans for the given product. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the plan is currently available for new subscriptions. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -274,21 +274,21 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nickname: NotRequired["str"] + nickname: NotRequired[str] """ A brief description of the plan, hidden from customers. """ - product: NotRequired["str"] + product: NotRequired[str] """ The product the plan belongs to. This cannot be changed once it has been used in a subscription or subscription schedule. """ - trial_period_days: NotRequired["int"] + trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_plan_service.py b/stripe/_plan_service.py index 2c379103e..e60aebe1d 100644 --- a/stripe/_plan_service.py +++ b/stripe/_plan_service.py @@ -11,25 +11,25 @@ class PlanService(StripeService): class CreateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the plan is currently available for new subscriptions. Defaults to `true`. """ aggregate_usage: NotRequired[ - "Literal['last_during_period', 'last_ever', 'max', 'sum']" + Literal["last_during_period", "last_ever", "max", "sum"] ] """ Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. """ - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. """ - amount_decimal: NotRequired["str"] + amount_decimal: NotRequired[str] """ Same as `amount`, but accepts a decimal value with at most 12 decimal places. Only one of `amount` and `amount_decimal` can be set. """ - billing_scheme: NotRequired["Literal['per_unit', 'tiered']"] + billing_scheme: NotRequired[Literal["per_unit", "tiered"]] """ Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. """ @@ -37,11 +37,11 @@ class CreateParams(TypedDict): """ 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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - id: NotRequired["str"] + id: NotRequired[str] """ An identifier randomly generated by Stripe. Used to identify this plan when subscribing a customer. You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. You can, however, use the same plan ID in both live and test modes. """ @@ -49,7 +49,7 @@ class CreateParams(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ @@ -57,16 +57,16 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nickname: NotRequired["str"] + nickname: NotRequired[str] """ A brief description of the plan, hidden from customers. """ product: NotRequired["PlanService.CreateParamsProduct|str"] - tiers: NotRequired["List[PlanService.CreateParamsTier]"] + tiers: NotRequired[List["PlanService.CreateParamsTier"]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ - tiers_mode: NotRequired["Literal['graduated', 'volume']"] + tiers_mode: NotRequired[Literal["graduated", "volume"]] """ Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. """ @@ -74,25 +74,25 @@ class CreateParams(TypedDict): """ Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. """ - trial_period_days: NotRequired["int"] + trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ - usage_type: NotRequired["Literal['licensed', 'metered']"] + usage_type: NotRequired[Literal["licensed", "metered"]] """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ class CreateParamsProduct(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the product is currently available for purchase. Defaults to `true`. """ - id: NotRequired["str"] + id: NotRequired[str] """ The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -100,35 +100,35 @@ class CreateParamsProduct(TypedDict): """ The product's name, meant to be displayable to the customer. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ - unit_label: NotRequired["str"] + 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 CreateParamsTier(TypedDict): - flat_amount: NotRequired["int"] + flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired["str"] + flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -151,7 +151,7 @@ class DeleteParams(TypedDict): pass class ListParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Only return plans that are active or inactive (e.g., pass `false` to list all inactive plans). """ @@ -159,57 +159,57 @@ class ListParams(TypedDict): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - product: NotRequired["str"] + product: NotRequired[str] """ Only return plans for the given product. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the plan is currently available for new subscriptions. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -217,15 +217,15 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nickname: NotRequired["str"] + nickname: NotRequired[str] """ A brief description of the plan, hidden from customers. """ - product: NotRequired["str"] + product: NotRequired[str] """ The product the plan belongs to. This cannot be changed once it has been used in a subscription or subscription schedule. """ - trial_period_days: NotRequired["int"] + trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ diff --git a/stripe/_price.py b/stripe/_price.py index 96f1c4404..67f7e2d8b 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -175,11 +175,11 @@ class TransformQuantity(StripeObject): """ class CreateParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the price can be used for new purchases. Defaults to `true`. """ - billing_scheme: NotRequired["Literal['per_unit', 'tiered']"] + billing_scheme: NotRequired[Literal["per_unit", "tiered"]] """ Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. """ @@ -188,7 +188,7 @@ class CreateParams(RequestOptions): 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). """ currency_options: NotRequired[ - "Dict[str, Price.CreateParamsCurrencyOptions]" + Dict[str, "Price.CreateParamsCurrencyOptions"] ] """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). @@ -197,23 +197,23 @@ class CreateParams(RequestOptions): """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - lookup_key: NotRequired["str"] + lookup_key: NotRequired[str] """ A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nickname: NotRequired["str"] + nickname: NotRequired[str] """ A brief description of the price, hidden from customers. """ - product: NotRequired["str"] + product: NotRequired[str] """ The ID of the product that this price will belong to. """ @@ -226,20 +226,20 @@ class CreateParams(RequestOptions): The recurring components of a price such as `interval` and `usage_type`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - tiers: NotRequired["List[Price.CreateParamsTier]"] + tiers: NotRequired[List["Price.CreateParamsTier"]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ - tiers_mode: NotRequired["Literal['graduated', 'volume']"] + tiers_mode: NotRequired[Literal["graduated", "volume"]] """ Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. """ - transfer_lookup_key: NotRequired["bool"] + transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. """ @@ -247,11 +247,11 @@ class CreateParams(RequestOptions): """ Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -264,20 +264,20 @@ class CreateParamsCurrencyOptions(TypedDict): When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - tiers: NotRequired["List[Price.CreateParamsCurrencyOptionsTier]"] + tiers: NotRequired[List["Price.CreateParamsCurrencyOptionsTier"]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -287,33 +287,33 @@ class CreateParamsCurrencyOptionsCustomUnitAmount(TypedDict): """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ - preset: NotRequired["int"] + preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class CreateParamsCurrencyOptionsTier(TypedDict): - flat_amount: NotRequired["int"] + flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired["str"] + flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -327,29 +327,29 @@ class CreateParamsCustomUnitAmount(TypedDict): """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ - preset: NotRequired["int"] + preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class CreateParamsProductData(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the product is currently available for purchase. Defaults to `true`. """ - id: NotRequired["str"] + id: NotRequired[str] """ The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -357,24 +357,24 @@ class CreateParamsProductData(TypedDict): """ The product's name, meant to be displayable to the customer. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ - unit_label: NotRequired["str"] + 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 CreateParamsRecurring(TypedDict): aggregate_usage: NotRequired[ - "Literal['last_during_period', 'last_ever', 'max', 'sum']" + Literal["last_during_period", "last_ever", "max", "sum"] ] """ Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. @@ -383,33 +383,33 @@ class CreateParamsRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ - trial_period_days: NotRequired["int"] + trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ - usage_type: NotRequired["Literal['licensed', 'metered']"] + usage_type: NotRequired[Literal["licensed", "metered"]] """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ class CreateParamsTier(TypedDict): - flat_amount: NotRequired["int"] + flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired["str"] + flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -429,7 +429,7 @@ class CreateParamsTransformQuantity(TypedDict): """ class ListParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices). """ @@ -437,27 +437,27 @@ class ListParams(RequestOptions): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Only return prices for the given currency. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - lookup_keys: NotRequired["List[str]"] + lookup_keys: NotRequired[List[str]] """ Only return the price with these lookup_keys, if any exist. """ - product: NotRequired["str"] + product: NotRequired[str] """ Only return prices for the given product. """ @@ -465,45 +465,45 @@ class ListParams(RequestOptions): """ Only return prices with these recurring fields. """ - starting_after: NotRequired["str"] + 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: NotRequired["Literal['one_time', 'recurring']"] + type: NotRequired[Literal["one_time", "recurring"]] """ Only return prices of type `recurring` or `one_time`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsRecurring(TypedDict): - interval: NotRequired["Literal['day', 'month', 'week', 'year']"] + interval: NotRequired[Literal["day", "month", "week", "year"]] """ Filter by billing frequency. Either `day`, `week`, `month` or `year`. """ - usage_type: NotRequired["Literal['licensed', 'metered']"] + usage_type: NotRequired[Literal["licensed", "metered"]] """ Filter by the usage type for this price. Can be either `metered` or `licensed`. """ class ModifyParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the price can be used for new purchases. Defaults to `true`. """ @@ -513,11 +513,11 @@ class ModifyParams(RequestOptions): """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - lookup_key: NotRequired["str"] + lookup_key: NotRequired[str] """ A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. """ @@ -525,17 +525,17 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nickname: NotRequired["str"] + nickname: NotRequired[str] """ A brief description of the price, hidden from customers. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - transfer_lookup_key: NotRequired["bool"] + transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. """ @@ -548,20 +548,20 @@ class ModifyParamsCurrencyOptions(TypedDict): When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - tiers: NotRequired["List[Price.ModifyParamsCurrencyOptionsTier]"] + tiers: NotRequired[List["Price.ModifyParamsCurrencyOptionsTier"]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -571,33 +571,33 @@ class ModifyParamsCurrencyOptionsCustomUnitAmount(TypedDict): """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ - preset: NotRequired["int"] + preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class ModifyParamsCurrencyOptionsTier(TypedDict): - flat_amount: NotRequired["int"] + flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired["str"] + flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -607,21 +607,21 @@ class ModifyParamsCurrencyOptionsTier(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ diff --git a/stripe/_price_service.py b/stripe/_price_service.py index 754dd45e1..05d9f7d5c 100644 --- a/stripe/_price_service.py +++ b/stripe/_price_service.py @@ -12,11 +12,11 @@ class PriceService(StripeService): class CreateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the price can be used for new purchases. Defaults to `true`. """ - billing_scheme: NotRequired["Literal['per_unit', 'tiered']"] + billing_scheme: NotRequired[Literal["per_unit", "tiered"]] """ Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. """ @@ -25,7 +25,7 @@ class CreateParams(TypedDict): 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). """ currency_options: NotRequired[ - "Dict[str, PriceService.CreateParamsCurrencyOptions]" + Dict[str, "PriceService.CreateParamsCurrencyOptions"] ] """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). @@ -36,23 +36,23 @@ class CreateParams(TypedDict): """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - lookup_key: NotRequired["str"] + lookup_key: NotRequired[str] """ A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nickname: NotRequired["str"] + nickname: NotRequired[str] """ A brief description of the price, hidden from customers. """ - product: NotRequired["str"] + product: NotRequired[str] """ The ID of the product that this price will belong to. """ @@ -65,20 +65,20 @@ class CreateParams(TypedDict): The recurring components of a price such as `interval` and `usage_type`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - tiers: NotRequired["List[PriceService.CreateParamsTier]"] + tiers: NotRequired[List["PriceService.CreateParamsTier"]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ - tiers_mode: NotRequired["Literal['graduated', 'volume']"] + tiers_mode: NotRequired[Literal["graduated", "volume"]] """ Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. """ - transfer_lookup_key: NotRequired["bool"] + transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. """ @@ -88,11 +88,11 @@ class CreateParams(TypedDict): """ Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -105,22 +105,22 @@ class CreateParamsCurrencyOptions(TypedDict): When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: NotRequired[ - "List[PriceService.CreateParamsCurrencyOptionsTier]" + List["PriceService.CreateParamsCurrencyOptionsTier"] ] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -130,33 +130,33 @@ class CreateParamsCurrencyOptionsCustomUnitAmount(TypedDict): """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ - preset: NotRequired["int"] + preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class CreateParamsCurrencyOptionsTier(TypedDict): - flat_amount: NotRequired["int"] + flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired["str"] + flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -170,29 +170,29 @@ class CreateParamsCustomUnitAmount(TypedDict): """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ - preset: NotRequired["int"] + preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class CreateParamsProductData(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the product is currently available for purchase. Defaults to `true`. """ - id: NotRequired["str"] + id: NotRequired[str] """ The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -200,24 +200,24 @@ class CreateParamsProductData(TypedDict): """ The product's name, meant to be displayable to the customer. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ - unit_label: NotRequired["str"] + 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 CreateParamsRecurring(TypedDict): aggregate_usage: NotRequired[ - "Literal['last_during_period', 'last_ever', 'max', 'sum']" + Literal["last_during_period", "last_ever", "max", "sum"] ] """ Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. @@ -226,33 +226,33 @@ class CreateParamsRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ - trial_period_days: NotRequired["int"] + trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ - usage_type: NotRequired["Literal['licensed', 'metered']"] + usage_type: NotRequired[Literal["licensed", "metered"]] """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ class CreateParamsTier(TypedDict): - flat_amount: NotRequired["int"] + flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired["str"] + flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -272,7 +272,7 @@ class CreateParamsTransformQuantity(TypedDict): """ class ListParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices). """ @@ -280,27 +280,27 @@ class ListParams(TypedDict): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Only return prices for the given currency. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - lookup_keys: NotRequired["List[str]"] + lookup_keys: NotRequired[List[str]] """ Only return the price with these lookup_keys, if any exist. """ - product: NotRequired["str"] + product: NotRequired[str] """ Only return prices for the given product. """ @@ -308,59 +308,59 @@ class ListParams(TypedDict): """ Only return prices with these recurring fields. """ - starting_after: NotRequired["str"] + 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: NotRequired["Literal['one_time', 'recurring']"] + type: NotRequired[Literal["one_time", "recurring"]] """ Only return prices of type `recurring` or `one_time`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsRecurring(TypedDict): - interval: NotRequired["Literal['day', 'month', 'week', 'year']"] + interval: NotRequired[Literal["day", "month", "week", "year"]] """ Filter by billing frequency. Either `day`, `week`, `month` or `year`. """ - usage_type: NotRequired["Literal['licensed', 'metered']"] + usage_type: NotRequired[Literal["licensed", "metered"]] """ Filter by the usage type for this price. Can be either `metered` or `licensed`. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ @@ -370,7 +370,7 @@ class SearchParams(TypedDict): """ class UpdateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the price can be used for new purchases. Defaults to `true`. """ @@ -380,11 +380,11 @@ class UpdateParams(TypedDict): """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - lookup_key: NotRequired["str"] + lookup_key: NotRequired[str] """ A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. """ @@ -392,17 +392,17 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nickname: NotRequired["str"] + nickname: NotRequired[str] """ A brief description of the price, hidden from customers. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - transfer_lookup_key: NotRequired["bool"] + transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. """ @@ -415,22 +415,22 @@ class UpdateParamsCurrencyOptions(TypedDict): When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: NotRequired[ - "List[PriceService.UpdateParamsCurrencyOptionsTier]" + List["PriceService.UpdateParamsCurrencyOptionsTier"] ] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -440,33 +440,33 @@ class UpdateParamsCurrencyOptionsCustomUnitAmount(TypedDict): """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ - preset: NotRequired["int"] + preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class UpdateParamsCurrencyOptionsTier(TypedDict): - flat_amount: NotRequired["int"] + flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired["str"] + flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/_product.py b/stripe/_product.py index 4e5d77cb6..04953c6ab 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -79,7 +79,7 @@ class PackageDimensions(StripeObject): """ class CreateParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the product is currently available for purchase. Defaults to `true`. """ @@ -87,27 +87,27 @@ class CreateParams(RequestOptions): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object. This Price will be set as the default price for this product. """ - description: NotRequired["str"] + description: NotRequired[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - features: NotRequired["List[Product.CreateParamsFeature]"] + features: NotRequired[List["Product.CreateParamsFeature"]] """ A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). """ - id: NotRequired["str"] + id: NotRequired[str] """ An identifier will be randomly generated by Stripe. You can optionally override this ID, but the ID must be unique across all products in your Stripe account. """ - images: NotRequired["List[str]"] + images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -121,30 +121,30 @@ class CreateParams(RequestOptions): """ The dimensions of this product for shipping purposes. """ - shippable: NotRequired["bool"] + shippable: NotRequired[bool] """ Whether this product is shipped (i.e., physical goods). """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. It must contain at least one letter. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ - type: NotRequired["Literal['good', 'service']"] + 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. """ - unit_label: NotRequired["str"] + 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. """ - url: NotRequired["str"] + url: NotRequired[str] """ A URL of a publicly-accessible webpage for this product. """ @@ -155,7 +155,7 @@ class CreateParamsDefaultPriceData(TypedDict): 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). """ currency_options: NotRequired[ - "Dict[str, Product.CreateParamsDefaultPriceDataCurrencyOptions]" + Dict[str, "Product.CreateParamsDefaultPriceDataCurrencyOptions"] ] """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). @@ -165,16 +165,16 @@ class CreateParamsDefaultPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -187,22 +187,22 @@ class CreateParamsDefaultPriceDataCurrencyOptions(TypedDict): When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: NotRequired[ - "List[Product.CreateParamsDefaultPriceDataCurrencyOptionsTier]" + List["Product.CreateParamsDefaultPriceDataCurrencyOptionsTier"] ] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -214,33 +214,33 @@ class CreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmount( """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ - preset: NotRequired["int"] + preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class CreateParamsDefaultPriceDataCurrencyOptionsTier(TypedDict): - flat_amount: NotRequired["int"] + flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired["str"] + flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -254,7 +254,7 @@ class CreateParamsDefaultPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ @@ -287,7 +287,7 @@ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Only return products that are active or inactive (e.g., pass `false` to list all inactive products). """ @@ -295,63 +295,63 @@ class ListParams(RequestOptions): """ Only return products that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - ids: NotRequired["List[str]"] + ids: NotRequired[List[str]] """ Only return products with the given IDs. Cannot be used with [starting_after](https://stripe.com/docs/api#list_products-starting_after) or [ending_before](https://stripe.com/docs/api#list_products-ending_before). """ - limit: NotRequired["int"] + 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. """ - shippable: NotRequired["bool"] + shippable: NotRequired[bool] """ Only return products that can be shipped (i.e., physical, not digital products). """ - starting_after: NotRequired["str"] + 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: NotRequired["Literal['good', 'service']"] + type: NotRequired[Literal["good", "service"]] """ Only return products of this type. """ - url: NotRequired["str"] + url: NotRequired[str] """ Only return products with the given url. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the product is available for purchase. """ - default_price: NotRequired["str"] + default_price: NotRequired[str] """ The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. """ @@ -359,7 +359,7 @@ class ModifyParams(RequestOptions): """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -375,7 +375,7 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ The product's name, meant to be displayable to the customer. """ @@ -385,11 +385,11 @@ class ModifyParams(RequestOptions): """ The dimensions of this product for shipping purposes. """ - shippable: NotRequired["bool"] + shippable: NotRequired[bool] """ Whether this product is shipped (i.e., physical goods). """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. @@ -434,21 +434,21 @@ class ModifyParamsPackageDimensions(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ diff --git a/stripe/_product_service.py b/stripe/_product_service.py index cfaaccbfe..d005dce13 100644 --- a/stripe/_product_service.py +++ b/stripe/_product_service.py @@ -12,7 +12,7 @@ class ProductService(StripeService): class CreateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the product is currently available for purchase. Defaults to `true`. """ @@ -22,27 +22,27 @@ class CreateParams(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object. This Price will be set as the default price for this product. """ - description: NotRequired["str"] + description: NotRequired[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - features: NotRequired["List[ProductService.CreateParamsFeature]"] + features: NotRequired[List["ProductService.CreateParamsFeature"]] """ A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). """ - id: NotRequired["str"] + id: NotRequired[str] """ An identifier will be randomly generated by Stripe. You can optionally override this ID, but the ID must be unique across all products in your Stripe account. """ - images: NotRequired["List[str]"] + images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -56,30 +56,30 @@ class CreateParams(TypedDict): """ The dimensions of this product for shipping purposes. """ - shippable: NotRequired["bool"] + shippable: NotRequired[bool] """ Whether this product is shipped (i.e., physical goods). """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. It must contain at least one letter. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ - type: NotRequired["Literal['good', 'service']"] + 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. """ - unit_label: NotRequired["str"] + 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. """ - url: NotRequired["str"] + url: NotRequired[str] """ A URL of a publicly-accessible webpage for this product. """ @@ -90,7 +90,10 @@ class CreateParamsDefaultPriceData(TypedDict): 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). """ currency_options: NotRequired[ - "Dict[str, ProductService.CreateParamsDefaultPriceDataCurrencyOptions]" + Dict[ + str, + "ProductService.CreateParamsDefaultPriceDataCurrencyOptions", + ] ] """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). @@ -102,16 +105,16 @@ class CreateParamsDefaultPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -124,22 +127,24 @@ class CreateParamsDefaultPriceDataCurrencyOptions(TypedDict): When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: NotRequired[ - "List[ProductService.CreateParamsDefaultPriceDataCurrencyOptionsTier]" + List[ + "ProductService.CreateParamsDefaultPriceDataCurrencyOptionsTier" + ] ] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -151,33 +156,33 @@ class CreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmount( """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ - preset: NotRequired["int"] + preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class CreateParamsDefaultPriceDataCurrencyOptionsTier(TypedDict): - flat_amount: NotRequired["int"] + flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired["str"] + flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -191,7 +196,7 @@ class CreateParamsDefaultPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ @@ -224,7 +229,7 @@ class DeleteParams(TypedDict): pass class ListParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Only return products that are active or inactive (e.g., pass `false` to list all inactive products). """ @@ -232,73 +237,73 @@ class ListParams(TypedDict): """ Only return products that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - ids: NotRequired["List[str]"] + ids: NotRequired[List[str]] """ Only return products with the given IDs. Cannot be used with [starting_after](https://stripe.com/docs/api#list_products-starting_after) or [ending_before](https://stripe.com/docs/api#list_products-ending_before). """ - limit: NotRequired["int"] + 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. """ - shippable: NotRequired["bool"] + shippable: NotRequired[bool] """ Only return products that can be shipped (i.e., physical, not digital products). """ - starting_after: NotRequired["str"] + 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: NotRequired["Literal['good', 'service']"] + type: NotRequired[Literal["good", "service"]] """ Only return products of this type. """ - url: NotRequired["str"] + url: NotRequired[str] """ Only return products with the given url. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ @@ -308,11 +313,11 @@ class SearchParams(TypedDict): """ class UpdateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the product is available for purchase. """ - default_price: NotRequired["str"] + default_price: NotRequired[str] """ The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. """ @@ -320,7 +325,7 @@ class UpdateParams(TypedDict): """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -338,7 +343,7 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ The product's name, meant to be displayable to the customer. """ @@ -348,11 +353,11 @@ class UpdateParams(TypedDict): """ The dimensions of this product for shipping purposes. """ - shippable: NotRequired["bool"] + shippable: NotRequired[bool] """ Whether this product is shipped (i.e., physical goods). """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. diff --git a/stripe/_promotion_code.py b/stripe/_promotion_code.py index 0bc39564e..37096b92f 100644 --- a/stripe/_promotion_code.py +++ b/stripe/_promotion_code.py @@ -61,11 +61,11 @@ class CurrencyOptions(StripeObject): _inner_class_dicts = ["currency_options"] class CreateParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the promotion code is currently active. """ - code: NotRequired["str"] + code: NotRequired[str] """ The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically. """ @@ -73,23 +73,23 @@ class CreateParams(RequestOptions): """ The coupon for this promotion code. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The timestamp at which this promotion code will expire. If the coupon has specified a `redeems_by`, then this value cannot be after the coupon's `redeems_by`. """ - max_redemptions: NotRequired["int"] + max_redemptions: NotRequired[int] """ A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified a `max_redemptions`, then this value cannot be greater than the coupon's `max_redemptions`. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -100,40 +100,40 @@ class CreateParams(RequestOptions): class CreateParamsRestrictions(TypedDict): currency_options: NotRequired[ - "Dict[str, PromotionCode.CreateParamsRestrictionsCurrencyOptions]" + Dict[str, "PromotionCode.CreateParamsRestrictionsCurrencyOptions"] ] """ Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ - first_time_transaction: NotRequired["bool"] + first_time_transaction: NotRequired[bool] """ A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices """ - minimum_amount: NotRequired["int"] + minimum_amount: NotRequired[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ - minimum_amount_currency: NotRequired["str"] + minimum_amount_currency: NotRequired[str] """ Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount """ class CreateParamsRestrictionsCurrencyOptions(TypedDict): - minimum_amount: NotRequired["int"] + minimum_amount: NotRequired[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ class ListParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Filter promotion codes by whether they are active. """ - code: NotRequired["str"] + code: NotRequired[str] """ Only return promotion codes that have this case-insensitive code. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ Only return promotion codes for this coupon. """ @@ -141,51 +141,51 @@ class ListParams(RequestOptions): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return promotion codes that are restricted to this customer. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the promotion code is currently active. A promotion code can only be reactivated when the coupon is still valid and the promotion code is otherwise redeemable. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -200,20 +200,20 @@ class ModifyParams(RequestOptions): class ModifyParamsRestrictions(TypedDict): currency_options: NotRequired[ - "Dict[str, PromotionCode.ModifyParamsRestrictionsCurrencyOptions]" + Dict[str, "PromotionCode.ModifyParamsRestrictionsCurrencyOptions"] ] """ Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class ModifyParamsRestrictionsCurrencyOptions(TypedDict): - minimum_amount: NotRequired["int"] + minimum_amount: NotRequired[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_promotion_code_service.py b/stripe/_promotion_code_service.py index d2c9ebbbb..4e6fdbb4a 100644 --- a/stripe/_promotion_code_service.py +++ b/stripe/_promotion_code_service.py @@ -11,11 +11,11 @@ class PromotionCodeService(StripeService): class CreateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the promotion code is currently active. """ - code: NotRequired["str"] + code: NotRequired[str] """ The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically. """ @@ -23,23 +23,23 @@ class CreateParams(TypedDict): """ The coupon for this promotion code. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The timestamp at which this promotion code will expire. If the coupon has specified a `redeems_by`, then this value cannot be after the coupon's `redeems_by`. """ - max_redemptions: NotRequired["int"] + max_redemptions: NotRequired[int] """ A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified a `max_redemptions`, then this value cannot be greater than the coupon's `max_redemptions`. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -52,40 +52,43 @@ class CreateParams(TypedDict): class CreateParamsRestrictions(TypedDict): currency_options: NotRequired[ - "Dict[str, PromotionCodeService.CreateParamsRestrictionsCurrencyOptions]" + Dict[ + str, + "PromotionCodeService.CreateParamsRestrictionsCurrencyOptions", + ] ] """ Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ - first_time_transaction: NotRequired["bool"] + first_time_transaction: NotRequired[bool] """ A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices """ - minimum_amount: NotRequired["int"] + minimum_amount: NotRequired[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ - minimum_amount_currency: NotRequired["str"] + minimum_amount_currency: NotRequired[str] """ Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount """ class CreateParamsRestrictionsCurrencyOptions(TypedDict): - minimum_amount: NotRequired["int"] + minimum_amount: NotRequired[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ class ListParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Filter promotion codes by whether they are active. """ - code: NotRequired["str"] + code: NotRequired[str] """ Only return promotion codes that have this case-insensitive code. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ Only return promotion codes for this coupon. """ @@ -93,57 +96,57 @@ class ListParams(TypedDict): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return promotion codes that are restricted to this customer. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the promotion code is currently active. A promotion code can only be reactivated when the coupon is still valid and the promotion code is otherwise redeemable. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -160,14 +163,17 @@ class UpdateParams(TypedDict): class UpdateParamsRestrictions(TypedDict): currency_options: NotRequired[ - "Dict[str, PromotionCodeService.UpdateParamsRestrictionsCurrencyOptions]" + Dict[ + str, + "PromotionCodeService.UpdateParamsRestrictionsCurrencyOptions", + ] ] """ Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class UpdateParamsRestrictionsCurrencyOptions(TypedDict): - minimum_amount: NotRequired["int"] + minimum_amount: NotRequired[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ diff --git a/stripe/_quote.py b/stripe/_quote.py index 5af37be32..eeff64e15 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -422,13 +422,13 @@ class TransferData(StripeObject): """ class AcceptParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CancelParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -447,12 +447,12 @@ class CreateParams(RequestOptions): Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. """ @@ -468,11 +468,11 @@ class CreateParams(RequestOptions): """ The discounts applied to the quote. You can only set up to one discount. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. If no value is passed, the default expiration date configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. """ @@ -492,11 +492,11 @@ class CreateParams(RequestOptions): """ All invoices will be billed using the specified settings. """ - line_items: NotRequired["List[Quote.CreateParamsLineItem]"] + line_items: NotRequired[List["Quote.CreateParamsLineItem"]] """ A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -508,7 +508,7 @@ class CreateParams(RequestOptions): """ When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. """ - test_clock: NotRequired["str"] + test_clock: NotRequired[str] """ ID of the test clock to attach to the quote. """ @@ -530,7 +530,7 @@ class CreateParamsAutomaticTax(TypedDict): """ class CreateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -540,17 +540,17 @@ class CreateParamsAutomaticTaxLiability(TypedDict): """ class CreateParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ class CreateParamsFromQuote(TypedDict): - is_revision: NotRequired["bool"] + is_revision: NotRequired[bool] """ Whether this quote is a revision of the previous quote. """ @@ -560,7 +560,7 @@ class CreateParamsFromQuote(TypedDict): """ class CreateParamsInvoiceSettings(TypedDict): - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ @@ -570,7 +570,7 @@ class CreateParamsInvoiceSettings(TypedDict): """ class CreateParamsInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -580,7 +580,7 @@ class CreateParamsInvoiceSettingsIssuer(TypedDict): """ class CreateParamsLineItem(TypedDict): - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ @@ -588,7 +588,7 @@ class CreateParamsLineItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity of the line item. """ @@ -611,16 +611,16 @@ class CreateParamsLineItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -630,13 +630,13 @@ class CreateParamsLineItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsSubscriptionData(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ @@ -646,7 +646,7 @@ class CreateParamsSubscriptionData(TypedDict): """ When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ @@ -656,11 +656,11 @@ class CreateParamsSubscriptionData(TypedDict): """ class CreateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. """ - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. """ @@ -670,77 +670,77 @@ class CreateParamsTransferData(TypedDict): """ class FinalizeQuoteParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. """ class ListComputedUpfrontLineItemsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListLineItemsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParams(RequestOptions): - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the customer whose quotes will be retrieved. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['accepted', 'canceled', 'draft', 'open']"] + status: NotRequired[Literal["accepted", "canceled", "draft", "open"]] """ The status of the quote. """ - test_clock: NotRequired["str"] + test_clock: NotRequired[str] """ Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set. """ @@ -759,12 +759,12 @@ class ModifyParams(RequestOptions): Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. """ @@ -780,11 +780,11 @@ class ModifyParams(RequestOptions): """ The discounts applied to the quote. You can only set up to one discount. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. """ @@ -800,11 +800,11 @@ class ModifyParams(RequestOptions): """ All invoices will be billed using the specified settings. """ - line_items: NotRequired["List[Quote.ModifyParamsLineItem]"] + line_items: NotRequired[List["Quote.ModifyParamsLineItem"]] """ A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -834,7 +834,7 @@ class ModifyParamsAutomaticTax(TypedDict): """ class ModifyParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -844,17 +844,17 @@ class ModifyParamsAutomaticTaxLiability(TypedDict): """ class ModifyParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ class ModifyParamsInvoiceSettings(TypedDict): - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ @@ -864,7 +864,7 @@ class ModifyParamsInvoiceSettings(TypedDict): """ class ModifyParamsInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -874,11 +874,11 @@ class ModifyParamsInvoiceSettingsIssuer(TypedDict): """ class ModifyParamsLineItem(TypedDict): - id: NotRequired["str"] + id: NotRequired[str] """ The ID of an existing line item on the quote. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ @@ -886,7 +886,7 @@ class ModifyParamsLineItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity of the line item. """ @@ -909,16 +909,16 @@ class ModifyParamsLineItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -928,7 +928,7 @@ class ModifyParamsLineItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ @@ -944,7 +944,7 @@ class ModifyParamsSubscriptionData(TypedDict): """ When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ @@ -954,11 +954,11 @@ class ModifyParamsSubscriptionData(TypedDict): """ class ModifyParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. """ - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. """ @@ -968,13 +968,13 @@ class ModifyParamsTransferData(TypedDict): """ class PdfParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_quote_computed_upfront_line_items_service.py b/stripe/_quote_computed_upfront_line_items_service.py index 9b52150af..470752f14 100644 --- a/stripe/_quote_computed_upfront_line_items_service.py +++ b/stripe/_quote_computed_upfront_line_items_service.py @@ -11,19 +11,19 @@ class QuoteComputedUpfrontLineItemsService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ diff --git a/stripe/_quote_line_item_service.py b/stripe/_quote_line_item_service.py index b9b03b222..358c7a6c7 100644 --- a/stripe/_quote_line_item_service.py +++ b/stripe/_quote_line_item_service.py @@ -11,19 +11,19 @@ class QuoteLineItemService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 7f904cc0a..91fc43396 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -24,13 +24,13 @@ def __init__(self, requestor): ) class AcceptParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CancelParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -49,12 +49,12 @@ class CreateParams(TypedDict): Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. """ @@ -72,11 +72,11 @@ class CreateParams(TypedDict): """ The discounts applied to the quote. You can only set up to one discount. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. If no value is passed, the default expiration date configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. """ @@ -98,11 +98,11 @@ class CreateParams(TypedDict): """ All invoices will be billed using the specified settings. """ - line_items: NotRequired["List[QuoteService.CreateParamsLineItem]"] + line_items: NotRequired[List["QuoteService.CreateParamsLineItem"]] """ A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -116,7 +116,7 @@ class CreateParams(TypedDict): """ When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. """ - test_clock: NotRequired["str"] + test_clock: NotRequired[str] """ ID of the test clock to attach to the quote. """ @@ -140,7 +140,7 @@ class CreateParamsAutomaticTax(TypedDict): """ class CreateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -150,17 +150,17 @@ class CreateParamsAutomaticTaxLiability(TypedDict): """ class CreateParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ class CreateParamsFromQuote(TypedDict): - is_revision: NotRequired["bool"] + is_revision: NotRequired[bool] """ Whether this quote is a revision of the previous quote. """ @@ -170,7 +170,7 @@ class CreateParamsFromQuote(TypedDict): """ class CreateParamsInvoiceSettings(TypedDict): - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ @@ -180,7 +180,7 @@ class CreateParamsInvoiceSettings(TypedDict): """ class CreateParamsInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -190,7 +190,7 @@ class CreateParamsInvoiceSettingsIssuer(TypedDict): """ class CreateParamsLineItem(TypedDict): - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ @@ -198,7 +198,7 @@ class CreateParamsLineItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity of the line item. """ @@ -223,16 +223,16 @@ class CreateParamsLineItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -242,13 +242,13 @@ class CreateParamsLineItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsSubscriptionData(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ @@ -258,7 +258,7 @@ class CreateParamsSubscriptionData(TypedDict): """ When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ @@ -268,11 +268,11 @@ class CreateParamsSubscriptionData(TypedDict): """ class CreateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. """ - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. """ @@ -282,53 +282,53 @@ class CreateParamsTransferData(TypedDict): """ class FinalizeQuoteParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. """ class ListParams(TypedDict): - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the customer whose quotes will be retrieved. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['accepted', 'canceled', 'draft', 'open']"] + status: NotRequired[Literal["accepted", "canceled", "draft", "open"]] """ The status of the quote. """ - test_clock: NotRequired["str"] + test_clock: NotRequired[str] """ Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set. """ class PdfParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -347,12 +347,12 @@ class UpdateParams(TypedDict): Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. """ @@ -370,11 +370,11 @@ class UpdateParams(TypedDict): """ The discounts applied to the quote. You can only set up to one discount. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. """ @@ -392,11 +392,11 @@ class UpdateParams(TypedDict): """ All invoices will be billed using the specified settings. """ - line_items: NotRequired["List[QuoteService.UpdateParamsLineItem]"] + line_items: NotRequired[List["QuoteService.UpdateParamsLineItem"]] """ A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -430,7 +430,7 @@ class UpdateParamsAutomaticTax(TypedDict): """ class UpdateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -440,17 +440,17 @@ class UpdateParamsAutomaticTaxLiability(TypedDict): """ class UpdateParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ - discount: NotRequired["str"] + discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ class UpdateParamsInvoiceSettings(TypedDict): - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ @@ -460,7 +460,7 @@ class UpdateParamsInvoiceSettings(TypedDict): """ class UpdateParamsInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -470,11 +470,11 @@ class UpdateParamsInvoiceSettingsIssuer(TypedDict): """ class UpdateParamsLineItem(TypedDict): - id: NotRequired["str"] + id: NotRequired[str] """ The ID of an existing line item on the quote. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ @@ -482,7 +482,7 @@ class UpdateParamsLineItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity of the line item. """ @@ -507,16 +507,16 @@ class UpdateParamsLineItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -526,7 +526,7 @@ class UpdateParamsLineItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ @@ -542,7 +542,7 @@ class UpdateParamsSubscriptionData(TypedDict): """ When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ @@ -552,11 +552,11 @@ class UpdateParamsSubscriptionData(TypedDict): """ class UpdateParamsTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. """ - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. """ diff --git a/stripe/_refund.py b/stripe/_refund.py index 1df08c45d..3c3aa87f8 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -304,30 +304,30 @@ class EmailSent(StripeObject): _inner_class_types = {"display_details": DisplayDetails} class CancelParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): - amount: NotRequired["int"] - charge: NotRequired["str"] + amount: NotRequired[int] + charge: NotRequired[str] """ The identifier of the charge to refund. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Customer whose customer balance to refund from. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - instructions_email: NotRequired["str"] + instructions_email: NotRequired[str] """ For payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions. """ @@ -335,25 +335,25 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - origin: NotRequired["Literal['customer_balance']"] + origin: NotRequired[Literal["customer_balance"]] """ Origin of the refund """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ The identifier of the PaymentIntent to refund. """ reason: NotRequired[ - "Literal['duplicate', 'fraudulent', 'requested_by_customer']" + Literal["duplicate", "fraudulent", "requested_by_customer"] ] """ String indicating the reason for the refund. If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`. If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://stripe.com/docs/radar/lists), and will also help us improve our fraud detection algorithms. """ - refund_application_fee: NotRequired["bool"] + refund_application_fee: NotRequired[bool] """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ - reverse_transfer: NotRequired["bool"] + reverse_transfer: NotRequired[bool] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). @@ -361,13 +361,13 @@ class CreateParams(RequestOptions): """ class ExpireParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): - charge: NotRequired["str"] + charge: NotRequired[str] """ Only return refunds for the charge specified by this charge ID. """ @@ -375,47 +375,47 @@ class ListParams(RequestOptions): """ Only return refunds that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ Only return refunds for the PaymentIntent specified by this ID. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -425,7 +425,7 @@ class ModifyParams(RequestOptions): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_refund_service.py b/stripe/_refund_service.py index 48c4f620a..806b2f957 100644 --- a/stripe/_refund_service.py +++ b/stripe/_refund_service.py @@ -11,30 +11,30 @@ class RefundService(StripeService): class CancelParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): - amount: NotRequired["int"] - charge: NotRequired["str"] + amount: NotRequired[int] + charge: NotRequired[str] """ The identifier of the charge to refund. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Customer whose customer balance to refund from. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - instructions_email: NotRequired["str"] + instructions_email: NotRequired[str] """ For payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions. """ @@ -42,25 +42,25 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - origin: NotRequired["Literal['customer_balance']"] + origin: NotRequired[Literal["customer_balance"]] """ Origin of the refund """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ The identifier of the PaymentIntent to refund. """ reason: NotRequired[ - "Literal['duplicate', 'fraudulent', 'requested_by_customer']" + Literal["duplicate", "fraudulent", "requested_by_customer"] ] """ String indicating the reason for the refund. If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`. If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://stripe.com/docs/radar/lists), and will also help us improve our fraud detection algorithms. """ - refund_application_fee: NotRequired["bool"] + refund_application_fee: NotRequired[bool] """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ - reverse_transfer: NotRequired["bool"] + reverse_transfer: NotRequired[bool] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). @@ -68,7 +68,7 @@ class CreateParams(TypedDict): """ class ListParams(TypedDict): - charge: NotRequired["str"] + charge: NotRequired[str] """ Only return refunds for the charge specified by this charge ID. """ @@ -76,53 +76,53 @@ class ListParams(TypedDict): """ Only return refunds that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ Only return refunds for the PaymentIntent specified by this ID. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_review.py b/stripe/_review.py index 2bb7a4e78..d209cbcd8 100644 --- a/stripe/_review.py +++ b/stripe/_review.py @@ -71,7 +71,7 @@ class Session(StripeObject): """ class ApproveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -81,43 +81,43 @@ class ListParams(RequestOptions): """ Only return reviews that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_review_service.py b/stripe/_review_service.py index cdd2b4f64..f1b8db8cf 100644 --- a/stripe/_review_service.py +++ b/stripe/_review_service.py @@ -11,7 +11,7 @@ class ReviewService(StripeService): class ApproveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -21,43 +21,43 @@ class ListParams(TypedDict): """ Only return reviews that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index f9ca69fff..4b41575e5 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -668,15 +668,15 @@ class ListParams(RequestOptions): can be a string with an integer Unix timestamp or a dictionary with a number of different query options. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -685,25 +685,25 @@ class ListParams(RequestOptions): Only return SetupAttempts created by the SetupIntent specified by this ID. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ diff --git a/stripe/_setup_attempt_service.py b/stripe/_setup_attempt_service.py index e32727c45..2a7d2468a 100644 --- a/stripe/_setup_attempt_service.py +++ b/stripe/_setup_attempt_service.py @@ -16,15 +16,15 @@ class ListParams(TypedDict): can be a string with an integer Unix timestamp or a dictionary with a number of different query options. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -33,25 +33,25 @@ class ListParams(TypedDict): Only return SetupAttempts created by the SetupIntent specified by this ID. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 0d353fb0d..2b07dd8ff 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -606,31 +606,31 @@ class MandateOptions(StripeObject): class CancelParams(RequestOptions): cancellation_reason: NotRequired[ - "Literal['abandoned', 'duplicate', 'requested_by_customer']" + Literal["abandoned", "duplicate", "requested_by_customer"] ] """ Reason for canceling this SetupIntent. Possible values are: `abandoned`, `requested_by_customer`, or `duplicate` """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ConfirmParams(RequestOptions): - confirmation_token: NotRequired["str"] + confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this SetupIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ mandate_data: NotRequired[ "Literal['']|SetupIntent.ConfirmParamsMandateData" ] - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. """ @@ -647,13 +647,13 @@ class ConfirmParams(RequestOptions): """ Payment method-specific configuration for this SetupIntent. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods. """ - use_stripe_sdk: NotRequired["bool"] + use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ @@ -667,7 +667,7 @@ class ConfirmParamsMandateData(TypedDict): """ class ConfirmParamsMandateDataCustomerAcceptance(TypedDict): - accepted_at: NotRequired["int"] + accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ @@ -692,11 +692,11 @@ class ConfirmParamsMandateDataCustomerAcceptanceOffline(TypedDict): pass class ConfirmParamsMandateDataCustomerAcceptanceOnline(TypedDict): - ip_address: NotRequired["str"] + ip_address: NotRequired[str] """ The IP address from which the Mandate was accepted by the customer. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the Mandate was accepted by the customer. """ @@ -810,7 +810,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -961,11 +961,11 @@ class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -994,27 +994,27 @@ class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): """ class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -1036,14 +1036,43 @@ class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): class ConfirmParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -1083,7 +1112,24 @@ class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -1126,7 +1172,34 @@ class ConfirmParamsPaymentMethodDataOxxo(TypedDict): class ConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -1145,7 +1218,7 @@ class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): pass class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -1169,23 +1242,23 @@ class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -1231,7 +1304,7 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired["Literal['cad', 'usd']"] + currency: NotRequired[Literal["cad", "usd"]] """ 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). """ @@ -1242,7 +1315,7 @@ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -1255,21 +1328,21 @@ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired["List[Literal['invoice', 'subscription']]"] + default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ @@ -1281,20 +1354,32 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ Configuration options for setting up an eMandate for cards issued in India. """ - moto: NotRequired["bool"] + moto: NotRequired[bool] """ When specified, this parameter signals that a card has been collected as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1320,11 +1405,11 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Currency in which future payments will be charged. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + 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: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ @@ -1332,7 +1417,7 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ @@ -1344,19 +1429,19 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - supported_types: NotRequired["List[Literal['india']]"] + supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ - "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ - cryptogram: NotRequired["str"] + cryptogram: NotRequired[str] """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. @@ -1364,7 +1449,7 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - "Literal['01', '02', '05', '06', '07']" + Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure @@ -1378,17 +1463,17 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ - requestor_challenge_indicator: NotRequired["str"] + requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ - transaction_id: NotRequired["str"] + transaction_id: NotRequired[str] """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: NotRequired["Literal['1.0.2', '2.1.0', '2.2.0']"] + version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was performed. """ @@ -1412,27 +1497,27 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBanca to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ - cb_exemption: NotRequired["str"] + cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ - cb_score: NotRequired["int"] + cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): - persistent_token: NotRequired["str"] + persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): - billing_agreement_id: NotRequired["str"] + billing_agreement_id: NotRequired[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ @@ -1468,7 +1553,7 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -1478,16 +1563,20 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ @@ -1501,13 +1590,13 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( """ class ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired["List[Literal['ach', 'us_domestic_wire']]"] + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class CreateParams(RequestOptions): - attach_to_self: NotRequired["bool"] + attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. @@ -1519,31 +1608,31 @@ class CreateParams(RequestOptions): """ When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters. """ - confirm: NotRequired["bool"] + confirm: NotRequired[bool] """ Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary. """ - confirmation_token: NotRequired["str"] + confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this SetupIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ ID of the Customer this SetupIntent belongs to, if one exists. If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - flow_directions: NotRequired["List[Literal['inbound', 'outbound']]"] + flow_directions: NotRequired[List[Literal["inbound", "outbound"]]] """ Indicates the directions of money movement for which this payment method is intended to be used. @@ -1555,19 +1644,19 @@ class CreateParams(RequestOptions): """ This hash contains details about the mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The Stripe account ID created for this SetupIntent. """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. """ - payment_method_configuration: NotRequired["str"] + payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this SetupIntent. """ @@ -1584,11 +1673,11 @@ class CreateParams(RequestOptions): """ Payment method-specific configuration for this SetupIntent. """ - payment_method_types: NotRequired["List[str]"] + payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, it defaults to ["card"]. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. To redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). """ @@ -1596,17 +1685,17 @@ class CreateParams(RequestOptions): """ If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion. """ - usage: NotRequired["Literal['off_session', 'on_session']"] + usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`. """ - use_stripe_sdk: NotRequired["bool"] + use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ class CreateParamsAutomaticPaymentMethods(TypedDict): - allow_redirects: NotRequired["Literal['always', 'never']"] + allow_redirects: NotRequired[Literal["always", "never"]] """ Controls whether this SetupIntent will accept redirect-based payment methods. @@ -1624,7 +1713,7 @@ class CreateParamsMandateData(TypedDict): """ class CreateParamsMandateDataCustomerAcceptance(TypedDict): - accepted_at: NotRequired["int"] + accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ @@ -1767,7 +1856,7 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -1918,11 +2007,11 @@ class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -1951,27 +2040,27 @@ class CreateParamsPaymentMethodDataBillingDetails(TypedDict): """ class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -1993,14 +2082,43 @@ class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): class CreateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -2040,7 +2158,24 @@ class CreateParamsPaymentMethodDataGrabpay(TypedDict): class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -2083,7 +2218,34 @@ class CreateParamsPaymentMethodDataOxxo(TypedDict): class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -2102,7 +2264,7 @@ class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass class CreateParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -2126,23 +2288,23 @@ class CreateParamsPaymentMethodDataSwish(TypedDict): pass class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -2188,7 +2350,7 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired["Literal['cad', 'usd']"] + currency: NotRequired[Literal["cad", "usd"]] """ 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). """ @@ -2199,7 +2361,7 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -2212,21 +2374,21 @@ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired["List[Literal['invoice', 'subscription']]"] + default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ @@ -2238,20 +2400,32 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Configuration options for setting up an eMandate for cards issued in India. """ - moto: NotRequired["bool"] + moto: NotRequired[bool] """ When specified, this parameter signals that a card has been collected as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -2277,11 +2451,11 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Currency in which future payments will be charged. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + 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: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ @@ -2289,7 +2463,7 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ @@ -2301,19 +2475,19 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - supported_types: NotRequired["List[Literal['india']]"] + supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ - "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ - cryptogram: NotRequired["str"] + cryptogram: NotRequired[str] """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. @@ -2321,7 +2495,7 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - "Literal['01', '02', '05', '06', '07']" + Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure @@ -2335,17 +2509,17 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ - requestor_challenge_indicator: NotRequired["str"] + requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ - transaction_id: NotRequired["str"] + transaction_id: NotRequired[str] """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: NotRequired["Literal['1.0.2', '2.1.0', '2.2.0']"] + version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was performed. """ @@ -2369,27 +2543,27 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ - cb_exemption: NotRequired["str"] + cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ - cb_score: NotRequired["int"] + cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class CreateParamsPaymentMethodOptionsLink(TypedDict): - persistent_token: NotRequired["str"] + persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): - billing_agreement_id: NotRequired["str"] + billing_agreement_id: NotRequired[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ @@ -2425,7 +2599,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -2435,16 +2609,20 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ @@ -2458,7 +2636,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( """ class CreateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired["List[Literal['ach', 'us_domestic_wire']]"] + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ @@ -2474,7 +2652,7 @@ class CreateParamsSingleUse(TypedDict): """ class ListParams(RequestOptions): - attach_to_self: NotRequired["bool"] + attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. @@ -2484,71 +2662,71 @@ class ListParams(RequestOptions): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return SetupIntents for the customer specified by this customer ID. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ Only return SetupIntents that associate with the specified payment method. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - attach_to_self: NotRequired["bool"] + attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ ID of the Customer this SetupIntent belongs to, if one exists. If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - flow_directions: NotRequired["List[Literal['inbound', 'outbound']]"] + flow_directions: NotRequired[List[Literal["inbound", "outbound"]]] """ Indicates the directions of money movement for which this payment method is intended to be used. @@ -2558,11 +2736,11 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. """ - payment_method_configuration: NotRequired["str"] + payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this SetupIntent. """ @@ -2579,7 +2757,7 @@ class ModifyParams(RequestOptions): """ Payment method-specific configuration for this SetupIntent. """ - payment_method_types: NotRequired["List[str]"] + payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this array, it defaults to ["card"]. """ @@ -2693,7 +2871,7 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -2844,11 +3022,11 @@ class ModifyParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class ModifyParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -2877,27 +3055,27 @@ class ModifyParamsPaymentMethodDataBillingDetails(TypedDict): """ class ModifyParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -2919,14 +3097,43 @@ class ModifyParamsPaymentMethodDataCustomerBalance(TypedDict): class ModifyParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class ModifyParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -2966,7 +3173,24 @@ class ModifyParamsPaymentMethodDataGrabpay(TypedDict): class ModifyParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -3009,7 +3233,34 @@ class ModifyParamsPaymentMethodDataOxxo(TypedDict): class ModifyParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -3028,7 +3279,7 @@ class ModifyParamsPaymentMethodDataPromptpay(TypedDict): pass class ModifyParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -3052,23 +3303,23 @@ class ModifyParamsPaymentMethodDataSwish(TypedDict): pass class ModifyParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -3114,7 +3365,7 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ class ModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired["Literal['cad', 'usd']"] + currency: NotRequired[Literal["cad", "usd"]] """ 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). """ @@ -3125,7 +3376,7 @@ class ModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -3138,21 +3389,21 @@ class ModifyParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired["List[Literal['invoice', 'subscription']]"] + default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ @@ -3164,20 +3415,32 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ Configuration options for setting up an eMandate for cards issued in India. """ - moto: NotRequired["bool"] + moto: NotRequired[bool] """ When specified, this parameter signals that a card has been collected as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -3203,11 +3466,11 @@ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Currency in which future payments will be charged. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + 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: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ @@ -3215,7 +3478,7 @@ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ @@ -3227,19 +3490,19 @@ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - supported_types: NotRequired["List[Literal['india']]"] + supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ - "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ - cryptogram: NotRequired["str"] + cryptogram: NotRequired[str] """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. @@ -3247,7 +3510,7 @@ class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - "Literal['01', '02', '05', '06', '07']" + Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure @@ -3261,17 +3524,17 @@ class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ - requestor_challenge_indicator: NotRequired["str"] + requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ - transaction_id: NotRequired["str"] + transaction_id: NotRequired[str] """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: NotRequired["Literal['1.0.2', '2.1.0', '2.2.0']"] + version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was performed. """ @@ -3295,27 +3558,27 @@ class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ - cb_exemption: NotRequired["str"] + cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ - cb_score: NotRequired["int"] + cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class ModifyParamsPaymentMethodOptionsLink(TypedDict): - persistent_token: NotRequired["str"] + persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): - billing_agreement_id: NotRequired["str"] + billing_agreement_id: NotRequired[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ @@ -3351,7 +3614,7 @@ class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -3361,16 +3624,20 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ @@ -3384,31 +3651,31 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountMandateOptions( """ class ModifyParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired["List[Literal['ach', 'us_domestic_wire']]"] + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class RetrieveParams(RequestOptions): - client_secret: NotRequired["str"] + client_secret: NotRequired[str] """ The client secret of the SetupIntent. We require this string if you use a publishable key to retrieve the SetupIntent. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class VerifyMicrodepositsParams(RequestOptions): - amounts: NotRequired["List[int]"] + amounts: NotRequired[List[int]] """ Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. """ - descriptor_code: NotRequired["str"] + descriptor_code: NotRequired[str] """ A six-character code starting with SM present in the microdeposit sent to the bank account. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index cd81278e5..a773f7647 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -12,31 +12,31 @@ class SetupIntentService(StripeService): class CancelParams(TypedDict): cancellation_reason: NotRequired[ - "Literal['abandoned', 'duplicate', 'requested_by_customer']" + Literal["abandoned", "duplicate", "requested_by_customer"] ] """ Reason for canceling this SetupIntent. Possible values are: `abandoned`, `requested_by_customer`, or `duplicate` """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ConfirmParams(TypedDict): - confirmation_token: NotRequired["str"] + confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this SetupIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ mandate_data: NotRequired[ "Literal['']|SetupIntentService.ConfirmParamsMandateData" ] - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. """ @@ -53,13 +53,13 @@ class ConfirmParams(TypedDict): """ Payment method-specific configuration for this SetupIntent. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods. """ - use_stripe_sdk: NotRequired["bool"] + use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ @@ -73,7 +73,7 @@ class ConfirmParamsMandateData(TypedDict): """ class ConfirmParamsMandateDataCustomerAcceptance(TypedDict): - accepted_at: NotRequired["int"] + accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ @@ -98,11 +98,11 @@ class ConfirmParamsMandateDataCustomerAcceptanceOffline(TypedDict): pass class ConfirmParamsMandateDataCustomerAcceptanceOnline(TypedDict): - ip_address: NotRequired["str"] + ip_address: NotRequired[str] """ The IP address from which the Mandate was accepted by the customer. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the Mandate was accepted by the customer. """ @@ -234,7 +234,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -401,11 +401,11 @@ class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -434,27 +434,27 @@ class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): """ class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -476,14 +476,43 @@ class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): class ConfirmParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -523,7 +552,24 @@ class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -568,7 +614,34 @@ class ConfirmParamsPaymentMethodDataOxxo(TypedDict): class ConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -587,7 +660,7 @@ class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): pass class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -611,23 +684,23 @@ class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -677,7 +750,7 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired["Literal['cad', 'usd']"] + currency: NotRequired[Literal["cad", "usd"]] """ 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). """ @@ -688,7 +761,7 @@ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -701,21 +774,21 @@ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired["List[Literal['invoice', 'subscription']]"] + default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ @@ -727,20 +800,32 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ Configuration options for setting up an eMandate for cards issued in India. """ - moto: NotRequired["bool"] + moto: NotRequired[bool] """ When specified, this parameter signals that a card has been collected as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -766,11 +851,11 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Currency in which future payments will be charged. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + 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: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ @@ -778,7 +863,7 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ @@ -790,19 +875,19 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - supported_types: NotRequired["List[Literal['india']]"] + supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ - "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ - cryptogram: NotRequired["str"] + cryptogram: NotRequired[str] """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. @@ -810,7 +895,7 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - "Literal['01', '02', '05', '06', '07']" + Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure @@ -824,17 +909,17 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ - requestor_challenge_indicator: NotRequired["str"] + requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ - transaction_id: NotRequired["str"] + transaction_id: NotRequired[str] """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: NotRequired["Literal['1.0.2', '2.1.0', '2.2.0']"] + version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was performed. """ @@ -858,27 +943,27 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBanca to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ - cb_exemption: NotRequired["str"] + cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ - cb_score: NotRequired["int"] + cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): - persistent_token: NotRequired["str"] + persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): - billing_agreement_id: NotRequired["str"] + billing_agreement_id: NotRequired[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ @@ -914,7 +999,7 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -924,16 +1009,20 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ @@ -947,13 +1036,13 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( """ class ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired["List[Literal['ach', 'us_domestic_wire']]"] + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class CreateParams(TypedDict): - attach_to_self: NotRequired["bool"] + attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. @@ -965,31 +1054,31 @@ class CreateParams(TypedDict): """ When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters. """ - confirm: NotRequired["bool"] + confirm: NotRequired[bool] """ Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary. """ - confirmation_token: NotRequired["str"] + confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this SetupIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ ID of the Customer this SetupIntent belongs to, if one exists. If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - flow_directions: NotRequired["List[Literal['inbound', 'outbound']]"] + flow_directions: NotRequired[List[Literal["inbound", "outbound"]]] """ Indicates the directions of money movement for which this payment method is intended to be used. @@ -1001,19 +1090,19 @@ class CreateParams(TypedDict): """ This hash contains details about the mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The Stripe account ID created for this SetupIntent. """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. """ - payment_method_configuration: NotRequired["str"] + payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this SetupIntent. """ @@ -1030,11 +1119,11 @@ class CreateParams(TypedDict): """ Payment method-specific configuration for this SetupIntent. """ - payment_method_types: NotRequired["List[str]"] + payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, it defaults to ["card"]. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. To redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). """ @@ -1042,17 +1131,17 @@ class CreateParams(TypedDict): """ If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion. """ - usage: NotRequired["Literal['off_session', 'on_session']"] + usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`. """ - use_stripe_sdk: NotRequired["bool"] + use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ class CreateParamsAutomaticPaymentMethods(TypedDict): - allow_redirects: NotRequired["Literal['always', 'never']"] + allow_redirects: NotRequired[Literal["always", "never"]] """ Controls whether this SetupIntent will accept redirect-based payment methods. @@ -1070,7 +1159,7 @@ class CreateParamsMandateData(TypedDict): """ class CreateParamsMandateDataCustomerAcceptance(TypedDict): - accepted_at: NotRequired["int"] + accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ @@ -1227,7 +1316,7 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -1388,11 +1477,11 @@ class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -1421,27 +1510,27 @@ class CreateParamsPaymentMethodDataBillingDetails(TypedDict): """ class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -1463,14 +1552,43 @@ class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): class CreateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -1510,7 +1628,24 @@ class CreateParamsPaymentMethodDataGrabpay(TypedDict): class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -1555,7 +1690,34 @@ class CreateParamsPaymentMethodDataOxxo(TypedDict): class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -1574,7 +1736,7 @@ class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass class CreateParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -1598,23 +1760,23 @@ class CreateParamsPaymentMethodDataSwish(TypedDict): pass class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -1664,7 +1826,7 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired["Literal['cad', 'usd']"] + currency: NotRequired[Literal["cad", "usd"]] """ 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). """ @@ -1675,7 +1837,7 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -1688,21 +1850,21 @@ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired["List[Literal['invoice', 'subscription']]"] + default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ @@ -1714,20 +1876,32 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Configuration options for setting up an eMandate for cards issued in India. """ - moto: NotRequired["bool"] + moto: NotRequired[bool] """ When specified, this parameter signals that a card has been collected as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1753,11 +1927,11 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Currency in which future payments will be charged. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + 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: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ @@ -1765,7 +1939,7 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ @@ -1777,19 +1951,19 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - supported_types: NotRequired["List[Literal['india']]"] + supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ - "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ - cryptogram: NotRequired["str"] + cryptogram: NotRequired[str] """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. @@ -1797,7 +1971,7 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - "Literal['01', '02', '05', '06', '07']" + Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure @@ -1811,17 +1985,17 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ - requestor_challenge_indicator: NotRequired["str"] + requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ - transaction_id: NotRequired["str"] + transaction_id: NotRequired[str] """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: NotRequired["Literal['1.0.2', '2.1.0', '2.2.0']"] + version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was performed. """ @@ -1845,27 +2019,27 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ - cb_exemption: NotRequired["str"] + cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ - cb_score: NotRequired["int"] + cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class CreateParamsPaymentMethodOptionsLink(TypedDict): - persistent_token: NotRequired["str"] + persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): - billing_agreement_id: NotRequired["str"] + billing_agreement_id: NotRequired[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ @@ -1901,7 +2075,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -1911,16 +2085,20 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ @@ -1934,7 +2112,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( """ class CreateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired["List[Literal['ach', 'us_domestic_wire']]"] + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ @@ -1950,7 +2128,7 @@ class CreateParamsSingleUse(TypedDict): """ class ListParams(TypedDict): - attach_to_self: NotRequired["bool"] + attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. @@ -1960,81 +2138,81 @@ class ListParams(TypedDict): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return SetupIntents for the customer specified by this customer ID. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ Only return SetupIntents that associate with the specified payment method. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - client_secret: NotRequired["str"] + client_secret: NotRequired[str] """ The client secret of the SetupIntent. We require this string if you use a publishable key to retrieve the SetupIntent. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - attach_to_self: NotRequired["bool"] + attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ ID of the Customer this SetupIntent belongs to, if one exists. If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - flow_directions: NotRequired["List[Literal['inbound', 'outbound']]"] + flow_directions: NotRequired[List[Literal["inbound", "outbound"]]] """ Indicates the directions of money movement for which this payment method is intended to be used. @@ -2044,11 +2222,11 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. """ - payment_method_configuration: NotRequired["str"] + payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this SetupIntent. """ @@ -2065,7 +2243,7 @@ class UpdateParams(TypedDict): """ Payment method-specific configuration for this SetupIntent. """ - payment_method_types: NotRequired["List[str]"] + payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this array, it defaults to ["card"]. """ @@ -2193,7 +2371,7 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -2354,11 +2532,11 @@ class UpdateParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class UpdateParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -2387,27 +2565,27 @@ class UpdateParamsPaymentMethodDataBillingDetails(TypedDict): """ class UpdateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -2429,14 +2607,43 @@ class UpdateParamsPaymentMethodDataCustomerBalance(TypedDict): class UpdateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class UpdateParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -2476,7 +2683,24 @@ class UpdateParamsPaymentMethodDataGrabpay(TypedDict): class UpdateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -2521,7 +2745,34 @@ class UpdateParamsPaymentMethodDataOxxo(TypedDict): class UpdateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -2540,7 +2791,7 @@ class UpdateParamsPaymentMethodDataPromptpay(TypedDict): pass class UpdateParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -2564,23 +2815,23 @@ class UpdateParamsPaymentMethodDataSwish(TypedDict): pass class UpdateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -2630,7 +2881,7 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ class UpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired["Literal['cad', 'usd']"] + currency: NotRequired[Literal["cad", "usd"]] """ 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). """ @@ -2641,7 +2892,7 @@ class UpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -2654,21 +2905,21 @@ class UpdateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired["List[Literal['invoice', 'subscription']]"] + default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ @@ -2680,20 +2931,32 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): """ Configuration options for setting up an eMandate for cards issued in India. """ - moto: NotRequired["bool"] + moto: NotRequired[bool] """ When specified, this parameter signals that a card has been collected as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -2719,11 +2982,11 @@ class UpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Currency in which future payments will be charged. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + 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: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ @@ -2731,7 +2994,7 @@ class UpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ @@ -2743,19 +3006,19 @@ class UpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - supported_types: NotRequired["List[Literal['india']]"] + supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class UpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ - "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ - cryptogram: NotRequired["str"] + cryptogram: NotRequired[str] """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. @@ -2763,7 +3026,7 @@ class UpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - "Literal['01', '02', '05', '06', '07']" + Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure @@ -2777,17 +3040,17 @@ class UpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ - requestor_challenge_indicator: NotRequired["str"] + requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ - transaction_id: NotRequired["str"] + transaction_id: NotRequired[str] """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: NotRequired["Literal['1.0.2', '2.1.0', '2.2.0']"] + version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was performed. """ @@ -2811,27 +3074,27 @@ class UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ - cb_exemption: NotRequired["str"] + cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ - cb_score: NotRequired["int"] + cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class UpdateParamsPaymentMethodOptionsLink(TypedDict): - persistent_token: NotRequired["str"] + persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): - billing_agreement_id: NotRequired["str"] + billing_agreement_id: NotRequired[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ @@ -2867,7 +3130,7 @@ class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. @@ -2877,16 +3140,20 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ @@ -2900,21 +3167,21 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountMandateOptions( """ class UpdateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired["List[Literal['ach', 'us_domestic_wire']]"] + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class VerifyMicrodepositsParams(TypedDict): - amounts: NotRequired["List[int]"] + amounts: NotRequired[List[int]] """ Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. """ - descriptor_code: NotRequired["str"] + descriptor_code: NotRequired[str] """ A six-character code starting with SM present in the microdeposit sent to the bank account. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_shipping_rate.py b/stripe/_shipping_rate.py index a647e9610..e93870df5 100644 --- a/stripe/_shipping_rate.py +++ b/stripe/_shipping_rate.py @@ -101,7 +101,7 @@ class CreateParams(RequestOptions): """ The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -109,21 +109,21 @@ class CreateParams(RequestOptions): """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ - type: NotRequired["Literal['fixed_amount']"] + type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. """ @@ -172,7 +172,7 @@ class CreateParamsFixedAmount(TypedDict): 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). """ currency_options: NotRequired[ - "Dict[str, ShippingRate.CreateParamsFixedAmountCurrencyOptions]" + Dict[str, "ShippingRate.CreateParamsFixedAmountCurrencyOptions"] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). @@ -184,14 +184,14 @@ class CreateParamsFixedAmountCurrencyOptions(TypedDict): A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class ListParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Only return shipping rates that are active or inactive. """ @@ -199,51 +199,51 @@ class ListParams(RequestOptions): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Only return shipping rates for the given currency. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the shipping rate can be used for new purchases. Defaults to `true`. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -256,7 +256,7 @@ class ModifyParams(RequestOptions): Set of [key-value pairs](https://stripe.com/docs/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`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. @@ -264,26 +264,26 @@ class ModifyParams(RequestOptions): class ModifyParamsFixedAmount(TypedDict): currency_options: NotRequired[ - "Dict[str, ShippingRate.ModifyParamsFixedAmountCurrencyOptions]" + Dict[str, "ShippingRate.ModifyParamsFixedAmountCurrencyOptions"] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class ModifyParamsFixedAmountCurrencyOptions(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_shipping_rate_service.py b/stripe/_shipping_rate_service.py index d8dffa5d6..e4b5e9b96 100644 --- a/stripe/_shipping_rate_service.py +++ b/stripe/_shipping_rate_service.py @@ -21,7 +21,7 @@ class CreateParams(TypedDict): """ The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -31,21 +31,21 @@ class CreateParams(TypedDict): """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ - type: NotRequired["Literal['fixed_amount']"] + type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. """ @@ -94,7 +94,10 @@ class CreateParamsFixedAmount(TypedDict): 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). """ currency_options: NotRequired[ - "Dict[str, ShippingRateService.CreateParamsFixedAmountCurrencyOptions]" + Dict[ + str, + "ShippingRateService.CreateParamsFixedAmountCurrencyOptions", + ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). @@ -106,14 +109,14 @@ class CreateParamsFixedAmountCurrencyOptions(TypedDict): A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class ListParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Only return shipping rates that are active or inactive. """ @@ -121,57 +124,57 @@ class ListParams(TypedDict): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Only return shipping rates for the given currency. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the shipping rate can be used for new purchases. Defaults to `true`. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -186,7 +189,7 @@ class UpdateParams(TypedDict): Set of [key-value pairs](https://stripe.com/docs/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`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. @@ -194,19 +197,22 @@ class UpdateParams(TypedDict): class UpdateParamsFixedAmount(TypedDict): currency_options: NotRequired[ - "Dict[str, ShippingRateService.UpdateParamsFixedAmountCurrencyOptions]" + Dict[ + str, + "ShippingRateService.UpdateParamsFixedAmountCurrencyOptions", + ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class UpdateParamsFixedAmountCurrencyOptions(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. diff --git a/stripe/_source.py b/stripe/_source.py index 58a49d5aa..49c8faf57 100644 --- a/stripe/_source.py +++ b/stripe/_source.py @@ -486,24 +486,24 @@ class Wechat(StripeObject): statement_descriptor: Optional[str] class CreateParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. Not supported for `receiver` type sources, where charge amount may not be specified until funds land. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The `Customer` to whom the original source is attached to. Must be set when the original source is not a `Source` (e.g., `Card`). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ flow: NotRequired[ - "Literal['code_verification', 'none', 'receiver', 'redirect']" + Literal["code_verification", "none", "receiver", "redirect"] ] """ The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. It is generally inferred unless a type supports multiple flows. @@ -512,8 +512,8 @@ class CreateParams(RequestOptions): """ Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. """ - metadata: NotRequired["Dict[str, str]"] - original_source: NotRequired["str"] + metadata: NotRequired[Dict[str, str]] + original_source: NotRequired[str] """ The source to share. """ @@ -533,19 +533,19 @@ class CreateParams(RequestOptions): """ Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's statement. As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. """ - token: NotRequired["str"] + token: NotRequired[str] """ An optional token used to create the source. When passed, token properties will override source parameters. """ - type: NotRequired["str"] + type: NotRequired[str] """ The `type` of the source to create. Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide) """ - usage: NotRequired["Literal['reusable', 'single_use']"] + usage: NotRequired[Literal["reusable", "single_use"]] class CreateParamsMandate(TypedDict): acceptance: NotRequired["Source.CreateParamsMandateAcceptance"] @@ -556,27 +556,29 @@ class CreateParamsMandate(TypedDict): """ The amount specified by the mandate. (Leave null for a mandate covering all amounts) """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency specified by the mandate. (Must match `currency` of the source) """ - interval: NotRequired["Literal['one_time', 'scheduled', 'variable']"] + interval: NotRequired[Literal["one_time", "scheduled", "variable"]] """ The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) """ notification_method: NotRequired[ - "Literal['deprecated_none', 'email', 'manual', 'none', 'stripe_email']" + Literal[ + "deprecated_none", "email", "manual", "none", "stripe_email" + ] ] """ The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). """ class CreateParamsMandateAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ @@ -592,11 +594,11 @@ class CreateParamsMandateAcceptance(TypedDict): """ The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). """ - type: NotRequired["Literal['offline', 'online']"] + type: NotRequired[Literal["offline", "online"]] """ The type of acceptance information included with the mandate. Either `online` or `offline` """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ @@ -608,15 +610,15 @@ class CreateParamsMandateAcceptanceOffline(TypedDict): """ class CreateParamsMandateAcceptanceOnline(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ @@ -626,48 +628,48 @@ class CreateParamsOwner(TypedDict): """ Owner's address. """ - email: NotRequired["str"] + email: NotRequired[str] """ Owner's email address. """ - name: NotRequired["str"] + name: NotRequired[str] """ Owner's full name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Owner's phone number. """ class CreateParamsOwnerAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsReceiver(TypedDict): refund_attributes_method: NotRequired[ - "Literal['email', 'manual', 'none']" + Literal["email", "manual", "none"] ] """ The method Stripe should use to request information needed to process a refund or mispayment. Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). Refer to each payment method's documentation to learn which refund attributes may be required. @@ -680,7 +682,7 @@ class CreateParamsRedirect(TypedDict): """ class CreateParamsSourceOrder(TypedDict): - items: NotRequired["List[Source.CreateParamsSourceOrderItem]"] + items: NotRequired[List["Source.CreateParamsSourceOrderItem"]] """ List of items constituting the order. """ @@ -690,47 +692,47 @@ class CreateParamsSourceOrder(TypedDict): """ class CreateParamsSourceOrderItem(TypedDict): - amount: NotRequired["int"] - currency: NotRequired["str"] - description: NotRequired["str"] - parent: NotRequired["str"] + amount: NotRequired[int] + currency: NotRequired[str] + description: NotRequired[str] + parent: NotRequired[str] """ The ID of the SKU being ordered. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. """ - type: NotRequired["Literal['discount', 'shipping', 'sku', 'tax']"] + type: NotRequired[Literal["discount", "shipping", "sku", "tax"]] class CreateParamsSourceOrderShipping(TypedDict): address: "Source.CreateParamsSourceOrderShippingAddress" """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ - name: NotRequired["str"] + name: NotRequired[str] """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsSourceOrderShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ @@ -738,43 +740,43 @@ class CreateParamsSourceOrderShippingAddress(TypedDict): """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class ListSourceTransactionsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ModifyParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount associated with the source. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -804,27 +806,29 @@ class ModifyParamsMandate(TypedDict): """ The amount specified by the mandate. (Leave null for a mandate covering all amounts) """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency specified by the mandate. (Must match `currency` of the source) """ - interval: NotRequired["Literal['one_time', 'scheduled', 'variable']"] + interval: NotRequired[Literal["one_time", "scheduled", "variable"]] """ The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) """ notification_method: NotRequired[ - "Literal['deprecated_none', 'email', 'manual', 'none', 'stripe_email']" + Literal[ + "deprecated_none", "email", "manual", "none", "stripe_email" + ] ] """ The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). """ class ModifyParamsMandateAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ @@ -840,11 +844,11 @@ class ModifyParamsMandateAcceptance(TypedDict): """ The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). """ - type: NotRequired["Literal['offline', 'online']"] + type: NotRequired[Literal["offline", "online"]] """ The type of acceptance information included with the mandate. Either `online` or `offline` """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ @@ -856,15 +860,15 @@ class ModifyParamsMandateAcceptanceOffline(TypedDict): """ class ModifyParamsMandateAcceptanceOnline(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ @@ -874,47 +878,47 @@ class ModifyParamsOwner(TypedDict): """ Owner's address. """ - email: NotRequired["str"] + email: NotRequired[str] """ Owner's email address. """ - name: NotRequired["str"] + name: NotRequired[str] """ Owner's full name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Owner's phone number. """ class ModifyParamsOwnerAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsSourceOrder(TypedDict): - items: NotRequired["List[Source.ModifyParamsSourceOrderItem]"] + items: NotRequired[List["Source.ModifyParamsSourceOrderItem"]] """ List of items constituting the order. """ @@ -924,47 +928,47 @@ class ModifyParamsSourceOrder(TypedDict): """ class ModifyParamsSourceOrderItem(TypedDict): - amount: NotRequired["int"] - currency: NotRequired["str"] - description: NotRequired["str"] - parent: NotRequired["str"] + amount: NotRequired[int] + currency: NotRequired[str] + description: NotRequired[str] + parent: NotRequired[str] """ The ID of the SKU being ordered. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. """ - type: NotRequired["Literal['discount', 'shipping', 'sku', 'tax']"] + type: NotRequired[Literal["discount", "shipping", "sku", "tax"]] class ModifyParamsSourceOrderShipping(TypedDict): address: "Source.ModifyParamsSourceOrderShippingAddress" """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ - name: NotRequired["str"] + name: NotRequired[str] """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class ModifyParamsSourceOrderShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ @@ -972,31 +976,31 @@ class ModifyParamsSourceOrderShippingAddress(TypedDict): """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class RetrieveParams(RequestOptions): - client_secret: NotRequired["str"] + client_secret: NotRequired[str] """ The client secret of the source. Required if a publishable key is used to retrieve the source. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class VerifyParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_source_service.py b/stripe/_source_service.py index e2ef4c5b2..506136f39 100644 --- a/stripe/_source_service.py +++ b/stripe/_source_service.py @@ -18,24 +18,24 @@ def __init__(self, requestor): self.transactions = SourceTransactionService(self._requestor) class CreateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. Not supported for `receiver` type sources, where charge amount may not be specified until funds land. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The `Customer` to whom the original source is attached to. Must be set when the original source is not a `Source` (e.g., `Card`). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ flow: NotRequired[ - "Literal['code_verification', 'none', 'receiver', 'redirect']" + Literal["code_verification", "none", "receiver", "redirect"] ] """ The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. It is generally inferred unless a type supports multiple flows. @@ -44,8 +44,8 @@ class CreateParams(TypedDict): """ Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. """ - metadata: NotRequired["Dict[str, str]"] - original_source: NotRequired["str"] + metadata: NotRequired[Dict[str, str]] + original_source: NotRequired[str] """ The source to share. """ @@ -65,19 +65,19 @@ class CreateParams(TypedDict): """ Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's statement. As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. """ - token: NotRequired["str"] + token: NotRequired[str] """ An optional token used to create the source. When passed, token properties will override source parameters. """ - type: NotRequired["str"] + type: NotRequired[str] """ The `type` of the source to create. Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide) """ - usage: NotRequired["Literal['reusable', 'single_use']"] + usage: NotRequired[Literal["reusable", "single_use"]] class CreateParamsMandate(TypedDict): acceptance: NotRequired["SourceService.CreateParamsMandateAcceptance"] @@ -88,27 +88,29 @@ class CreateParamsMandate(TypedDict): """ The amount specified by the mandate. (Leave null for a mandate covering all amounts) """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency specified by the mandate. (Must match `currency` of the source) """ - interval: NotRequired["Literal['one_time', 'scheduled', 'variable']"] + interval: NotRequired[Literal["one_time", "scheduled", "variable"]] """ The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) """ notification_method: NotRequired[ - "Literal['deprecated_none', 'email', 'manual', 'none', 'stripe_email']" + Literal[ + "deprecated_none", "email", "manual", "none", "stripe_email" + ] ] """ The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). """ class CreateParamsMandateAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ @@ -128,11 +130,11 @@ class CreateParamsMandateAcceptance(TypedDict): """ The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). """ - type: NotRequired["Literal['offline', 'online']"] + type: NotRequired[Literal["offline", "online"]] """ The type of acceptance information included with the mandate. Either `online` or `offline` """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ @@ -144,15 +146,15 @@ class CreateParamsMandateAcceptanceOffline(TypedDict): """ class CreateParamsMandateAcceptanceOnline(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ @@ -162,48 +164,48 @@ class CreateParamsOwner(TypedDict): """ Owner's address. """ - email: NotRequired["str"] + email: NotRequired[str] """ Owner's email address. """ - name: NotRequired["str"] + name: NotRequired[str] """ Owner's full name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Owner's phone number. """ class CreateParamsOwnerAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsReceiver(TypedDict): refund_attributes_method: NotRequired[ - "Literal['email', 'manual', 'none']" + Literal["email", "manual", "none"] ] """ The method Stripe should use to request information needed to process a refund or mispayment. Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). Refer to each payment method's documentation to learn which refund attributes may be required. @@ -216,7 +218,7 @@ class CreateParamsRedirect(TypedDict): """ class CreateParamsSourceOrder(TypedDict): - items: NotRequired["List[SourceService.CreateParamsSourceOrderItem]"] + items: NotRequired[List["SourceService.CreateParamsSourceOrderItem"]] """ List of items constituting the order. """ @@ -226,47 +228,47 @@ class CreateParamsSourceOrder(TypedDict): """ class CreateParamsSourceOrderItem(TypedDict): - amount: NotRequired["int"] - currency: NotRequired["str"] - description: NotRequired["str"] - parent: NotRequired["str"] + amount: NotRequired[int] + currency: NotRequired[str] + description: NotRequired[str] + parent: NotRequired[str] """ The ID of the SKU being ordered. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. """ - type: NotRequired["Literal['discount', 'shipping', 'sku', 'tax']"] + type: NotRequired[Literal["discount", "shipping", "sku", "tax"]] class CreateParamsSourceOrderShipping(TypedDict): address: "SourceService.CreateParamsSourceOrderShippingAddress" """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ - name: NotRequired["str"] + name: NotRequired[str] """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsSourceOrderShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ @@ -274,41 +276,41 @@ class CreateParamsSourceOrderShippingAddress(TypedDict): """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class DetachParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): - client_secret: NotRequired["str"] + client_secret: NotRequired[str] """ The client secret of the source. Required if a publishable key is used to retrieve the source. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount associated with the source. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -338,27 +340,29 @@ class UpdateParamsMandate(TypedDict): """ The amount specified by the mandate. (Leave null for a mandate covering all amounts) """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency specified by the mandate. (Must match `currency` of the source) """ - interval: NotRequired["Literal['one_time', 'scheduled', 'variable']"] + interval: NotRequired[Literal["one_time", "scheduled", "variable"]] """ The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) """ notification_method: NotRequired[ - "Literal['deprecated_none', 'email', 'manual', 'none', 'stripe_email']" + Literal[ + "deprecated_none", "email", "manual", "none", "stripe_email" + ] ] """ The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). """ class UpdateParamsMandateAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ @@ -378,11 +382,11 @@ class UpdateParamsMandateAcceptance(TypedDict): """ The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). """ - type: NotRequired["Literal['offline', 'online']"] + type: NotRequired[Literal["offline", "online"]] """ The type of acceptance information included with the mandate. Either `online` or `offline` """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ @@ -394,15 +398,15 @@ class UpdateParamsMandateAcceptanceOffline(TypedDict): """ class UpdateParamsMandateAcceptanceOnline(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ @@ -412,47 +416,47 @@ class UpdateParamsOwner(TypedDict): """ Owner's address. """ - email: NotRequired["str"] + email: NotRequired[str] """ Owner's email address. """ - name: NotRequired["str"] + name: NotRequired[str] """ Owner's full name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Owner's phone number. """ class UpdateParamsOwnerAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsSourceOrder(TypedDict): - items: NotRequired["List[SourceService.UpdateParamsSourceOrderItem]"] + items: NotRequired[List["SourceService.UpdateParamsSourceOrderItem"]] """ List of items constituting the order. """ @@ -462,47 +466,47 @@ class UpdateParamsSourceOrder(TypedDict): """ class UpdateParamsSourceOrderItem(TypedDict): - amount: NotRequired["int"] - currency: NotRequired["str"] - description: NotRequired["str"] - parent: NotRequired["str"] + amount: NotRequired[int] + currency: NotRequired[str] + description: NotRequired[str] + parent: NotRequired[str] """ The ID of the SKU being ordered. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. """ - type: NotRequired["Literal['discount', 'shipping', 'sku', 'tax']"] + type: NotRequired[Literal["discount", "shipping", "sku", "tax"]] class UpdateParamsSourceOrderShipping(TypedDict): address: "SourceService.UpdateParamsSourceOrderShippingAddress" """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ - name: NotRequired["str"] + name: NotRequired[str] """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class UpdateParamsSourceOrderShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ @@ -510,21 +514,21 @@ class UpdateParamsSourceOrderShippingAddress(TypedDict): """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class VerifyParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_source_transaction_service.py b/stripe/_source_transaction_service.py index c1fe5c061..e8ea44222 100644 --- a/stripe/_source_transaction_service.py +++ b/stripe/_source_transaction_service.py @@ -11,19 +11,19 @@ class SourceTransactionService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ diff --git a/stripe/_subscription.py b/stripe/_subscription.py index c37ed8471..f20b250d6 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -426,15 +426,15 @@ class CancelParams(RequestOptions): """ Details about why this subscription was cancelled """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice_now: NotRequired["bool"] + invoice_now: NotRequired[bool] """ Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. """ - prorate: NotRequired["bool"] + prorate: NotRequired[bool] """ Will generate a proration invoice item that credits remaining unused time until the subscription period end. """ @@ -453,7 +453,7 @@ class CancelParamsCancellationDetails(TypedDict): class CreateParams(RequestOptions): add_invoice_items: NotRequired[ - "List[Subscription.CreateParamsAddInvoiceItem]" + List["Subscription.CreateParamsAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. @@ -466,11 +466,11 @@ class CreateParams(RequestOptions): """ Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. """ - backdate_start_date: NotRequired["int"] + backdate_start_date: NotRequired[int] """ For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. """ - billing_cycle_anchor: NotRequired["int"] + billing_cycle_anchor: NotRequired[int] """ A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. """ @@ -486,25 +486,25 @@ class CreateParams(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. """ - cancel_at: NotRequired["int"] + cancel_at: NotRequired[int] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ - cancel_at_period_end: NotRequired["bool"] + cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ @@ -512,15 +512,15 @@ class CreateParams(RequestOptions): """ The identifier of the customer to subscribe. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ - default_source: NotRequired["str"] + default_source: NotRequired[str] """ ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ @@ -528,11 +528,11 @@ class CreateParams(RequestOptions): """ The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. """ - description: NotRequired["str"] + description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -542,7 +542,7 @@ class CreateParams(RequestOptions): """ All invoices will be billed using the specified settings. """ - items: NotRequired["List[Subscription.CreateParamsItem]"] + items: NotRequired[List["Subscription.CreateParamsItem"]] """ A list of up to 20 subscription items, each with an attached price. """ @@ -550,7 +550,7 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - off_session: NotRequired["bool"] + off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. """ @@ -559,7 +559,12 @@ class CreateParams(RequestOptions): The account on behalf of which to charge, for each of the subscription's invoices. """ payment_behavior: NotRequired[ - "Literal['allow_incomplete', 'default_incomplete', 'error_if_incomplete', 'pending_if_incomplete']" + Literal[ + "allow_incomplete", + "default_incomplete", + "error_if_incomplete", + "pending_if_incomplete", + ] ] """ Only applies to subscriptions with `collection_method=charge_automatically`. @@ -586,12 +591,12 @@ class CreateParams(RequestOptions): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ The API ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. @@ -604,11 +609,11 @@ class CreateParams(RequestOptions): """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ - trial_from_plan: NotRequired["bool"] + trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ - trial_period_days: NotRequired["int"] + trial_period_days: NotRequired[int] """ Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ @@ -618,7 +623,7 @@ class CreateParams(RequestOptions): """ class CreateParamsAddInvoiceItem(TypedDict): - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -628,7 +633,7 @@ class CreateParamsAddInvoiceItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ @@ -647,16 +652,16 @@ class CreateParamsAddInvoiceItemPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -674,7 +679,7 @@ class CreateParamsAutomaticTax(TypedDict): """ class CreateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -688,29 +693,29 @@ class CreateParamsBillingCycleAnchorConfig(TypedDict): """ The day of the month the billing_cycle_anchor should be. Ranges from 1 to 31. """ - hour: NotRequired["int"] + hour: NotRequired[int] """ The hour of the day the billing_cycle_anchor should be. Ranges from 0 to 23. """ - minute: NotRequired["int"] + minute: NotRequired[int] """ The minute of the hour the billing_cycle_anchor should be. Ranges from 0 to 59. """ - month: NotRequired["int"] + month: NotRequired[int] """ The month to start full cycle billing periods. Ranges from 1 to 12. """ - second: NotRequired["int"] + second: NotRequired[int] """ The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. """ class CreateParamsBillingThresholds(TypedDict): - amount_gte: NotRequired["int"] + amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ - reset_billing_cycle_anchor: NotRequired["bool"] + reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ @@ -726,7 +731,7 @@ class CreateParamsInvoiceSettings(TypedDict): """ class CreateParamsInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -742,15 +747,15 @@ class CreateParamsItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ Plan ID for this item, as a string. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -758,7 +763,7 @@ class CreateParamsItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. """ @@ -787,16 +792,16 @@ class CreateParamsItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -806,7 +811,7 @@ class CreateParamsItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ @@ -825,7 +830,7 @@ class CreateParamsPaymentSettings(TypedDict): The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ save_default_payment_method: NotRequired[ - "Literal['off', 'on_subscription']" + Literal["off", "on_subscription"] ] """ Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. @@ -883,7 +888,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -892,13 +897,13 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -911,13 +916,25 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): Configuration options for setting up an eMandate for cards issued in India. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -926,15 +943,15 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): class CreateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions( TypedDict, ): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount to be charged for future payments. """ - amount_type: NotRequired["Literal['fixed', 'maximum']"] + 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"] + description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ @@ -948,7 +965,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["str"] + funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ @@ -962,7 +979,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer """ Configuration for eu_bank_transfer funding type. """ - type: NotRequired["str"] + type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ @@ -991,7 +1008,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -1001,12 +1018,16 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ @@ -1016,13 +1037,13 @@ class CreateParamsPendingInvoiceItemInterval(TypedDict): """ Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + 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 CreateParamsTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ @@ -1052,7 +1073,7 @@ class ListParams(RequestOptions): Filter subscriptions by their automatic tax settings. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ The collection method of the subscriptions to retrieve. Either `charge_automatically` or `send_invoice`. @@ -1067,41 +1088,52 @@ class ListParams(RequestOptions): current_period_start: NotRequired[ "Subscription.ListParamsCurrentPeriodStart|int" ] - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the customer whose subscriptions will be retrieved. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ The ID of the plan whose subscriptions will be retrieved. """ - price: NotRequired["str"] + price: NotRequired[str] """ Filter for subscriptions that contain this recurring price ID. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['active', 'all', 'canceled', 'ended', 'incomplete', 'incomplete_expired', 'past_due', 'paused', 'trialing', 'unpaid']" + Literal[ + "active", + "all", + "canceled", + "ended", + "incomplete", + "incomplete_expired", + "past_due", + "paused", + "trialing", + "unpaid", + ] ] """ The status of the subscriptions to retrieve. Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). Passing in a value of `all` will return subscriptions of all statuses. If no value is supplied, all subscriptions that have not been canceled are returned. """ - test_clock: NotRequired["str"] + test_clock: NotRequired[str] """ Filter for subscriptions that are associated with the specified test clock. The response will not include subscriptions with test clocks if this and the customer parameter is not set. """ @@ -1113,62 +1145,62 @@ class ListParamsAutomaticTax(TypedDict): """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCurrentPeriodEnd(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCurrentPeriodStart(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): add_invoice_items: NotRequired[ - "List[Subscription.ModifyParamsAddInvoiceItem]" + List["Subscription.ModifyParamsAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. @@ -1181,7 +1213,7 @@ class ModifyParams(RequestOptions): """ Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. """ - billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']"] + billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ @@ -1195,7 +1227,7 @@ class ModifyParams(RequestOptions): """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ - cancel_at_period_end: NotRequired["bool"] + cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ @@ -1206,20 +1238,20 @@ class ModifyParams(RequestOptions): Details about why this subscription was cancelled """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ @@ -1235,7 +1267,7 @@ class ModifyParams(RequestOptions): """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1245,7 +1277,7 @@ class ModifyParams(RequestOptions): """ All invoices will be billed using the specified settings. """ - items: NotRequired["List[Subscription.ModifyParamsItem]"] + items: NotRequired[List["Subscription.ModifyParamsItem"]] """ A list of up to 20 subscription items, each with an attached price. """ @@ -1253,7 +1285,7 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - off_session: NotRequired["bool"] + off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. """ @@ -1268,7 +1300,12 @@ class ModifyParams(RequestOptions): If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment). """ payment_behavior: NotRequired[ - "Literal['allow_incomplete', 'default_incomplete', 'error_if_incomplete', 'pending_if_incomplete']" + Literal[ + "allow_incomplete", + "default_incomplete", + "error_if_incomplete", + "pending_if_incomplete", + ] ] """ Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. @@ -1291,17 +1328,17 @@ class ModifyParams(RequestOptions): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - proration_date: NotRequired["int"] + 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 exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#upcoming_invoice) endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations. """ @@ -1315,7 +1352,7 @@ class ModifyParams(RequestOptions): """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. """ - trial_from_plan: NotRequired["bool"] + trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ @@ -1325,7 +1362,7 @@ class ModifyParams(RequestOptions): """ class ModifyParamsAddInvoiceItem(TypedDict): - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -1335,7 +1372,7 @@ class ModifyParamsAddInvoiceItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ @@ -1354,16 +1391,16 @@ class ModifyParamsAddInvoiceItemPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -1381,7 +1418,7 @@ class ModifyParamsAutomaticTax(TypedDict): """ class ModifyParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1391,11 +1428,11 @@ class ModifyParamsAutomaticTaxLiability(TypedDict): """ class ModifyParamsBillingThresholds(TypedDict): - amount_gte: NotRequired["int"] + amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ - reset_billing_cycle_anchor: NotRequired["bool"] + reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ @@ -1423,7 +1460,7 @@ class ModifyParamsInvoiceSettings(TypedDict): """ class ModifyParamsInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1439,15 +1476,15 @@ class ModifyParamsItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - clear_usage: NotRequired["bool"] + clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ - deleted: NotRequired["bool"] + deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ - id: NotRequired["str"] + id: NotRequired[str] """ Subscription item to update. """ @@ -1455,11 +1492,11 @@ class ModifyParamsItem(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ Plan ID for this item, as a string. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ @@ -1467,7 +1504,7 @@ class ModifyParamsItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. """ @@ -1496,16 +1533,16 @@ class ModifyParamsItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -1515,7 +1552,7 @@ class ModifyParamsItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ @@ -1525,7 +1562,7 @@ class ModifyParamsPauseCollection(TypedDict): """ The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. """ - resumes_at: NotRequired["int"] + resumes_at: NotRequired[int] """ The time after which the subscription will resume collecting payments. """ @@ -1544,7 +1581,7 @@ class ModifyParamsPaymentSettings(TypedDict): The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ save_default_payment_method: NotRequired[ - "Literal['off', 'on_subscription']" + Literal["off", "on_subscription"] ] """ Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. @@ -1602,7 +1639,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -1611,13 +1648,13 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -1630,13 +1667,25 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): Configuration options for setting up an eMandate for cards issued in India. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1645,15 +1694,15 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): class ModifyParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions( TypedDict, ): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount to be charged for future payments. """ - amount_type: NotRequired["Literal['fixed', 'maximum']"] + 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"] + description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ @@ -1667,7 +1716,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["str"] + funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ @@ -1681,7 +1730,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer """ Configuration for eu_bank_transfer funding type. """ - type: NotRequired["str"] + type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ @@ -1710,7 +1759,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -1720,12 +1769,16 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ @@ -1735,13 +1788,13 @@ class ModifyParamsPendingInvoiceItemInterval(TypedDict): """ Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + 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 ModifyParamsTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ @@ -1763,41 +1816,41 @@ class ModifyParamsTrialSettingsEndBehavior(TypedDict): """ class ResumeParams(RequestOptions): - billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']"] + billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). Setting the value to `unchanged` advances the subscription's billing cycle anchor to the period that surrounds the current time. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - proration_date: NotRequired["int"] + proration_date: NotRequired[int] """ If set, the proration will be calculated as though the subscription was resumed at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index bc6821b3a..780753378 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -54,16 +54,21 @@ class CreateParams(RequestOptions): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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_behavior: NotRequired[ - "Literal['allow_incomplete', 'default_incomplete', 'error_if_incomplete', 'pending_if_incomplete']" + Literal[ + "allow_incomplete", + "default_incomplete", + "error_if_incomplete", + "pending_if_incomplete", + ] ] """ Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. @@ -74,11 +79,11 @@ class CreateParams(RequestOptions): Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ The identifier of the plan to add to the subscription. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -87,16 +92,16 @@ class CreateParams(RequestOptions): Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - proration_date: NotRequired["int"] + 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://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity you'd like to apply to the subscription item you're creating. """ @@ -129,16 +134,16 @@ class CreateParamsPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -148,17 +153,17 @@ class CreateParamsPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateUsageRecordParams(RequestOptions): - action: NotRequired["Literal['increment', 'set']"] + action: NotRequired[Literal["increment", "set"]] """ Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -172,35 +177,35 @@ class CreateUsageRecordParams(RequestOptions): """ class DeleteParams(RequestOptions): - clear_usage: NotRequired["bool"] + clear_usage: NotRequired[bool] """ Delete all usage for the given subscription item. Allowed only when the current plan's `usage_type` is `metered`. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - proration_date: NotRequired["int"] + 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://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ @@ -210,19 +215,19 @@ class ListParams(RequestOptions): """ class ListUsageRecordSummariesParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ @@ -234,7 +239,7 @@ class ModifyParams(RequestOptions): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -242,12 +247,17 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - off_session: NotRequired["bool"] + off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. """ payment_behavior: NotRequired[ - "Literal['allow_incomplete', 'default_incomplete', 'error_if_incomplete', 'pending_if_incomplete']" + Literal[ + "allow_incomplete", + "default_incomplete", + "error_if_incomplete", + "pending_if_incomplete", + ] ] """ Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. @@ -258,11 +268,11 @@ class ModifyParams(RequestOptions): Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ The identifier of the new plan for this subscription item. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ @@ -271,16 +281,16 @@ class ModifyParams(RequestOptions): Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - proration_date: NotRequired["int"] + 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://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity you'd like to apply to the subscription item you're creating. """ @@ -309,16 +319,16 @@ class ModifyParamsPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -328,13 +338,13 @@ class ModifyParamsPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_subscription_item_service.py b/stripe/_subscription_item_service.py index 499f83d41..568342e4a 100644 --- a/stripe/_subscription_item_service.py +++ b/stripe/_subscription_item_service.py @@ -34,16 +34,21 @@ class CreateParams(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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_behavior: NotRequired[ - "Literal['allow_incomplete', 'default_incomplete', 'error_if_incomplete', 'pending_if_incomplete']" + Literal[ + "allow_incomplete", + "default_incomplete", + "error_if_incomplete", + "pending_if_incomplete", + ] ] """ Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. @@ -54,11 +59,11 @@ class CreateParams(TypedDict): Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ The identifier of the plan to add to the subscription. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -69,16 +74,16 @@ class CreateParams(TypedDict): Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - proration_date: NotRequired["int"] + 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://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity you'd like to apply to the subscription item you're creating. """ @@ -111,16 +116,16 @@ class CreateParamsPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -130,41 +135,41 @@ class CreateParamsPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class DeleteParams(TypedDict): - clear_usage: NotRequired["bool"] + clear_usage: NotRequired[bool] """ Delete all usage for the given subscription item. Allowed only when the current plan's `usage_type` is `metered`. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - proration_date: NotRequired["int"] + 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://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ @@ -174,7 +179,7 @@ class ListParams(TypedDict): """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -186,7 +191,7 @@ class UpdateParams(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -194,12 +199,17 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - off_session: NotRequired["bool"] + off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. """ payment_behavior: NotRequired[ - "Literal['allow_incomplete', 'default_incomplete', 'error_if_incomplete', 'pending_if_incomplete']" + Literal[ + "allow_incomplete", + "default_incomplete", + "error_if_incomplete", + "pending_if_incomplete", + ] ] """ Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. @@ -210,11 +220,11 @@ class UpdateParams(TypedDict): Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ The identifier of the new plan for this subscription item. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ @@ -225,16 +235,16 @@ class UpdateParams(TypedDict): Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - proration_date: NotRequired["int"] + 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://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity you'd like to apply to the subscription item you're creating. """ @@ -263,16 +273,16 @@ class UpdateParamsPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -282,7 +292,7 @@ class UpdateParamsPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ diff --git a/stripe/_subscription_item_usage_record_service.py b/stripe/_subscription_item_usage_record_service.py index c7ccc31df..ecd1101cb 100644 --- a/stripe/_subscription_item_usage_record_service.py +++ b/stripe/_subscription_item_usage_record_service.py @@ -10,11 +10,11 @@ class SubscriptionItemUsageRecordService(StripeService): class CreateParams(TypedDict): - action: NotRequired["Literal['increment', 'set']"] + action: NotRequired[Literal["increment", "set"]] """ Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_subscription_item_usage_record_summary_service.py b/stripe/_subscription_item_usage_record_summary_service.py index eb0a47fad..5ef28d8c8 100644 --- a/stripe/_subscription_item_usage_record_summary_service.py +++ b/stripe/_subscription_item_usage_record_summary_service.py @@ -11,19 +11,19 @@ class SubscriptionItemUsageRecordSummaryService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index 913c6a37e..9d1216472 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -368,21 +368,21 @@ class TransferData(StripeObject): } class CancelParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice_now: NotRequired["bool"] + invoice_now: NotRequired[bool] """ If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`. """ - prorate: NotRequired["bool"] + prorate: NotRequired[bool] """ If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`. """ class CreateParams(RequestOptions): - customer: NotRequired["str"] + customer: NotRequired[str] """ The identifier of the customer to create the subscription schedule for. """ @@ -393,16 +393,16 @@ class CreateParams(RequestOptions): Object representing the subscription schedule's default settings. """ end_behavior: NotRequired[ - "Literal['cancel', 'none', 'release', 'renew']" + Literal["cancel", "none", "release", "renew"] ] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - from_subscription: NotRequired["str"] + from_subscription: NotRequired[str] """ Migrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls. """ @@ -410,7 +410,7 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - phases: NotRequired["List[SubscriptionSchedule.CreateParamsPhase]"] + phases: NotRequired[List["SubscriptionSchedule.CreateParamsPhase"]] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ @@ -420,7 +420,7 @@ class CreateParams(RequestOptions): """ class CreateParamsDefaultSettings(TypedDict): - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ @@ -430,9 +430,7 @@ class CreateParamsDefaultSettings(TypedDict): """ Default settings for automatic tax computation. """ - billing_cycle_anchor: NotRequired[ - "Literal['automatic', 'phase_start']" - ] + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ @@ -443,12 +441,12 @@ class CreateParamsDefaultSettings(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. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ @@ -486,7 +484,7 @@ class CreateParamsDefaultSettingsAutomaticTax(TypedDict): """ class CreateParamsDefaultSettingsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -496,11 +494,11 @@ class CreateParamsDefaultSettingsAutomaticTaxLiability(TypedDict): """ class CreateParamsDefaultSettingsBillingThresholds(TypedDict): - amount_gte: NotRequired["int"] + amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ - reset_billing_cycle_anchor: NotRequired["bool"] + reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ @@ -510,7 +508,7 @@ class CreateParamsDefaultSettingsInvoiceSettings(TypedDict): """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. """ @@ -522,7 +520,7 @@ class CreateParamsDefaultSettingsInvoiceSettings(TypedDict): """ class CreateParamsDefaultSettingsInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -532,7 +530,7 @@ class CreateParamsDefaultSettingsInvoiceSettingsIssuer(TypedDict): """ class CreateParamsDefaultSettingsTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ @@ -543,12 +541,12 @@ class CreateParamsDefaultSettingsTransferData(TypedDict): class CreateParamsPhase(TypedDict): add_invoice_items: NotRequired[ - "List[SubscriptionSchedule.CreateParamsPhaseAddInvoiceItem]" + List["SubscriptionSchedule.CreateParamsPhaseAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ @@ -558,9 +556,7 @@ class CreateParamsPhase(TypedDict): """ Automatic tax settings for this phase. """ - billing_cycle_anchor: NotRequired[ - "Literal['automatic', 'phase_start']" - ] + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ @@ -571,20 +567,20 @@ class CreateParamsPhase(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. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The identifier of the coupon to apply to this phase of the subscription schedule. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ @@ -596,7 +592,7 @@ class CreateParamsPhase(TypedDict): """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ - end_date: NotRequired["int"] + end_date: NotRequired[int] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ @@ -610,20 +606,20 @@ class CreateParamsPhase(TypedDict): """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ - iterations: NotRequired["int"] + iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. @@ -634,17 +630,17 @@ class CreateParamsPhase(TypedDict): """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ - trial: NotRequired["bool"] + trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ - trial_end: NotRequired["int"] + trial_end: NotRequired[int] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ class CreateParamsPhaseAddInvoiceItem(TypedDict): - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -654,7 +650,7 @@ class CreateParamsPhaseAddInvoiceItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ @@ -673,16 +669,16 @@ class CreateParamsPhaseAddInvoiceItemPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -700,7 +696,7 @@ class CreateParamsPhaseAutomaticTax(TypedDict): """ class CreateParamsPhaseAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -710,11 +706,11 @@ class CreateParamsPhaseAutomaticTaxLiability(TypedDict): """ class CreateParamsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired["int"] + amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ - reset_billing_cycle_anchor: NotRequired["bool"] + reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ @@ -724,7 +720,7 @@ class CreateParamsPhaseInvoiceSettings(TypedDict): """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ @@ -736,7 +732,7 @@ class CreateParamsPhaseInvoiceSettings(TypedDict): """ class CreateParamsPhaseInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -752,15 +748,15 @@ class CreateParamsPhaseItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -770,7 +766,7 @@ class CreateParamsPhaseItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ @@ -799,16 +795,16 @@ class CreateParamsPhaseItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -818,13 +814,13 @@ class CreateParamsPhaseItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsPhaseTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ @@ -850,19 +846,19 @@ class ListParams(RequestOptions): """ Only return subscription schedules that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return subscription schedules for the given customer. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -872,83 +868,83 @@ class ListParams(RequestOptions): """ Only return subscription schedules that were released during the given date interval. """ - scheduled: NotRequired["bool"] + scheduled: NotRequired[bool] """ Only return subscription schedules that have not started yet. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCanceledAt(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCompletedAt(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsReleasedAt(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ @@ -961,12 +957,12 @@ class ModifyParams(RequestOptions): Object representing the subscription schedule's default settings. """ end_behavior: NotRequired[ - "Literal['cancel', 'none', 'release', 'renew']" + Literal["cancel", "none", "release", "renew"] ] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -974,19 +970,19 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - phases: NotRequired["List[SubscriptionSchedule.ModifyParamsPhase]"] + phases: NotRequired[List["SubscriptionSchedule.ModifyParamsPhase"]] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`. """ class ModifyParamsDefaultSettings(TypedDict): - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ @@ -996,9 +992,7 @@ class ModifyParamsDefaultSettings(TypedDict): """ Default settings for automatic tax computation. """ - billing_cycle_anchor: NotRequired[ - "Literal['automatic', 'phase_start']" - ] + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ @@ -1009,12 +1003,12 @@ class ModifyParamsDefaultSettings(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. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ @@ -1052,7 +1046,7 @@ class ModifyParamsDefaultSettingsAutomaticTax(TypedDict): """ class ModifyParamsDefaultSettingsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1062,11 +1056,11 @@ class ModifyParamsDefaultSettingsAutomaticTaxLiability(TypedDict): """ class ModifyParamsDefaultSettingsBillingThresholds(TypedDict): - amount_gte: NotRequired["int"] + amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ - reset_billing_cycle_anchor: NotRequired["bool"] + reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ @@ -1076,7 +1070,7 @@ class ModifyParamsDefaultSettingsInvoiceSettings(TypedDict): """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. """ @@ -1088,7 +1082,7 @@ class ModifyParamsDefaultSettingsInvoiceSettings(TypedDict): """ class ModifyParamsDefaultSettingsInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1098,7 +1092,7 @@ class ModifyParamsDefaultSettingsInvoiceSettingsIssuer(TypedDict): """ class ModifyParamsDefaultSettingsTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ @@ -1109,12 +1103,12 @@ class ModifyParamsDefaultSettingsTransferData(TypedDict): class ModifyParamsPhase(TypedDict): add_invoice_items: NotRequired[ - "List[SubscriptionSchedule.ModifyParamsPhaseAddInvoiceItem]" + List["SubscriptionSchedule.ModifyParamsPhaseAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ @@ -1124,9 +1118,7 @@ class ModifyParamsPhase(TypedDict): """ Automatic tax settings for this phase. """ - billing_cycle_anchor: NotRequired[ - "Literal['automatic', 'phase_start']" - ] + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ @@ -1137,20 +1129,20 @@ class ModifyParamsPhase(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. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The identifier of the coupon to apply to this phase of the subscription schedule. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ @@ -1176,20 +1168,20 @@ class ModifyParamsPhase(TypedDict): """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ - iterations: NotRequired["int"] + iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. @@ -1204,7 +1196,7 @@ class ModifyParamsPhase(TypedDict): """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ - trial: NotRequired["bool"] + trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ @@ -1214,7 +1206,7 @@ class ModifyParamsPhase(TypedDict): """ class ModifyParamsPhaseAddInvoiceItem(TypedDict): - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -1224,7 +1216,7 @@ class ModifyParamsPhaseAddInvoiceItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ @@ -1243,16 +1235,16 @@ class ModifyParamsPhaseAddInvoiceItemPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -1270,7 +1262,7 @@ class ModifyParamsPhaseAutomaticTax(TypedDict): """ class ModifyParamsPhaseAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1280,11 +1272,11 @@ class ModifyParamsPhaseAutomaticTaxLiability(TypedDict): """ class ModifyParamsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired["int"] + amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ - reset_billing_cycle_anchor: NotRequired["bool"] + reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ @@ -1294,7 +1286,7 @@ class ModifyParamsPhaseInvoiceSettings(TypedDict): """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ @@ -1306,7 +1298,7 @@ class ModifyParamsPhaseInvoiceSettings(TypedDict): """ class ModifyParamsPhaseInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1322,15 +1314,15 @@ class ModifyParamsPhaseItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -1340,7 +1332,7 @@ class ModifyParamsPhaseItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ @@ -1369,16 +1361,16 @@ class ModifyParamsPhaseItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -1388,13 +1380,13 @@ class ModifyParamsPhaseItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class ModifyParamsPhaseTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ @@ -1404,17 +1396,17 @@ class ModifyParamsPhaseTransferData(TypedDict): """ class ReleaseParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - preserve_cancel_date: NotRequired["bool"] + preserve_cancel_date: NotRequired[bool] """ Keep any cancellation on the subscription that the schedule has set """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index aa592cfc5..260f36d88 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -11,21 +11,21 @@ class SubscriptionScheduleService(StripeService): class CancelParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice_now: NotRequired["bool"] + invoice_now: NotRequired[bool] """ If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`. """ - prorate: NotRequired["bool"] + prorate: NotRequired[bool] """ If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`. """ class CreateParams(TypedDict): - customer: NotRequired["str"] + customer: NotRequired[str] """ The identifier of the customer to create the subscription schedule for. """ @@ -36,16 +36,16 @@ class CreateParams(TypedDict): Object representing the subscription schedule's default settings. """ end_behavior: NotRequired[ - "Literal['cancel', 'none', 'release', 'renew']" + Literal["cancel", "none", "release", "renew"] ] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - from_subscription: NotRequired["str"] + from_subscription: NotRequired[str] """ Migrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls. """ @@ -54,7 +54,7 @@ class CreateParams(TypedDict): Set of [key-value pairs](https://stripe.com/docs/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`. """ phases: NotRequired[ - "List[SubscriptionScheduleService.CreateParamsPhase]" + List["SubscriptionScheduleService.CreateParamsPhase"] ] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. @@ -65,7 +65,7 @@ class CreateParams(TypedDict): """ class CreateParamsDefaultSettings(TypedDict): - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ @@ -75,9 +75,7 @@ class CreateParamsDefaultSettings(TypedDict): """ Default settings for automatic tax computation. """ - billing_cycle_anchor: NotRequired[ - "Literal['automatic', 'phase_start']" - ] + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ @@ -88,12 +86,12 @@ class CreateParamsDefaultSettings(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. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ @@ -131,7 +129,7 @@ class CreateParamsDefaultSettingsAutomaticTax(TypedDict): """ class CreateParamsDefaultSettingsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -141,11 +139,11 @@ class CreateParamsDefaultSettingsAutomaticTaxLiability(TypedDict): """ class CreateParamsDefaultSettingsBillingThresholds(TypedDict): - amount_gte: NotRequired["int"] + amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ - reset_billing_cycle_anchor: NotRequired["bool"] + reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ @@ -155,7 +153,7 @@ class CreateParamsDefaultSettingsInvoiceSettings(TypedDict): """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. """ @@ -167,7 +165,7 @@ class CreateParamsDefaultSettingsInvoiceSettings(TypedDict): """ class CreateParamsDefaultSettingsInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -177,7 +175,7 @@ class CreateParamsDefaultSettingsInvoiceSettingsIssuer(TypedDict): """ class CreateParamsDefaultSettingsTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ @@ -188,12 +186,12 @@ class CreateParamsDefaultSettingsTransferData(TypedDict): class CreateParamsPhase(TypedDict): add_invoice_items: NotRequired[ - "List[SubscriptionScheduleService.CreateParamsPhaseAddInvoiceItem]" + List["SubscriptionScheduleService.CreateParamsPhaseAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ @@ -203,9 +201,7 @@ class CreateParamsPhase(TypedDict): """ Automatic tax settings for this phase. """ - billing_cycle_anchor: NotRequired[ - "Literal['automatic', 'phase_start']" - ] + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ @@ -216,20 +212,20 @@ class CreateParamsPhase(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. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The identifier of the coupon to apply to this phase of the subscription schedule. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ @@ -241,7 +237,7 @@ class CreateParamsPhase(TypedDict): """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ - end_date: NotRequired["int"] + end_date: NotRequired[int] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ @@ -255,20 +251,20 @@ class CreateParamsPhase(TypedDict): """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ - iterations: NotRequired["int"] + iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. @@ -279,17 +275,17 @@ class CreateParamsPhase(TypedDict): """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ - trial: NotRequired["bool"] + trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ - trial_end: NotRequired["int"] + trial_end: NotRequired[int] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ class CreateParamsPhaseAddInvoiceItem(TypedDict): - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -299,7 +295,7 @@ class CreateParamsPhaseAddInvoiceItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ @@ -318,16 +314,16 @@ class CreateParamsPhaseAddInvoiceItemPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -345,7 +341,7 @@ class CreateParamsPhaseAutomaticTax(TypedDict): """ class CreateParamsPhaseAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -355,11 +351,11 @@ class CreateParamsPhaseAutomaticTaxLiability(TypedDict): """ class CreateParamsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired["int"] + amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ - reset_billing_cycle_anchor: NotRequired["bool"] + reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ @@ -369,7 +365,7 @@ class CreateParamsPhaseInvoiceSettings(TypedDict): """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ @@ -381,7 +377,7 @@ class CreateParamsPhaseInvoiceSettings(TypedDict): """ class CreateParamsPhaseInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -397,15 +393,15 @@ class CreateParamsPhaseItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -415,7 +411,7 @@ class CreateParamsPhaseItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ @@ -444,16 +440,16 @@ class CreateParamsPhaseItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -463,13 +459,13 @@ class CreateParamsPhaseItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsPhaseTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ @@ -497,19 +493,19 @@ class ListParams(TypedDict): """ Only return subscription schedules that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return subscription schedules for the given customer. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -519,99 +515,99 @@ class ListParams(TypedDict): """ Only return subscription schedules that were released during the given date interval. """ - scheduled: NotRequired["bool"] + scheduled: NotRequired[bool] """ Only return subscription schedules that have not started yet. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCanceledAt(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCompletedAt(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsReleasedAt(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ReleaseParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - preserve_cancel_date: NotRequired["bool"] + preserve_cancel_date: NotRequired[bool] """ Keep any cancellation on the subscription that the schedule has set """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -624,12 +620,12 @@ class UpdateParams(TypedDict): Object representing the subscription schedule's default settings. """ end_behavior: NotRequired[ - "Literal['cancel', 'none', 'release', 'renew']" + Literal["cancel", "none", "release", "renew"] ] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -638,20 +634,20 @@ class UpdateParams(TypedDict): Set of [key-value pairs](https://stripe.com/docs/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`. """ phases: NotRequired[ - "List[SubscriptionScheduleService.UpdateParamsPhase]" + List["SubscriptionScheduleService.UpdateParamsPhase"] ] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`. """ class UpdateParamsDefaultSettings(TypedDict): - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ @@ -661,9 +657,7 @@ class UpdateParamsDefaultSettings(TypedDict): """ Default settings for automatic tax computation. """ - billing_cycle_anchor: NotRequired[ - "Literal['automatic', 'phase_start']" - ] + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ @@ -674,12 +668,12 @@ class UpdateParamsDefaultSettings(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. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ @@ -717,7 +711,7 @@ class UpdateParamsDefaultSettingsAutomaticTax(TypedDict): """ class UpdateParamsDefaultSettingsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -727,11 +721,11 @@ class UpdateParamsDefaultSettingsAutomaticTaxLiability(TypedDict): """ class UpdateParamsDefaultSettingsBillingThresholds(TypedDict): - amount_gte: NotRequired["int"] + amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ - reset_billing_cycle_anchor: NotRequired["bool"] + reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ @@ -741,7 +735,7 @@ class UpdateParamsDefaultSettingsInvoiceSettings(TypedDict): """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. """ @@ -753,7 +747,7 @@ class UpdateParamsDefaultSettingsInvoiceSettings(TypedDict): """ class UpdateParamsDefaultSettingsInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -763,7 +757,7 @@ class UpdateParamsDefaultSettingsInvoiceSettingsIssuer(TypedDict): """ class UpdateParamsDefaultSettingsTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ @@ -774,12 +768,12 @@ class UpdateParamsDefaultSettingsTransferData(TypedDict): class UpdateParamsPhase(TypedDict): add_invoice_items: NotRequired[ - "List[SubscriptionScheduleService.UpdateParamsPhaseAddInvoiceItem]" + List["SubscriptionScheduleService.UpdateParamsPhaseAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ @@ -789,9 +783,7 @@ class UpdateParamsPhase(TypedDict): """ Automatic tax settings for this phase. """ - billing_cycle_anchor: NotRequired[ - "Literal['automatic', 'phase_start']" - ] + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ @@ -802,20 +794,20 @@ class UpdateParamsPhase(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. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The identifier of the coupon to apply to this phase of the subscription schedule. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ @@ -841,20 +833,20 @@ class UpdateParamsPhase(TypedDict): """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ - iterations: NotRequired["int"] + iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. @@ -869,7 +861,7 @@ class UpdateParamsPhase(TypedDict): """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ - trial: NotRequired["bool"] + trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ @@ -879,7 +871,7 @@ class UpdateParamsPhase(TypedDict): """ class UpdateParamsPhaseAddInvoiceItem(TypedDict): - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -889,7 +881,7 @@ class UpdateParamsPhaseAddInvoiceItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ @@ -908,16 +900,16 @@ class UpdateParamsPhaseAddInvoiceItemPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -935,7 +927,7 @@ class UpdateParamsPhaseAutomaticTax(TypedDict): """ class UpdateParamsPhaseAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -945,11 +937,11 @@ class UpdateParamsPhaseAutomaticTaxLiability(TypedDict): """ class UpdateParamsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired["int"] + amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ - reset_billing_cycle_anchor: NotRequired["bool"] + reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ @@ -959,7 +951,7 @@ class UpdateParamsPhaseInvoiceSettings(TypedDict): """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ @@ -971,7 +963,7 @@ class UpdateParamsPhaseInvoiceSettings(TypedDict): """ class UpdateParamsPhaseInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -987,15 +979,15 @@ class UpdateParamsPhaseItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -1005,7 +997,7 @@ class UpdateParamsPhaseItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ @@ -1034,16 +1026,16 @@ class UpdateParamsPhaseItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -1053,13 +1045,13 @@ class UpdateParamsPhaseItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpdateParamsPhaseTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index f806e5b8d..b42a10f3c 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -19,15 +19,15 @@ class CancelParams(TypedDict): """ Details about why this subscription was cancelled """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - invoice_now: NotRequired["bool"] + invoice_now: NotRequired[bool] """ Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. """ - prorate: NotRequired["bool"] + prorate: NotRequired[bool] """ Will generate a proration invoice item that credits remaining unused time until the subscription period end. """ @@ -46,7 +46,7 @@ class CancelParamsCancellationDetails(TypedDict): class CreateParams(TypedDict): add_invoice_items: NotRequired[ - "List[SubscriptionService.CreateParamsAddInvoiceItem]" + List["SubscriptionService.CreateParamsAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. @@ -61,11 +61,11 @@ class CreateParams(TypedDict): """ Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. """ - backdate_start_date: NotRequired["int"] + backdate_start_date: NotRequired[int] """ For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. """ - billing_cycle_anchor: NotRequired["int"] + billing_cycle_anchor: NotRequired[int] """ A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. """ @@ -81,25 +81,25 @@ class CreateParams(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. """ - cancel_at: NotRequired["int"] + cancel_at: NotRequired[int] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ - cancel_at_period_end: NotRequired["bool"] + cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. """ - currency: NotRequired["str"] + currency: NotRequired[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). """ @@ -107,15 +107,15 @@ class CreateParams(TypedDict): """ The identifier of the customer to subscribe. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ - default_source: NotRequired["str"] + default_source: NotRequired[str] """ ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ @@ -123,11 +123,11 @@ class CreateParams(TypedDict): """ The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. """ - description: NotRequired["str"] + description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -137,7 +137,7 @@ class CreateParams(TypedDict): """ All invoices will be billed using the specified settings. """ - items: NotRequired["List[SubscriptionService.CreateParamsItem]"] + items: NotRequired[List["SubscriptionService.CreateParamsItem"]] """ A list of up to 20 subscription items, each with an attached price. """ @@ -145,7 +145,7 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - off_session: NotRequired["bool"] + off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. """ @@ -154,7 +154,12 @@ class CreateParams(TypedDict): The account on behalf of which to charge, for each of the subscription's invoices. """ payment_behavior: NotRequired[ - "Literal['allow_incomplete', 'default_incomplete', 'error_if_incomplete', 'pending_if_incomplete']" + Literal[ + "allow_incomplete", + "default_incomplete", + "error_if_incomplete", + "pending_if_incomplete", + ] ] """ Only applies to subscriptions with `collection_method=charge_automatically`. @@ -181,12 +186,12 @@ class CreateParams(TypedDict): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ The API ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. @@ -201,11 +206,11 @@ class CreateParams(TypedDict): """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ - trial_from_plan: NotRequired["bool"] + trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ - trial_period_days: NotRequired["int"] + trial_period_days: NotRequired[int] """ Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ @@ -217,7 +222,7 @@ class CreateParams(TypedDict): """ class CreateParamsAddInvoiceItem(TypedDict): - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -227,7 +232,7 @@ class CreateParamsAddInvoiceItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ @@ -246,16 +251,16 @@ class CreateParamsAddInvoiceItemPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -273,7 +278,7 @@ class CreateParamsAutomaticTax(TypedDict): """ class CreateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -287,29 +292,29 @@ class CreateParamsBillingCycleAnchorConfig(TypedDict): """ The day of the month the billing_cycle_anchor should be. Ranges from 1 to 31. """ - hour: NotRequired["int"] + hour: NotRequired[int] """ The hour of the day the billing_cycle_anchor should be. Ranges from 0 to 23. """ - minute: NotRequired["int"] + minute: NotRequired[int] """ The minute of the hour the billing_cycle_anchor should be. Ranges from 0 to 59. """ - month: NotRequired["int"] + month: NotRequired[int] """ The month to start full cycle billing periods. Ranges from 1 to 12. """ - second: NotRequired["int"] + second: NotRequired[int] """ The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. """ class CreateParamsBillingThresholds(TypedDict): - amount_gte: NotRequired["int"] + amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ - reset_billing_cycle_anchor: NotRequired["bool"] + reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ @@ -327,7 +332,7 @@ class CreateParamsInvoiceSettings(TypedDict): """ class CreateParamsInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -343,15 +348,15 @@ class CreateParamsItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ Plan ID for this item, as a string. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -361,7 +366,7 @@ class CreateParamsItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. """ @@ -390,16 +395,16 @@ class CreateParamsItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -409,7 +414,7 @@ class CreateParamsItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ @@ -428,7 +433,7 @@ class CreateParamsPaymentSettings(TypedDict): The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ save_default_payment_method: NotRequired[ - "Literal['off', 'on_subscription']" + Literal["off", "on_subscription"] ] """ Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. @@ -486,7 +491,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -495,13 +500,13 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -514,13 +519,25 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): Configuration options for setting up an eMandate for cards issued in India. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -529,15 +546,15 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): class CreateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions( TypedDict, ): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount to be charged for future payments. """ - amount_type: NotRequired["Literal['fixed', 'maximum']"] + 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"] + description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ @@ -551,7 +568,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["str"] + funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ @@ -565,7 +582,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer """ Configuration for eu_bank_transfer funding type. """ - type: NotRequired["str"] + type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ @@ -594,7 +611,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -604,12 +621,16 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ @@ -619,13 +640,13 @@ class CreateParamsPendingInvoiceItemInterval(TypedDict): """ Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + 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 CreateParamsTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ @@ -657,7 +678,7 @@ class ListParams(TypedDict): Filter subscriptions by their automatic tax settings. """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ The collection method of the subscriptions to retrieve. Either `charge_automatically` or `send_invoice`. @@ -672,41 +693,52 @@ class ListParams(TypedDict): current_period_start: NotRequired[ "SubscriptionService.ListParamsCurrentPeriodStart|int" ] - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the customer whose subscriptions will be retrieved. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ The ID of the plan whose subscriptions will be retrieved. """ - price: NotRequired["str"] + price: NotRequired[str] """ Filter for subscriptions that contain this recurring price ID. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['active', 'all', 'canceled', 'ended', 'incomplete', 'incomplete_expired', 'past_due', 'paused', 'trialing', 'unpaid']" + Literal[ + "active", + "all", + "canceled", + "ended", + "incomplete", + "incomplete_expired", + "past_due", + "paused", + "trialing", + "unpaid", + ] ] """ The status of the subscriptions to retrieve. Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). Passing in a value of `all` will return subscriptions of all statuses. If no value is supplied, all subscriptions that have not been canceled are returned. """ - test_clock: NotRequired["str"] + test_clock: NotRequired[str] """ Filter for subscriptions that are associated with the specified test clock. The response will not include subscriptions with test clocks if this and the customer parameter is not set. """ @@ -718,95 +750,95 @@ class ListParamsAutomaticTax(TypedDict): """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCurrentPeriodEnd(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCurrentPeriodStart(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ResumeParams(TypedDict): - billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']"] + billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). Setting the value to `unchanged` advances the subscription's billing cycle anchor to the period that surrounds the current time. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - proration_date: NotRequired["int"] + proration_date: NotRequired[int] """ If set, the proration will be calculated as though the subscription was resumed at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - page: NotRequired["str"] + page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ @@ -817,7 +849,7 @@ class SearchParams(TypedDict): class UpdateParams(TypedDict): add_invoice_items: NotRequired[ - "List[SubscriptionService.UpdateParamsAddInvoiceItem]" + List["SubscriptionService.UpdateParamsAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. @@ -832,7 +864,7 @@ class UpdateParams(TypedDict): """ Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. """ - billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']"] + billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ @@ -846,7 +878,7 @@ class UpdateParams(TypedDict): """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ - cancel_at_period_end: NotRequired["bool"] + cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ @@ -857,20 +889,20 @@ class UpdateParams(TypedDict): Details about why this subscription was cancelled """ collection_method: NotRequired[ - "Literal['charge_automatically', 'send_invoice']" + Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. """ - days_until_due: NotRequired["int"] + days_until_due: NotRequired[int] """ Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. """ - default_payment_method: NotRequired["str"] + default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ @@ -886,7 +918,7 @@ class UpdateParams(TypedDict): """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -896,7 +928,7 @@ class UpdateParams(TypedDict): """ All invoices will be billed using the specified settings. """ - items: NotRequired["List[SubscriptionService.UpdateParamsItem]"] + items: NotRequired[List["SubscriptionService.UpdateParamsItem"]] """ A list of up to 20 subscription items, each with an attached price. """ @@ -904,7 +936,7 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - off_session: NotRequired["bool"] + off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. """ @@ -919,7 +951,12 @@ class UpdateParams(TypedDict): If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment). """ payment_behavior: NotRequired[ - "Literal['allow_incomplete', 'default_incomplete', 'error_if_incomplete', 'pending_if_incomplete']" + Literal[ + "allow_incomplete", + "default_incomplete", + "error_if_incomplete", + "pending_if_incomplete", + ] ] """ Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. @@ -942,17 +979,17 @@ class UpdateParams(TypedDict): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - proration_date: NotRequired["int"] + 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 exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#upcoming_invoice) endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations. """ @@ -966,7 +1003,7 @@ class UpdateParams(TypedDict): """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. """ - trial_from_plan: NotRequired["bool"] + trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ @@ -978,7 +1015,7 @@ class UpdateParams(TypedDict): """ class UpdateParamsAddInvoiceItem(TypedDict): - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. """ @@ -988,7 +1025,7 @@ class UpdateParamsAddInvoiceItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ @@ -1007,16 +1044,16 @@ class UpdateParamsAddInvoiceItemPriceData(TypedDict): The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -1034,7 +1071,7 @@ class UpdateParamsAutomaticTax(TypedDict): """ class UpdateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1044,11 +1081,11 @@ class UpdateParamsAutomaticTaxLiability(TypedDict): """ class UpdateParamsBillingThresholds(TypedDict): - amount_gte: NotRequired["int"] + amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ - reset_billing_cycle_anchor: NotRequired["bool"] + reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ @@ -1078,7 +1115,7 @@ class UpdateParamsInvoiceSettings(TypedDict): """ class UpdateParamsInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1094,15 +1131,15 @@ class UpdateParamsItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - clear_usage: NotRequired["bool"] + clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ - deleted: NotRequired["bool"] + deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ - id: NotRequired["str"] + id: NotRequired[str] """ Subscription item to update. """ @@ -1110,11 +1147,11 @@ class UpdateParamsItem(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - plan: NotRequired["str"] + plan: NotRequired[str] """ Plan ID for this item, as a string. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ @@ -1124,7 +1161,7 @@ class UpdateParamsItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ Quantity for this item. """ @@ -1153,16 +1190,16 @@ class UpdateParamsItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -1172,7 +1209,7 @@ class UpdateParamsItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ @@ -1182,7 +1219,7 @@ class UpdateParamsPauseCollection(TypedDict): """ The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. """ - resumes_at: NotRequired["int"] + resumes_at: NotRequired[int] """ The time after which the subscription will resume collecting payments. """ @@ -1201,7 +1238,7 @@ class UpdateParamsPaymentSettings(TypedDict): The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ save_default_payment_method: NotRequired[ - "Literal['off', 'on_subscription']" + Literal["off", "on_subscription"] ] """ Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. @@ -1259,7 +1296,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -1268,13 +1305,13 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): class UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']"] + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -1287,13 +1324,25 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): Configuration options for setting up an eMandate for cards issued in India. """ network: NotRequired[ - "Literal['amex', 'cartes_bancaires', 'diners', 'discover', 'eftpos_au', 'interac', 'jcb', 'mastercard', 'unionpay', 'unknown', 'visa']" + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1302,15 +1351,15 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): class UpdateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions( TypedDict, ): - amount: NotRequired["int"] + amount: NotRequired[int] """ Amount to be charged for future payments. """ - amount_type: NotRequired["Literal['fixed', 'maximum']"] + 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"] + description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ @@ -1324,7 +1373,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["str"] + funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ @@ -1338,7 +1387,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer """ Configuration for eu_bank_transfer funding type. """ - type: NotRequired["str"] + type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ @@ -1367,7 +1416,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -1377,12 +1426,16 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ @@ -1392,13 +1445,13 @@ class UpdateParamsPendingInvoiceItemInterval(TypedDict): """ Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + 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 UpdateParamsTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ diff --git a/stripe/_tax_code.py b/stripe/_tax_code.py index 42b142c72..5a1279e78 100644 --- a/stripe/_tax_code.py +++ b/stripe/_tax_code.py @@ -15,25 +15,25 @@ class TaxCode(ListableAPIResource["TaxCode"]): OBJECT_NAME: ClassVar[Literal["tax_code"]] = "tax_code" class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_tax_code_service.py b/stripe/_tax_code_service.py index f66d1bd3e..27f9ede8d 100644 --- a/stripe/_tax_code_service.py +++ b/stripe/_tax_code_service.py @@ -11,25 +11,25 @@ class TaxCodeService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index ec064134c..8619a7a8e 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -70,7 +70,7 @@ class Verification(StripeObject): """ class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -156,11 +156,11 @@ class CreateParams(RequestOptions): """ class CreateParamsOwner(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ Account the tax ID belongs to. Required when `type=account` """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Customer the tax ID belongs to. Required when `type=customer` """ @@ -173,15 +173,15 @@ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -189,17 +189,17 @@ class ListParams(RequestOptions): """ The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsOwner(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ Account the tax ID belongs to. Required when `type=account` """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Customer the tax ID belongs to. Required when `type=customer` """ @@ -209,7 +209,7 @@ class ListParamsOwner(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py index e835ad4aa..7d4ab2014 100644 --- a/stripe/_tax_id_service.py +++ b/stripe/_tax_id_service.py @@ -11,7 +11,7 @@ class TaxIdService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -97,11 +97,11 @@ class CreateParams(TypedDict): """ class CreateParamsOwner(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ Account the tax ID belongs to. Required when `type=account` """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Customer the tax ID belongs to. Required when `type=customer` """ @@ -114,15 +114,15 @@ class DeleteParams(TypedDict): pass class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -130,17 +130,17 @@ class ListParams(TypedDict): """ The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsOwner(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ Account the tax ID belongs to. Required when `type=account` """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Customer the tax ID belongs to. Required when `type=customer` """ @@ -150,7 +150,7 @@ class ListParamsOwner(TypedDict): """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index 0ece4d92a..1d6389f46 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -24,15 +24,15 @@ class TaxRate( OBJECT_NAME: ClassVar[Literal["tax_rate"]] = "tax_rate" class CreateParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ @@ -40,7 +40,7 @@ class CreateParams(RequestOptions): """ The display name of the tax rate, which will be shown to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -48,11 +48,11 @@ class CreateParams(RequestOptions): """ This specifies if the tax rate is inclusive or exclusive. """ - jurisdiction: NotRequired["str"] + jurisdiction: NotRequired[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -60,19 +60,33 @@ class CreateParams(RequestOptions): """ This represents the tax rate percent out of 100. """ - state: NotRequired["str"] + state: NotRequired[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'vat', 'service_tax']" + Literal[ + "amusement_tax", + "communications_tax", + "gst", + "hst", + "igst", + "jct", + "lease_tax", + "pst", + "qst", + "rst", + "sales_tax", + "vat", + "service_tax", + ] ] """ The high-level tax type, such as `vat` or `sales_tax`. """ class ListParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Optional flag to filter by tax rates that are either active or inactive (archived). """ @@ -80,67 +94,67 @@ class ListParams(RequestOptions): """ Optional range for filtering created date. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - inclusive: NotRequired["bool"] + inclusive: NotRequired[bool] """ Optional flag to filter by tax rates that are inclusive (or those that are not inclusive). """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ - display_name: NotRequired["str"] + display_name: NotRequired[str] """ The display name of the tax rate, which will be shown to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - jurisdiction: NotRequired["str"] + jurisdiction: NotRequired[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ @@ -148,19 +162,33 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - state: NotRequired["str"] + state: NotRequired[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'vat', 'service_tax']" + Literal[ + "amusement_tax", + "communications_tax", + "gst", + "hst", + "igst", + "jct", + "lease_tax", + "pst", + "qst", + "rst", + "sales_tax", + "vat", + "service_tax", + ] ] """ The high-level tax type, such as `vat` or `sales_tax`. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_tax_rate_service.py b/stripe/_tax_rate_service.py index 4beab11a1..e676afd05 100644 --- a/stripe/_tax_rate_service.py +++ b/stripe/_tax_rate_service.py @@ -11,15 +11,15 @@ class TaxRateService(StripeService): class CreateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ @@ -27,7 +27,7 @@ class CreateParams(TypedDict): """ The display name of the tax rate, which will be shown to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -35,11 +35,11 @@ class CreateParams(TypedDict): """ This specifies if the tax rate is inclusive or exclusive. """ - jurisdiction: NotRequired["str"] + jurisdiction: NotRequired[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -47,19 +47,33 @@ class CreateParams(TypedDict): """ This represents the tax rate percent out of 100. """ - state: NotRequired["str"] + state: NotRequired[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'vat', 'service_tax']" + Literal[ + "amusement_tax", + "communications_tax", + "gst", + "hst", + "igst", + "jct", + "lease_tax", + "pst", + "qst", + "rst", + "sales_tax", + "vat", + "service_tax", + ] ] """ The high-level tax type, such as `vat` or `sales_tax`. """ class ListParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Optional flag to filter by tax rates that are either active or inactive (archived). """ @@ -67,73 +81,73 @@ class ListParams(TypedDict): """ Optional range for filtering created date. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - inclusive: NotRequired["bool"] + inclusive: NotRequired[bool] """ Optional flag to filter by tax rates that are inclusive (or those that are not inclusive). """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ - display_name: NotRequired["str"] + display_name: NotRequired[str] """ The display name of the tax rate, which will be shown to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - jurisdiction: NotRequired["str"] + jurisdiction: NotRequired[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ @@ -141,12 +155,26 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - state: NotRequired["str"] + state: NotRequired[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'vat', 'service_tax']" + Literal[ + "amusement_tax", + "communications_tax", + "gst", + "hst", + "igst", + "jct", + "lease_tax", + "pst", + "qst", + "rst", + "sales_tax", + "vat", + "service_tax", + ] ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/_token.py b/stripe/_token.py index ea31719c8..3f9957202 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -55,7 +55,7 @@ class CreateParams(RequestOptions): """ The card this token will represent. If you also pass in a customer, the card must be the ID of a card belonging to the customer. Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Create a token for the customer, which is owned by the application's account. You can only use this with an [OAuth access token](https://stripe.com/docs/connect/standard-accounts) or [Stripe-Account header](https://stripe.com/docs/connect/authentication). Learn more about [cloning saved payment methods](https://stripe.com/docs/connect/cloning-saved-payment-methods). """ @@ -63,7 +63,7 @@ class CreateParams(RequestOptions): """ The updated CVC value this token represents. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -78,7 +78,7 @@ class CreateParams(RequestOptions): class CreateParamsAccount(TypedDict): business_type: NotRequired[ - "Literal['company', 'government_entity', 'individual', 'non_profit']" + Literal["company", "government_entity", "individual", "non_profit"] ] """ The business type. @@ -91,7 +91,7 @@ class CreateParamsAccount(TypedDict): """ Information about the person represented by the account. """ - tos_shown_and_accepted: NotRequired["bool"] + tos_shown_and_accepted: NotRequired[bool] """ Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. """ @@ -113,35 +113,35 @@ class CreateParamsAccountCompany(TypedDict): """ The Kanji variation of the company's primary address (Japan only). """ - directors_provided: NotRequired["bool"] + directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ - executives_provided: NotRequired["bool"] + executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. """ - export_license_id: NotRequired["str"] + export_license_id: NotRequired[str] """ The export license ID number of the company, also referred as Import Export Code (India only). """ - export_purpose_code: NotRequired["str"] + export_purpose_code: NotRequired[str] """ The purpose code to use for export transactions (India only). """ - name: NotRequired["str"] + name: NotRequired[str] """ The company's legal name. """ - name_kana: NotRequired["str"] + name_kana: NotRequired[str] """ The Kana variation of the company's legal name (Japan only). """ - name_kanji: NotRequired["str"] + name_kanji: NotRequired[str] """ The Kanji variation of the company's legal name (Japan only). """ - owners_provided: NotRequired["bool"] + owners_provided: NotRequired[bool] """ Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. """ @@ -151,15 +151,15 @@ class CreateParamsAccountCompany(TypedDict): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ - ownership_declaration_shown_and_signed: NotRequired["bool"] + ownership_declaration_shown_and_signed: NotRequired[bool] """ Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The company's phone number (used for verification). """ - registration_number: NotRequired["str"] + registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). """ @@ -169,15 +169,15 @@ class CreateParamsAccountCompany(TypedDict): """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ - tax_id: NotRequired["str"] + tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) """ - tax_id_registrar: NotRequired["str"] + tax_id_registrar: NotRequired[str] """ The jurisdiction in which the `tax_id` is registered (Germany-based companies only). """ - vat_id: NotRequired["str"] + vat_id: NotRequired[str] """ The VAT number of the company. """ @@ -189,101 +189,101 @@ class CreateParamsAccountCompany(TypedDict): """ class CreateParamsAccountCompanyAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAccountCompanyAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountCompanyAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountCompanyOwnershipDeclaration(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the beneficial owner attestation was made. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the beneficial owner attestation was made. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the beneficial owner attestation was made. """ @@ -297,11 +297,11 @@ class CreateParamsAccountCompanyVerification(TypedDict): """ class CreateParamsAccountCompanyVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -327,19 +327,19 @@ class CreateParamsAccountIndividual(TypedDict): """ The individual's date of birth. """ - email: NotRequired["str"] + email: NotRequired[str] """ The individual's email address. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The individual's first name. """ - first_name_kana: NotRequired["str"] + first_name_kana: NotRequired[str] """ The Kana variation of the the individual's first name (Japan only). """ - first_name_kanji: NotRequired["str"] + first_name_kanji: NotRequired[str] """ The Kanji variation of the individual's first name (Japan only). """ @@ -347,31 +347,31 @@ class CreateParamsAccountIndividual(TypedDict): """ A list of alternate names or aliases that the individual is known by. """ - gender: NotRequired["str"] + gender: NotRequired[str] """ The individual's gender (International regulations require either "male" or "female"). """ - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - id_number_secondary: NotRequired["str"] + id_number_secondary: NotRequired[str] """ The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The individual's last name. """ - last_name_kana: NotRequired["str"] + last_name_kana: NotRequired[str] """ The Kana variation of the individual's last name (Japan only). """ - last_name_kanji: NotRequired["str"] + last_name_kanji: NotRequired[str] """ The Kanji variation of the individual's last name (Japan only). """ - maiden_name: NotRequired["str"] + maiden_name: NotRequired[str] """ The individual's maiden name. """ @@ -379,11 +379,11 @@ class CreateParamsAccountIndividual(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The individual's phone number. """ - political_exposure: NotRequired["Literal['existing', 'none']"] + political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -399,7 +399,7 @@ class CreateParamsAccountIndividual(TypedDict): """ Describes the person's relationship to the account. """ - ssn_last_4: NotRequired["str"] + ssn_last_4: NotRequired[str] """ The last four digits of the individual's Social Security Number (U.S. only). """ @@ -411,87 +411,87 @@ class CreateParamsAccountIndividual(TypedDict): """ class CreateParamsAccountIndividualAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAccountIndividualAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountIndividualAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ @@ -511,41 +511,41 @@ class CreateParamsAccountIndividualDob(TypedDict): """ class CreateParamsAccountIndividualRegisteredAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAccountIndividualRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ @@ -553,7 +553,7 @@ class CreateParamsAccountIndividualRelationship(TypedDict): """ The percent owned by the person of the account's legal entity. """ - title: NotRequired["str"] + title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ @@ -575,31 +575,31 @@ class CreateParamsAccountIndividualVerification(TypedDict): class CreateParamsAccountIndividualVerificationAdditionalDocument( TypedDict, ): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class CreateParamsAccountIndividualVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class CreateParamsBankAccount(TypedDict): - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account. This field is required when attaching the bank account to a `Customer` object. """ - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ @@ -608,7 +608,7 @@ class CreateParamsBankAccount(TypedDict): The account number for the bank account, in string form. Must be a checking account. """ account_type: NotRequired[ - "Literal['checking', 'futsu', 'savings', 'toza']" + Literal["checking", "futsu", "savings", "toza"] ] """ The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. @@ -617,49 +617,49 @@ class CreateParamsBankAccount(TypedDict): """ The country in which the bank account is located. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts) """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ The ID of a Payment Method with a `type` of `us_bank_account`. The Payment Method's bank account information will be copied and returned as a Bank Account Token. This parameter is exclusive with respect to all other parameters in the `bank_account` hash. You must include the top-level `customer` parameter if the Payment Method is attached to a `Customer` object. If the Payment Method is not attached to a `Customer` object, it will be consumed and cannot be used again. You may not use Payment Methods which were created by a Setup Intent with `attach_to_self=true`. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. """ class CreateParamsCard(TypedDict): - address_city: NotRequired["str"] + address_city: NotRequired[str] """ City / District / Suburb / Town / Village. """ - address_country: NotRequired["str"] + address_country: NotRequired[str] """ Billing address country, if provided. """ - address_line1: NotRequired["str"] + address_line1: NotRequired[str] """ Address line 1 (Street address / PO Box / Company name). """ - address_line2: NotRequired["str"] + address_line2: NotRequired[str] """ Address line 2 (Apartment / Suite / Unit / Building). """ - address_state: NotRequired["str"] + address_state: NotRequired[str] """ State / County / Province / Region. """ - address_zip: NotRequired["str"] + address_zip: NotRequired[str] """ ZIP or postal code. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Required in order to add the card to an account; in all other cases, this parameter is not used. When added to an account, the card (which must be a debit card) can be used as a transfer destination for funds in this currency. """ - cvc: NotRequired["str"] + cvc: NotRequired[str] """ Card security code. Highly recommended to always include this value. """ @@ -671,7 +671,7 @@ class CreateParamsCard(TypedDict): """ Two- or four-digit number representing the card's expiration year. """ - name: NotRequired["str"] + name: NotRequired[str] """ Cardholder's full name. """ @@ -686,7 +686,7 @@ class CreateParamsCard(TypedDict): class CreateParamsCardNetworks(TypedDict): preferred: NotRequired[ - "Literal['cartes_bancaires', 'mastercard', 'visa']" + Literal["cartes_bancaires", "mastercard", "visa"] ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. @@ -725,19 +725,19 @@ class CreateParamsPerson(TypedDict): """ Documents that may be submitted to satisfy various informational requests. """ - email: NotRequired["str"] + email: NotRequired[str] """ The person's email address. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The person's first name. """ - first_name_kana: NotRequired["str"] + first_name_kana: NotRequired[str] """ The Kana variation of the person's first name (Japan only). """ - first_name_kanji: NotRequired["str"] + first_name_kanji: NotRequired[str] """ The Kanji variation of the person's first name (Japan only). """ @@ -745,31 +745,31 @@ class CreateParamsPerson(TypedDict): """ A list of alternate names or aliases that the person is known by. """ - gender: NotRequired["str"] + gender: NotRequired[str] """ The person's gender (International regulations require either "male" or "female"). """ - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - id_number_secondary: NotRequired["str"] + id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The person's last name. """ - last_name_kana: NotRequired["str"] + last_name_kana: NotRequired[str] """ The Kana variation of the person's last name (Japan only). """ - last_name_kanji: NotRequired["str"] + last_name_kanji: NotRequired[str] """ The Kanji variation of the person's last name (Japan only). """ - maiden_name: NotRequired["str"] + maiden_name: NotRequired[str] """ The person's maiden name. """ @@ -777,15 +777,15 @@ class CreateParamsPerson(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nationality: NotRequired["str"] + nationality: NotRequired[str] """ The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The person's phone number. """ - political_exposure: NotRequired["str"] + political_exposure: NotRequired[str] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -799,7 +799,7 @@ class CreateParamsPerson(TypedDict): """ The relationship that this person has with the account's legal entity. """ - ssn_last_4: NotRequired["str"] + ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). """ @@ -817,11 +817,11 @@ class CreateParamsPersonAdditionalTosAcceptances(TypedDict): """ class CreateParamsPersonAdditionalTosAcceptancesAccount(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ @@ -831,87 +831,87 @@ class CreateParamsPersonAdditionalTosAcceptancesAccount(TypedDict): """ class CreateParamsPersonAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPersonAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsPersonAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ @@ -947,63 +947,63 @@ class CreateParamsPersonDocuments(TypedDict): """ class CreateParamsPersonDocumentsCompanyAuthorization(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsPersonDocumentsPassport(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsPersonDocumentsVisa(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsPersonRegisteredAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPersonRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ - legal_guardian: NotRequired["bool"] + legal_guardian: NotRequired[bool] """ Whether the person is the legal guardian of the account's representative. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ @@ -1011,11 +1011,11 @@ class CreateParamsPersonRelationship(TypedDict): """ The percent owned by the person of the account's legal entity. """ - representative: NotRequired["bool"] + representative: NotRequired[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ - title: NotRequired["str"] + title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ @@ -1033,33 +1033,33 @@ class CreateParamsPersonVerification(TypedDict): """ class CreateParamsPersonVerificationAdditionalDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class CreateParamsPersonVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class CreateParamsPii(TypedDict): - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The `id_number` for the PII, in string form. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 798459555..b1a247755 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -22,7 +22,7 @@ class CreateParams(TypedDict): """ The card this token will represent. If you also pass in a customer, the card must be the ID of a card belonging to the customer. Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Create a token for the customer, which is owned by the application's account. You can only use this with an [OAuth access token](https://stripe.com/docs/connect/standard-accounts) or [Stripe-Account header](https://stripe.com/docs/connect/authentication). Learn more about [cloning saved payment methods](https://stripe.com/docs/connect/cloning-saved-payment-methods). """ @@ -30,7 +30,7 @@ class CreateParams(TypedDict): """ The updated CVC value this token represents. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -45,7 +45,7 @@ class CreateParams(TypedDict): class CreateParamsAccount(TypedDict): business_type: NotRequired[ - "Literal['company', 'government_entity', 'individual', 'non_profit']" + Literal["company", "government_entity", "individual", "non_profit"] ] """ The business type. @@ -58,7 +58,7 @@ class CreateParamsAccount(TypedDict): """ Information about the person represented by the account. """ - tos_shown_and_accepted: NotRequired["bool"] + tos_shown_and_accepted: NotRequired[bool] """ Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. """ @@ -80,35 +80,35 @@ class CreateParamsAccountCompany(TypedDict): """ The Kanji variation of the company's primary address (Japan only). """ - directors_provided: NotRequired["bool"] + directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ - executives_provided: NotRequired["bool"] + executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. """ - export_license_id: NotRequired["str"] + export_license_id: NotRequired[str] """ The export license ID number of the company, also referred as Import Export Code (India only). """ - export_purpose_code: NotRequired["str"] + export_purpose_code: NotRequired[str] """ The purpose code to use for export transactions (India only). """ - name: NotRequired["str"] + name: NotRequired[str] """ The company's legal name. """ - name_kana: NotRequired["str"] + name_kana: NotRequired[str] """ The Kana variation of the company's legal name (Japan only). """ - name_kanji: NotRequired["str"] + name_kanji: NotRequired[str] """ The Kanji variation of the company's legal name (Japan only). """ - owners_provided: NotRequired["bool"] + owners_provided: NotRequired[bool] """ Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. """ @@ -118,15 +118,15 @@ class CreateParamsAccountCompany(TypedDict): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ - ownership_declaration_shown_and_signed: NotRequired["bool"] + ownership_declaration_shown_and_signed: NotRequired[bool] """ Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The company's phone number (used for verification). """ - registration_number: NotRequired["str"] + registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). """ @@ -136,15 +136,15 @@ class CreateParamsAccountCompany(TypedDict): """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ - tax_id: NotRequired["str"] + tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) """ - tax_id_registrar: NotRequired["str"] + tax_id_registrar: NotRequired[str] """ The jurisdiction in which the `tax_id` is registered (Germany-based companies only). """ - vat_id: NotRequired["str"] + vat_id: NotRequired[str] """ The VAT number of the company. """ @@ -156,101 +156,101 @@ class CreateParamsAccountCompany(TypedDict): """ class CreateParamsAccountCompanyAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAccountCompanyAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountCompanyAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountCompanyOwnershipDeclaration(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the beneficial owner attestation was made. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the beneficial owner attestation was made. """ - user_agent: NotRequired["str"] + user_agent: NotRequired[str] """ The user agent of the browser from which the beneficial owner attestation was made. """ @@ -264,11 +264,11 @@ class CreateParamsAccountCompanyVerification(TypedDict): """ class CreateParamsAccountCompanyVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -298,19 +298,19 @@ class CreateParamsAccountIndividual(TypedDict): """ The individual's date of birth. """ - email: NotRequired["str"] + email: NotRequired[str] """ The individual's email address. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The individual's first name. """ - first_name_kana: NotRequired["str"] + first_name_kana: NotRequired[str] """ The Kana variation of the the individual's first name (Japan only). """ - first_name_kanji: NotRequired["str"] + first_name_kanji: NotRequired[str] """ The Kanji variation of the individual's first name (Japan only). """ @@ -318,31 +318,31 @@ class CreateParamsAccountIndividual(TypedDict): """ A list of alternate names or aliases that the individual is known by. """ - gender: NotRequired["str"] + gender: NotRequired[str] """ The individual's gender (International regulations require either "male" or "female"). """ - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - id_number_secondary: NotRequired["str"] + id_number_secondary: NotRequired[str] """ The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The individual's last name. """ - last_name_kana: NotRequired["str"] + last_name_kana: NotRequired[str] """ The Kana variation of the individual's last name (Japan only). """ - last_name_kanji: NotRequired["str"] + last_name_kanji: NotRequired[str] """ The Kanji variation of the individual's last name (Japan only). """ - maiden_name: NotRequired["str"] + maiden_name: NotRequired[str] """ The individual's maiden name. """ @@ -350,11 +350,11 @@ class CreateParamsAccountIndividual(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The individual's phone number. """ - political_exposure: NotRequired["Literal['existing', 'none']"] + political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -370,7 +370,7 @@ class CreateParamsAccountIndividual(TypedDict): """ Describes the person's relationship to the account. """ - ssn_last_4: NotRequired["str"] + ssn_last_4: NotRequired[str] """ The last four digits of the individual's Social Security Number (U.S. only). """ @@ -382,87 +382,87 @@ class CreateParamsAccountIndividual(TypedDict): """ class CreateParamsAccountIndividualAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAccountIndividualAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountIndividualAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ @@ -482,41 +482,41 @@ class CreateParamsAccountIndividualDob(TypedDict): """ class CreateParamsAccountIndividualRegisteredAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAccountIndividualRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ @@ -524,7 +524,7 @@ class CreateParamsAccountIndividualRelationship(TypedDict): """ The percent owned by the person of the account's legal entity. """ - title: NotRequired["str"] + title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ @@ -546,31 +546,31 @@ class CreateParamsAccountIndividualVerification(TypedDict): class CreateParamsAccountIndividualVerificationAdditionalDocument( TypedDict, ): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class CreateParamsAccountIndividualVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class CreateParamsBankAccount(TypedDict): - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account. This field is required when attaching the bank account to a `Customer` object. """ - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ @@ -579,7 +579,7 @@ class CreateParamsBankAccount(TypedDict): The account number for the bank account, in string form. Must be a checking account. """ account_type: NotRequired[ - "Literal['checking', 'futsu', 'savings', 'toza']" + Literal["checking", "futsu", "savings", "toza"] ] """ The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. @@ -588,49 +588,49 @@ class CreateParamsBankAccount(TypedDict): """ The country in which the bank account is located. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts) """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ The ID of a Payment Method with a `type` of `us_bank_account`. The Payment Method's bank account information will be copied and returned as a Bank Account Token. This parameter is exclusive with respect to all other parameters in the `bank_account` hash. You must include the top-level `customer` parameter if the Payment Method is attached to a `Customer` object. If the Payment Method is not attached to a `Customer` object, it will be consumed and cannot be used again. You may not use Payment Methods which were created by a Setup Intent with `attach_to_self=true`. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. """ class CreateParamsCard(TypedDict): - address_city: NotRequired["str"] + address_city: NotRequired[str] """ City / District / Suburb / Town / Village. """ - address_country: NotRequired["str"] + address_country: NotRequired[str] """ Billing address country, if provided. """ - address_line1: NotRequired["str"] + address_line1: NotRequired[str] """ Address line 1 (Street address / PO Box / Company name). """ - address_line2: NotRequired["str"] + address_line2: NotRequired[str] """ Address line 2 (Apartment / Suite / Unit / Building). """ - address_state: NotRequired["str"] + address_state: NotRequired[str] """ State / County / Province / Region. """ - address_zip: NotRequired["str"] + address_zip: NotRequired[str] """ ZIP or postal code. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Required in order to add the card to an account; in all other cases, this parameter is not used. When added to an account, the card (which must be a debit card) can be used as a transfer destination for funds in this currency. """ - cvc: NotRequired["str"] + cvc: NotRequired[str] """ Card security code. Highly recommended to always include this value. """ @@ -642,7 +642,7 @@ class CreateParamsCard(TypedDict): """ Two- or four-digit number representing the card's expiration year. """ - name: NotRequired["str"] + name: NotRequired[str] """ Cardholder's full name. """ @@ -657,7 +657,7 @@ class CreateParamsCard(TypedDict): class CreateParamsCardNetworks(TypedDict): preferred: NotRequired[ - "Literal['cartes_bancaires', 'mastercard', 'visa']" + Literal["cartes_bancaires", "mastercard", "visa"] ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. @@ -698,19 +698,19 @@ class CreateParamsPerson(TypedDict): """ Documents that may be submitted to satisfy various informational requests. """ - email: NotRequired["str"] + email: NotRequired[str] """ The person's email address. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The person's first name. """ - first_name_kana: NotRequired["str"] + first_name_kana: NotRequired[str] """ The Kana variation of the person's first name (Japan only). """ - first_name_kanji: NotRequired["str"] + first_name_kanji: NotRequired[str] """ The Kanji variation of the person's first name (Japan only). """ @@ -718,31 +718,31 @@ class CreateParamsPerson(TypedDict): """ A list of alternate names or aliases that the person is known by. """ - gender: NotRequired["str"] + gender: NotRequired[str] """ The person's gender (International regulations require either "male" or "female"). """ - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - id_number_secondary: NotRequired["str"] + id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The person's last name. """ - last_name_kana: NotRequired["str"] + last_name_kana: NotRequired[str] """ The Kana variation of the person's last name (Japan only). """ - last_name_kanji: NotRequired["str"] + last_name_kanji: NotRequired[str] """ The Kanji variation of the person's last name (Japan only). """ - maiden_name: NotRequired["str"] + maiden_name: NotRequired[str] """ The person's maiden name. """ @@ -750,15 +750,15 @@ class CreateParamsPerson(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - nationality: NotRequired["str"] + nationality: NotRequired[str] """ The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ The person's phone number. """ - political_exposure: NotRequired["str"] + political_exposure: NotRequired[str] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -774,7 +774,7 @@ class CreateParamsPerson(TypedDict): """ The relationship that this person has with the account's legal entity. """ - ssn_last_4: NotRequired["str"] + ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). """ @@ -794,11 +794,11 @@ class CreateParamsPersonAdditionalTosAcceptances(TypedDict): """ class CreateParamsPersonAdditionalTosAcceptancesAccount(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ @@ -808,87 +808,87 @@ class CreateParamsPersonAdditionalTosAcceptancesAccount(TypedDict): """ class CreateParamsPersonAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPersonAddressKana(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ class CreateParamsPersonAddressKanji(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City or ward. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Block or building number. """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Building details. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ Prefecture. """ - town: NotRequired["str"] + town: NotRequired[str] """ Town or cho-me. """ @@ -926,63 +926,63 @@ class CreateParamsPersonDocuments(TypedDict): """ class CreateParamsPersonDocumentsCompanyAuthorization(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsPersonDocumentsPassport(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsPersonDocumentsVisa(TypedDict): - files: NotRequired["List[str]"] + files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsPersonRegisteredAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPersonRelationship(TypedDict): - director: NotRequired["bool"] + director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ - executive: NotRequired["bool"] + executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ - legal_guardian: NotRequired["bool"] + legal_guardian: NotRequired[bool] """ Whether the person is the legal guardian of the account's representative. """ - owner: NotRequired["bool"] + owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ @@ -990,11 +990,11 @@ class CreateParamsPersonRelationship(TypedDict): """ The percent owned by the person of the account's legal entity. """ - representative: NotRequired["bool"] + representative: NotRequired[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ - title: NotRequired["str"] + title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ @@ -1014,33 +1014,33 @@ class CreateParamsPersonVerification(TypedDict): """ class CreateParamsPersonVerificationAdditionalDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class CreateParamsPersonVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class CreateParamsPii(TypedDict): - id_number: NotRequired["str"] + id_number: NotRequired[str] """ The `id_number` for the PII, in string form. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_topup.py b/stripe/_topup.py index b9edd5280..bcbf96e5f 100644 --- a/stripe/_topup.py +++ b/stripe/_topup.py @@ -37,7 +37,7 @@ class Topup( OBJECT_NAME: ClassVar[Literal["topup"]] = "topup" class CancelParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -51,11 +51,11 @@ class CreateParams(RequestOptions): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -63,15 +63,15 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - source: NotRequired["str"] + source: NotRequired[str] """ The ID of a source to transfer funds from. For most users, this should be left unspecified which will use the bank account that was set up in the dashboard for the specified currency. In test mode, this can be a test bank token (see [Testing Top-ups](https://stripe.com/docs/connect/testing#testing-top-ups)). """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ Extra information about a top-up for the source's bank statement. Limited to 15 ASCII characters. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies this top-up as part of a group. """ @@ -85,71 +85,71 @@ class ListParams(RequestOptions): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['canceled', 'failed', 'pending', 'succeeded']" + Literal["canceled", "failed", "pending", "succeeded"] ] """ Only return top-ups that have the given status. One of `canceled`, `failed`, `pending` or `succeeded`. """ class ListParamsAmount(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -159,7 +159,7 @@ class ModifyParams(RequestOptions): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_topup_service.py b/stripe/_topup_service.py index 0f05e875b..c89aa4753 100644 --- a/stripe/_topup_service.py +++ b/stripe/_topup_service.py @@ -11,7 +11,7 @@ class TopupService(StripeService): class CancelParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -25,11 +25,11 @@ class CreateParams(TypedDict): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -37,15 +37,15 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - source: NotRequired["str"] + source: NotRequired[str] """ The ID of a source to transfer funds from. For most users, this should be left unspecified which will use the bank account that was set up in the dashboard for the specified currency. In test mode, this can be a test bank token (see [Testing Top-ups](https://stripe.com/docs/connect/testing#testing-top-ups)). """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ Extra information about a top-up for the source's bank statement. Limited to 15 ASCII characters. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies this top-up as part of a group. """ @@ -59,77 +59,77 @@ class ListParams(TypedDict): """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['canceled', 'failed', 'pending', 'succeeded']" + Literal["canceled", "failed", "pending", "succeeded"] ] """ Only return top-ups that have the given status. One of `canceled`, `failed`, `pending` or `succeeded`. """ class ListParamsAmount(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_transfer.py b/stripe/_transfer.py index c6763eef6..50fd7bdc9 100644 --- a/stripe/_transfer.py +++ b/stripe/_transfer.py @@ -46,7 +46,7 @@ class Transfer( OBJECT_NAME: ClassVar[Literal["transfer"]] = "transfer" class CreateParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer in cents (or local equivalent) representing how much to transfer. """ @@ -54,7 +54,7 @@ class CreateParams(RequestOptions): """ 3-letter [ISO code for currency](https://stripe.com/docs/payouts). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ @@ -62,37 +62,37 @@ class CreateParams(RequestOptions): """ The ID of a connected Stripe account. [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - source_transaction: NotRequired["str"] + source_transaction: NotRequired[str] """ You can use this parameter to transfer funds from a charge before they are added to your available balance. A pending balance will transfer immediately but the funds will not become available until the original charge becomes available. [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-availability) for details. """ - source_type: NotRequired["Literal['bank_account', 'card', 'fpx']"] + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] """ The source balance to use for this transfer. One of `bank_account`, `card`, or `fpx`. For most users, this will default to `card`. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ class CreateReversalParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to a reversal object. It is displayed alongside the reversal in the Dashboard. This will be unset if you POST an empty value. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -100,7 +100,7 @@ class CreateReversalParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - refund_application_fee: NotRequired["bool"] + refund_application_fee: NotRequired[bool] """ Boolean indicating whether the application fee should be refunded when reversing this transfer. If a full transfer reversal is given, the full application fee will be refunded. Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed. """ @@ -110,73 +110,73 @@ class ListParams(RequestOptions): """ Only return transfers that were created during the given date interval. """ - destination: NotRequired["str"] + destination: NotRequired[str] """ Only return transfers for the destination specified by this account ID. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ Only return transfers with the specified transfer group. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListReversalsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ModifyParams(RequestOptions): - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -186,7 +186,7 @@ class ModifyParams(RequestOptions): """ class ModifyReversalParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -196,13 +196,13 @@ class ModifyReversalParams(RequestOptions): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveReversalParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_transfer_reversal_service.py b/stripe/_transfer_reversal_service.py index ffe5cde5a..919481021 100644 --- a/stripe/_transfer_reversal_service.py +++ b/stripe/_transfer_reversal_service.py @@ -11,15 +11,15 @@ class TransferReversalService(StripeService): class CreateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string which you can attach to a reversal object. It is displayed alongside the reversal in the Dashboard. This will be unset if you POST an empty value. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -27,37 +27,37 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - refund_application_fee: NotRequired["bool"] + refund_application_fee: NotRequired[bool] """ Boolean indicating whether the application fee should be refunded when reversing this transfer. If a full transfer reversal is given, the full application fee will be refunded. Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed. """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_transfer_service.py b/stripe/_transfer_service.py index 581d2d78c..9dfdc07d4 100644 --- a/stripe/_transfer_service.py +++ b/stripe/_transfer_service.py @@ -16,7 +16,7 @@ def __init__(self, requestor): self.reversals = TransferReversalService(self._requestor) class CreateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer in cents (or local equivalent) representing how much to transfer. """ @@ -24,7 +24,7 @@ class CreateParams(TypedDict): """ 3-letter [ISO code for currency](https://stripe.com/docs/payouts). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ @@ -32,23 +32,23 @@ class CreateParams(TypedDict): """ The ID of a connected Stripe account. [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - source_transaction: NotRequired["str"] + source_transaction: NotRequired[str] """ You can use this parameter to transfer funds from a charge before they are added to your available balance. A pending balance will transfer immediately but the funds will not become available until the original charge becomes available. [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-availability) for details. """ - source_type: NotRequired["Literal['bank_account', 'card', 'fpx']"] + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] """ The source balance to use for this transfer. One of `bank_account`, `card`, or `fpx`. For most users, this will default to `card`. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ @@ -58,61 +58,61 @@ class ListParams(TypedDict): """ Only return transfers that were created during the given date interval. """ - destination: NotRequired["str"] + destination: NotRequired[str] """ Only return transfers for the destination specified by this account ID. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ Only return transfers with the specified transfer group. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 13cfd4f3e..f7deee920 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -31,12 +31,113 @@ class WebhookEndpoint( class CreateParams(RequestOptions): api_version: NotRequired[ - "Literal['2011-01-01', '2011-06-21', '2011-06-28', '2011-08-01', '2011-09-15', '2011-11-17', '2012-02-23', '2012-03-25', '2012-06-18', '2012-06-28', '2012-07-09', '2012-09-24', '2012-10-26', '2012-11-07', '2013-02-11', '2013-02-13', '2013-07-05', '2013-08-12', '2013-08-13', '2013-10-29', '2013-12-03', '2014-01-31', '2014-03-13', '2014-03-28', '2014-05-19', '2014-06-13', '2014-06-17', '2014-07-22', '2014-07-26', '2014-08-04', '2014-08-20', '2014-09-08', '2014-10-07', '2014-11-05', '2014-11-20', '2014-12-08', '2014-12-17', '2014-12-22', '2015-01-11', '2015-01-26', '2015-02-10', '2015-02-16', '2015-02-18', '2015-03-24', '2015-04-07', '2015-06-15', '2015-07-07', '2015-07-13', '2015-07-28', '2015-08-07', '2015-08-19', '2015-09-03', '2015-09-08', '2015-09-23', '2015-10-01', '2015-10-12', '2015-10-16', '2016-02-03', '2016-02-19', '2016-02-22', '2016-02-23', '2016-02-29', '2016-03-07', '2016-06-15', '2016-07-06', '2016-10-19', '2017-01-27', '2017-02-14', '2017-04-06', '2017-05-25', '2017-06-05', '2017-08-15', '2017-12-14', '2018-01-23', '2018-02-05', '2018-02-06', '2018-02-28', '2018-05-21', '2018-07-27', '2018-08-23', '2018-09-06', '2018-09-24', '2018-10-31', '2018-11-08', '2019-02-11', '2019-02-19', '2019-03-14', '2019-05-16', '2019-08-14', '2019-09-09', '2019-10-08', '2019-10-17', '2019-11-05', '2019-12-03', '2020-03-02', '2020-08-27', '2022-08-01', '2022-11-15', '2023-08-16', '2023-10-16']" + Literal[ + "2011-01-01", + "2011-06-21", + "2011-06-28", + "2011-08-01", + "2011-09-15", + "2011-11-17", + "2012-02-23", + "2012-03-25", + "2012-06-18", + "2012-06-28", + "2012-07-09", + "2012-09-24", + "2012-10-26", + "2012-11-07", + "2013-02-11", + "2013-02-13", + "2013-07-05", + "2013-08-12", + "2013-08-13", + "2013-10-29", + "2013-12-03", + "2014-01-31", + "2014-03-13", + "2014-03-28", + "2014-05-19", + "2014-06-13", + "2014-06-17", + "2014-07-22", + "2014-07-26", + "2014-08-04", + "2014-08-20", + "2014-09-08", + "2014-10-07", + "2014-11-05", + "2014-11-20", + "2014-12-08", + "2014-12-17", + "2014-12-22", + "2015-01-11", + "2015-01-26", + "2015-02-10", + "2015-02-16", + "2015-02-18", + "2015-03-24", + "2015-04-07", + "2015-06-15", + "2015-07-07", + "2015-07-13", + "2015-07-28", + "2015-08-07", + "2015-08-19", + "2015-09-03", + "2015-09-08", + "2015-09-23", + "2015-10-01", + "2015-10-12", + "2015-10-16", + "2016-02-03", + "2016-02-19", + "2016-02-22", + "2016-02-23", + "2016-02-29", + "2016-03-07", + "2016-06-15", + "2016-07-06", + "2016-10-19", + "2017-01-27", + "2017-02-14", + "2017-04-06", + "2017-05-25", + "2017-06-05", + "2017-08-15", + "2017-12-14", + "2018-01-23", + "2018-02-05", + "2018-02-06", + "2018-02-28", + "2018-05-21", + "2018-07-27", + "2018-08-23", + "2018-09-06", + "2018-09-24", + "2018-10-31", + "2018-11-08", + "2019-02-11", + "2019-02-19", + "2019-03-14", + "2019-05-16", + "2019-08-14", + "2019-09-09", + "2019-10-08", + "2019-10-17", + "2019-11-05", + "2019-12-03", + "2020-03-02", + "2020-08-27", + "2022-08-01", + "2022-11-15", + "2023-08-16", + "2023-10-16", + ] ] """ Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version. """ - connect: NotRequired["bool"] + connect: NotRequired[bool] """ Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). Defaults to `false`. """ @@ -286,7 +387,7 @@ class CreateParams(RequestOptions): """ The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -303,19 +404,19 @@ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ @@ -325,17 +426,255 @@ class ModifyParams(RequestOptions): """ An optional description of what the webhook is used for. """ - disabled: NotRequired["bool"] + disabled: NotRequired[bool] """ Disable the webhook endpoint if set to true. """ enabled_events: NotRequired[ - "List[Literal['*', 'account.application.authorized', 'account.application.deauthorized', 'account.external_account.created', 'account.external_account.deleted', 'account.external_account.updated', 'account.updated', 'application_fee.created', 'application_fee.refund.updated', 'application_fee.refunded', 'balance.available', 'billing_portal.configuration.created', 'billing_portal.configuration.updated', 'billing_portal.session.created', 'capability.updated', 'cash_balance.funds_available', 'charge.captured', 'charge.dispute.closed', 'charge.dispute.created', 'charge.dispute.funds_reinstated', 'charge.dispute.funds_withdrawn', 'charge.dispute.updated', 'charge.expired', 'charge.failed', 'charge.pending', 'charge.refund.updated', 'charge.refunded', 'charge.succeeded', 'charge.updated', 'checkout.session.async_payment_failed', 'checkout.session.async_payment_succeeded', 'checkout.session.completed', 'checkout.session.expired', 'climate.order.canceled', 'climate.order.created', 'climate.order.delayed', 'climate.order.delivered', 'climate.order.product_substituted', 'climate.product.created', 'climate.product.pricing_updated', 'coupon.created', 'coupon.deleted', 'coupon.updated', 'credit_note.created', 'credit_note.updated', 'credit_note.voided', 'customer.created', 'customer.deleted', 'customer.discount.created', 'customer.discount.deleted', 'customer.discount.updated', 'customer.source.created', 'customer.source.deleted', 'customer.source.expiring', 'customer.source.updated', 'customer.subscription.created', 'customer.subscription.deleted', 'customer.subscription.paused', 'customer.subscription.pending_update_applied', 'customer.subscription.pending_update_expired', 'customer.subscription.resumed', 'customer.subscription.trial_will_end', 'customer.subscription.updated', 'customer.tax_id.created', 'customer.tax_id.deleted', 'customer.tax_id.updated', 'customer.updated', 'customer_cash_balance_transaction.created', 'file.created', 'financial_connections.account.created', 'financial_connections.account.deactivated', 'financial_connections.account.disconnected', 'financial_connections.account.reactivated', 'financial_connections.account.refreshed_balance', 'financial_connections.account.refreshed_ownership', 'financial_connections.account.refreshed_transactions', 'identity.verification_session.canceled', 'identity.verification_session.created', 'identity.verification_session.processing', 'identity.verification_session.redacted', 'identity.verification_session.requires_input', 'identity.verification_session.verified', 'invoice.created', 'invoice.deleted', 'invoice.finalization_failed', 'invoice.finalized', 'invoice.marked_uncollectible', 'invoice.paid', 'invoice.payment_action_required', 'invoice.payment_failed', 'invoice.payment_succeeded', 'invoice.sent', 'invoice.upcoming', 'invoice.updated', 'invoice.voided', 'invoiceitem.created', 'invoiceitem.deleted', 'issuing_authorization.created', 'issuing_authorization.request', 'issuing_authorization.updated', 'issuing_card.created', 'issuing_card.updated', 'issuing_cardholder.created', 'issuing_cardholder.updated', 'issuing_dispute.closed', 'issuing_dispute.created', 'issuing_dispute.funds_reinstated', 'issuing_dispute.submitted', 'issuing_dispute.updated', 'issuing_token.created', 'issuing_token.updated', 'issuing_transaction.created', 'issuing_transaction.updated', 'mandate.updated', 'payment_intent.amount_capturable_updated', 'payment_intent.canceled', 'payment_intent.created', 'payment_intent.partially_funded', 'payment_intent.payment_failed', 'payment_intent.processing', 'payment_intent.requires_action', 'payment_intent.succeeded', 'payment_link.created', 'payment_link.updated', 'payment_method.attached', 'payment_method.automatically_updated', 'payment_method.detached', 'payment_method.updated', 'payout.canceled', 'payout.created', 'payout.failed', 'payout.paid', 'payout.reconciliation_completed', 'payout.updated', 'person.created', 'person.deleted', 'person.updated', 'plan.created', 'plan.deleted', 'plan.updated', 'price.created', 'price.deleted', 'price.updated', 'product.created', 'product.deleted', 'product.updated', 'promotion_code.created', 'promotion_code.updated', 'quote.accepted', 'quote.canceled', 'quote.created', 'quote.finalized', 'radar.early_fraud_warning.created', 'radar.early_fraud_warning.updated', 'refund.created', 'refund.updated', 'reporting.report_run.failed', 'reporting.report_run.succeeded', 'reporting.report_type.updated', 'review.closed', 'review.opened', 'setup_intent.canceled', 'setup_intent.created', 'setup_intent.requires_action', 'setup_intent.setup_failed', 'setup_intent.succeeded', 'sigma.scheduled_query_run.created', 'source.canceled', 'source.chargeable', 'source.failed', 'source.mandate_notification', 'source.refund_attributes_required', 'source.transaction.created', 'source.transaction.updated', 'subscription_schedule.aborted', 'subscription_schedule.canceled', 'subscription_schedule.completed', 'subscription_schedule.created', 'subscription_schedule.expiring', 'subscription_schedule.released', 'subscription_schedule.updated', 'tax.settings.updated', 'tax_rate.created', 'tax_rate.updated', 'terminal.reader.action_failed', 'terminal.reader.action_succeeded', 'test_helpers.test_clock.advancing', 'test_helpers.test_clock.created', 'test_helpers.test_clock.deleted', 'test_helpers.test_clock.internal_failure', 'test_helpers.test_clock.ready', 'topup.canceled', 'topup.created', 'topup.failed', 'topup.reversed', 'topup.succeeded', 'transfer.created', 'transfer.reversed', 'transfer.updated', 'treasury.credit_reversal.created', 'treasury.credit_reversal.posted', 'treasury.debit_reversal.completed', 'treasury.debit_reversal.created', 'treasury.debit_reversal.initial_credit_granted', 'treasury.financial_account.closed', 'treasury.financial_account.created', 'treasury.financial_account.features_status_updated', 'treasury.inbound_transfer.canceled', 'treasury.inbound_transfer.created', 'treasury.inbound_transfer.failed', 'treasury.inbound_transfer.succeeded', 'treasury.outbound_payment.canceled', 'treasury.outbound_payment.created', 'treasury.outbound_payment.expected_arrival_date_updated', 'treasury.outbound_payment.failed', 'treasury.outbound_payment.posted', 'treasury.outbound_payment.returned', 'treasury.outbound_transfer.canceled', 'treasury.outbound_transfer.created', 'treasury.outbound_transfer.expected_arrival_date_updated', 'treasury.outbound_transfer.failed', 'treasury.outbound_transfer.posted', 'treasury.outbound_transfer.returned', 'treasury.received_credit.created', 'treasury.received_credit.failed', 'treasury.received_credit.succeeded', 'treasury.received_debit.created', 'invoiceitem.updated', 'order.created', 'recipient.created', 'recipient.deleted', 'recipient.updated', 'sku.created', 'sku.deleted', 'sku.updated']]" + List[ + Literal[ + "*", + "account.application.authorized", + "account.application.deauthorized", + "account.external_account.created", + "account.external_account.deleted", + "account.external_account.updated", + "account.updated", + "application_fee.created", + "application_fee.refund.updated", + "application_fee.refunded", + "balance.available", + "billing_portal.configuration.created", + "billing_portal.configuration.updated", + "billing_portal.session.created", + "capability.updated", + "cash_balance.funds_available", + "charge.captured", + "charge.dispute.closed", + "charge.dispute.created", + "charge.dispute.funds_reinstated", + "charge.dispute.funds_withdrawn", + "charge.dispute.updated", + "charge.expired", + "charge.failed", + "charge.pending", + "charge.refund.updated", + "charge.refunded", + "charge.succeeded", + "charge.updated", + "checkout.session.async_payment_failed", + "checkout.session.async_payment_succeeded", + "checkout.session.completed", + "checkout.session.expired", + "climate.order.canceled", + "climate.order.created", + "climate.order.delayed", + "climate.order.delivered", + "climate.order.product_substituted", + "climate.product.created", + "climate.product.pricing_updated", + "coupon.created", + "coupon.deleted", + "coupon.updated", + "credit_note.created", + "credit_note.updated", + "credit_note.voided", + "customer.created", + "customer.deleted", + "customer.discount.created", + "customer.discount.deleted", + "customer.discount.updated", + "customer.source.created", + "customer.source.deleted", + "customer.source.expiring", + "customer.source.updated", + "customer.subscription.created", + "customer.subscription.deleted", + "customer.subscription.paused", + "customer.subscription.pending_update_applied", + "customer.subscription.pending_update_expired", + "customer.subscription.resumed", + "customer.subscription.trial_will_end", + "customer.subscription.updated", + "customer.tax_id.created", + "customer.tax_id.deleted", + "customer.tax_id.updated", + "customer.updated", + "customer_cash_balance_transaction.created", + "file.created", + "financial_connections.account.created", + "financial_connections.account.deactivated", + "financial_connections.account.disconnected", + "financial_connections.account.reactivated", + "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_ownership", + "financial_connections.account.refreshed_transactions", + "identity.verification_session.canceled", + "identity.verification_session.created", + "identity.verification_session.processing", + "identity.verification_session.redacted", + "identity.verification_session.requires_input", + "identity.verification_session.verified", + "invoice.created", + "invoice.deleted", + "invoice.finalization_failed", + "invoice.finalized", + "invoice.marked_uncollectible", + "invoice.paid", + "invoice.payment_action_required", + "invoice.payment_failed", + "invoice.payment_succeeded", + "invoice.sent", + "invoice.upcoming", + "invoice.updated", + "invoice.voided", + "invoiceitem.created", + "invoiceitem.deleted", + "issuing_authorization.created", + "issuing_authorization.request", + "issuing_authorization.updated", + "issuing_card.created", + "issuing_card.updated", + "issuing_cardholder.created", + "issuing_cardholder.updated", + "issuing_dispute.closed", + "issuing_dispute.created", + "issuing_dispute.funds_reinstated", + "issuing_dispute.submitted", + "issuing_dispute.updated", + "issuing_token.created", + "issuing_token.updated", + "issuing_transaction.created", + "issuing_transaction.updated", + "mandate.updated", + "payment_intent.amount_capturable_updated", + "payment_intent.canceled", + "payment_intent.created", + "payment_intent.partially_funded", + "payment_intent.payment_failed", + "payment_intent.processing", + "payment_intent.requires_action", + "payment_intent.succeeded", + "payment_link.created", + "payment_link.updated", + "payment_method.attached", + "payment_method.automatically_updated", + "payment_method.detached", + "payment_method.updated", + "payout.canceled", + "payout.created", + "payout.failed", + "payout.paid", + "payout.reconciliation_completed", + "payout.updated", + "person.created", + "person.deleted", + "person.updated", + "plan.created", + "plan.deleted", + "plan.updated", + "price.created", + "price.deleted", + "price.updated", + "product.created", + "product.deleted", + "product.updated", + "promotion_code.created", + "promotion_code.updated", + "quote.accepted", + "quote.canceled", + "quote.created", + "quote.finalized", + "radar.early_fraud_warning.created", + "radar.early_fraud_warning.updated", + "refund.created", + "refund.updated", + "reporting.report_run.failed", + "reporting.report_run.succeeded", + "reporting.report_type.updated", + "review.closed", + "review.opened", + "setup_intent.canceled", + "setup_intent.created", + "setup_intent.requires_action", + "setup_intent.setup_failed", + "setup_intent.succeeded", + "sigma.scheduled_query_run.created", + "source.canceled", + "source.chargeable", + "source.failed", + "source.mandate_notification", + "source.refund_attributes_required", + "source.transaction.created", + "source.transaction.updated", + "subscription_schedule.aborted", + "subscription_schedule.canceled", + "subscription_schedule.completed", + "subscription_schedule.created", + "subscription_schedule.expiring", + "subscription_schedule.released", + "subscription_schedule.updated", + "tax.settings.updated", + "tax_rate.created", + "tax_rate.updated", + "terminal.reader.action_failed", + "terminal.reader.action_succeeded", + "test_helpers.test_clock.advancing", + "test_helpers.test_clock.created", + "test_helpers.test_clock.deleted", + "test_helpers.test_clock.internal_failure", + "test_helpers.test_clock.ready", + "topup.canceled", + "topup.created", + "topup.failed", + "topup.reversed", + "topup.succeeded", + "transfer.created", + "transfer.reversed", + "transfer.updated", + "treasury.credit_reversal.created", + "treasury.credit_reversal.posted", + "treasury.debit_reversal.completed", + "treasury.debit_reversal.created", + "treasury.debit_reversal.initial_credit_granted", + "treasury.financial_account.closed", + "treasury.financial_account.created", + "treasury.financial_account.features_status_updated", + "treasury.inbound_transfer.canceled", + "treasury.inbound_transfer.created", + "treasury.inbound_transfer.failed", + "treasury.inbound_transfer.succeeded", + "treasury.outbound_payment.canceled", + "treasury.outbound_payment.created", + "treasury.outbound_payment.expected_arrival_date_updated", + "treasury.outbound_payment.failed", + "treasury.outbound_payment.posted", + "treasury.outbound_payment.returned", + "treasury.outbound_transfer.canceled", + "treasury.outbound_transfer.created", + "treasury.outbound_transfer.expected_arrival_date_updated", + "treasury.outbound_transfer.failed", + "treasury.outbound_transfer.posted", + "treasury.outbound_transfer.returned", + "treasury.received_credit.created", + "treasury.received_credit.failed", + "treasury.received_credit.succeeded", + "treasury.received_debit.created", + "invoiceitem.updated", + "order.created", + "recipient.created", + "recipient.deleted", + "recipient.updated", + "sku.created", + "sku.deleted", + "sku.updated", + ] + ] ] """ The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -343,13 +682,13 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - url: NotRequired["str"] + url: NotRequired[str] """ The URL of the webhook endpoint. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 76ea445b0..a015b0c9f 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -12,12 +12,113 @@ class WebhookEndpointService(StripeService): class CreateParams(TypedDict): api_version: NotRequired[ - "Literal['2011-01-01', '2011-06-21', '2011-06-28', '2011-08-01', '2011-09-15', '2011-11-17', '2012-02-23', '2012-03-25', '2012-06-18', '2012-06-28', '2012-07-09', '2012-09-24', '2012-10-26', '2012-11-07', '2013-02-11', '2013-02-13', '2013-07-05', '2013-08-12', '2013-08-13', '2013-10-29', '2013-12-03', '2014-01-31', '2014-03-13', '2014-03-28', '2014-05-19', '2014-06-13', '2014-06-17', '2014-07-22', '2014-07-26', '2014-08-04', '2014-08-20', '2014-09-08', '2014-10-07', '2014-11-05', '2014-11-20', '2014-12-08', '2014-12-17', '2014-12-22', '2015-01-11', '2015-01-26', '2015-02-10', '2015-02-16', '2015-02-18', '2015-03-24', '2015-04-07', '2015-06-15', '2015-07-07', '2015-07-13', '2015-07-28', '2015-08-07', '2015-08-19', '2015-09-03', '2015-09-08', '2015-09-23', '2015-10-01', '2015-10-12', '2015-10-16', '2016-02-03', '2016-02-19', '2016-02-22', '2016-02-23', '2016-02-29', '2016-03-07', '2016-06-15', '2016-07-06', '2016-10-19', '2017-01-27', '2017-02-14', '2017-04-06', '2017-05-25', '2017-06-05', '2017-08-15', '2017-12-14', '2018-01-23', '2018-02-05', '2018-02-06', '2018-02-28', '2018-05-21', '2018-07-27', '2018-08-23', '2018-09-06', '2018-09-24', '2018-10-31', '2018-11-08', '2019-02-11', '2019-02-19', '2019-03-14', '2019-05-16', '2019-08-14', '2019-09-09', '2019-10-08', '2019-10-17', '2019-11-05', '2019-12-03', '2020-03-02', '2020-08-27', '2022-08-01', '2022-11-15', '2023-08-16', '2023-10-16']" + Literal[ + "2011-01-01", + "2011-06-21", + "2011-06-28", + "2011-08-01", + "2011-09-15", + "2011-11-17", + "2012-02-23", + "2012-03-25", + "2012-06-18", + "2012-06-28", + "2012-07-09", + "2012-09-24", + "2012-10-26", + "2012-11-07", + "2013-02-11", + "2013-02-13", + "2013-07-05", + "2013-08-12", + "2013-08-13", + "2013-10-29", + "2013-12-03", + "2014-01-31", + "2014-03-13", + "2014-03-28", + "2014-05-19", + "2014-06-13", + "2014-06-17", + "2014-07-22", + "2014-07-26", + "2014-08-04", + "2014-08-20", + "2014-09-08", + "2014-10-07", + "2014-11-05", + "2014-11-20", + "2014-12-08", + "2014-12-17", + "2014-12-22", + "2015-01-11", + "2015-01-26", + "2015-02-10", + "2015-02-16", + "2015-02-18", + "2015-03-24", + "2015-04-07", + "2015-06-15", + "2015-07-07", + "2015-07-13", + "2015-07-28", + "2015-08-07", + "2015-08-19", + "2015-09-03", + "2015-09-08", + "2015-09-23", + "2015-10-01", + "2015-10-12", + "2015-10-16", + "2016-02-03", + "2016-02-19", + "2016-02-22", + "2016-02-23", + "2016-02-29", + "2016-03-07", + "2016-06-15", + "2016-07-06", + "2016-10-19", + "2017-01-27", + "2017-02-14", + "2017-04-06", + "2017-05-25", + "2017-06-05", + "2017-08-15", + "2017-12-14", + "2018-01-23", + "2018-02-05", + "2018-02-06", + "2018-02-28", + "2018-05-21", + "2018-07-27", + "2018-08-23", + "2018-09-06", + "2018-09-24", + "2018-10-31", + "2018-11-08", + "2019-02-11", + "2019-02-19", + "2019-03-14", + "2019-05-16", + "2019-08-14", + "2019-09-09", + "2019-10-08", + "2019-10-17", + "2019-11-05", + "2019-12-03", + "2020-03-02", + "2020-08-27", + "2022-08-01", + "2022-11-15", + "2023-08-16", + "2023-10-16", + ] ] """ Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version. """ - connect: NotRequired["bool"] + connect: NotRequired[bool] """ Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). Defaults to `false`. """ @@ -267,7 +368,7 @@ class CreateParams(TypedDict): """ The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -284,25 +385,25 @@ class DeleteParams(TypedDict): pass class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -312,17 +413,255 @@ class UpdateParams(TypedDict): """ An optional description of what the webhook is used for. """ - disabled: NotRequired["bool"] + disabled: NotRequired[bool] """ Disable the webhook endpoint if set to true. """ enabled_events: NotRequired[ - "List[Literal['*', 'account.application.authorized', 'account.application.deauthorized', 'account.external_account.created', 'account.external_account.deleted', 'account.external_account.updated', 'account.updated', 'application_fee.created', 'application_fee.refund.updated', 'application_fee.refunded', 'balance.available', 'billing_portal.configuration.created', 'billing_portal.configuration.updated', 'billing_portal.session.created', 'capability.updated', 'cash_balance.funds_available', 'charge.captured', 'charge.dispute.closed', 'charge.dispute.created', 'charge.dispute.funds_reinstated', 'charge.dispute.funds_withdrawn', 'charge.dispute.updated', 'charge.expired', 'charge.failed', 'charge.pending', 'charge.refund.updated', 'charge.refunded', 'charge.succeeded', 'charge.updated', 'checkout.session.async_payment_failed', 'checkout.session.async_payment_succeeded', 'checkout.session.completed', 'checkout.session.expired', 'climate.order.canceled', 'climate.order.created', 'climate.order.delayed', 'climate.order.delivered', 'climate.order.product_substituted', 'climate.product.created', 'climate.product.pricing_updated', 'coupon.created', 'coupon.deleted', 'coupon.updated', 'credit_note.created', 'credit_note.updated', 'credit_note.voided', 'customer.created', 'customer.deleted', 'customer.discount.created', 'customer.discount.deleted', 'customer.discount.updated', 'customer.source.created', 'customer.source.deleted', 'customer.source.expiring', 'customer.source.updated', 'customer.subscription.created', 'customer.subscription.deleted', 'customer.subscription.paused', 'customer.subscription.pending_update_applied', 'customer.subscription.pending_update_expired', 'customer.subscription.resumed', 'customer.subscription.trial_will_end', 'customer.subscription.updated', 'customer.tax_id.created', 'customer.tax_id.deleted', 'customer.tax_id.updated', 'customer.updated', 'customer_cash_balance_transaction.created', 'file.created', 'financial_connections.account.created', 'financial_connections.account.deactivated', 'financial_connections.account.disconnected', 'financial_connections.account.reactivated', 'financial_connections.account.refreshed_balance', 'financial_connections.account.refreshed_ownership', 'financial_connections.account.refreshed_transactions', 'identity.verification_session.canceled', 'identity.verification_session.created', 'identity.verification_session.processing', 'identity.verification_session.redacted', 'identity.verification_session.requires_input', 'identity.verification_session.verified', 'invoice.created', 'invoice.deleted', 'invoice.finalization_failed', 'invoice.finalized', 'invoice.marked_uncollectible', 'invoice.paid', 'invoice.payment_action_required', 'invoice.payment_failed', 'invoice.payment_succeeded', 'invoice.sent', 'invoice.upcoming', 'invoice.updated', 'invoice.voided', 'invoiceitem.created', 'invoiceitem.deleted', 'issuing_authorization.created', 'issuing_authorization.request', 'issuing_authorization.updated', 'issuing_card.created', 'issuing_card.updated', 'issuing_cardholder.created', 'issuing_cardholder.updated', 'issuing_dispute.closed', 'issuing_dispute.created', 'issuing_dispute.funds_reinstated', 'issuing_dispute.submitted', 'issuing_dispute.updated', 'issuing_token.created', 'issuing_token.updated', 'issuing_transaction.created', 'issuing_transaction.updated', 'mandate.updated', 'payment_intent.amount_capturable_updated', 'payment_intent.canceled', 'payment_intent.created', 'payment_intent.partially_funded', 'payment_intent.payment_failed', 'payment_intent.processing', 'payment_intent.requires_action', 'payment_intent.succeeded', 'payment_link.created', 'payment_link.updated', 'payment_method.attached', 'payment_method.automatically_updated', 'payment_method.detached', 'payment_method.updated', 'payout.canceled', 'payout.created', 'payout.failed', 'payout.paid', 'payout.reconciliation_completed', 'payout.updated', 'person.created', 'person.deleted', 'person.updated', 'plan.created', 'plan.deleted', 'plan.updated', 'price.created', 'price.deleted', 'price.updated', 'product.created', 'product.deleted', 'product.updated', 'promotion_code.created', 'promotion_code.updated', 'quote.accepted', 'quote.canceled', 'quote.created', 'quote.finalized', 'radar.early_fraud_warning.created', 'radar.early_fraud_warning.updated', 'refund.created', 'refund.updated', 'reporting.report_run.failed', 'reporting.report_run.succeeded', 'reporting.report_type.updated', 'review.closed', 'review.opened', 'setup_intent.canceled', 'setup_intent.created', 'setup_intent.requires_action', 'setup_intent.setup_failed', 'setup_intent.succeeded', 'sigma.scheduled_query_run.created', 'source.canceled', 'source.chargeable', 'source.failed', 'source.mandate_notification', 'source.refund_attributes_required', 'source.transaction.created', 'source.transaction.updated', 'subscription_schedule.aborted', 'subscription_schedule.canceled', 'subscription_schedule.completed', 'subscription_schedule.created', 'subscription_schedule.expiring', 'subscription_schedule.released', 'subscription_schedule.updated', 'tax.settings.updated', 'tax_rate.created', 'tax_rate.updated', 'terminal.reader.action_failed', 'terminal.reader.action_succeeded', 'test_helpers.test_clock.advancing', 'test_helpers.test_clock.created', 'test_helpers.test_clock.deleted', 'test_helpers.test_clock.internal_failure', 'test_helpers.test_clock.ready', 'topup.canceled', 'topup.created', 'topup.failed', 'topup.reversed', 'topup.succeeded', 'transfer.created', 'transfer.reversed', 'transfer.updated', 'treasury.credit_reversal.created', 'treasury.credit_reversal.posted', 'treasury.debit_reversal.completed', 'treasury.debit_reversal.created', 'treasury.debit_reversal.initial_credit_granted', 'treasury.financial_account.closed', 'treasury.financial_account.created', 'treasury.financial_account.features_status_updated', 'treasury.inbound_transfer.canceled', 'treasury.inbound_transfer.created', 'treasury.inbound_transfer.failed', 'treasury.inbound_transfer.succeeded', 'treasury.outbound_payment.canceled', 'treasury.outbound_payment.created', 'treasury.outbound_payment.expected_arrival_date_updated', 'treasury.outbound_payment.failed', 'treasury.outbound_payment.posted', 'treasury.outbound_payment.returned', 'treasury.outbound_transfer.canceled', 'treasury.outbound_transfer.created', 'treasury.outbound_transfer.expected_arrival_date_updated', 'treasury.outbound_transfer.failed', 'treasury.outbound_transfer.posted', 'treasury.outbound_transfer.returned', 'treasury.received_credit.created', 'treasury.received_credit.failed', 'treasury.received_credit.succeeded', 'treasury.received_debit.created', 'invoiceitem.updated', 'order.created', 'recipient.created', 'recipient.deleted', 'recipient.updated', 'sku.created', 'sku.deleted', 'sku.updated']]" + List[ + Literal[ + "*", + "account.application.authorized", + "account.application.deauthorized", + "account.external_account.created", + "account.external_account.deleted", + "account.external_account.updated", + "account.updated", + "application_fee.created", + "application_fee.refund.updated", + "application_fee.refunded", + "balance.available", + "billing_portal.configuration.created", + "billing_portal.configuration.updated", + "billing_portal.session.created", + "capability.updated", + "cash_balance.funds_available", + "charge.captured", + "charge.dispute.closed", + "charge.dispute.created", + "charge.dispute.funds_reinstated", + "charge.dispute.funds_withdrawn", + "charge.dispute.updated", + "charge.expired", + "charge.failed", + "charge.pending", + "charge.refund.updated", + "charge.refunded", + "charge.succeeded", + "charge.updated", + "checkout.session.async_payment_failed", + "checkout.session.async_payment_succeeded", + "checkout.session.completed", + "checkout.session.expired", + "climate.order.canceled", + "climate.order.created", + "climate.order.delayed", + "climate.order.delivered", + "climate.order.product_substituted", + "climate.product.created", + "climate.product.pricing_updated", + "coupon.created", + "coupon.deleted", + "coupon.updated", + "credit_note.created", + "credit_note.updated", + "credit_note.voided", + "customer.created", + "customer.deleted", + "customer.discount.created", + "customer.discount.deleted", + "customer.discount.updated", + "customer.source.created", + "customer.source.deleted", + "customer.source.expiring", + "customer.source.updated", + "customer.subscription.created", + "customer.subscription.deleted", + "customer.subscription.paused", + "customer.subscription.pending_update_applied", + "customer.subscription.pending_update_expired", + "customer.subscription.resumed", + "customer.subscription.trial_will_end", + "customer.subscription.updated", + "customer.tax_id.created", + "customer.tax_id.deleted", + "customer.tax_id.updated", + "customer.updated", + "customer_cash_balance_transaction.created", + "file.created", + "financial_connections.account.created", + "financial_connections.account.deactivated", + "financial_connections.account.disconnected", + "financial_connections.account.reactivated", + "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_ownership", + "financial_connections.account.refreshed_transactions", + "identity.verification_session.canceled", + "identity.verification_session.created", + "identity.verification_session.processing", + "identity.verification_session.redacted", + "identity.verification_session.requires_input", + "identity.verification_session.verified", + "invoice.created", + "invoice.deleted", + "invoice.finalization_failed", + "invoice.finalized", + "invoice.marked_uncollectible", + "invoice.paid", + "invoice.payment_action_required", + "invoice.payment_failed", + "invoice.payment_succeeded", + "invoice.sent", + "invoice.upcoming", + "invoice.updated", + "invoice.voided", + "invoiceitem.created", + "invoiceitem.deleted", + "issuing_authorization.created", + "issuing_authorization.request", + "issuing_authorization.updated", + "issuing_card.created", + "issuing_card.updated", + "issuing_cardholder.created", + "issuing_cardholder.updated", + "issuing_dispute.closed", + "issuing_dispute.created", + "issuing_dispute.funds_reinstated", + "issuing_dispute.submitted", + "issuing_dispute.updated", + "issuing_token.created", + "issuing_token.updated", + "issuing_transaction.created", + "issuing_transaction.updated", + "mandate.updated", + "payment_intent.amount_capturable_updated", + "payment_intent.canceled", + "payment_intent.created", + "payment_intent.partially_funded", + "payment_intent.payment_failed", + "payment_intent.processing", + "payment_intent.requires_action", + "payment_intent.succeeded", + "payment_link.created", + "payment_link.updated", + "payment_method.attached", + "payment_method.automatically_updated", + "payment_method.detached", + "payment_method.updated", + "payout.canceled", + "payout.created", + "payout.failed", + "payout.paid", + "payout.reconciliation_completed", + "payout.updated", + "person.created", + "person.deleted", + "person.updated", + "plan.created", + "plan.deleted", + "plan.updated", + "price.created", + "price.deleted", + "price.updated", + "product.created", + "product.deleted", + "product.updated", + "promotion_code.created", + "promotion_code.updated", + "quote.accepted", + "quote.canceled", + "quote.created", + "quote.finalized", + "radar.early_fraud_warning.created", + "radar.early_fraud_warning.updated", + "refund.created", + "refund.updated", + "reporting.report_run.failed", + "reporting.report_run.succeeded", + "reporting.report_type.updated", + "review.closed", + "review.opened", + "setup_intent.canceled", + "setup_intent.created", + "setup_intent.requires_action", + "setup_intent.setup_failed", + "setup_intent.succeeded", + "sigma.scheduled_query_run.created", + "source.canceled", + "source.chargeable", + "source.failed", + "source.mandate_notification", + "source.refund_attributes_required", + "source.transaction.created", + "source.transaction.updated", + "subscription_schedule.aborted", + "subscription_schedule.canceled", + "subscription_schedule.completed", + "subscription_schedule.created", + "subscription_schedule.expiring", + "subscription_schedule.released", + "subscription_schedule.updated", + "tax.settings.updated", + "tax_rate.created", + "tax_rate.updated", + "terminal.reader.action_failed", + "terminal.reader.action_succeeded", + "test_helpers.test_clock.advancing", + "test_helpers.test_clock.created", + "test_helpers.test_clock.deleted", + "test_helpers.test_clock.internal_failure", + "test_helpers.test_clock.ready", + "topup.canceled", + "topup.created", + "topup.failed", + "topup.reversed", + "topup.succeeded", + "transfer.created", + "transfer.reversed", + "transfer.updated", + "treasury.credit_reversal.created", + "treasury.credit_reversal.posted", + "treasury.debit_reversal.completed", + "treasury.debit_reversal.created", + "treasury.debit_reversal.initial_credit_granted", + "treasury.financial_account.closed", + "treasury.financial_account.created", + "treasury.financial_account.features_status_updated", + "treasury.inbound_transfer.canceled", + "treasury.inbound_transfer.created", + "treasury.inbound_transfer.failed", + "treasury.inbound_transfer.succeeded", + "treasury.outbound_payment.canceled", + "treasury.outbound_payment.created", + "treasury.outbound_payment.expected_arrival_date_updated", + "treasury.outbound_payment.failed", + "treasury.outbound_payment.posted", + "treasury.outbound_payment.returned", + "treasury.outbound_transfer.canceled", + "treasury.outbound_transfer.created", + "treasury.outbound_transfer.expected_arrival_date_updated", + "treasury.outbound_transfer.failed", + "treasury.outbound_transfer.posted", + "treasury.outbound_transfer.returned", + "treasury.received_credit.created", + "treasury.received_credit.failed", + "treasury.received_credit.succeeded", + "treasury.received_debit.created", + "invoiceitem.updated", + "order.created", + "recipient.created", + "recipient.deleted", + "recipient.updated", + "sku.created", + "sku.deleted", + "sku.updated", + ] + ] ] """ The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -330,7 +669,7 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - url: NotRequired["str"] + url: NotRequired[str] """ The URL of the webhook endpoint. """ diff --git a/stripe/apps/_secret.py b/stripe/apps/_secret.py index f10d8797a..59b84c323 100644 --- a/stripe/apps/_secret.py +++ b/stripe/apps/_secret.py @@ -35,11 +35,11 @@ class Scope(StripeObject): """ class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The Unix timestamp for the expiry time of the secret, after which the secret deletes. """ @@ -61,13 +61,13 @@ class CreateParamsScope(TypedDict): """ The secret scope type. """ - user: NotRequired["str"] + user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ class DeleteWhereParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -85,13 +85,13 @@ class DeleteWhereParamsScope(TypedDict): """ The secret scope type. """ - user: NotRequired["str"] + user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ class FindParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -109,21 +109,21 @@ class FindParamsScope(TypedDict): """ The secret scope type. """ - user: NotRequired["str"] + user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -131,7 +131,7 @@ class ListParams(RequestOptions): """ Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. """ - starting_after: NotRequired["str"] + 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. """ @@ -141,7 +141,7 @@ class ListParamsScope(TypedDict): """ The secret scope type. """ - user: NotRequired["str"] + user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ diff --git a/stripe/apps/_secret_service.py b/stripe/apps/_secret_service.py index 318bed591..1806cb381 100644 --- a/stripe/apps/_secret_service.py +++ b/stripe/apps/_secret_service.py @@ -10,11 +10,11 @@ class SecretService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ The Unix timestamp for the expiry time of the secret, after which the secret deletes. """ @@ -36,13 +36,13 @@ class CreateParamsScope(TypedDict): """ The secret scope type. """ - user: NotRequired["str"] + user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ class DeleteWhereParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -60,13 +60,13 @@ class DeleteWhereParamsScope(TypedDict): """ The secret scope type. """ - user: NotRequired["str"] + user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ class FindParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -84,21 +84,21 @@ class FindParamsScope(TypedDict): """ The secret scope type. """ - user: NotRequired["str"] + user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -106,7 +106,7 @@ class ListParams(TypedDict): """ Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. """ - starting_after: NotRequired["str"] + 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. """ @@ -116,7 +116,7 @@ class ListParamsScope(TypedDict): """ The secret scope type. """ - user: NotRequired["str"] + user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index 7e9fb906c..293f384dd 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -189,7 +189,7 @@ class CreateParams(RequestOptions): """ The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -201,7 +201,7 @@ class CreateParams(RequestOptions): """ The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -211,11 +211,11 @@ class CreateParamsBusinessProfile(TypedDict): """ The messaging shown to customers in the portal. """ - privacy_policy_url: NotRequired["str"] + privacy_policy_url: NotRequired[str] """ A link to the business's publicly available privacy policy. """ - terms_of_service_url: NotRequired["str"] + terms_of_service_url: NotRequired[str] """ A link to the business's publicly available terms of service. """ @@ -293,12 +293,12 @@ class CreateParamsFeaturesSubscriptionCancel(TypedDict): """ Whether the feature is enabled. """ - mode: NotRequired["Literal['at_period_end', 'immediately']"] + mode: NotRequired[Literal["at_period_end", "immediately"]] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. @@ -329,7 +329,7 @@ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): """ class CreateParamsFeaturesSubscriptionPause(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether the feature is enabled. """ @@ -355,7 +355,7 @@ class CreateParamsFeaturesSubscriptionUpdate(TypedDict): The list of up to 10 products that support subscription updates. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. @@ -378,33 +378,33 @@ class CreateParamsLoginPage(TypedDict): """ class ListParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Only return configurations that are active or inactive (e.g., pass `true` to only list active configurations). """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - is_default: NotRequired["bool"] + is_default: NotRequired[bool] """ Only return the default or non-default configurations (e.g., pass `true` to only list the default configuration). """ - limit: NotRequired["int"] + 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"] + 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. """ class ModifyParams(RequestOptions): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the configuration is active and can be used to create portal sessions. """ @@ -418,7 +418,7 @@ class ModifyParams(RequestOptions): """ The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -494,7 +494,7 @@ class ModifyParamsFeaturesCustomerUpdate(TypedDict): """ The types of customer updates that are supported. When empty, customers are not updateable. """ - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether the feature is enabled. """ @@ -518,16 +518,16 @@ class ModifyParamsFeaturesSubscriptionCancel(TypedDict): """ Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer """ - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether the feature is enabled. """ - mode: NotRequired["Literal['at_period_end', 'immediately']"] + mode: NotRequired[Literal["at_period_end", "immediately"]] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. @@ -546,7 +546,7 @@ class ModifyParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): """ class ModifyParamsFeaturesSubscriptionPause(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether the feature is enabled. """ @@ -558,7 +558,7 @@ class ModifyParamsFeaturesSubscriptionUpdate(TypedDict): """ The types of subscription updates that are supported. When empty, subscriptions are not updateable. """ - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether the feature is enabled. """ @@ -569,7 +569,7 @@ class ModifyParamsFeaturesSubscriptionUpdate(TypedDict): The list of up to 10 products that support subscription updates. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. @@ -594,7 +594,7 @@ class ModifyParamsLoginPage(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/billing_portal/_configuration_service.py b/stripe/billing_portal/_configuration_service.py index 32f0eea86..40d79de28 100644 --- a/stripe/billing_portal/_configuration_service.py +++ b/stripe/billing_portal/_configuration_service.py @@ -19,7 +19,7 @@ class CreateParams(TypedDict): """ The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -31,7 +31,7 @@ class CreateParams(TypedDict): """ The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -41,11 +41,11 @@ class CreateParamsBusinessProfile(TypedDict): """ The messaging shown to customers in the portal. """ - privacy_policy_url: NotRequired["str"] + privacy_policy_url: NotRequired[str] """ A link to the business's publicly available privacy policy. """ - terms_of_service_url: NotRequired["str"] + terms_of_service_url: NotRequired[str] """ A link to the business's publicly available terms of service. """ @@ -123,12 +123,12 @@ class CreateParamsFeaturesSubscriptionCancel(TypedDict): """ Whether the feature is enabled. """ - mode: NotRequired["Literal['at_period_end', 'immediately']"] + mode: NotRequired[Literal["at_period_end", "immediately"]] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. @@ -159,7 +159,7 @@ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): """ class CreateParamsFeaturesSubscriptionPause(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether the feature is enabled. """ @@ -185,7 +185,7 @@ class CreateParamsFeaturesSubscriptionUpdate(TypedDict): The list of up to 10 products that support subscription updates. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. @@ -208,39 +208,39 @@ class CreateParamsLoginPage(TypedDict): """ class ListParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Only return configurations that are active or inactive (e.g., pass `true` to only list active configurations). """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - is_default: NotRequired["bool"] + is_default: NotRequired[bool] """ Only return the default or non-default configurations (e.g., pass `true` to only list the default configuration). """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - active: NotRequired["bool"] + active: NotRequired[bool] """ Whether the configuration is active and can be used to create portal sessions. """ @@ -254,7 +254,7 @@ class UpdateParams(TypedDict): """ The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -330,7 +330,7 @@ class UpdateParamsFeaturesCustomerUpdate(TypedDict): """ The types of customer updates that are supported. When empty, customers are not updateable. """ - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether the feature is enabled. """ @@ -354,16 +354,16 @@ class UpdateParamsFeaturesSubscriptionCancel(TypedDict): """ Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer """ - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether the feature is enabled. """ - mode: NotRequired["Literal['at_period_end', 'immediately']"] + mode: NotRequired[Literal["at_period_end", "immediately"]] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. @@ -382,7 +382,7 @@ class UpdateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): """ class UpdateParamsFeaturesSubscriptionPause(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether the feature is enabled. """ @@ -394,7 +394,7 @@ class UpdateParamsFeaturesSubscriptionUpdate(TypedDict): """ The types of subscription updates that are supported. When empty, subscriptions are not updateable. """ - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Whether the feature is enabled. """ @@ -405,7 +405,7 @@ class UpdateParamsFeaturesSubscriptionUpdate(TypedDict): The list of up to 10 products that support subscription updates. """ proration_behavior: NotRequired[ - "Literal['always_invoice', 'create_prorations', 'none']" + Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index 001041d1d..479797a13 100644 --- a/stripe/billing_portal/_session.py +++ b/stripe/billing_portal/_session.py @@ -173,7 +173,7 @@ class Item(StripeObject): } class CreateParams(RequestOptions): - configuration: NotRequired["str"] + configuration: NotRequired[str] """ The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration. """ @@ -181,7 +181,7 @@ class CreateParams(RequestOptions): """ The ID of an existing customer. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -190,16 +190,64 @@ class CreateParams(RequestOptions): Information about a specific flow for the customer to go through. See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. """ locale: NotRequired[ - "Literal['auto', 'bg', 'cs', 'da', 'de', 'el', 'en', 'en-AU', 'en-CA', 'en-GB', 'en-IE', 'en-IN', 'en-NZ', 'en-SG', 'es', 'es-419', 'et', 'fi', 'fil', 'fr', 'fr-CA', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lt', 'lv', 'ms', 'mt', 'nb', 'nl', 'pl', 'pt', 'pt-BR', 'ro', 'ru', 'sk', 'sl', 'sv', 'th', 'tr', 'vi', 'zh', 'zh-HK', 'zh-TW']" + Literal[ + "auto", + "bg", + "cs", + "da", + "de", + "el", + "en", + "en-AU", + "en-CA", + "en-GB", + "en-IE", + "en-IN", + "en-NZ", + "en-SG", + "es", + "es-419", + "et", + "fi", + "fil", + "fr", + "fr-CA", + "hr", + "hu", + "id", + "it", + "ja", + "ko", + "lt", + "lv", + "ms", + "mt", + "nb", + "nl", + "pl", + "pt", + "pt-BR", + "ro", + "ru", + "sk", + "sl", + "sv", + "th", + "tr", + "vi", + "zh", + "zh-HK", + "zh-TW", + ] ] """ The IETF language tag of the locale customer portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The default URL to redirect customers to when they click on the portal's link to return to your website. """ @@ -258,7 +306,7 @@ class CreateParamsFlowDataAfterCompletion(TypedDict): """ class CreateParamsFlowDataAfterCompletionHostedConfirmation(TypedDict): - custom_message: NotRequired["str"] + custom_message: NotRequired[str] """ A custom message to display to the customer after the flow is completed. """ @@ -307,7 +355,9 @@ class CreateParamsFlowDataSubscriptionUpdate(TypedDict): class CreateParamsFlowDataSubscriptionUpdateConfirm(TypedDict): discounts: NotRequired[ - "List[Session.CreateParamsFlowDataSubscriptionUpdateConfirmDiscount]" + List[ + "Session.CreateParamsFlowDataSubscriptionUpdateConfirmDiscount" + ] ] """ The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. @@ -324,11 +374,11 @@ class CreateParamsFlowDataSubscriptionUpdateConfirm(TypedDict): """ class CreateParamsFlowDataSubscriptionUpdateConfirmDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The ID of the coupon to apply to this subscription update. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ The ID of a promotion code to apply to this subscription update. """ @@ -338,11 +388,11 @@ class CreateParamsFlowDataSubscriptionUpdateConfirmItem(TypedDict): """ The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. """ - price: NotRequired["str"] + price: NotRequired[str] """ The price the customer should subscribe to through this flow. The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. """ diff --git a/stripe/billing_portal/_session_service.py b/stripe/billing_portal/_session_service.py index 250e4031f..0a173db8d 100644 --- a/stripe/billing_portal/_session_service.py +++ b/stripe/billing_portal/_session_service.py @@ -9,7 +9,7 @@ class SessionService(StripeService): class CreateParams(TypedDict): - configuration: NotRequired["str"] + configuration: NotRequired[str] """ The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration. """ @@ -17,7 +17,7 @@ class CreateParams(TypedDict): """ The ID of an existing customer. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -26,16 +26,64 @@ class CreateParams(TypedDict): Information about a specific flow for the customer to go through. See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. """ locale: NotRequired[ - "Literal['auto', 'bg', 'cs', 'da', 'de', 'el', 'en', 'en-AU', 'en-CA', 'en-GB', 'en-IE', 'en-IN', 'en-NZ', 'en-SG', 'es', 'es-419', 'et', 'fi', 'fil', 'fr', 'fr-CA', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lt', 'lv', 'ms', 'mt', 'nb', 'nl', 'pl', 'pt', 'pt-BR', 'ro', 'ru', 'sk', 'sl', 'sv', 'th', 'tr', 'vi', 'zh', 'zh-HK', 'zh-TW']" + Literal[ + "auto", + "bg", + "cs", + "da", + "de", + "el", + "en", + "en-AU", + "en-CA", + "en-GB", + "en-IE", + "en-IN", + "en-NZ", + "en-SG", + "es", + "es-419", + "et", + "fi", + "fil", + "fr", + "fr-CA", + "hr", + "hu", + "id", + "it", + "ja", + "ko", + "lt", + "lv", + "ms", + "mt", + "nb", + "nl", + "pl", + "pt", + "pt-BR", + "ro", + "ru", + "sk", + "sl", + "sv", + "th", + "tr", + "vi", + "zh", + "zh-HK", + "zh-TW", + ] ] """ The IETF language tag of the locale customer portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The default URL to redirect customers to when they click on the portal's link to return to your website. """ @@ -94,7 +142,7 @@ class CreateParamsFlowDataAfterCompletion(TypedDict): """ class CreateParamsFlowDataAfterCompletionHostedConfirmation(TypedDict): - custom_message: NotRequired["str"] + custom_message: NotRequired[str] """ A custom message to display to the customer after the flow is completed. """ @@ -143,7 +191,9 @@ class CreateParamsFlowDataSubscriptionUpdate(TypedDict): class CreateParamsFlowDataSubscriptionUpdateConfirm(TypedDict): discounts: NotRequired[ - "List[SessionService.CreateParamsFlowDataSubscriptionUpdateConfirmDiscount]" + List[ + "SessionService.CreateParamsFlowDataSubscriptionUpdateConfirmDiscount" + ] ] """ The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. @@ -160,11 +210,11 @@ class CreateParamsFlowDataSubscriptionUpdateConfirm(TypedDict): """ class CreateParamsFlowDataSubscriptionUpdateConfirmDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The ID of the coupon to apply to this subscription update. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ The ID of a promotion code to apply to this subscription update. """ @@ -174,11 +224,11 @@ class CreateParamsFlowDataSubscriptionUpdateConfirmItem(TypedDict): """ The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. """ - price: NotRequired["str"] + price: NotRequired[str] """ The price the customer should subscribe to through this flow. The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 3c82a846e..86bf8eaaa 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1473,7 +1473,7 @@ class CreateParams(RequestOptions): """ Configure actions after a Checkout Session has expired. """ - allow_promotion_codes: NotRequired["bool"] + allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes. """ @@ -1481,15 +1481,15 @@ class CreateParams(RequestOptions): """ Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. """ - billing_address_collection: NotRequired["Literal['auto', 'required']"] + billing_address_collection: NotRequired[Literal["auto", "required"]] """ Specify whether Checkout should collect the customer's billing address. Defaults to `auto`. """ - cancel_url: NotRequired["str"] + cancel_url: NotRequired[str] """ If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. """ - client_reference_id: NotRequired["str"] + client_reference_id: NotRequired[str] """ A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the @@ -1501,11 +1501,11 @@ class CreateParams(RequestOptions): """ Configure fields for the Checkout Session to gather active consent from customers. """ - currency: NotRequired["str"] + currency: NotRequired[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). Required in `setup` mode when `payment_method_types` is not set. """ - custom_fields: NotRequired["List[Session.CreateParamsCustomField]"] + custom_fields: NotRequired[List["Session.CreateParamsCustomField"]] """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. """ @@ -1513,7 +1513,7 @@ class CreateParams(RequestOptions): """ Display additional text for your customers using custom text. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ ID of an existing Customer, if one exists. In `payment` mode, the customer's most recently saved card payment method will be used to prefill the email, name, card details, and billing address @@ -1527,7 +1527,7 @@ class CreateParams(RequestOptions): You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. """ - customer_creation: NotRequired["Literal['always', 'if_required']"] + customer_creation: NotRequired[Literal["always", "if_required"]] """ Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. @@ -1539,7 +1539,7 @@ class CreateParams(RequestOptions): Can only be set in `payment` and `setup` mode. """ - customer_email: NotRequired["str"] + customer_email: NotRequired[str] """ If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. @@ -1551,15 +1551,15 @@ class CreateParams(RequestOptions): """ Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when `customer` is provided. """ - discounts: NotRequired["List[Session.CreateParamsDiscount]"] + discounts: NotRequired[List["Session.CreateParamsDiscount"]] """ The coupon or promotion code to apply to this Session. Currently, only up to one may be specified. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ 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. """ @@ -1567,7 +1567,7 @@ class CreateParams(RequestOptions): """ Generate a post-purchase Invoice for one-time payments. """ - line_items: NotRequired["List[Session.CreateParamsLineItem]"] + line_items: NotRequired[List["Session.CreateParamsLineItem"]] """ A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). @@ -1576,16 +1576,58 @@ class CreateParams(RequestOptions): For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. Line items with one-time Prices will be on the initial invoice only. """ locale: NotRequired[ - "Literal['auto', 'bg', 'cs', 'da', 'de', 'el', 'en', 'en-GB', 'es', 'es-419', 'et', 'fi', 'fil', 'fr', 'fr-CA', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lt', 'lv', 'ms', 'mt', 'nb', 'nl', 'pl', 'pt', 'pt-BR', 'ro', 'ru', 'sk', 'sl', 'sv', 'th', 'tr', 'vi', 'zh', 'zh-HK', 'zh-TW']" + Literal[ + "auto", + "bg", + "cs", + "da", + "de", + "el", + "en", + "en-GB", + "es", + "es-419", + "et", + "fi", + "fil", + "fr", + "fr-CA", + "hr", + "hu", + "id", + "it", + "ja", + "ko", + "lt", + "lv", + "ms", + "mt", + "nb", + "nl", + "pl", + "pt", + "pt-BR", + "ro", + "ru", + "sk", + "sl", + "sv", + "th", + "tr", + "vi", + "zh", + "zh-HK", + "zh-TW", + ] ] """ The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - mode: NotRequired["Literal['payment', 'setup', 'subscription']"] + mode: NotRequired[Literal["payment", "setup", "subscription"]] """ The mode of the Checkout Session. Pass `subscription` if the Checkout Session includes at least one recurring item. """ @@ -1596,7 +1638,7 @@ class CreateParams(RequestOptions): A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ payment_method_collection: NotRequired[ - "Literal['always', 'if_required']" + Literal["always", "if_required"] ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. @@ -1606,7 +1648,7 @@ class CreateParams(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://stripe.com/docs/payments/checkout/free-trials). """ - payment_method_configuration: NotRequired["str"] + payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this Checkout session. """ @@ -1617,7 +1659,43 @@ class CreateParams(RequestOptions): Payment-method-specific configuration. """ payment_method_types: NotRequired[ - "List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']]" + List[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "card", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "revolut_pay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + "zip", + ] + ] ] """ A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. @@ -1642,12 +1720,12 @@ class CreateParams(RequestOptions): before using this feature. Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers). """ redirect_on_completion: NotRequired[ - "Literal['always', 'if_required', 'never']" + Literal["always", "if_required", "never"] ] """ This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. This parameter is required if ui_mode is `embedded` @@ -1664,12 +1742,12 @@ class CreateParams(RequestOptions): When set, provides configuration for Checkout to collect a shipping address from a customer. """ shipping_options: NotRequired[ - "List[Session.CreateParamsShippingOption]" + List["Session.CreateParamsShippingOption"] ] """ The shipping rate options to apply to this Session. Up to a maximum of 5. """ - submit_type: NotRequired["Literal['auto', 'book', 'donate', 'pay']"] + submit_type: NotRequired[Literal["auto", "book", "donate", "pay"]] """ Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. `submit_type` can only be @@ -1679,7 +1757,7 @@ class CreateParams(RequestOptions): """ A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. """ - success_url: NotRequired["str"] + success_url: NotRequired[str] """ The URL to which Stripe should send customers when payment or setup is complete. @@ -1691,7 +1769,7 @@ class CreateParams(RequestOptions): """ Controls tax ID collection settings for the session. """ - ui_mode: NotRequired["Literal['embedded', 'hosted']"] + ui_mode: NotRequired[Literal["embedded", "hosted"]] """ The UI mode of the Session. Defaults to `hosted`. """ @@ -1703,7 +1781,7 @@ class CreateParamsAfterExpiration(TypedDict): """ class CreateParamsAfterExpirationRecovery(TypedDict): - allow_promotion_codes: NotRequired["bool"] + allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false` """ @@ -1725,7 +1803,7 @@ class CreateParamsAutomaticTax(TypedDict): """ class CreateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1741,13 +1819,13 @@ class CreateParamsConsentCollection(TypedDict): """ Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. """ - promotions: NotRequired["Literal['auto', 'none']"] + promotions: NotRequired[Literal["auto", "none"]] """ If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. Only available to US merchants. """ - terms_of_service: NotRequired["Literal['none', 'required']"] + terms_of_service: NotRequired[Literal["none", "required"]] """ If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). @@ -1777,7 +1855,7 @@ class CreateParamsCustomField(TypedDict): """ Configuration for `type=numeric` fields. """ - optional: NotRequired["bool"] + optional: NotRequired[bool] """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ @@ -1817,21 +1895,21 @@ class CreateParamsCustomFieldLabel(TypedDict): """ class CreateParamsCustomFieldNumeric(TypedDict): - maximum_length: NotRequired["int"] + maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ - minimum_length: NotRequired["int"] + minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class CreateParamsCustomFieldText(TypedDict): - maximum_length: NotRequired["int"] + maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ - minimum_length: NotRequired["int"] + minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ @@ -1885,27 +1963,27 @@ class CreateParamsCustomTextTermsOfServiceAcceptance(TypedDict): """ class CreateParamsCustomerUpdate(TypedDict): - address: NotRequired["Literal['auto', 'never']"] + address: NotRequired[Literal["auto", "never"]] """ Describes whether Checkout saves the billing address onto `customer.address`. To always collect a full billing address, use `billing_address_collection`. Defaults to `never`. """ - name: NotRequired["Literal['auto', 'never']"] + name: NotRequired[Literal["auto", "never"]] """ Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`. """ - shipping: NotRequired["Literal['auto', 'never']"] + shipping: NotRequired[Literal["auto", "never"]] """ Describes whether Checkout saves shipping information onto `customer.shipping`. To collect shipping information, use `shipping_address_collection`. Defaults to `never`. """ class CreateParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The ID of the coupon to apply to this Session. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ The ID of a promotion code to apply to this Session. """ @@ -1933,11 +2011,11 @@ class CreateParamsInvoiceCreationInvoiceData(TypedDict): """ Default custom fields to be displayed on invoices for this customer. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ @@ -1947,7 +2025,7 @@ class CreateParamsInvoiceCreationInvoiceData(TypedDict): """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -1969,7 +2047,7 @@ class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): """ class CreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1993,11 +2071,11 @@ class CreateParamsLineItem(TypedDict): """ When set, provides configuration for this item's quantity to be adjusted by the customer during Checkout. """ - dynamic_tax_rates: NotRequired["List[str]"] + dynamic_tax_rates: NotRequired[List[str]] """ The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price` or `price_data` is required. """ @@ -2005,11 +2083,11 @@ class CreateParamsLineItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`. """ - tax_rates: NotRequired["List[str]"] + tax_rates: NotRequired[List[str]] """ The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item. """ @@ -2019,11 +2097,11 @@ class CreateParamsLineItemAdjustableQuantity(TypedDict): """ Set to true if the quantity can be adjusted to any non-negative integer. By default customers will be able to remove the line item by setting the quantity to 0. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0. """ @@ -2033,7 +2111,7 @@ class CreateParamsLineItemPriceData(TypedDict): """ 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). """ - product: NotRequired["str"] + product: NotRequired[str] """ The ID of the product that this price will belong to. One of `product` or `product_data` is required. """ @@ -2050,30 +2128,30 @@ class CreateParamsLineItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsLineItemPriceDataProductData(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ - images: NotRequired["List[str]"] + images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -2081,7 +2159,7 @@ class CreateParamsLineItemPriceDataProductData(TypedDict): """ The product's name, meant to be displayable to the customer. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ @@ -2091,41 +2169,41 @@ class CreateParamsLineItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsPaymentIntentData(TypedDict): - application_fee_amount: NotRequired["int"] + 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ capture_method: NotRequired[ - "Literal['automatic', 'automatic_async', 'manual']" + Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The Stripe account ID for which these funds are intended. For details, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - receipt_email: NotRequired["str"] + receipt_email: NotRequired[str] """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ - setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] + setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. @@ -2152,12 +2230,12 @@ class CreateParamsPaymentIntentData(TypedDict): """ Shipping information for this payment. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete @@ -2170,7 +2248,7 @@ class CreateParamsPaymentIntentData(TypedDict): The parameters used to automatically create a Transfer when the payment succeeds. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ @@ -2180,7 +2258,7 @@ class CreateParamsPaymentIntentDataShipping(TypedDict): """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ @@ -2188,21 +2266,21 @@ class CreateParamsPaymentIntentDataShipping(TypedDict): """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsPaymentIntentDataShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ @@ -2210,21 +2288,21 @@ class CreateParamsPaymentIntentDataShippingAddress(TypedDict): """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPaymentIntentDataTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ @@ -2379,7 +2457,7 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired["Literal['cad', 'usd']"] + currency: NotRequired[Literal["cad", "usd"]] """ 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). This is only accepted for Checkout Sessions in `setup` mode. """ @@ -2390,7 +2468,7 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['none', 'off_session', 'on_session']" + Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2400,7 +2478,7 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -2413,27 +2491,27 @@ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired["List[Literal['invoice', 'subscription']]"] + default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. Only usable in `setup` mode. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2443,7 +2521,7 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): """ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2453,7 +2531,7 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2463,7 +2541,7 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): """ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2474,7 +2552,7 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): setup_future_usage: NotRequired[ - "Literal['none', 'off_session', 'on_session']" + Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2485,7 +2563,7 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2495,12 +2573,12 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ - "Literal['none', 'off_session', 'on_session']" + Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2518,12 +2596,12 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): Installment options for card payments """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ - setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] + setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2531,17 +2609,17 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ - statement_descriptor_suffix_kana: NotRequired["str"] + statement_descriptor_suffix_kana: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ - statement_descriptor_suffix_kanji: NotRequired["str"] + statement_descriptor_suffix_kanji: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Setting to true enables installments for this Checkout Session. Setting to false will prevent any installment plan from applying to a payment. @@ -2549,7 +2627,7 @@ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): class CreateParamsPaymentMethodOptionsCashapp(TypedDict): setup_future_usage: NotRequired[ - "Literal['none', 'off_session', 'on_session']" + Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2566,11 +2644,11 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["Literal['bank_transfer']"] + funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2589,7 +2667,17 @@ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Configuration for eu_bank_transfer funding type. """ requested_address_types: NotRequired[ - "List[Literal['aba', 'iban', 'sepa', 'sort_code', 'spei', 'swift', 'zengin']]" + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. @@ -2616,7 +2704,7 @@ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( """ class CreateParamsPaymentMethodOptionsEps(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2626,7 +2714,7 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2636,7 +2724,7 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2646,7 +2734,7 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2656,7 +2744,7 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): """ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2666,7 +2754,7 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): """ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2676,11 +2764,11 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2690,7 +2778,7 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): """ class CreateParamsPaymentMethodOptionsLink(TypedDict): - setup_future_usage: NotRequired["Literal['none', 'off_session']"] + setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2700,11 +2788,11 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2714,7 +2802,7 @@ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): """ class CreateParamsPaymentMethodOptionsP24(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2722,13 +2810,13 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ - tos_shown_and_accepted: NotRequired["bool"] + tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2743,16 +2831,38 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ - risk_correlation_id: NotRequired["str"] + risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ @@ -2770,13 +2880,13 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): """ class CreateParamsPaymentMethodOptionsPix(TypedDict): - expires_after_seconds: NotRequired["int"] + expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): - setup_future_usage: NotRequired["Literal['none', 'off_session']"] + setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2787,7 +2897,7 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): setup_future_usage: NotRequired[ - "Literal['none', 'off_session', 'on_session']" + Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2798,7 +2908,7 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsSofort(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2821,7 +2931,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for Financial Connections Session creation """ setup_future_usage: NotRequired[ - "Literal['none', 'off_session', 'on_session']" + Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2830,7 +2940,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ - verification_method: NotRequired["Literal['automatic', 'instant']"] + verification_method: NotRequired[Literal["automatic", "instant"]] """ Verification method for the intent """ @@ -2839,18 +2949,22 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): - app_id: NotRequired["str"] + app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ @@ -2858,7 +2972,7 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2874,15 +2988,15 @@ class CreateParamsPhoneNumberCollection(TypedDict): """ class CreateParamsSetupIntentData(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The Stripe account for which the setup is intended. """ @@ -3135,7 +3249,7 @@ class CreateParamsShippingAddressCollection(TypedDict): """ class CreateParamsShippingOption(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the Shipping Rate to use for this shipping option. """ @@ -3163,21 +3277,21 @@ class CreateParamsShippingOptionShippingRateData(TypedDict): """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ - type: NotRequired["Literal['fixed_amount']"] + type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. """ @@ -3232,7 +3346,10 @@ class CreateParamsShippingOptionShippingRateDataFixedAmount(TypedDict): 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). """ currency_options: NotRequired[ - "Dict[str, Session.CreateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions]" + Dict[ + str, + "Session.CreateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions", + ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). @@ -3246,28 +3363,28 @@ class CreateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions( A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class CreateParamsSubscriptionData(TypedDict): - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ - billing_cycle_anchor: NotRequired["int"] + billing_cycle_anchor: NotRequired[int] """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ - default_tax_rates: NotRequired["List[str]"] + default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. """ - description: NotRequired["str"] + description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription @@ -3279,15 +3396,15 @@ class CreateParamsSubscriptionData(TypedDict): """ All invoices will be billed using the specified settings. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the subscription's invoices. """ - proration_behavior: NotRequired["Literal['create_prorations', 'none']"] + 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`. """ @@ -3297,13 +3414,13 @@ class CreateParamsSubscriptionData(TypedDict): """ If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. """ - trial_end: NotRequired["int"] + 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. """ - trial_period_days: NotRequired["int"] + trial_period_days: NotRequired[int] """ Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. @@ -3324,7 +3441,7 @@ class CreateParamsSubscriptionDataInvoiceSettings(TypedDict): """ class CreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -3334,7 +3451,7 @@ class CreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): """ class CreateParamsSubscriptionDataTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ @@ -3362,25 +3479,25 @@ class CreateParamsTaxIdCollection(TypedDict): """ class ExpireParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListLineItemsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ @@ -3390,7 +3507,7 @@ class ListParams(RequestOptions): """ Only return Checkout Sessions that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return the Checkout Sessions for the Customer specified. """ @@ -3398,53 +3515,53 @@ class ListParams(RequestOptions): """ Only return the Checkout Sessions for the Customer details specified. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ Only return the Checkout Session for the PaymentIntent specified. """ - payment_link: NotRequired["str"] + payment_link: NotRequired[str] """ Only return the Checkout Sessions for the Payment Link specified. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['complete', 'expired', 'open']"] + status: NotRequired[Literal["complete", "expired", "open"]] """ Only return the Checkout Sessions matching the given status. """ - subscription: NotRequired["str"] + subscription: NotRequired[str] """ Only return the Checkout Session for the subscription specified. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ @@ -3456,7 +3573,7 @@ class ListParamsCustomerDetails(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/checkout/_session_line_item_service.py b/stripe/checkout/_session_line_item_service.py index 917bcdf44..cc1dc8317 100644 --- a/stripe/checkout/_session_line_item_service.py +++ b/stripe/checkout/_session_line_item_service.py @@ -11,19 +11,19 @@ class SessionLineItemService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 77fc71dc7..70498abbf 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -22,7 +22,7 @@ class CreateParams(TypedDict): """ Configure actions after a Checkout Session has expired. """ - allow_promotion_codes: NotRequired["bool"] + allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes. """ @@ -30,15 +30,15 @@ class CreateParams(TypedDict): """ Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. """ - billing_address_collection: NotRequired["Literal['auto', 'required']"] + billing_address_collection: NotRequired[Literal["auto", "required"]] """ Specify whether Checkout should collect the customer's billing address. Defaults to `auto`. """ - cancel_url: NotRequired["str"] + cancel_url: NotRequired[str] """ If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. """ - client_reference_id: NotRequired["str"] + client_reference_id: NotRequired[str] """ A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the @@ -50,12 +50,12 @@ class CreateParams(TypedDict): """ Configure fields for the Checkout Session to gather active consent from customers. """ - currency: NotRequired["str"] + currency: NotRequired[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). Required in `setup` mode when `payment_method_types` is not set. """ custom_fields: NotRequired[ - "List[SessionService.CreateParamsCustomField]" + List["SessionService.CreateParamsCustomField"] ] """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. @@ -64,7 +64,7 @@ class CreateParams(TypedDict): """ Display additional text for your customers using custom text. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ ID of an existing Customer, if one exists. In `payment` mode, the customer's most recently saved card payment method will be used to prefill the email, name, card details, and billing address @@ -78,7 +78,7 @@ class CreateParams(TypedDict): You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. """ - customer_creation: NotRequired["Literal['always', 'if_required']"] + customer_creation: NotRequired[Literal["always", "if_required"]] """ Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. @@ -90,7 +90,7 @@ class CreateParams(TypedDict): Can only be set in `payment` and `setup` mode. """ - customer_email: NotRequired["str"] + customer_email: NotRequired[str] """ If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. @@ -104,15 +104,15 @@ class CreateParams(TypedDict): """ Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when `customer` is provided. """ - discounts: NotRequired["List[SessionService.CreateParamsDiscount]"] + discounts: NotRequired[List["SessionService.CreateParamsDiscount"]] """ The coupon or promotion code to apply to this Session. Currently, only up to one may be specified. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ 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. """ @@ -122,7 +122,7 @@ class CreateParams(TypedDict): """ Generate a post-purchase Invoice for one-time payments. """ - line_items: NotRequired["List[SessionService.CreateParamsLineItem]"] + line_items: NotRequired[List["SessionService.CreateParamsLineItem"]] """ A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). @@ -131,16 +131,58 @@ class CreateParams(TypedDict): For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. Line items with one-time Prices will be on the initial invoice only. """ locale: NotRequired[ - "Literal['auto', 'bg', 'cs', 'da', 'de', 'el', 'en', 'en-GB', 'es', 'es-419', 'et', 'fi', 'fil', 'fr', 'fr-CA', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lt', 'lv', 'ms', 'mt', 'nb', 'nl', 'pl', 'pt', 'pt-BR', 'ro', 'ru', 'sk', 'sl', 'sv', 'th', 'tr', 'vi', 'zh', 'zh-HK', 'zh-TW']" + Literal[ + "auto", + "bg", + "cs", + "da", + "de", + "el", + "en", + "en-GB", + "es", + "es-419", + "et", + "fi", + "fil", + "fr", + "fr-CA", + "hr", + "hu", + "id", + "it", + "ja", + "ko", + "lt", + "lv", + "ms", + "mt", + "nb", + "nl", + "pl", + "pt", + "pt-BR", + "ro", + "ru", + "sk", + "sl", + "sv", + "th", + "tr", + "vi", + "zh", + "zh-HK", + "zh-TW", + ] ] """ The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - mode: NotRequired["Literal['payment', 'setup', 'subscription']"] + mode: NotRequired[Literal["payment", "setup", "subscription"]] """ The mode of the Checkout Session. Pass `subscription` if the Checkout Session includes at least one recurring item. """ @@ -151,7 +193,7 @@ class CreateParams(TypedDict): A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ payment_method_collection: NotRequired[ - "Literal['always', 'if_required']" + Literal["always", "if_required"] ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. @@ -161,7 +203,7 @@ class CreateParams(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://stripe.com/docs/payments/checkout/free-trials). """ - payment_method_configuration: NotRequired["str"] + payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this Checkout session. """ @@ -172,7 +214,43 @@ class CreateParams(TypedDict): Payment-method-specific configuration. """ payment_method_types: NotRequired[ - "List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'revolut_pay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay', 'zip']]" + List[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "blik", + "boleto", + "card", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "oxxo", + "p24", + "paynow", + "paypal", + "pix", + "promptpay", + "revolut_pay", + "sepa_debit", + "sofort", + "swish", + "us_bank_account", + "wechat_pay", + "zip", + ] + ] ] """ A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. @@ -197,12 +275,12 @@ class CreateParams(TypedDict): before using this feature. Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers). """ redirect_on_completion: NotRequired[ - "Literal['always', 'if_required', 'never']" + Literal["always", "if_required", "never"] ] """ This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. This parameter is required if ui_mode is `embedded` @@ -221,12 +299,12 @@ class CreateParams(TypedDict): When set, provides configuration for Checkout to collect a shipping address from a customer. """ shipping_options: NotRequired[ - "List[SessionService.CreateParamsShippingOption]" + List["SessionService.CreateParamsShippingOption"] ] """ The shipping rate options to apply to this Session. Up to a maximum of 5. """ - submit_type: NotRequired["Literal['auto', 'book', 'donate', 'pay']"] + submit_type: NotRequired[Literal["auto", "book", "donate", "pay"]] """ Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. `submit_type` can only be @@ -238,7 +316,7 @@ class CreateParams(TypedDict): """ A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. """ - success_url: NotRequired["str"] + success_url: NotRequired[str] """ The URL to which Stripe should send customers when payment or setup is complete. @@ -252,7 +330,7 @@ class CreateParams(TypedDict): """ Controls tax ID collection settings for the session. """ - ui_mode: NotRequired["Literal['embedded', 'hosted']"] + ui_mode: NotRequired[Literal["embedded", "hosted"]] """ The UI mode of the Session. Defaults to `hosted`. """ @@ -266,7 +344,7 @@ class CreateParamsAfterExpiration(TypedDict): """ class CreateParamsAfterExpirationRecovery(TypedDict): - allow_promotion_codes: NotRequired["bool"] + allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false` """ @@ -290,7 +368,7 @@ class CreateParamsAutomaticTax(TypedDict): """ class CreateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -306,13 +384,13 @@ class CreateParamsConsentCollection(TypedDict): """ Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. """ - promotions: NotRequired["Literal['auto', 'none']"] + promotions: NotRequired[Literal["auto", "none"]] """ If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. Only available to US merchants. """ - terms_of_service: NotRequired["Literal['none', 'required']"] + terms_of_service: NotRequired[Literal["none", "required"]] """ If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). @@ -342,7 +420,7 @@ class CreateParamsCustomField(TypedDict): """ Configuration for `type=numeric` fields. """ - optional: NotRequired["bool"] + optional: NotRequired[bool] """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ @@ -382,21 +460,21 @@ class CreateParamsCustomFieldLabel(TypedDict): """ class CreateParamsCustomFieldNumeric(TypedDict): - maximum_length: NotRequired["int"] + maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ - minimum_length: NotRequired["int"] + minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class CreateParamsCustomFieldText(TypedDict): - maximum_length: NotRequired["int"] + maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ - minimum_length: NotRequired["int"] + minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ @@ -452,27 +530,27 @@ class CreateParamsCustomTextTermsOfServiceAcceptance(TypedDict): """ class CreateParamsCustomerUpdate(TypedDict): - address: NotRequired["Literal['auto', 'never']"] + address: NotRequired[Literal["auto", "never"]] """ Describes whether Checkout saves the billing address onto `customer.address`. To always collect a full billing address, use `billing_address_collection`. Defaults to `never`. """ - name: NotRequired["Literal['auto', 'never']"] + name: NotRequired[Literal["auto", "never"]] """ Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`. """ - shipping: NotRequired["Literal['auto', 'never']"] + shipping: NotRequired[Literal["auto", "never"]] """ Describes whether Checkout saves shipping information onto `customer.shipping`. To collect shipping information, use `shipping_address_collection`. Defaults to `never`. """ class CreateParamsDiscount(TypedDict): - coupon: NotRequired["str"] + coupon: NotRequired[str] """ The ID of the coupon to apply to this Session. """ - promotion_code: NotRequired["str"] + promotion_code: NotRequired[str] """ The ID of a promotion code to apply to this Session. """ @@ -500,11 +578,11 @@ class CreateParamsInvoiceCreationInvoiceData(TypedDict): """ Default custom fields to be displayed on invoices for this customer. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - footer: NotRequired["str"] + footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ @@ -514,7 +592,7 @@ class CreateParamsInvoiceCreationInvoiceData(TypedDict): """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -536,7 +614,7 @@ class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): """ class CreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -560,11 +638,11 @@ class CreateParamsLineItem(TypedDict): """ When set, provides configuration for this item's quantity to be adjusted by the customer during Checkout. """ - dynamic_tax_rates: NotRequired["List[str]"] + dynamic_tax_rates: NotRequired[List[str]] """ The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU. """ - price: NotRequired["str"] + price: NotRequired[str] """ The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price` or `price_data` is required. """ @@ -572,11 +650,11 @@ class CreateParamsLineItem(TypedDict): """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`. """ - tax_rates: NotRequired["List[str]"] + tax_rates: NotRequired[List[str]] """ The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item. """ @@ -586,11 +664,11 @@ class CreateParamsLineItemAdjustableQuantity(TypedDict): """ Set to true if the quantity can be adjusted to any non-negative integer. By default customers will be able to remove the line item by setting the quantity to 0. """ - maximum: NotRequired["int"] + maximum: NotRequired[int] """ The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999. """ - minimum: NotRequired["int"] + minimum: NotRequired[int] """ The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0. """ @@ -600,7 +678,7 @@ class CreateParamsLineItemPriceData(TypedDict): """ 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). """ - product: NotRequired["str"] + product: NotRequired[str] """ The ID of the product that this price will belong to. One of `product` or `product_data` is required. """ @@ -617,30 +695,30 @@ class CreateParamsLineItemPriceData(TypedDict): The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - unit_amount: NotRequired["int"] + unit_amount: NotRequired[int] """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired["str"] + unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsLineItemPriceDataProductData(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ - images: NotRequired["List[str]"] + images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -648,7 +726,7 @@ class CreateParamsLineItemPriceDataProductData(TypedDict): """ The product's name, meant to be displayable to the customer. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ @@ -658,41 +736,41 @@ class CreateParamsLineItemPriceDataRecurring(TypedDict): """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired["int"] + interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsPaymentIntentData(TypedDict): - application_fee_amount: NotRequired["int"] + 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ capture_method: NotRequired[ - "Literal['automatic', 'automatic_async', 'manual']" + Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The Stripe account ID for which these funds are intended. For details, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - receipt_email: NotRequired["str"] + receipt_email: NotRequired[str] """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ - setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] + setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. @@ -721,12 +799,12 @@ class CreateParamsPaymentIntentData(TypedDict): """ Shipping information for this payment. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. """ - statement_descriptor_suffix: NotRequired["str"] + statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete @@ -739,7 +817,7 @@ class CreateParamsPaymentIntentData(TypedDict): The parameters used to automatically create a Transfer when the payment succeeds. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - transfer_group: NotRequired["str"] + transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ @@ -749,7 +827,7 @@ class CreateParamsPaymentIntentDataShipping(TypedDict): """ Shipping address. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ @@ -757,21 +835,21 @@ class CreateParamsPaymentIntentDataShipping(TypedDict): """ Recipient name. """ - phone: NotRequired["str"] + phone: NotRequired[str] """ Recipient phone (including extension). """ - tracking_number: NotRequired["str"] + tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsPaymentIntentDataShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ @@ -779,21 +857,21 @@ class CreateParamsPaymentIntentDataShippingAddress(TypedDict): """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPaymentIntentDataTransferData(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ @@ -980,7 +1058,7 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired["Literal['cad', 'usd']"] + currency: NotRequired[Literal["cad", "usd"]] """ 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). This is only accepted for Checkout Sessions in `setup` mode. """ @@ -991,7 +1069,7 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['none', 'off_session', 'on_session']" + Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1001,7 +1079,7 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: NotRequired[ - "Literal['automatic', 'instant', 'microdeposits']" + Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent @@ -1014,27 +1092,27 @@ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired["List[Literal['invoice', 'subscription']]"] + default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. Only usable in `setup` mode. """ - interval_description: NotRequired["str"] + interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ - "Literal['combined', 'interval', 'sporadic']" + Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired["Literal['business', 'personal']"] + transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1044,7 +1122,7 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): """ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1054,7 +1132,7 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1064,7 +1142,7 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): """ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1075,7 +1153,7 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): setup_future_usage: NotRequired[ - "Literal['none', 'off_session', 'on_session']" + Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1086,7 +1164,7 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1096,12 +1174,12 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ - "Literal['none', 'off_session', 'on_session']" + Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1119,12 +1197,12 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): Installment options for card payments """ request_three_d_secure: NotRequired[ - "Literal['any', 'automatic', 'challenge']" + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ - setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] + setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1132,17 +1210,17 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ - statement_descriptor_suffix_kana: NotRequired["str"] + statement_descriptor_suffix_kana: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ - statement_descriptor_suffix_kanji: NotRequired["str"] + statement_descriptor_suffix_kanji: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): - enabled: NotRequired["bool"] + enabled: NotRequired[bool] """ Setting to true enables installments for this Checkout Session. Setting to false will prevent any installment plan from applying to a payment. @@ -1150,7 +1228,7 @@ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): class CreateParamsPaymentMethodOptionsCashapp(TypedDict): setup_future_usage: NotRequired[ - "Literal['none', 'off_session', 'on_session']" + Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1167,11 +1245,11 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired["Literal['bank_transfer']"] + funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1190,7 +1268,17 @@ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Configuration for eu_bank_transfer funding type. """ requested_address_types: NotRequired[ - "List[Literal['aba', 'iban', 'sepa', 'sort_code', 'spei', 'swift', 'zengin']]" + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. @@ -1217,7 +1305,7 @@ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( """ class CreateParamsPaymentMethodOptionsEps(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1227,7 +1315,7 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1237,7 +1325,7 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1247,7 +1335,7 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1257,7 +1345,7 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): """ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1267,7 +1355,7 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): """ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1277,11 +1365,11 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1291,7 +1379,7 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): """ class CreateParamsPaymentMethodOptionsLink(TypedDict): - setup_future_usage: NotRequired["Literal['none', 'off_session']"] + setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1301,11 +1389,11 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): - expires_after_days: NotRequired["int"] + expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1315,7 +1403,7 @@ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): """ class CreateParamsPaymentMethodOptionsP24(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1323,13 +1411,13 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ - tos_shown_and_accepted: NotRequired["bool"] + tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1344,16 +1432,38 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']" + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ - risk_correlation_id: NotRequired["str"] + risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ @@ -1371,13 +1481,13 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): """ class CreateParamsPaymentMethodOptionsPix(TypedDict): - expires_after_seconds: NotRequired["int"] + expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): - setup_future_usage: NotRequired["Literal['none', 'off_session']"] + setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1388,7 +1498,7 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): setup_future_usage: NotRequired[ - "Literal['none', 'off_session', 'on_session']" + Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1399,7 +1509,7 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsSofort(TypedDict): - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1422,7 +1532,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for Financial Connections Session creation """ setup_future_usage: NotRequired[ - "Literal['none', 'off_session', 'on_session']" + Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1431,7 +1541,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ - verification_method: NotRequired["Literal['automatic', 'instant']"] + verification_method: NotRequired[Literal["automatic", "instant"]] """ Verification method for the intent """ @@ -1440,18 +1550,22 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ - "List[Literal['balances', 'ownership', 'payment_method', 'transactions']]" + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired["List[Literal['balances', 'transactions']]"] + prefetch: NotRequired[List[Literal["balances", "transactions"]]] """ List of data features that you would like to retrieve upon account creation. """ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): - app_id: NotRequired["str"] + app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ @@ -1459,7 +1573,7 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired["Literal['none']"] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1475,15 +1589,15 @@ class CreateParamsPhoneNumberCollection(TypedDict): """ class CreateParamsSetupIntentData(TypedDict): - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The Stripe account for which the setup is intended. """ @@ -1736,7 +1850,7 @@ class CreateParamsShippingAddressCollection(TypedDict): """ class CreateParamsShippingOption(TypedDict): - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ The ID of the Shipping Rate to use for this shipping option. """ @@ -1764,21 +1878,21 @@ class CreateParamsShippingOptionShippingRateData(TypedDict): """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ - type: NotRequired["Literal['fixed_amount']"] + type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. """ @@ -1833,7 +1947,10 @@ class CreateParamsShippingOptionShippingRateDataFixedAmount(TypedDict): 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). """ currency_options: NotRequired[ - "Dict[str, SessionService.CreateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions]" + Dict[ + str, + "SessionService.CreateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions", + ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). @@ -1847,28 +1964,28 @@ class CreateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions( A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'unspecified']" + Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class CreateParamsSubscriptionData(TypedDict): - application_fee_percent: NotRequired["float"] + application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ - billing_cycle_anchor: NotRequired["int"] + billing_cycle_anchor: NotRequired[int] """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ - default_tax_rates: NotRequired["List[str]"] + default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. """ - description: NotRequired["str"] + description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription @@ -1880,15 +1997,15 @@ class CreateParamsSubscriptionData(TypedDict): """ All invoices will be billed using the specified settings. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - on_behalf_of: NotRequired["str"] + on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the subscription's invoices. """ - proration_behavior: NotRequired["Literal['create_prorations', 'none']"] + 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`. """ @@ -1898,13 +2015,13 @@ class CreateParamsSubscriptionData(TypedDict): """ If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. """ - trial_end: NotRequired["int"] + 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. """ - trial_period_days: NotRequired["int"] + trial_period_days: NotRequired[int] """ Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. @@ -1925,7 +2042,7 @@ class CreateParamsSubscriptionDataInvoiceSettings(TypedDict): """ class CreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ @@ -1935,7 +2052,7 @@ class CreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): """ class CreateParamsSubscriptionDataTransferData(TypedDict): - amount_percent: NotRequired["float"] + amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ @@ -1963,7 +2080,7 @@ class CreateParamsTaxIdCollection(TypedDict): """ class ExpireParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1973,7 +2090,7 @@ class ListParams(TypedDict): """ Only return Checkout Sessions that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return the Checkout Sessions for the Customer specified. """ @@ -1983,53 +2100,53 @@ class ListParams(TypedDict): """ Only return the Checkout Sessions for the Customer details specified. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ Only return the Checkout Session for the PaymentIntent specified. """ - payment_link: NotRequired["str"] + payment_link: NotRequired[str] """ Only return the Checkout Sessions for the Payment Link specified. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['complete', 'expired', 'open']"] + status: NotRequired[Literal["complete", "expired", "open"]] """ Only return the Checkout Sessions matching the given status. """ - subscription: NotRequired["str"] + subscription: NotRequired[str] """ Only return the Checkout Session for the subscription specified. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ @@ -2041,7 +2158,7 @@ class ListParamsCustomerDetails(TypedDict): """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/climate/_order.py b/stripe/climate/_order.py index be7330d6b..649ccf2da 100644 --- a/stripe/climate/_order.py +++ b/stripe/climate/_order.py @@ -86,13 +86,13 @@ class Location(StripeObject): _inner_class_types = {"location": Location} class CancelParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ Requested amount of carbon removal units. Either this or `metric_tons` must be specified. """ @@ -100,19 +100,19 @@ class CreateParams(RequestOptions): """ Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe account if not set. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Request currency for the order as a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a supported [settlement currency for your account](https://stripe.com/docs/currencies). If omitted, the account's default currency will be used. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - metric_tons: NotRequired["str"] + metric_tons: NotRequired[str] """ Requested number of tons for the order. Either this or `amount` must be specified. """ @@ -128,19 +128,19 @@ class CreateParamsBeneficiary(TypedDict): """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ @@ -150,11 +150,11 @@ class ModifyParams(RequestOptions): """ Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe account if not set. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -166,7 +166,7 @@ class ModifyParamsBeneficiary(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/climate/_order_service.py b/stripe/climate/_order_service.py index 5e9929957..ab75fa1ac 100644 --- a/stripe/climate/_order_service.py +++ b/stripe/climate/_order_service.py @@ -11,13 +11,13 @@ class OrderService(StripeService): class CancelParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ Requested amount of carbon removal units. Either this or `metric_tons` must be specified. """ @@ -25,19 +25,19 @@ class CreateParams(TypedDict): """ Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe account if not set. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Request currency for the order as a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a supported [settlement currency for your account](https://stripe.com/docs/currencies). If omitted, the account's default currency will be used. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - metric_tons: NotRequired["str"] + metric_tons: NotRequired[str] """ Requested number of tons for the order. Either this or `amount` must be specified. """ @@ -53,25 +53,25 @@ class CreateParamsBeneficiary(TypedDict): """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -83,11 +83,11 @@ class UpdateParams(TypedDict): """ Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe account if not set. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ diff --git a/stripe/climate/_product.py b/stripe/climate/_product.py index a6ba2fa56..f290b237a 100644 --- a/stripe/climate/_product.py +++ b/stripe/climate/_product.py @@ -34,25 +34,25 @@ class CurrentPricesPerMetricTon(StripeObject): """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/climate/_product_service.py b/stripe/climate/_product_service.py index 9a0918156..847f8c1ec 100644 --- a/stripe/climate/_product_service.py +++ b/stripe/climate/_product_service.py @@ -11,25 +11,25 @@ class ProductService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/climate/_supplier.py b/stripe/climate/_supplier.py index 63e97b0dc..b64c569e0 100644 --- a/stripe/climate/_supplier.py +++ b/stripe/climate/_supplier.py @@ -38,25 +38,25 @@ class Location(StripeObject): """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/climate/_supplier_service.py b/stripe/climate/_supplier_service.py index 5296cf68c..2dd297e7c 100644 --- a/stripe/climate/_supplier_service.py +++ b/stripe/climate/_supplier_service.py @@ -11,25 +11,25 @@ class SupplierService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/financial_connections/_account.py b/stripe/financial_connections/_account.py index f376ccf24..f96db7667 100644 --- a/stripe/financial_connections/_account.py +++ b/stripe/financial_connections/_account.py @@ -131,21 +131,21 @@ class TransactionRefresh(StripeObject): """ class DisconnectParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListOwnersParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -153,7 +153,7 @@ class ListOwnersParams(RequestOptions): """ The ID of the ownership object to fetch owners from. """ - starting_after: NotRequired["str"] + 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. """ @@ -163,39 +163,39 @@ class ListParams(RequestOptions): """ If present, only return accounts that belong to the specified account holder. `account_holder[customer]` and `account_holder[account]` are mutually exclusive. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - session: NotRequired["str"] + session: NotRequired[str] """ If present, only return accounts that were collected as part of the given session. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsAccountHolder(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The ID of the Stripe account whose accounts will be retrieved. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the Stripe customer whose accounts will be retrieved. """ class RefreshAccountParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -205,13 +205,13 @@ class RefreshAccountParams(RequestOptions): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SubscribeParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -221,7 +221,7 @@ class SubscribeParams(RequestOptions): """ class UnsubscribeParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/financial_connections/_account_owner_service.py b/stripe/financial_connections/_account_owner_service.py index 94325989a..767367fdb 100644 --- a/stripe/financial_connections/_account_owner_service.py +++ b/stripe/financial_connections/_account_owner_service.py @@ -11,15 +11,15 @@ class AccountOwnerService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ @@ -27,7 +27,7 @@ class ListParams(TypedDict): """ The ID of the ownership object to fetch owners from. """ - starting_after: NotRequired["str"] + 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. """ diff --git a/stripe/financial_connections/_account_service.py b/stripe/financial_connections/_account_service.py index ddd64c02e..1a6c878b7 100644 --- a/stripe/financial_connections/_account_service.py +++ b/stripe/financial_connections/_account_service.py @@ -18,7 +18,7 @@ def __init__(self, requestor): self.owners = AccountOwnerService(self._requestor) class DisconnectParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -28,39 +28,39 @@ class ListParams(TypedDict): """ If present, only return accounts that belong to the specified account holder. `account_holder[customer]` and `account_holder[account]` are mutually exclusive. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - session: NotRequired["str"] + session: NotRequired[str] """ If present, only return accounts that were collected as part of the given session. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsAccountHolder(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The ID of the Stripe account whose accounts will be retrieved. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the Stripe customer whose accounts will be retrieved. """ class RefreshParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -70,13 +70,13 @@ class RefreshParams(TypedDict): """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SubscribeParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -86,7 +86,7 @@ class SubscribeParams(TypedDict): """ class UnsubscribeParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/financial_connections/_session.py b/stripe/financial_connections/_session.py index 90298725a..897e42934 100644 --- a/stripe/financial_connections/_session.py +++ b/stripe/financial_connections/_session.py @@ -56,7 +56,7 @@ class CreateParams(RequestOptions): """ The account holder to link accounts for. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -73,22 +73,22 @@ class CreateParams(RequestOptions): Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. """ prefetch: NotRequired[ - "List[Literal['balances', 'ownership', 'transactions']]" + List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ class CreateParamsAccountHolder(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The ID of the Stripe account whose accounts will be retrieved. Should only be present if `type` is `account`. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the Stripe customer whose accounts will be retrieved. Should only be present if `type` is `customer`. """ @@ -104,7 +104,7 @@ class CreateParamsFilters(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/financial_connections/_session_service.py b/stripe/financial_connections/_session_service.py index 640e4b1ca..127626741 100644 --- a/stripe/financial_connections/_session_service.py +++ b/stripe/financial_connections/_session_service.py @@ -14,7 +14,7 @@ class CreateParams(TypedDict): """ The account holder to link accounts for. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -31,22 +31,22 @@ class CreateParams(TypedDict): Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. """ prefetch: NotRequired[ - "List[Literal['balances', 'ownership', 'transactions']]" + List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ 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. """ class CreateParamsAccountHolder(TypedDict): - account: NotRequired["str"] + account: NotRequired[str] """ The ID of the Stripe account whose accounts will be retrieved. Should only be present if `type` is `account`. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of the Stripe customer whose accounts will be retrieved. Should only be present if `type` is `customer`. """ @@ -62,7 +62,7 @@ class CreateParamsFilters(TypedDict): """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/financial_connections/_transaction.py b/stripe/financial_connections/_transaction.py index f08dec81e..601378e94 100644 --- a/stripe/financial_connections/_transaction.py +++ b/stripe/financial_connections/_transaction.py @@ -32,19 +32,19 @@ class ListParams(RequestOptions): """ The ID of the Stripe account whose transactions will be retrieved. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ @@ -60,19 +60,19 @@ class ListParams(RequestOptions): """ class ListParamsTransactedAt(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ @@ -84,7 +84,7 @@ class ListParamsTransactionRefresh(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/financial_connections/_transaction_service.py b/stripe/financial_connections/_transaction_service.py index fde302e5d..e5df770c4 100644 --- a/stripe/financial_connections/_transaction_service.py +++ b/stripe/financial_connections/_transaction_service.py @@ -15,19 +15,19 @@ class ListParams(TypedDict): """ The ID of the Stripe account whose transactions will be retrieved. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ @@ -45,19 +45,19 @@ class ListParams(TypedDict): """ class ListParamsTransactedAt(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ @@ -69,7 +69,7 @@ class ListParamsTransactionRefresh(TypedDict): """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/forwarding/_request.py b/stripe/forwarding/_request.py index 1d3e1d67e..0ecf34d48 100644 --- a/stripe/forwarding/_request.py +++ b/stripe/forwarding/_request.py @@ -96,7 +96,7 @@ class CreateParams(RequestOptions): """ The Forwarding Config used when making the forwarded request. The config specifes the HTTP method, merchant credentials, connection settings, and supported destination URLs. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -122,11 +122,11 @@ class CreateParams(RequestOptions): """ class CreateParamsRequest(TypedDict): - body: NotRequired["str"] + body: NotRequired[str] """ The body payload to send to the destination endpoint. """ - headers: NotRequired["List[Request.CreateParamsRequestHeader]"] + headers: NotRequired[List["Request.CreateParamsRequestHeader"]] """ The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included. """ @@ -146,43 +146,43 @@ class ListParams(RequestOptions): """ Similar to other List endpoints, filters results based on created timestamp. You can pass gt, gte, lt, and lte timestamp values. """ - ending_before: NotRequired["str"] + ending_before: NotRequired[str] """ A pagination cursor to fetch the previous page of the list. The value must be a ForwardingRequest ID. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A pagination cursor to fetch the next page of the list. The value must be a ForwardingRequest ID. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Return results where the `created` field is greater than this value. """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Return results where the `created` field is greater than or equal to this value. """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Return results where the `created` field is less than this value. """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Return results where the `created` field is less than or equal to this value. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/forwarding/_request_service.py b/stripe/forwarding/_request_service.py index 1796e9630..e5734ab68 100644 --- a/stripe/forwarding/_request_service.py +++ b/stripe/forwarding/_request_service.py @@ -15,7 +15,7 @@ class CreateParams(TypedDict): """ The Forwarding Config used when making the forwarded request. The config specifes the HTTP method, merchant credentials, connection settings, and supported destination URLs. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -41,11 +41,11 @@ class CreateParams(TypedDict): """ class CreateParamsRequest(TypedDict): - body: NotRequired["str"] + body: NotRequired[str] """ The body payload to send to the destination endpoint. """ - headers: NotRequired["List[RequestService.CreateParamsRequestHeader]"] + headers: NotRequired[List["RequestService.CreateParamsRequestHeader"]] """ The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included. """ @@ -65,43 +65,43 @@ class ListParams(TypedDict): """ Similar to other List endpoints, filters results based on created timestamp. You can pass gt, gte, lt, and lte timestamp values. """ - ending_before: NotRequired["str"] + ending_before: NotRequired[str] """ A pagination cursor to fetch the previous page of the list. The value must be a ForwardingRequest ID. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A pagination cursor to fetch the next page of the list. The value must be a ForwardingRequest ID. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Return results where the `created` field is greater than this value. """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Return results where the `created` field is greater than or equal to this value. """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Return results where the `created` field is less than this value. """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Return results where the `created` field is less than or equal to this value. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index 8f291ed02..5a711e9ae 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -294,7 +294,7 @@ class Error(StripeObject): _inner_class_types = {"error": Error} class ListParams(RequestOptions): - client_reference_id: NotRequired["str"] + client_reference_id: NotRequired[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ @@ -302,51 +302,51 @@ class ListParams(RequestOptions): """ Only return VerificationReports that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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: NotRequired["Literal['document', 'id_number']"] + type: NotRequired[Literal["document", "id_number"]] """ Only return VerificationReports of this type """ - verification_session: NotRequired["str"] + verification_session: NotRequired[str] """ Only return VerificationReports created by this VerificationSession ID. It is allowed to provide a VerificationIntent ID. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/identity/_verification_report_service.py b/stripe/identity/_verification_report_service.py index 281f9279a..b37675adf 100644 --- a/stripe/identity/_verification_report_service.py +++ b/stripe/identity/_verification_report_service.py @@ -11,7 +11,7 @@ class VerificationReportService(StripeService): class ListParams(TypedDict): - client_reference_id: NotRequired["str"] + client_reference_id: NotRequired[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ @@ -19,51 +19,51 @@ class ListParams(TypedDict): """ Only return VerificationReports that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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: NotRequired["Literal['document', 'id_number']"] + type: NotRequired[Literal["document", "id_number"]] """ Only return VerificationReports of this type """ - verification_session: NotRequired["str"] + verification_session: NotRequired[str] """ Only return VerificationReports created by this VerificationSession ID. It is allowed to provide a VerificationIntent ID. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index d66717bfa..fa4667a27 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -174,21 +174,21 @@ class Dob(StripeObject): _inner_class_types = {"address": Address, "dob": Dob} class CancelParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): - client_reference_id: NotRequired["str"] + client_reference_id: NotRequired[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -196,7 +196,7 @@ class CreateParams(RequestOptions): """ A set of options for the session's verification checks. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. """ @@ -215,26 +215,26 @@ class CreateParamsOptions(TypedDict): class CreateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ - "List[Literal['driving_license', 'id_card', 'passport']]" + List[Literal["driving_license", "id_card", "passport"]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. """ - require_id_number: NotRequired["bool"] + require_id_number: NotRequired[bool] """ Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. """ - require_live_capture: NotRequired["bool"] + require_live_capture: NotRequired[bool] """ Disable image uploads, identity document images have to be captured using the device's camera. """ - require_matching_selfie: NotRequired["bool"] + require_matching_selfie: NotRequired[bool] """ Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ class ListParams(RequestOptions): - client_reference_id: NotRequired["str"] + client_reference_id: NotRequired[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ @@ -242,53 +242,53 @@ class ListParams(RequestOptions): """ Only return VerificationSessions that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['canceled', 'processing', 'requires_input', 'verified']" + Literal["canceled", "processing", "requires_input", "verified"] ] """ Only return VerificationSessions with this status. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -296,7 +296,7 @@ class ModifyParams(RequestOptions): """ A set of options for the session's verification checks. """ - type: NotRequired["Literal['document', 'id_number']"] + type: NotRequired[Literal["document", "id_number"]] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. """ @@ -311,32 +311,32 @@ class ModifyParamsOptions(TypedDict): class ModifyParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ - "List[Literal['driving_license', 'id_card', 'passport']]" + List[Literal["driving_license", "id_card", "passport"]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. """ - require_id_number: NotRequired["bool"] + require_id_number: NotRequired[bool] """ Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. """ - require_live_capture: NotRequired["bool"] + require_live_capture: NotRequired[bool] """ Disable image uploads, identity document images have to be captured using the device's camera. """ - require_matching_selfie: NotRequired["bool"] + require_matching_selfie: NotRequired[bool] """ Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ class RedactParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index 08cf2148c..6bafb5f9b 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -11,21 +11,21 @@ class VerificationSessionService(StripeService): class CancelParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): - client_reference_id: NotRequired["str"] + client_reference_id: NotRequired[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -33,7 +33,7 @@ class CreateParams(TypedDict): """ A set of options for the session's verification checks. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. """ @@ -52,26 +52,26 @@ class CreateParamsOptions(TypedDict): class CreateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ - "List[Literal['driving_license', 'id_card', 'passport']]" + List[Literal["driving_license", "id_card", "passport"]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. """ - require_id_number: NotRequired["bool"] + require_id_number: NotRequired[bool] """ Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. """ - require_live_capture: NotRequired["bool"] + require_live_capture: NotRequired[bool] """ Disable image uploads, identity document images have to be captured using the device's camera. """ - require_matching_selfie: NotRequired["bool"] + require_matching_selfie: NotRequired[bool] """ Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ class ListParams(TypedDict): - client_reference_id: NotRequired["str"] + client_reference_id: NotRequired[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ @@ -81,65 +81,65 @@ class ListParams(TypedDict): """ Only return VerificationSessions that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['canceled', 'processing', 'requires_input', 'verified']" + Literal["canceled", "processing", "requires_input", "verified"] ] """ Only return VerificationSessions with this status. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RedactParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -147,7 +147,7 @@ class UpdateParams(TypedDict): """ A set of options for the session's verification checks. """ - type: NotRequired["Literal['document', 'id_number']"] + type: NotRequired[Literal["document", "id_number"]] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. """ @@ -162,20 +162,20 @@ class UpdateParamsOptions(TypedDict): class UpdateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ - "List[Literal['driving_license', 'id_card', 'passport']]" + List[Literal["driving_license", "id_card", "passport"]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. """ - require_id_number: NotRequired["bool"] + require_id_number: NotRequired[bool] """ Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. """ - require_live_capture: NotRequired["bool"] + require_live_capture: NotRequired[bool] """ Disable image uploads, identity document images have to be captured using the device's camera. """ - require_matching_selfie: NotRequired["bool"] + require_matching_selfie: NotRequired[bool] """ Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index 09b794fef..fdf4c8685 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -294,11 +294,11 @@ class ThreeDSecure(StripeObject): } class ApproveParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ If the authorization's `pending_request.is_amount_controllable` property is `true`, you may provide this value to control how much to hold for the authorization. Must be positive (use [`decline`](https://stripe.com/docs/api/issuing/authorizations/decline) to decline an authorization request). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -308,15 +308,15 @@ class ApproveParams(RequestOptions): """ class CaptureParams(RequestOptions): - capture_amount: NotRequired["int"] + capture_amount: NotRequired[int] """ The amount to capture from the authorization. If not provided, the full amount of the authorization will be captured. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ - close_authorization: NotRequired["bool"] + close_authorization: NotRequired[bool] """ Whether to close the authorization after capture. Defaults to true. Set to false to enable multi-capture flows. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -343,101 +343,107 @@ class CaptureParamsPurchaseDetails(TypedDict): Information about lodging that was purchased with this transaction. """ receipt: NotRequired[ - "List[Authorization.CaptureParamsPurchaseDetailsReceipt]" + List["Authorization.CaptureParamsPurchaseDetailsReceipt"] ] """ The line items in the purchase. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A merchant-specific order number. """ class CaptureParamsPurchaseDetailsFlight(TypedDict): - departure_at: NotRequired["int"] + departure_at: NotRequired[int] """ The time that the flight departed. """ - passenger_name: NotRequired["str"] + passenger_name: NotRequired[str] """ The name of the passenger. """ - refundable: NotRequired["bool"] + refundable: NotRequired[bool] """ Whether the ticket is refundable. """ segments: NotRequired[ - "List[Authorization.CaptureParamsPurchaseDetailsFlightSegment]" + List["Authorization.CaptureParamsPurchaseDetailsFlightSegment"] ] """ The legs of the trip. """ - travel_agency: NotRequired["str"] + travel_agency: NotRequired[str] """ The travel agency that issued the ticket. """ class CaptureParamsPurchaseDetailsFlightSegment(TypedDict): - arrival_airport_code: NotRequired["str"] + arrival_airport_code: NotRequired[str] """ The three-letter IATA airport code of the flight's destination. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The airline carrier code. """ - departure_airport_code: NotRequired["str"] + departure_airport_code: NotRequired[str] """ The three-letter IATA airport code that the flight departed from. """ - flight_number: NotRequired["str"] + flight_number: NotRequired[str] """ The flight number. """ - service_class: NotRequired["str"] + service_class: NotRequired[str] """ The flight's service class. """ - stopover_allowed: NotRequired["bool"] + stopover_allowed: NotRequired[bool] """ Whether a stopover is allowed on this flight. """ class CaptureParamsPurchaseDetailsFuel(TypedDict): type: NotRequired[ - "Literal['diesel', 'other', 'unleaded_plus', 'unleaded_regular', 'unleaded_super']" + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired["Literal['liter', 'us_gallon']"] + unit: NotRequired[Literal["liter", "us_gallon"]] """ The units for `volume_decimal`. One of `us_gallon` or `liter`. """ - unit_cost_decimal: NotRequired["str"] + unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: NotRequired["str"] + volume_decimal: NotRequired[str] """ The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. """ class CaptureParamsPurchaseDetailsLodging(TypedDict): - check_in_at: NotRequired["int"] + check_in_at: NotRequired[int] """ The time of checking into the lodging. """ - nights: NotRequired["int"] + nights: NotRequired[int] """ The number of nights stayed at the lodging. """ class CaptureParamsPurchaseDetailsReceipt(TypedDict): - description: NotRequired["str"] - quantity: NotRequired["str"] - total: NotRequired["int"] - unit_cost: NotRequired["int"] + description: NotRequired[str] + quantity: NotRequired[str] + total: NotRequired[int] + unit_cost: NotRequired[int] class CreateParams(RequestOptions): amount: int @@ -449,7 +455,7 @@ class CreateParams(RequestOptions): Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ authorization_method: NotRequired[ - "Literal['chip', 'contactless', 'keyed_in', 'online', 'swipe']" + Literal["chip", "contactless", "keyed_in", "online", "swipe"] ] """ How the card details were provided. Defaults to online. @@ -458,15 +464,15 @@ class CreateParams(RequestOptions): """ Card associated with this authorization. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency of the authorization. If not provided, defaults to the currency of the card. 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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - is_amount_controllable: NotRequired["bool"] + is_amount_controllable: NotRequired[bool] """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. """ @@ -484,78 +490,371 @@ class CreateParams(RequestOptions): """ Verifications that Stripe performed on information that the cardholder provided to the merchant. """ - wallet: NotRequired[ - "Literal['apple_pay', 'google_pay', 'samsung_pay']" - ] + wallet: NotRequired[Literal["apple_pay", "google_pay", "samsung_pay"]] """ The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized. """ class CreateParamsAmountDetails(TypedDict): - atm_fee: NotRequired["int"] + atm_fee: NotRequired[int] """ The ATM withdrawal fee. """ - cashback_amount: NotRequired["int"] + cashback_amount: NotRequired[int] """ The amount of cash requested by the cardholder. """ class CreateParamsMerchantData(TypedDict): category: NotRequired[ - "Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']" + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] ] """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ - city: NotRequired["str"] + city: NotRequired[str] """ City where the seller is located """ - country: NotRequired["str"] + country: NotRequired[str] """ Country where the seller is located """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the seller """ - network_id: NotRequired["str"] + network_id: NotRequired[str] """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code where the seller is located """ - state: NotRequired["str"] + state: NotRequired[str] """ State where the seller is located """ - terminal_id: NotRequired["str"] + terminal_id: NotRequired[str] """ An ID assigned by the seller to the location of the sale. """ - url: NotRequired["str"] + url: NotRequired[str] """ URL provided by the merchant on a 3DS request """ class CreateParamsNetworkData(TypedDict): - acquiring_institution_id: NotRequired["str"] + acquiring_institution_id: NotRequired[str] """ Identifier assigned to the acquirer by the card network. """ class CreateParamsVerificationData(TypedDict): address_line1_check: NotRequired[ - "Literal['match', 'mismatch', 'not_provided']" + Literal["match", "mismatch", "not_provided"] ] """ Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`. """ address_postal_code_check: NotRequired[ - "Literal['match', 'mismatch', 'not_provided']" + Literal["match", "mismatch", "not_provided"] ] """ Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`. @@ -566,13 +865,11 @@ class CreateParamsVerificationData(TypedDict): """ The exemption applied to this authorization. """ - cvc_check: NotRequired["Literal['match', 'mismatch', 'not_provided']"] + cvc_check: NotRequired[Literal["match", "mismatch", "not_provided"]] """ Whether the cardholder provided a CVC and if it matched Stripe's record. """ - expiry_check: NotRequired[ - "Literal['match', 'mismatch', 'not_provided']" - ] + expiry_check: NotRequired[Literal["match", "mismatch", "not_provided"]] """ Whether the cardholder provided an expiry date and if it matched Stripe's record. """ @@ -604,7 +901,7 @@ class CreateParamsVerificationDataThreeDSecure(TypedDict): """ class DeclineParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -614,13 +911,13 @@ class DeclineParams(RequestOptions): """ class ExpireParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class IncrementParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -628,17 +925,17 @@ class IncrementParams(RequestOptions): """ The amount to increment the authorization by. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ - is_amount_controllable: NotRequired["bool"] + is_amount_controllable: NotRequired[bool] """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. """ class ListParams(RequestOptions): - card: NotRequired["str"] + card: NotRequired[str] """ Only return authorizations that belong to the given card. """ - cardholder: NotRequired["str"] + cardholder: NotRequired[str] """ Only return authorizations that belong to the given cardholder. """ @@ -646,47 +943,47 @@ class ListParams(RequestOptions): """ Only return authorizations that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['closed', 'pending', 'reversed']"] + status: NotRequired[Literal["closed", "pending", "reversed"]] """ Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -696,17 +993,17 @@ class ModifyParams(RequestOptions): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReverseParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - reverse_amount: NotRequired["int"] + reverse_amount: NotRequired[int] """ The amount to reverse from the authorization. If not provided, the full amount of the authorization will be reversed. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ diff --git a/stripe/issuing/_authorization_service.py b/stripe/issuing/_authorization_service.py index b224eabda..7ea57564f 100644 --- a/stripe/issuing/_authorization_service.py +++ b/stripe/issuing/_authorization_service.py @@ -11,11 +11,11 @@ class AuthorizationService(StripeService): class ApproveParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ If the authorization's `pending_request.is_amount_controllable` property is `true`, you may provide this value to control how much to hold for the authorization. Must be positive (use [`decline`](https://stripe.com/docs/api/issuing/authorizations/decline) to decline an authorization request). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -25,7 +25,7 @@ class ApproveParams(TypedDict): """ class DeclineParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -35,11 +35,11 @@ class DeclineParams(TypedDict): """ class ListParams(TypedDict): - card: NotRequired["str"] + card: NotRequired[str] """ Only return authorizations that belong to the given card. """ - cardholder: NotRequired["str"] + cardholder: NotRequired[str] """ Only return authorizations that belong to the given cardholder. """ @@ -47,53 +47,53 @@ class ListParams(TypedDict): """ Only return authorizations that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['closed', 'pending', 'reversed']"] + status: NotRequired[Literal["closed", "pending", "reversed"]] """ Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index f2f1a05eb..c1092153f 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -1106,7 +1106,7 @@ class GooglePay(StripeObject): _inner_class_types = {"apple_pay": ApplePay, "google_pay": GooglePay} class CreateParams(RequestOptions): - cardholder: NotRequired["str"] + cardholder: NotRequired[str] """ The [Cardholder](https://stripe.com/docs/api#issuing_cardholder_object) object with which the card will be associated. """ @@ -1114,16 +1114,16 @@ class CreateParams(RequestOptions): """ The currency for the card. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - financial_account: NotRequired["str"] - metadata: NotRequired["Dict[str, str]"] + financial_account: NotRequired[str] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - personalization_design: NotRequired["str"] + personalization_design: NotRequired[str] """ The personalization design object belonging to this card. """ @@ -1131,12 +1131,12 @@ class CreateParams(RequestOptions): """ The desired PIN for this card. """ - replacement_for: NotRequired["str"] + replacement_for: NotRequired[str] """ The card this is meant to be a replacement for (if any). """ replacement_reason: NotRequired[ - "Literal['damaged', 'expired', 'lost', 'stolen']" + Literal["damaged", "expired", "lost", "stolen"] ] """ If `replacement_for` is specified, this should indicate why that card is being replaced. @@ -1149,7 +1149,7 @@ class CreateParams(RequestOptions): """ Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ - status: NotRequired["Literal['active', 'inactive']"] + status: NotRequired[Literal["active", "inactive"]] """ Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. """ @@ -1159,7 +1159,7 @@ class CreateParams(RequestOptions): """ class CreateParamsPin(TypedDict): - encrypted_number: NotRequired["str"] + encrypted_number: NotRequired[str] """ The card's desired new PIN, encrypted under Stripe's public key. """ @@ -1177,19 +1177,19 @@ class CreateParamsShipping(TypedDict): """ The name printed on the shipping label when shipping the card. """ - phone_number: NotRequired["str"] + phone_number: NotRequired[str] """ Phone number of the recipient of the shipment. """ - require_signature: NotRequired["bool"] + require_signature: NotRequired[bool] """ Whether a signature is required for card delivery. """ - service: NotRequired["Literal['express', 'priority', 'standard']"] + service: NotRequired[Literal["express", "priority", "standard"]] """ Shipment service. """ - type: NotRequired["Literal['bulk', 'individual']"] + type: NotRequired[Literal["bulk", "individual"]] """ Packaging options. """ @@ -1207,7 +1207,7 @@ class CreateParamsShippingAddress(TypedDict): """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ @@ -1215,32 +1215,628 @@ class CreateParamsShippingAddress(TypedDict): """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsShippingCustoms(TypedDict): - eori_number: NotRequired["str"] + eori_number: NotRequired[str] """ The Economic Operators Registration and Identification (EORI) number to use for Customs. Required for bulk shipments to Europe. """ class CreateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ blocked_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ spending_limits: NotRequired[ - "List[Card.CreateParamsSpendingControlsSpendingLimit]" + List["Card.CreateParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). @@ -1252,7 +1848,305 @@ class CreateParamsSpendingControlsSpendingLimit(TypedDict): Maximum amount allowed to spend per interval. """ categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. @@ -1270,19 +2164,19 @@ class CreateParamsSpendingControlsSpendingLimit(TypedDict): """ class DeliverCardParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class FailCardParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): - cardholder: NotRequired["str"] + cardholder: NotRequired[str] """ Only return cards belonging to the Cardholder with the provided ID. """ @@ -1290,68 +2184,68 @@ class ListParams(RequestOptions): """ Only return cards that were issued during the given date interval. """ - ending_before: NotRequired["str"] + 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. """ - exp_month: NotRequired["int"] + exp_month: NotRequired[int] """ Only return cards that have the given expiration month. """ - exp_year: NotRequired["int"] + exp_year: NotRequired[int] """ Only return cards that have the given expiration year. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - last4: NotRequired["str"] + last4: NotRequired[str] """ Only return cards that have the given last four digits. """ - limit: NotRequired["int"] + 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. """ - personalization_design: NotRequired["str"] - starting_after: NotRequired["str"] + personalization_design: NotRequired[str] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['active', 'canceled', 'inactive']"] + status: NotRequired[Literal["active", "canceled", "inactive"]] """ Only return cards that have the given status. One of `active`, `inactive`, or `canceled`. """ - type: NotRequired["Literal['physical', 'virtual']"] + type: NotRequired[Literal["physical", "virtual"]] """ Only return cards that have the given type. One of `virtual` or `physical`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - cancellation_reason: NotRequired["Literal['lost', 'stolen']"] + cancellation_reason: NotRequired[Literal["lost", "stolen"]] """ Reason why the `status` of this card is `canceled`. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1359,7 +2253,7 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - personalization_design: NotRequired["str"] + personalization_design: NotRequired[str] pin: NotRequired["Card.ModifyParamsPin"] """ The desired new PIN for this card. @@ -1368,32 +2262,628 @@ class ModifyParams(RequestOptions): """ Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ - status: NotRequired["Literal['active', 'canceled', 'inactive']"] + status: NotRequired[Literal["active", "canceled", "inactive"]] """ Dictates whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`. """ class ModifyParamsPin(TypedDict): - encrypted_number: NotRequired["str"] + encrypted_number: NotRequired[str] """ The card's desired new PIN, encrypted under Stripe's public key. """ class ModifyParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ blocked_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ spending_limits: NotRequired[ - "List[Card.ModifyParamsSpendingControlsSpendingLimit]" + List["Card.ModifyParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). @@ -1405,7 +2895,305 @@ class ModifyParamsSpendingControlsSpendingLimit(TypedDict): Maximum amount allowed to spend per interval. """ categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. @@ -1423,19 +3211,19 @@ class ModifyParamsSpendingControlsSpendingLimit(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnCardParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ShipCardParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/issuing/_card_service.py b/stripe/issuing/_card_service.py index d12a70c70..ca570d27f 100644 --- a/stripe/issuing/_card_service.py +++ b/stripe/issuing/_card_service.py @@ -11,7 +11,7 @@ class CardService(StripeService): class CreateParams(TypedDict): - cardholder: NotRequired["str"] + cardholder: NotRequired[str] """ The [Cardholder](https://stripe.com/docs/api#issuing_cardholder_object) object with which the card will be associated. """ @@ -19,16 +19,16 @@ class CreateParams(TypedDict): """ The currency for the card. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - financial_account: NotRequired["str"] - metadata: NotRequired["Dict[str, str]"] + financial_account: NotRequired[str] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - personalization_design: NotRequired["str"] + personalization_design: NotRequired[str] """ The personalization design object belonging to this card. """ @@ -36,12 +36,12 @@ class CreateParams(TypedDict): """ The desired PIN for this card. """ - replacement_for: NotRequired["str"] + replacement_for: NotRequired[str] """ The card this is meant to be a replacement for (if any). """ replacement_reason: NotRequired[ - "Literal['damaged', 'expired', 'lost', 'stolen']" + Literal["damaged", "expired", "lost", "stolen"] ] """ If `replacement_for` is specified, this should indicate why that card is being replaced. @@ -56,7 +56,7 @@ class CreateParams(TypedDict): """ Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ - status: NotRequired["Literal['active', 'inactive']"] + status: NotRequired[Literal["active", "inactive"]] """ Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. """ @@ -66,7 +66,7 @@ class CreateParams(TypedDict): """ class CreateParamsPin(TypedDict): - encrypted_number: NotRequired["str"] + encrypted_number: NotRequired[str] """ The card's desired new PIN, encrypted under Stripe's public key. """ @@ -84,19 +84,19 @@ class CreateParamsShipping(TypedDict): """ The name printed on the shipping label when shipping the card. """ - phone_number: NotRequired["str"] + phone_number: NotRequired[str] """ Phone number of the recipient of the shipment. """ - require_signature: NotRequired["bool"] + require_signature: NotRequired[bool] """ Whether a signature is required for card delivery. """ - service: NotRequired["Literal['express', 'priority', 'standard']"] + service: NotRequired[Literal["express", "priority", "standard"]] """ Shipment service. """ - type: NotRequired["Literal['bulk', 'individual']"] + type: NotRequired[Literal["bulk", "individual"]] """ Packaging options. """ @@ -114,7 +114,7 @@ class CreateParamsShippingAddress(TypedDict): """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ @@ -122,32 +122,628 @@ class CreateParamsShippingAddress(TypedDict): """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsShippingCustoms(TypedDict): - eori_number: NotRequired["str"] + eori_number: NotRequired[str] """ The Economic Operators Registration and Identification (EORI) number to use for Customs. Required for bulk shipments to Europe. """ class CreateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ blocked_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ spending_limits: NotRequired[ - "List[CardService.CreateParamsSpendingControlsSpendingLimit]" + List["CardService.CreateParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). @@ -159,7 +755,305 @@ class CreateParamsSpendingControlsSpendingLimit(TypedDict): Maximum amount allowed to spend per interval. """ categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. @@ -177,7 +1071,7 @@ class CreateParamsSpendingControlsSpendingLimit(TypedDict): """ class ListParams(TypedDict): - cardholder: NotRequired["str"] + cardholder: NotRequired[str] """ Only return cards belonging to the Cardholder with the provided ID. """ @@ -185,74 +1079,74 @@ class ListParams(TypedDict): """ Only return cards that were issued during the given date interval. """ - ending_before: NotRequired["str"] + 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. """ - exp_month: NotRequired["int"] + exp_month: NotRequired[int] """ Only return cards that have the given expiration month. """ - exp_year: NotRequired["int"] + exp_year: NotRequired[int] """ Only return cards that have the given expiration year. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - last4: NotRequired["str"] + last4: NotRequired[str] """ Only return cards that have the given last four digits. """ - limit: NotRequired["int"] + 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. """ - personalization_design: NotRequired["str"] - starting_after: NotRequired["str"] + personalization_design: NotRequired[str] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['active', 'canceled', 'inactive']"] + status: NotRequired[Literal["active", "canceled", "inactive"]] """ Only return cards that have the given status. One of `active`, `inactive`, or `canceled`. """ - type: NotRequired["Literal['physical', 'virtual']"] + type: NotRequired[Literal["physical", "virtual"]] """ Only return cards that have the given type. One of `virtual` or `physical`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - cancellation_reason: NotRequired["Literal['lost', 'stolen']"] + cancellation_reason: NotRequired[Literal["lost", "stolen"]] """ Reason why the `status` of this card is `canceled`. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -260,7 +1154,7 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - personalization_design: NotRequired["str"] + personalization_design: NotRequired[str] pin: NotRequired["CardService.UpdateParamsPin"] """ The desired new PIN for this card. @@ -271,32 +1165,628 @@ class UpdateParams(TypedDict): """ Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ - status: NotRequired["Literal['active', 'canceled', 'inactive']"] + status: NotRequired[Literal["active", "canceled", "inactive"]] """ Dictates whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`. """ class UpdateParamsPin(TypedDict): - encrypted_number: NotRequired["str"] + encrypted_number: NotRequired[str] """ The card's desired new PIN, encrypted under Stripe's public key. """ class UpdateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ blocked_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ spending_limits: NotRequired[ - "List[CardService.UpdateParamsSpendingControlsSpendingLimit]" + List["CardService.UpdateParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). @@ -308,7 +1798,305 @@ class UpdateParamsSpendingControlsSpendingLimit(TypedDict): Maximum amount allowed to spend per interval. """ categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. diff --git a/stripe/issuing/_cardholder.py b/stripe/issuing/_cardholder.py index 1811fa9b3..6f9287d5d 100644 --- a/stripe/issuing/_cardholder.py +++ b/stripe/issuing/_cardholder.py @@ -1129,11 +1129,11 @@ class CreateParams(RequestOptions): """ Additional information about a `company` cardholder. """ - email: NotRequired["str"] + email: NotRequired[str] """ The cardholder's email address. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1141,7 +1141,7 @@ class CreateParams(RequestOptions): """ Additional information about an `individual` cardholder. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -1149,12 +1149,12 @@ class CreateParams(RequestOptions): """ The cardholder's name. This will be printed on cards issued to them. The maximum length of this field is 24 characters. This field cannot contain any special characters or numbers. """ - phone_number: NotRequired["str"] + phone_number: NotRequired[str] """ The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. """ preferred_locales: NotRequired[ - "List[Literal['de', 'en', 'es', 'fr', 'it']]" + List[Literal["de", "en", "es", "fr", "it"]] ] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. @@ -1166,11 +1166,11 @@ class CreateParams(RequestOptions): """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ - status: NotRequired["Literal['active', 'inactive']"] + status: NotRequired[Literal["active", "inactive"]] """ Specifies whether to permit authorizations on this cardholder's cards. Defaults to `active`. """ - type: NotRequired["Literal['company', 'individual']"] + type: NotRequired[Literal["company", "individual"]] """ One of `individual` or `company`. See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. """ @@ -1194,7 +1194,7 @@ class CreateParamsBillingAddress(TypedDict): """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ @@ -1202,13 +1202,13 @@ class CreateParamsBillingAddress(TypedDict): """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsCompany(TypedDict): - tax_id: NotRequired["str"] + tax_id: NotRequired[str] """ The entity's business ID number. """ @@ -1224,11 +1224,11 @@ class CreateParamsIndividual(TypedDict): """ The date of birth of this cardholder. Cardholders must be older than 13 years old. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ @@ -1248,11 +1248,11 @@ class CreateParamsIndividualCardIssuing(TypedDict): """ class CreateParamsIndividualCardIssuingUserTermsAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ @@ -1284,35 +1284,631 @@ class CreateParamsIndividualVerification(TypedDict): """ class CreateParamsIndividualVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ class CreateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ blocked_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ spending_limits: NotRequired[ - "List[Cardholder.CreateParamsSpendingControlsSpendingLimit]" + List["Cardholder.CreateParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across this cardholder's cards. """ - spending_limits_currency: NotRequired["str"] + spending_limits_currency: NotRequired[str] """ Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. """ @@ -1323,7 +1919,305 @@ class CreateParamsSpendingControlsSpendingLimit(TypedDict): Maximum amount allowed to spend per interval. """ categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. @@ -1345,53 +2239,53 @@ class ListParams(RequestOptions): """ Only return cardholders that were created during the given date interval. """ - email: NotRequired["str"] + email: NotRequired[str] """ Only return cardholders that have the given email address. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - phone_number: NotRequired["str"] + phone_number: NotRequired[str] """ Only return cardholders that have the given phone number. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['active', 'blocked', 'inactive']"] + status: NotRequired[Literal["active", "blocked", "inactive"]] """ Only return cardholders that have the given status. One of `active`, `inactive`, or `blocked`. """ - type: NotRequired["Literal['company', 'individual']"] + type: NotRequired[Literal["company", "individual"]] """ Only return cardholders that have the given type. One of `individual` or `company`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ @@ -1405,11 +2299,11 @@ class ModifyParams(RequestOptions): """ Additional information about a `company` cardholder. """ - email: NotRequired["str"] + email: NotRequired[str] """ The cardholder's email address. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1417,16 +2311,16 @@ class ModifyParams(RequestOptions): """ Additional information about an `individual` cardholder. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - phone_number: NotRequired["str"] + phone_number: NotRequired[str] """ The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure) for more details. """ preferred_locales: NotRequired[ - "List[Literal['de', 'en', 'es', 'fr', 'it']]" + List[Literal["de", "en", "es", "fr", "it"]] ] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. @@ -1438,7 +2332,7 @@ class ModifyParams(RequestOptions): """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ - status: NotRequired["Literal['active', 'inactive']"] + status: NotRequired[Literal["active", "inactive"]] """ Specifies whether to permit authorizations on this cardholder's cards. """ @@ -1462,7 +2356,7 @@ class ModifyParamsBillingAddress(TypedDict): """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ @@ -1470,13 +2364,13 @@ class ModifyParamsBillingAddress(TypedDict): """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsCompany(TypedDict): - tax_id: NotRequired["str"] + tax_id: NotRequired[str] """ The entity's business ID number. """ @@ -1492,11 +2386,11 @@ class ModifyParamsIndividual(TypedDict): """ The date of birth of this cardholder. Cardholders must be older than 13 years old. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ @@ -1516,11 +2410,11 @@ class ModifyParamsIndividualCardIssuing(TypedDict): """ class ModifyParamsIndividualCardIssuingUserTermsAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ @@ -1552,35 +2446,631 @@ class ModifyParamsIndividualVerification(TypedDict): """ class ModifyParamsIndividualVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ class ModifyParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ blocked_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ spending_limits: NotRequired[ - "List[Cardholder.ModifyParamsSpendingControlsSpendingLimit]" + List["Cardholder.ModifyParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across this cardholder's cards. """ - spending_limits_currency: NotRequired["str"] + spending_limits_currency: NotRequired[str] """ Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. """ @@ -1591,7 +3081,305 @@ class ModifyParamsSpendingControlsSpendingLimit(TypedDict): Maximum amount allowed to spend per interval. """ categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. @@ -1609,7 +3397,7 @@ class ModifyParamsSpendingControlsSpendingLimit(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/issuing/_cardholder_service.py b/stripe/issuing/_cardholder_service.py index 9e4efc03d..7a730fb51 100644 --- a/stripe/issuing/_cardholder_service.py +++ b/stripe/issuing/_cardholder_service.py @@ -19,11 +19,11 @@ class CreateParams(TypedDict): """ Additional information about a `company` cardholder. """ - email: NotRequired["str"] + email: NotRequired[str] """ The cardholder's email address. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -31,7 +31,7 @@ class CreateParams(TypedDict): """ Additional information about an `individual` cardholder. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -39,12 +39,12 @@ class CreateParams(TypedDict): """ The cardholder's name. This will be printed on cards issued to them. The maximum length of this field is 24 characters. This field cannot contain any special characters or numbers. """ - phone_number: NotRequired["str"] + phone_number: NotRequired[str] """ The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. """ preferred_locales: NotRequired[ - "List[Literal['de', 'en', 'es', 'fr', 'it']]" + List[Literal["de", "en", "es", "fr", "it"]] ] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. @@ -56,11 +56,11 @@ class CreateParams(TypedDict): """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ - status: NotRequired["Literal['active', 'inactive']"] + status: NotRequired[Literal["active", "inactive"]] """ Specifies whether to permit authorizations on this cardholder's cards. Defaults to `active`. """ - type: NotRequired["Literal['company', 'individual']"] + type: NotRequired[Literal["company", "individual"]] """ One of `individual` or `company`. See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. """ @@ -84,7 +84,7 @@ class CreateParamsBillingAddress(TypedDict): """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ @@ -92,13 +92,13 @@ class CreateParamsBillingAddress(TypedDict): """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsCompany(TypedDict): - tax_id: NotRequired["str"] + tax_id: NotRequired[str] """ The entity's business ID number. """ @@ -114,11 +114,11 @@ class CreateParamsIndividual(TypedDict): """ The date of birth of this cardholder. Cardholders must be older than 13 years old. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ @@ -138,11 +138,11 @@ class CreateParamsIndividualCardIssuing(TypedDict): """ class CreateParamsIndividualCardIssuingUserTermsAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ @@ -174,35 +174,631 @@ class CreateParamsIndividualVerification(TypedDict): """ class CreateParamsIndividualVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ class CreateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ blocked_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ spending_limits: NotRequired[ - "List[CardholderService.CreateParamsSpendingControlsSpendingLimit]" + List["CardholderService.CreateParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across this cardholder's cards. """ - spending_limits_currency: NotRequired["str"] + spending_limits_currency: NotRequired[str] """ Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. """ @@ -213,7 +809,305 @@ class CreateParamsSpendingControlsSpendingLimit(TypedDict): Maximum amount allowed to spend per interval. """ categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. @@ -235,59 +1129,59 @@ class ListParams(TypedDict): """ Only return cardholders that were created during the given date interval. """ - email: NotRequired["str"] + email: NotRequired[str] """ Only return cardholders that have the given email address. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - phone_number: NotRequired["str"] + phone_number: NotRequired[str] """ Only return cardholders that have the given phone number. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['active', 'blocked', 'inactive']"] + status: NotRequired[Literal["active", "blocked", "inactive"]] """ Only return cardholders that have the given status. One of `active`, `inactive`, or `blocked`. """ - type: NotRequired["Literal['company', 'individual']"] + type: NotRequired[Literal["company", "individual"]] """ Only return cardholders that have the given type. One of `individual` or `company`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -301,11 +1195,11 @@ class UpdateParams(TypedDict): """ Additional information about a `company` cardholder. """ - email: NotRequired["str"] + email: NotRequired[str] """ The cardholder's email address. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -313,16 +1207,16 @@ class UpdateParams(TypedDict): """ Additional information about an `individual` cardholder. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - phone_number: NotRequired["str"] + phone_number: NotRequired[str] """ The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure) for more details. """ preferred_locales: NotRequired[ - "List[Literal['de', 'en', 'es', 'fr', 'it']]" + List[Literal["de", "en", "es", "fr", "it"]] ] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. @@ -334,7 +1228,7 @@ class UpdateParams(TypedDict): """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ - status: NotRequired["Literal['active', 'inactive']"] + status: NotRequired[Literal["active", "inactive"]] """ Specifies whether to permit authorizations on this cardholder's cards. """ @@ -358,7 +1252,7 @@ class UpdateParamsBillingAddress(TypedDict): """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ @@ -366,13 +1260,13 @@ class UpdateParamsBillingAddress(TypedDict): """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsCompany(TypedDict): - tax_id: NotRequired["str"] + tax_id: NotRequired[str] """ The entity's business ID number. """ @@ -388,11 +1282,11 @@ class UpdateParamsIndividual(TypedDict): """ The date of birth of this cardholder. Cardholders must be older than 13 years old. """ - first_name: NotRequired["str"] + first_name: NotRequired[str] """ The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ - last_name: NotRequired["str"] + last_name: NotRequired[str] """ The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ @@ -412,11 +1306,11 @@ class UpdateParamsIndividualCardIssuing(TypedDict): """ class UpdateParamsIndividualCardIssuingUserTermsAcceptance(TypedDict): - date: NotRequired["int"] + date: NotRequired[int] """ The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ - ip: NotRequired["str"] + ip: NotRequired[str] """ The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ @@ -448,35 +1342,631 @@ class UpdateParamsIndividualVerification(TypedDict): """ class UpdateParamsIndividualVerificationDocument(TypedDict): - back: NotRequired["str"] + back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ - front: NotRequired["str"] + front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ class UpdateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ blocked_categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ spending_limits: NotRequired[ - "List[CardholderService.UpdateParamsSpendingControlsSpendingLimit]" + List["CardholderService.UpdateParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across this cardholder's cards. """ - spending_limits_currency: NotRequired["str"] + spending_limits_currency: NotRequired[str] """ Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. """ @@ -487,7 +1977,305 @@ class UpdateParamsSpendingControlsSpendingLimit(TypedDict): Maximum amount allowed to spend per interval. """ categories: NotRequired[ - "List[Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']]" + List[ + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] + ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. diff --git a/stripe/issuing/_dispute.py b/stripe/issuing/_dispute.py index 42ba8d0a7..20b714afa 100644 --- a/stripe/issuing/_dispute.py +++ b/stripe/issuing/_dispute.py @@ -243,7 +243,7 @@ class Treasury(StripeObject): """ class CreateParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If not set, defaults to the full transaction amount. """ @@ -251,15 +251,15 @@ class CreateParams(RequestOptions): """ Evidence provided for the dispute. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - transaction: NotRequired["str"] + transaction: NotRequired[str] """ The ID of the issuing transaction to create a dispute for. For transaction on Treasury FinancialAccounts, use `treasury.received_debit`. """ @@ -304,7 +304,15 @@ class CreateParamsEvidence(TypedDict): Evidence provided when `reason` is 'other'. """ reason: NotRequired[ - "Literal['canceled', 'duplicate', 'fraudulent', 'merchandise_not_as_described', 'not_received', 'other', 'service_not_as_described']" + Literal[ + "canceled", + "duplicate", + "fraudulent", + "merchandise_not_as_described", + "not_received", + "other", + "service_not_as_described", + ] ] """ The reason for filing the dispute. The evidence should be submitted in the field of the same name. @@ -383,7 +391,7 @@ class CreateParamsEvidenceDuplicate(TypedDict): """ Explanation of why the cardholder is disputing this transaction. """ - original_transaction: NotRequired["str"] + original_transaction: NotRequired[str] """ Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. """ @@ -503,53 +511,53 @@ class ListParams(RequestOptions): """ Only return Issuing disputes that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['expired', 'lost', 'submitted', 'unsubmitted', 'won']" + Literal["expired", "lost", "submitted", "unsubmitted", "won"] ] """ Select Issuing disputes with the given status. """ - transaction: NotRequired["str"] + transaction: NotRequired[str] """ Select the Issuing dispute for the given transaction. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ @@ -557,7 +565,7 @@ class ModifyParams(RequestOptions): """ Evidence provided for the dispute. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -602,7 +610,15 @@ class ModifyParamsEvidence(TypedDict): Evidence provided when `reason` is 'other'. """ reason: NotRequired[ - "Literal['canceled', 'duplicate', 'fraudulent', 'merchandise_not_as_described', 'not_received', 'other', 'service_not_as_described']" + Literal[ + "canceled", + "duplicate", + "fraudulent", + "merchandise_not_as_described", + "not_received", + "other", + "service_not_as_described", + ] ] """ The reason for filing the dispute. The evidence should be submitted in the field of the same name. @@ -681,7 +697,7 @@ class ModifyParamsEvidenceDuplicate(TypedDict): """ Explanation of why the cardholder is disputing this transaction. """ - original_transaction: NotRequired["str"] + original_transaction: NotRequired[str] """ Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. """ @@ -791,13 +807,13 @@ class ModifyParamsEvidenceServiceNotAsDescribed(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SubmitParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/issuing/_dispute_service.py b/stripe/issuing/_dispute_service.py index 420dfee49..7ed43fe19 100644 --- a/stripe/issuing/_dispute_service.py +++ b/stripe/issuing/_dispute_service.py @@ -11,7 +11,7 @@ class DisputeService(StripeService): class CreateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If not set, defaults to the full transaction amount. """ @@ -19,15 +19,15 @@ class CreateParams(TypedDict): """ Evidence provided for the dispute. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - transaction: NotRequired["str"] + transaction: NotRequired[str] """ The ID of the issuing transaction to create a dispute for. For transaction on Treasury FinancialAccounts, use `treasury.received_debit`. """ @@ -74,7 +74,15 @@ class CreateParamsEvidence(TypedDict): Evidence provided when `reason` is 'other'. """ reason: NotRequired[ - "Literal['canceled', 'duplicate', 'fraudulent', 'merchandise_not_as_described', 'not_received', 'other', 'service_not_as_described']" + Literal[ + "canceled", + "duplicate", + "fraudulent", + "merchandise_not_as_described", + "not_received", + "other", + "service_not_as_described", + ] ] """ The reason for filing the dispute. The evidence should be submitted in the field of the same name. @@ -153,7 +161,7 @@ class CreateParamsEvidenceDuplicate(TypedDict): """ Explanation of why the cardholder is disputing this transaction. """ - original_transaction: NotRequired["str"] + original_transaction: NotRequired[str] """ Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. """ @@ -273,59 +281,59 @@ class ListParams(TypedDict): """ Only return Issuing disputes that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['expired', 'lost', 'submitted', 'unsubmitted', 'won']" + Literal["expired", "lost", "submitted", "unsubmitted", "won"] ] """ Select Issuing disputes with the given status. """ - transaction: NotRequired["str"] + transaction: NotRequired[str] """ Select the Issuing dispute for the given transaction. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SubmitParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -335,7 +343,7 @@ class SubmitParams(TypedDict): """ class UpdateParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ @@ -343,7 +351,7 @@ class UpdateParams(TypedDict): """ Evidence provided for the dispute. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -390,7 +398,15 @@ class UpdateParamsEvidence(TypedDict): Evidence provided when `reason` is 'other'. """ reason: NotRequired[ - "Literal['canceled', 'duplicate', 'fraudulent', 'merchandise_not_as_described', 'not_received', 'other', 'service_not_as_described']" + Literal[ + "canceled", + "duplicate", + "fraudulent", + "merchandise_not_as_described", + "not_received", + "other", + "service_not_as_described", + ] ] """ The reason for filing the dispute. The evidence should be submitted in the field of the same name. @@ -469,7 +485,7 @@ class UpdateParamsEvidenceDuplicate(TypedDict): """ Explanation of why the cardholder is disputing this transaction. """ - original_transaction: NotRequired["str"] + original_transaction: NotRequired[str] """ Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. """ diff --git a/stripe/issuing/_personalization_design.py b/stripe/issuing/_personalization_design.py index d7ae91469..6ef27050c 100644 --- a/stripe/issuing/_personalization_design.py +++ b/stripe/issuing/_personalization_design.py @@ -101,13 +101,13 @@ class RejectionReasons(StripeObject): """ class ActivateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): - card_logo: NotRequired["str"] + card_logo: NotRequired[str] """ The file for the card logo, for use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. """ @@ -117,19 +117,19 @@ class CreateParams(RequestOptions): """ Hash containing carrier text, for use with physical bundles that support carrier text. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - lookup_key: NotRequired["str"] + lookup_key: NotRequired[str] """ A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ Friendly display name. """ @@ -143,7 +143,7 @@ class CreateParams(RequestOptions): """ Information on whether this personalization design is used to create cards when one is not specified. """ - transfer_lookup_key: NotRequired["bool"] + transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. """ @@ -173,25 +173,25 @@ class CreateParamsPreferences(TypedDict): """ class DeactivateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - lookup_keys: NotRequired["List[str]"] + lookup_keys: NotRequired[List[str]] """ Only return personalization designs with the given lookup keys. """ @@ -199,23 +199,23 @@ class ListParams(RequestOptions): """ Only return personalization designs with the given preferences. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['active', 'inactive', 'rejected', 'review']" + Literal["active", "inactive", "rejected", "review"] ] """ Only return personalization designs with the given status. """ class ListParamsPreferences(TypedDict): - is_default: NotRequired["bool"] + is_default: NotRequired[bool] """ Only return the personalization design that's set as the default. A connected account uses the Connect platform's default design if no personalization design is set as the default. """ - is_platform_default: NotRequired["bool"] + is_platform_default: NotRequired[bool] """ Only return the personalization design that is set as the Connect platform's default. This parameter is only applicable to connected accounts. """ @@ -231,7 +231,7 @@ class ModifyParams(RequestOptions): """ Hash containing carrier text, for use with physical bundles that support carrier text. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -239,7 +239,7 @@ class ModifyParams(RequestOptions): """ A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -247,7 +247,7 @@ class ModifyParams(RequestOptions): """ Friendly display name. Providing an empty string will set the field to null. """ - physical_bundle: NotRequired["str"] + physical_bundle: NotRequired[str] """ The physical bundle object belonging to this personalization design. """ @@ -257,7 +257,7 @@ class ModifyParams(RequestOptions): """ Information on whether this personalization design is used to create cards when one is not specified. """ - transfer_lookup_key: NotRequired["bool"] + transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. """ @@ -287,7 +287,7 @@ class ModifyParamsPreferences(TypedDict): """ class RejectParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -298,20 +298,41 @@ class RejectParams(RequestOptions): class RejectParamsRejectionReasons(TypedDict): card_logo: NotRequired[ - "List[Literal['geographic_location', 'inappropriate', 'network_name', 'non_binary_image', 'non_fiat_currency', 'other', 'other_entity', 'promotional_material']]" + List[ + Literal[ + "geographic_location", + "inappropriate", + "network_name", + "non_binary_image", + "non_fiat_currency", + "other", + "other_entity", + "promotional_material", + ] + ] ] """ The reason(s) the card logo was rejected. """ carrier_text: NotRequired[ - "List[Literal['geographic_location', 'inappropriate', 'network_name', 'non_fiat_currency', 'other', 'other_entity', 'promotional_material']]" + List[ + Literal[ + "geographic_location", + "inappropriate", + "network_name", + "non_fiat_currency", + "other", + "other_entity", + "promotional_material", + ] + ] ] """ The reason(s) the carrier text was rejected. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/issuing/_personalization_design_service.py b/stripe/issuing/_personalization_design_service.py index fa06f7e7e..90d2808fb 100644 --- a/stripe/issuing/_personalization_design_service.py +++ b/stripe/issuing/_personalization_design_service.py @@ -11,7 +11,7 @@ class PersonalizationDesignService(StripeService): class CreateParams(TypedDict): - card_logo: NotRequired["str"] + card_logo: NotRequired[str] """ The file for the card logo, for use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. """ @@ -21,19 +21,19 @@ class CreateParams(TypedDict): """ Hash containing carrier text, for use with physical bundles that support carrier text. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - lookup_key: NotRequired["str"] + lookup_key: NotRequired[str] """ A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ Friendly display name. """ @@ -47,7 +47,7 @@ class CreateParams(TypedDict): """ Information on whether this personalization design is used to create cards when one is not specified. """ - transfer_lookup_key: NotRequired["bool"] + transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. """ @@ -77,19 +77,19 @@ class CreateParamsPreferences(TypedDict): """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - lookup_keys: NotRequired["List[str]"] + lookup_keys: NotRequired[List[str]] """ Only return personalization designs with the given lookup keys. """ @@ -99,29 +99,29 @@ class ListParams(TypedDict): """ Only return personalization designs with the given preferences. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['active', 'inactive', 'rejected', 'review']" + Literal["active", "inactive", "rejected", "review"] ] """ Only return personalization designs with the given status. """ class ListParamsPreferences(TypedDict): - is_default: NotRequired["bool"] + is_default: NotRequired[bool] """ Only return the personalization design that's set as the default. A connected account uses the Connect platform's default design if no personalization design is set as the default. """ - is_platform_default: NotRequired["bool"] + is_platform_default: NotRequired[bool] """ Only return the personalization design that is set as the Connect platform's default. This parameter is only applicable to connected accounts. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -137,7 +137,7 @@ class UpdateParams(TypedDict): """ Hash containing carrier text, for use with physical bundles that support carrier text. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -145,7 +145,7 @@ class UpdateParams(TypedDict): """ A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -153,7 +153,7 @@ class UpdateParams(TypedDict): """ Friendly display name. Providing an empty string will set the field to null. """ - physical_bundle: NotRequired["str"] + physical_bundle: NotRequired[str] """ The physical bundle object belonging to this personalization design. """ @@ -163,7 +163,7 @@ class UpdateParams(TypedDict): """ Information on whether this personalization design is used to create cards when one is not specified. """ - transfer_lookup_key: NotRequired["bool"] + transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. """ diff --git a/stripe/issuing/_physical_bundle.py b/stripe/issuing/_physical_bundle.py index 156e2c1f5..4868a7da1 100644 --- a/stripe/issuing/_physical_bundle.py +++ b/stripe/issuing/_physical_bundle.py @@ -32,33 +32,33 @@ class Features(StripeObject): """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['active', 'inactive', 'review']"] + status: NotRequired[Literal["active", "inactive", "review"]] """ Only return physical bundles with the given status. """ - type: NotRequired["Literal['custom', 'standard']"] + type: NotRequired[Literal["custom", "standard"]] """ Only return physical bundles with the given type. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/issuing/_physical_bundle_service.py b/stripe/issuing/_physical_bundle_service.py index 35d93189d..55fa268b6 100644 --- a/stripe/issuing/_physical_bundle_service.py +++ b/stripe/issuing/_physical_bundle_service.py @@ -11,33 +11,33 @@ class PhysicalBundleService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['active', 'inactive', 'review']"] + status: NotRequired[Literal["active", "inactive", "review"]] """ Only return physical bundles with the given status. """ - type: NotRequired["Literal['custom', 'standard']"] + type: NotRequired[Literal["custom", "standard"]] """ Only return physical bundles with the given type. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/issuing/_token.py b/stripe/issuing/_token.py index 4f1ca698b..63387f7ab 100644 --- a/stripe/issuing/_token.py +++ b/stripe/issuing/_token.py @@ -201,49 +201,49 @@ class ListParams(RequestOptions): """ Only return Issuing tokens that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['active', 'deleted', 'requested', 'suspended']" + Literal["active", "deleted", "requested", "suspended"] ] """ Select Issuing tokens with the given status. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -253,7 +253,7 @@ class ModifyParams(RequestOptions): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/issuing/_token_service.py b/stripe/issuing/_token_service.py index 49db37535..521636b68 100644 --- a/stripe/issuing/_token_service.py +++ b/stripe/issuing/_token_service.py @@ -19,55 +19,55 @@ class ListParams(TypedDict): """ Only return Issuing tokens that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['active', 'deleted', 'requested', 'suspended']" + Literal["active", "deleted", "requested", "suspended"] ] """ Select Issuing tokens with the given status. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index 36bd97f4d..4c6184ce0 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -251,11 +251,11 @@ class CreateForceCaptureParams(RequestOptions): """ Card associated with this transaction. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency of the capture. If not provided, defaults to the currency of the card. 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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -274,40 +274,335 @@ class CreateForceCaptureParams(RequestOptions): class CreateForceCaptureParamsMerchantData(TypedDict): category: NotRequired[ - "Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']" + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] ] """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ - city: NotRequired["str"] + city: NotRequired[str] """ City where the seller is located """ - country: NotRequired["str"] + country: NotRequired[str] """ Country where the seller is located """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the seller """ - network_id: NotRequired["str"] + network_id: NotRequired[str] """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code where the seller is located """ - state: NotRequired["str"] + state: NotRequired[str] """ State where the seller is located """ - terminal_id: NotRequired["str"] + terminal_id: NotRequired[str] """ An ID assigned by the seller to the location of the sale. """ - url: NotRequired["str"] + url: NotRequired[str] """ URL provided by the merchant on a 3DS request """ @@ -332,101 +627,109 @@ class CreateForceCaptureParamsPurchaseDetails(TypedDict): Information about lodging that was purchased with this transaction. """ receipt: NotRequired[ - "List[Transaction.CreateForceCaptureParamsPurchaseDetailsReceipt]" + List["Transaction.CreateForceCaptureParamsPurchaseDetailsReceipt"] ] """ The line items in the purchase. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A merchant-specific order number. """ class CreateForceCaptureParamsPurchaseDetailsFlight(TypedDict): - departure_at: NotRequired["int"] + departure_at: NotRequired[int] """ The time that the flight departed. """ - passenger_name: NotRequired["str"] + passenger_name: NotRequired[str] """ The name of the passenger. """ - refundable: NotRequired["bool"] + refundable: NotRequired[bool] """ Whether the ticket is refundable. """ segments: NotRequired[ - "List[Transaction.CreateForceCaptureParamsPurchaseDetailsFlightSegment]" + List[ + "Transaction.CreateForceCaptureParamsPurchaseDetailsFlightSegment" + ] ] """ The legs of the trip. """ - travel_agency: NotRequired["str"] + travel_agency: NotRequired[str] """ The travel agency that issued the ticket. """ class CreateForceCaptureParamsPurchaseDetailsFlightSegment(TypedDict): - arrival_airport_code: NotRequired["str"] + arrival_airport_code: NotRequired[str] """ The three-letter IATA airport code of the flight's destination. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The airline carrier code. """ - departure_airport_code: NotRequired["str"] + departure_airport_code: NotRequired[str] """ The three-letter IATA airport code that the flight departed from. """ - flight_number: NotRequired["str"] + flight_number: NotRequired[str] """ The flight number. """ - service_class: NotRequired["str"] + service_class: NotRequired[str] """ The flight's service class. """ - stopover_allowed: NotRequired["bool"] + stopover_allowed: NotRequired[bool] """ Whether a stopover is allowed on this flight. """ class CreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): type: NotRequired[ - "Literal['diesel', 'other', 'unleaded_plus', 'unleaded_regular', 'unleaded_super']" + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired["Literal['liter', 'us_gallon']"] + unit: NotRequired[Literal["liter", "us_gallon"]] """ The units for `volume_decimal`. One of `us_gallon` or `liter`. """ - unit_cost_decimal: NotRequired["str"] + unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: NotRequired["str"] + volume_decimal: NotRequired[str] """ The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. """ class CreateForceCaptureParamsPurchaseDetailsLodging(TypedDict): - check_in_at: NotRequired["int"] + check_in_at: NotRequired[int] """ The time of checking into the lodging. """ - nights: NotRequired["int"] + nights: NotRequired[int] """ The number of nights stayed at the lodging. """ class CreateForceCaptureParamsPurchaseDetailsReceipt(TypedDict): - description: NotRequired["str"] - quantity: NotRequired["str"] - total: NotRequired["int"] - unit_cost: NotRequired["int"] + description: NotRequired[str] + quantity: NotRequired[str] + total: NotRequired[int] + unit_cost: NotRequired[int] class CreateUnlinkedRefundParams(RequestOptions): amount: int @@ -437,11 +740,11 @@ class CreateUnlinkedRefundParams(RequestOptions): """ Card associated with this unlinked refund transaction. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency of the unlinked refund. If not provided, defaults to the currency of the card. 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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -460,40 +763,335 @@ class CreateUnlinkedRefundParams(RequestOptions): class CreateUnlinkedRefundParamsMerchantData(TypedDict): category: NotRequired[ - "Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']" + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] ] """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ - city: NotRequired["str"] + city: NotRequired[str] """ City where the seller is located """ - country: NotRequired["str"] + country: NotRequired[str] """ Country where the seller is located """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the seller """ - network_id: NotRequired["str"] + network_id: NotRequired[str] """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code where the seller is located """ - state: NotRequired["str"] + state: NotRequired[str] """ State where the seller is located """ - terminal_id: NotRequired["str"] + terminal_id: NotRequired[str] """ An ID assigned by the seller to the location of the sale. """ - url: NotRequired["str"] + url: NotRequired[str] """ URL provided by the merchant on a 3DS request """ @@ -518,108 +1116,118 @@ class CreateUnlinkedRefundParamsPurchaseDetails(TypedDict): Information about lodging that was purchased with this transaction. """ receipt: NotRequired[ - "List[Transaction.CreateUnlinkedRefundParamsPurchaseDetailsReceipt]" + List[ + "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsReceipt" + ] ] """ The line items in the purchase. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A merchant-specific order number. """ class CreateUnlinkedRefundParamsPurchaseDetailsFlight(TypedDict): - departure_at: NotRequired["int"] + departure_at: NotRequired[int] """ The time that the flight departed. """ - passenger_name: NotRequired["str"] + passenger_name: NotRequired[str] """ The name of the passenger. """ - refundable: NotRequired["bool"] + refundable: NotRequired[bool] """ Whether the ticket is refundable. """ segments: NotRequired[ - "List[Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFlightSegment]" + List[ + "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFlightSegment" + ] ] """ The legs of the trip. """ - travel_agency: NotRequired["str"] + travel_agency: NotRequired[str] """ The travel agency that issued the ticket. """ class CreateUnlinkedRefundParamsPurchaseDetailsFlightSegment(TypedDict): - arrival_airport_code: NotRequired["str"] + arrival_airport_code: NotRequired[str] """ The three-letter IATA airport code of the flight's destination. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The airline carrier code. """ - departure_airport_code: NotRequired["str"] + departure_airport_code: NotRequired[str] """ The three-letter IATA airport code that the flight departed from. """ - flight_number: NotRequired["str"] + flight_number: NotRequired[str] """ The flight number. """ - service_class: NotRequired["str"] + service_class: NotRequired[str] """ The flight's service class. """ - stopover_allowed: NotRequired["bool"] + stopover_allowed: NotRequired[bool] """ Whether a stopover is allowed on this flight. """ class CreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): type: NotRequired[ - "Literal['diesel', 'other', 'unleaded_plus', 'unleaded_regular', 'unleaded_super']" + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired["Literal['liter', 'us_gallon']"] + unit: NotRequired[Literal["liter", "us_gallon"]] """ The units for `volume_decimal`. One of `us_gallon` or `liter`. """ - unit_cost_decimal: NotRequired["str"] + unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: NotRequired["str"] + volume_decimal: NotRequired[str] """ The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. """ class CreateUnlinkedRefundParamsPurchaseDetailsLodging(TypedDict): - check_in_at: NotRequired["int"] + check_in_at: NotRequired[int] """ The time of checking into the lodging. """ - nights: NotRequired["int"] + nights: NotRequired[int] """ The number of nights stayed at the lodging. """ class CreateUnlinkedRefundParamsPurchaseDetailsReceipt(TypedDict): - description: NotRequired["str"] - quantity: NotRequired["str"] - total: NotRequired["int"] - unit_cost: NotRequired["int"] + description: NotRequired[str] + quantity: NotRequired[str] + total: NotRequired[int] + unit_cost: NotRequired[int] class ListParams(RequestOptions): - card: NotRequired["str"] + card: NotRequired[str] """ Only return transactions that belong to the given card. """ - cardholder: NotRequired["str"] + cardholder: NotRequired[str] """ Only return transactions that belong to the given cardholder. """ @@ -627,47 +1235,47 @@ class ListParams(RequestOptions): """ Only return transactions that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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: NotRequired["Literal['capture', 'refund']"] + type: NotRequired[Literal["capture", "refund"]] """ Only return transactions that have the given type. One of `capture` or `refund`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -677,17 +1285,17 @@ class ModifyParams(RequestOptions): """ class RefundParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - refund_amount: NotRequired["int"] + refund_amount: NotRequired[int] """ The total amount to attempt to refund. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/issuing/_transaction_service.py b/stripe/issuing/_transaction_service.py index 3a182cf45..6910fa538 100644 --- a/stripe/issuing/_transaction_service.py +++ b/stripe/issuing/_transaction_service.py @@ -11,11 +11,11 @@ class TransactionService(StripeService): class ListParams(TypedDict): - card: NotRequired["str"] + card: NotRequired[str] """ Only return transactions that belong to the given card. """ - cardholder: NotRequired["str"] + cardholder: NotRequired[str] """ Only return transactions that belong to the given cardholder. """ @@ -23,53 +23,53 @@ class ListParams(TypedDict): """ Only return transactions that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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: NotRequired["Literal['capture', 'refund']"] + type: NotRequired[Literal["capture", "refund"]] """ Only return transactions that have the given type. One of `capture` or `refund`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/radar/_early_fraud_warning.py b/stripe/radar/_early_fraud_warning.py index 2204622c2..81899d553 100644 --- a/stripe/radar/_early_fraud_warning.py +++ b/stripe/radar/_early_fraud_warning.py @@ -31,7 +31,7 @@ class EarlyFraudWarning(ListableAPIResource["EarlyFraudWarning"]): ] = "radar.early_fraud_warning" class ListParams(RequestOptions): - charge: NotRequired["str"] + charge: NotRequired[str] """ Only return early fraud warnings for the charge specified by this charge ID. """ @@ -39,47 +39,47 @@ class ListParams(RequestOptions): """ Only return early fraud warnings that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ Only return early fraud warnings for charges that were created by the PaymentIntent specified by this PaymentIntent ID. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/radar/_early_fraud_warning_service.py b/stripe/radar/_early_fraud_warning_service.py index 12fb1703d..31940e009 100644 --- a/stripe/radar/_early_fraud_warning_service.py +++ b/stripe/radar/_early_fraud_warning_service.py @@ -11,7 +11,7 @@ class EarlyFraudWarningService(StripeService): class ListParams(TypedDict): - charge: NotRequired["str"] + charge: NotRequired[str] """ Only return early fraud warnings for the charge specified by this charge ID. """ @@ -19,47 +19,47 @@ class ListParams(TypedDict): """ Only return early fraud warnings that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ Only return early fraud warnings for charges that were created by the PaymentIntent specified by this PaymentIntent ID. """ - starting_after: NotRequired["str"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/radar/_value_list.py b/stripe/radar/_value_list.py index 8d91ffae4..ed0fa44c7 100644 --- a/stripe/radar/_value_list.py +++ b/stripe/radar/_value_list.py @@ -39,17 +39,28 @@ class CreateParams(RequestOptions): """ The name of the value list for use in rules. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ item_type: NotRequired[ - "Literal['card_bin', 'card_fingerprint', 'case_sensitive_string', 'country', 'customer_id', 'email', 'ip_address', 'sepa_debit_fingerprint', 'string', 'us_bank_account_fingerprint']" + Literal[ + "card_bin", + "card_fingerprint", + "case_sensitive_string", + "country", + "customer_id", + "email", + "ip_address", + "sepa_debit_fingerprint", + "string", + "us_bank_account_fingerprint", + ] ] """ Type of the items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. Use `string` if the item type is unknown or mixed. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -62,11 +73,11 @@ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): - alias: NotRequired["str"] + alias: NotRequired[str] """ The alias used to reference the value list when writing rules. """ - contains: NotRequired["str"] + contains: NotRequired[str] """ A value contained within a value list - returns all value lists containing this value. """ @@ -74,61 +85,61 @@ class ListParams(RequestOptions): """ Only return value lists that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - alias: NotRequired["str"] + alias: NotRequired[str] """ The name of the value list for use in rules. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ The human-readable name of the value list. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/radar/_value_list_item.py b/stripe/radar/_value_list_item.py index 8f9abd4e6..b90795c6c 100644 --- a/stripe/radar/_value_list_item.py +++ b/stripe/radar/_value_list_item.py @@ -26,7 +26,7 @@ class ValueListItem( ] = "radar.value_list_item" class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -47,23 +47,23 @@ class ListParams(RequestOptions): """ Only return items that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ - value: NotRequired["str"] + value: NotRequired[str] """ Return items belonging to the parent list whose value matches the specified value (using an "is like" match). """ @@ -73,25 +73,25 @@ class ListParams(RequestOptions): """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/radar/_value_list_item_service.py b/stripe/radar/_value_list_item_service.py index ce97a4cd0..477715442 100644 --- a/stripe/radar/_value_list_item_service.py +++ b/stripe/radar/_value_list_item_service.py @@ -11,7 +11,7 @@ class ValueListItemService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -32,23 +32,23 @@ class ListParams(TypedDict): """ Only return items that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ - value: NotRequired["str"] + value: NotRequired[str] """ Return items belonging to the parent list whose value matches the specified value (using an "is like" match). """ @@ -58,25 +58,25 @@ class ListParams(TypedDict): """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/radar/_value_list_service.py b/stripe/radar/_value_list_service.py index d1a5b49e4..a63d09724 100644 --- a/stripe/radar/_value_list_service.py +++ b/stripe/radar/_value_list_service.py @@ -15,17 +15,28 @@ class CreateParams(TypedDict): """ The name of the value list for use in rules. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ item_type: NotRequired[ - "Literal['card_bin', 'card_fingerprint', 'case_sensitive_string', 'country', 'customer_id', 'email', 'ip_address', 'sepa_debit_fingerprint', 'string', 'us_bank_account_fingerprint']" + Literal[ + "card_bin", + "card_fingerprint", + "case_sensitive_string", + "country", + "customer_id", + "email", + "ip_address", + "sepa_debit_fingerprint", + "string", + "us_bank_account_fingerprint", + ] ] """ Type of the items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. Use `string` if the item type is unknown or mixed. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -38,11 +49,11 @@ class DeleteParams(TypedDict): pass class ListParams(TypedDict): - alias: NotRequired["str"] + alias: NotRequired[str] """ The alias used to reference the value list when writing rules. """ - contains: NotRequired["str"] + contains: NotRequired[str] """ A value contained within a value list - returns all value lists containing this value. """ @@ -50,61 +61,61 @@ class ListParams(TypedDict): """ Only return value lists that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - alias: NotRequired["str"] + alias: NotRequired[str] """ The name of the value list for use in rules. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - name: NotRequired["str"] + name: NotRequired[str] """ The human-readable name of the value list. """ diff --git a/stripe/reporting/_report_run.py b/stripe/reporting/_report_run.py index cd3fbee92..b97af6367 100644 --- a/stripe/reporting/_report_run.py +++ b/stripe/reporting/_report_run.py @@ -72,7 +72,7 @@ class Parameters(StripeObject): """ class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -86,38 +86,676 @@ class CreateParams(RequestOptions): """ class CreateParamsParameters(TypedDict): - columns: NotRequired["List[str]"] + columns: NotRequired[List[str]] """ The set of report columns to include in the report output. If omitted, the Report Type is run with its default column set. """ - connected_account: NotRequired["str"] + connected_account: NotRequired[str] """ Connected account ID to filter for in the report run. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Currency of objects to be included in the report run. """ - interval_end: NotRequired["int"] + interval_end: NotRequired[int] """ Ending timestamp of data to be included in the report run (exclusive). """ - interval_start: NotRequired["int"] + interval_start: NotRequired[int] """ Starting timestamp of data to be included in the report run. """ - payout: NotRequired["str"] + payout: NotRequired[str] """ Payout ID by which to filter the report run. """ reporting_category: NotRequired[ - "Literal['advance', 'advance_funding', 'anticipation_repayment', 'charge', 'charge_failure', 'climate_order_purchase', 'climate_order_refund', 'connect_collection_transfer', 'connect_reserved_funds', 'contribution', 'dispute', 'dispute_reversal', 'fee', 'financing_paydown', 'financing_paydown_reversal', 'financing_payout', 'financing_payout_reversal', 'issuing_authorization_hold', 'issuing_authorization_release', 'issuing_dispute', 'issuing_transaction', 'network_cost', 'other_adjustment', 'partial_capture_reversal', 'payout', 'payout_reversal', 'platform_earning', 'platform_earning_refund', 'refund', 'refund_failure', 'risk_reserved_funds', 'tax', 'topup', 'topup_reversal', 'transfer', 'transfer_reversal', 'unreconciled_customer_funds', 'obligation']" + Literal[ + "advance", + "advance_funding", + "anticipation_repayment", + "charge", + "charge_failure", + "climate_order_purchase", + "climate_order_refund", + "connect_collection_transfer", + "connect_reserved_funds", + "contribution", + "dispute", + "dispute_reversal", + "fee", + "financing_paydown", + "financing_paydown_reversal", + "financing_payout", + "financing_payout_reversal", + "issuing_authorization_hold", + "issuing_authorization_release", + "issuing_dispute", + "issuing_transaction", + "network_cost", + "other_adjustment", + "partial_capture_reversal", + "payout", + "payout_reversal", + "platform_earning", + "platform_earning_refund", + "refund", + "refund_failure", + "risk_reserved_funds", + "tax", + "topup", + "topup_reversal", + "transfer", + "transfer_reversal", + "unreconciled_customer_funds", + "obligation", + ] ] """ Category of balance transactions to be included in the report run. """ timezone: NotRequired[ - "Literal['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Asmera', 'Africa/Bamako', 'Africa/Bangui', 'Africa/Banjul', 'Africa/Bissau', 'Africa/Blantyre', 'Africa/Brazzaville', 'Africa/Bujumbura', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Ceuta', 'Africa/Conakry', 'Africa/Dakar', 'Africa/Dar_es_Salaam', 'Africa/Djibouti', 'Africa/Douala', 'Africa/El_Aaiun', 'Africa/Freetown', 'Africa/Gaborone', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Juba', 'Africa/Kampala', 'Africa/Khartoum', 'Africa/Kigali', 'Africa/Kinshasa', 'Africa/Lagos', 'Africa/Libreville', 'Africa/Lome', 'Africa/Luanda', 'Africa/Lubumbashi', 'Africa/Lusaka', 'Africa/Malabo', 'Africa/Maputo', 'Africa/Maseru', 'Africa/Mbabane', 'Africa/Mogadishu', 'Africa/Monrovia', 'Africa/Nairobi', 'Africa/Ndjamena', 'Africa/Niamey', 'Africa/Nouakchott', 'Africa/Ouagadougou', 'Africa/Porto-Novo', 'Africa/Sao_Tome', 'Africa/Timbuktu', 'Africa/Tripoli', 'Africa/Tunis', 'Africa/Windhoek', 'America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Araguaina', 'America/Argentina/Buenos_Aires', 'America/Argentina/Catamarca', 'America/Argentina/ComodRivadavia', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/La_Rioja', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Salta', 'America/Argentina/San_Juan', 'America/Argentina/San_Luis', 'America/Argentina/Tucuman', 'America/Argentina/Ushuaia', 'America/Aruba', 'America/Asuncion', 'America/Atikokan', 'America/Atka', 'America/Bahia', 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', 'America/Blanc-Sablon', 'America/Boa_Vista', 'America/Bogota', 'America/Boise', 'America/Buenos_Aires', 'America/Cambridge_Bay', 'America/Campo_Grande', 'America/Cancun', 'America/Caracas', 'America/Catamarca', 'America/Cayenne', 'America/Cayman', 'America/Chicago', 'America/Chihuahua', 'America/Ciudad_Juarez', 'America/Coral_Harbour', 'America/Cordoba', 'America/Costa_Rica', 'America/Creston', 'America/Cuiaba', 'America/Curacao', 'America/Danmarkshavn', 'America/Dawson', 'America/Dawson_Creek', 'America/Denver', 'America/Detroit', 'America/Dominica', 'America/Edmonton', 'America/Eirunepe', 'America/El_Salvador', 'America/Ensenada', 'America/Fort_Nelson', 'America/Fort_Wayne', 'America/Fortaleza', 'America/Glace_Bay', 'America/Godthab', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', 'America/Guadeloupe', 'America/Guatemala', 'America/Guayaquil', 'America/Guyana', 'America/Halifax', 'America/Havana', 'America/Hermosillo', 'America/Indiana/Indianapolis', 'America/Indiana/Knox', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Tell_City', 'America/Indiana/Vevay', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Indianapolis', 'America/Inuvik', 'America/Iqaluit', 'America/Jamaica', 'America/Jujuy', 'America/Juneau', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Knox_IN', 'America/Kralendijk', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Louisville', 'America/Lower_Princes', 'America/Maceio', 'America/Managua', 'America/Manaus', 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', 'America/Mendoza', 'America/Menominee', 'America/Merida', 'America/Metlakatla', 'America/Mexico_City', 'America/Miquelon', 'America/Moncton', 'America/Monterrey', 'America/Montevideo', 'America/Montreal', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/Nipigon', 'America/Nome', 'America/Noronha', 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Nuuk', 'America/Ojinaga', 'America/Panama', 'America/Pangnirtung', 'America/Paramaribo', 'America/Phoenix', 'America/Port-au-Prince', 'America/Port_of_Spain', 'America/Porto_Acre', 'America/Porto_Velho', 'America/Puerto_Rico', 'America/Punta_Arenas', 'America/Rainy_River', 'America/Rankin_Inlet', 'America/Recife', 'America/Regina', 'America/Resolute', 'America/Rio_Branco', 'America/Rosario', 'America/Santa_Isabel', 'America/Santarem', 'America/Santiago', 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', 'America/Shiprock', 'America/Sitka', 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Swift_Current', 'America/Tegucigalpa', 'America/Thule', 'America/Thunder_Bay', 'America/Tijuana', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Virgin', 'America/Whitehorse', 'America/Winnipeg', 'America/Yakutat', 'America/Yellowknife', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Macquarie', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/South_Pole', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok', 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Almaty', 'Asia/Amman', 'Asia/Anadyr', 'Asia/Aqtau', 'Asia/Aqtobe', 'Asia/Ashgabat', 'Asia/Ashkhabad', 'Asia/Atyrau', 'Asia/Baghdad', 'Asia/Bahrain', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Barnaul', 'Asia/Beirut', 'Asia/Bishkek', 'Asia/Brunei', 'Asia/Calcutta', 'Asia/Chita', 'Asia/Choibalsan', 'Asia/Chongqing', 'Asia/Chungking', 'Asia/Colombo', 'Asia/Dacca', 'Asia/Damascus', 'Asia/Dhaka', 'Asia/Dili', 'Asia/Dubai', 'Asia/Dushanbe', 'Asia/Famagusta', 'Asia/Gaza', 'Asia/Harbin', 'Asia/Hebron', 'Asia/Ho_Chi_Minh', 'Asia/Hong_Kong', 'Asia/Hovd', 'Asia/Irkutsk', 'Asia/Istanbul', 'Asia/Jakarta', 'Asia/Jayapura', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Kashgar', 'Asia/Kathmandu', 'Asia/Katmandu', 'Asia/Khandyga', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuching', 'Asia/Kuwait', 'Asia/Macao', 'Asia/Macau', 'Asia/Magadan', 'Asia/Makassar', 'Asia/Manila', 'Asia/Muscat', 'Asia/Nicosia', 'Asia/Novokuznetsk', 'Asia/Novosibirsk', 'Asia/Omsk', 'Asia/Oral', 'Asia/Phnom_Penh', 'Asia/Pontianak', 'Asia/Pyongyang', 'Asia/Qatar', 'Asia/Qostanay', 'Asia/Qyzylorda', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Saigon', 'Asia/Sakhalin', 'Asia/Samarkand', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tel_Aviv', 'Asia/Thimbu', 'Asia/Thimphu', 'Asia/Tokyo', 'Asia/Tomsk', 'Asia/Ujung_Pandang', 'Asia/Ulaanbaatar', 'Asia/Ulan_Bator', 'Asia/Urumqi', 'Asia/Ust-Nera', 'Asia/Vientiane', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yangon', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Bermuda', 'Atlantic/Canary', 'Atlantic/Cape_Verde', 'Atlantic/Faeroe', 'Atlantic/Faroe', 'Atlantic/Jan_Mayen', 'Atlantic/Madeira', 'Atlantic/Reykjavik', 'Atlantic/South_Georgia', 'Atlantic/St_Helena', 'Atlantic/Stanley', 'Australia/ACT', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Broken_Hill', 'Australia/Canberra', 'Australia/Currie', 'Australia/Darwin', 'Australia/Eucla', 'Australia/Hobart', 'Australia/LHI', 'Australia/Lindeman', 'Australia/Lord_Howe', 'Australia/Melbourne', 'Australia/NSW', 'Australia/North', 'Australia/Perth', 'Australia/Queensland', 'Australia/South', 'Australia/Sydney', 'Australia/Tasmania', 'Australia/Victoria', 'Australia/West', 'Australia/Yancowinna', 'Brazil/Acre', 'Brazil/DeNoronha', 'Brazil/East', 'Brazil/West', 'CET', 'CST6CDT', 'Canada/Atlantic', 'Canada/Central', 'Canada/Eastern', 'Canada/Mountain', 'Canada/Newfoundland', 'Canada/Pacific', 'Canada/Saskatchewan', 'Canada/Yukon', 'Chile/Continental', 'Chile/EasterIsland', 'Cuba', 'EET', 'EST', 'EST5EDT', 'Egypt', 'Eire', 'Etc/GMT', 'Etc/GMT+0', 'Etc/GMT+1', 'Etc/GMT+10', 'Etc/GMT+11', 'Etc/GMT+12', 'Etc/GMT+2', 'Etc/GMT+3', 'Etc/GMT+4', 'Etc/GMT+5', 'Etc/GMT+6', 'Etc/GMT+7', 'Etc/GMT+8', 'Etc/GMT+9', 'Etc/GMT-0', 'Etc/GMT-1', 'Etc/GMT-10', 'Etc/GMT-11', 'Etc/GMT-12', 'Etc/GMT-13', 'Etc/GMT-14', 'Etc/GMT-2', 'Etc/GMT-3', 'Etc/GMT-4', 'Etc/GMT-5', 'Etc/GMT-6', 'Etc/GMT-7', 'Etc/GMT-8', 'Etc/GMT-9', 'Etc/GMT0', 'Etc/Greenwich', 'Etc/UCT', 'Etc/UTC', 'Etc/Universal', 'Etc/Zulu', 'Europe/Amsterdam', 'Europe/Andorra', 'Europe/Astrakhan', 'Europe/Athens', 'Europe/Belfast', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Busingen', 'Europe/Chisinau', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Gibraltar', 'Europe/Guernsey', 'Europe/Helsinki', 'Europe/Isle_of_Man', 'Europe/Istanbul', 'Europe/Jersey', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Kirov', 'Europe/Kyiv', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/Luxembourg', 'Europe/Madrid', 'Europe/Malta', 'Europe/Mariehamn', 'Europe/Minsk', 'Europe/Monaco', 'Europe/Moscow', 'Europe/Nicosia', 'Europe/Oslo', 'Europe/Paris', 'Europe/Podgorica', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/San_Marino', 'Europe/Sarajevo', 'Europe/Saratov', 'Europe/Simferopol', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Tirane', 'Europe/Tiraspol', 'Europe/Ulyanovsk', 'Europe/Uzhgorod', 'Europe/Vaduz', 'Europe/Vatican', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zaporozhye', 'Europe/Zurich', 'Factory', 'GB', 'GB-Eire', 'GMT', 'GMT+0', 'GMT-0', 'GMT0', 'Greenwich', 'HST', 'Hongkong', 'Iceland', 'Indian/Antananarivo', 'Indian/Chagos', 'Indian/Christmas', 'Indian/Cocos', 'Indian/Comoro', 'Indian/Kerguelen', 'Indian/Mahe', 'Indian/Maldives', 'Indian/Mauritius', 'Indian/Mayotte', 'Indian/Reunion', 'Iran', 'Israel', 'Jamaica', 'Japan', 'Kwajalein', 'Libya', 'MET', 'MST', 'MST7MDT', 'Mexico/BajaNorte', 'Mexico/BajaSur', 'Mexico/General', 'NZ', 'NZ-CHAT', 'Navajo', 'PRC', 'PST8PDT', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Bougainville', 'Pacific/Chatham', 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Enderbury', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Funafuti', 'Pacific/Galapagos', 'Pacific/Gambier', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Johnston', 'Pacific/Kanton', 'Pacific/Kiritimati', 'Pacific/Kosrae', 'Pacific/Kwajalein', 'Pacific/Majuro', 'Pacific/Marquesas', 'Pacific/Midway', 'Pacific/Nauru', 'Pacific/Niue', 'Pacific/Norfolk', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', 'Pacific/Pohnpei', 'Pacific/Ponape', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', 'Pacific/Saipan', 'Pacific/Samoa', 'Pacific/Tahiti', 'Pacific/Tarawa', 'Pacific/Tongatapu', 'Pacific/Truk', 'Pacific/Wake', 'Pacific/Wallis', 'Pacific/Yap', 'Poland', 'Portugal', 'ROC', 'ROK', 'Singapore', 'Turkey', 'UCT', 'US/Alaska', 'US/Aleutian', 'US/Arizona', 'US/Central', 'US/East-Indiana', 'US/Eastern', 'US/Hawaii', 'US/Indiana-Starke', 'US/Michigan', 'US/Mountain', 'US/Pacific', 'US/Pacific-New', 'US/Samoa', 'UTC', 'Universal', 'W-SU', 'WET', 'Zulu']" + Literal[ + "Africa/Abidjan", + "Africa/Accra", + "Africa/Addis_Ababa", + "Africa/Algiers", + "Africa/Asmara", + "Africa/Asmera", + "Africa/Bamako", + "Africa/Bangui", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Blantyre", + "Africa/Brazzaville", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/Conakry", + "Africa/Dakar", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Douala", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Kigali", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Lome", + "Africa/Luanda", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Malabo", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Mogadishu", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Porto-Novo", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Anguilla", + "America/Antigua", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Aruba", + "America/Asuncion", + "America/Atikokan", + "America/Atka", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Buenos_Aires", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Catamarca", + "America/Cayenne", + "America/Cayman", + "America/Chicago", + "America/Chihuahua", + "America/Ciudad_Juarez", + "America/Coral_Harbour", + "America/Cordoba", + "America/Costa_Rica", + "America/Creston", + "America/Cuiaba", + "America/Curacao", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Dominica", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Ensenada", + "America/Fort_Nelson", + "America/Fort_Wayne", + "America/Fortaleza", + "America/Glace_Bay", + "America/Godthab", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Grenada", + "America/Guadeloupe", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Indianapolis", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Jujuy", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Knox_IN", + "America/Kralendijk", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Louisville", + "America/Lower_Princes", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Marigot", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Mendoza", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/Montreal", + "America/Montserrat", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port-au-Prince", + "America/Port_of_Spain", + "America/Porto_Acre", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Rosario", + "America/Santa_Isabel", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Shiprock", + "America/Sitka", + "America/St_Barthelemy", + "America/St_Johns", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Tortola", + "America/Vancouver", + "America/Virgin", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/DumontDUrville", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/McMurdo", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/South_Pole", + "Antarctica/Syowa", + "Antarctica/Troll", + "Antarctica/Vostok", + "Arctic/Longyearbyen", + "Asia/Aden", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Calcutta", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Chongqing", + "Asia/Chungking", + "Asia/Colombo", + "Asia/Dacca", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Harbin", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Istanbul", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kashgar", + "Asia/Kathmandu", + "Asia/Katmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Kuwait", + "Asia/Macao", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Muscat", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Rangoon", + "Asia/Riyadh", + "Asia/Saigon", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Tel_Aviv", + "Asia/Thimbu", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vientiane", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faeroe", + "Atlantic/Faroe", + "Atlantic/Jan_Mayen", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/St_Helena", + "Atlantic/Stanley", + "Australia/ACT", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Canberra", + "Australia/Currie", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/LHI", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/NSW", + "Australia/North", + "Australia/Perth", + "Australia/Queensland", + "Australia/South", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Australia/West", + "Australia/Yancowinna", + "Brazil/Acre", + "Brazil/DeNoronha", + "Brazil/East", + "Brazil/West", + "CET", + "CST6CDT", + "Canada/Atlantic", + "Canada/Central", + "Canada/Eastern", + "Canada/Mountain", + "Canada/Newfoundland", + "Canada/Pacific", + "Canada/Saskatchewan", + "Canada/Yukon", + "Chile/Continental", + "Chile/EasterIsland", + "Cuba", + "EET", + "EST", + "EST5EDT", + "Egypt", + "Eire", + "Etc/GMT", + "Etc/GMT+0", + "Etc/GMT+1", + "Etc/GMT+10", + "Etc/GMT+11", + "Etc/GMT+12", + "Etc/GMT+2", + "Etc/GMT+3", + "Etc/GMT+4", + "Etc/GMT+5", + "Etc/GMT+6", + "Etc/GMT+7", + "Etc/GMT+8", + "Etc/GMT+9", + "Etc/GMT-0", + "Etc/GMT-1", + "Etc/GMT-10", + "Etc/GMT-11", + "Etc/GMT-12", + "Etc/GMT-13", + "Etc/GMT-14", + "Etc/GMT-2", + "Etc/GMT-3", + "Etc/GMT-4", + "Etc/GMT-5", + "Etc/GMT-6", + "Etc/GMT-7", + "Etc/GMT-8", + "Etc/GMT-9", + "Etc/GMT0", + "Etc/Greenwich", + "Etc/UCT", + "Etc/UTC", + "Etc/Universal", + "Etc/Zulu", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belfast", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Busingen", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Guernsey", + "Europe/Helsinki", + "Europe/Isle_of_Man", + "Europe/Istanbul", + "Europe/Jersey", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Kyiv", + "Europe/Lisbon", + "Europe/Ljubljana", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Nicosia", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Skopje", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Tiraspol", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zaporozhye", + "Europe/Zurich", + "Factory", + "GB", + "GB-Eire", + "GMT", + "GMT+0", + "GMT-0", + "GMT0", + "Greenwich", + "HST", + "Hongkong", + "Iceland", + "Indian/Antananarivo", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Comoro", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Mayotte", + "Indian/Reunion", + "Iran", + "Israel", + "Jamaica", + "Japan", + "Kwajalein", + "Libya", + "MET", + "MST", + "MST7MDT", + "Mexico/BajaNorte", + "Mexico/BajaSur", + "Mexico/General", + "NZ", + "NZ-CHAT", + "Navajo", + "PRC", + "PST8PDT", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Enderbury", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Midway", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Ponape", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Saipan", + "Pacific/Samoa", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Truk", + "Pacific/Wake", + "Pacific/Wallis", + "Pacific/Yap", + "Poland", + "Portugal", + "ROC", + "ROK", + "Singapore", + "Turkey", + "UCT", + "US/Alaska", + "US/Aleutian", + "US/Arizona", + "US/Central", + "US/East-Indiana", + "US/Eastern", + "US/Hawaii", + "US/Indiana-Starke", + "US/Michigan", + "US/Mountain", + "US/Pacific", + "US/Pacific-New", + "US/Samoa", + "UTC", + "Universal", + "W-SU", + "WET", + "Zulu", + ] ] """ Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`. @@ -128,43 +766,43 @@ class ListParams(RequestOptions): """ Only return Report Runs that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/reporting/_report_run_service.py b/stripe/reporting/_report_run_service.py index 34c1caaab..d1c47f95c 100644 --- a/stripe/reporting/_report_run_service.py +++ b/stripe/reporting/_report_run_service.py @@ -11,7 +11,7 @@ class ReportRunService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -25,38 +25,676 @@ class CreateParams(TypedDict): """ class CreateParamsParameters(TypedDict): - columns: NotRequired["List[str]"] + columns: NotRequired[List[str]] """ The set of report columns to include in the report output. If omitted, the Report Type is run with its default column set. """ - connected_account: NotRequired["str"] + connected_account: NotRequired[str] """ Connected account ID to filter for in the report run. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ Currency of objects to be included in the report run. """ - interval_end: NotRequired["int"] + interval_end: NotRequired[int] """ Ending timestamp of data to be included in the report run (exclusive). """ - interval_start: NotRequired["int"] + interval_start: NotRequired[int] """ Starting timestamp of data to be included in the report run. """ - payout: NotRequired["str"] + payout: NotRequired[str] """ Payout ID by which to filter the report run. """ reporting_category: NotRequired[ - "Literal['advance', 'advance_funding', 'anticipation_repayment', 'charge', 'charge_failure', 'climate_order_purchase', 'climate_order_refund', 'connect_collection_transfer', 'connect_reserved_funds', 'contribution', 'dispute', 'dispute_reversal', 'fee', 'financing_paydown', 'financing_paydown_reversal', 'financing_payout', 'financing_payout_reversal', 'issuing_authorization_hold', 'issuing_authorization_release', 'issuing_dispute', 'issuing_transaction', 'network_cost', 'other_adjustment', 'partial_capture_reversal', 'payout', 'payout_reversal', 'platform_earning', 'platform_earning_refund', 'refund', 'refund_failure', 'risk_reserved_funds', 'tax', 'topup', 'topup_reversal', 'transfer', 'transfer_reversal', 'unreconciled_customer_funds', 'obligation']" + Literal[ + "advance", + "advance_funding", + "anticipation_repayment", + "charge", + "charge_failure", + "climate_order_purchase", + "climate_order_refund", + "connect_collection_transfer", + "connect_reserved_funds", + "contribution", + "dispute", + "dispute_reversal", + "fee", + "financing_paydown", + "financing_paydown_reversal", + "financing_payout", + "financing_payout_reversal", + "issuing_authorization_hold", + "issuing_authorization_release", + "issuing_dispute", + "issuing_transaction", + "network_cost", + "other_adjustment", + "partial_capture_reversal", + "payout", + "payout_reversal", + "platform_earning", + "platform_earning_refund", + "refund", + "refund_failure", + "risk_reserved_funds", + "tax", + "topup", + "topup_reversal", + "transfer", + "transfer_reversal", + "unreconciled_customer_funds", + "obligation", + ] ] """ Category of balance transactions to be included in the report run. """ timezone: NotRequired[ - "Literal['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Asmera', 'Africa/Bamako', 'Africa/Bangui', 'Africa/Banjul', 'Africa/Bissau', 'Africa/Blantyre', 'Africa/Brazzaville', 'Africa/Bujumbura', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Ceuta', 'Africa/Conakry', 'Africa/Dakar', 'Africa/Dar_es_Salaam', 'Africa/Djibouti', 'Africa/Douala', 'Africa/El_Aaiun', 'Africa/Freetown', 'Africa/Gaborone', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Juba', 'Africa/Kampala', 'Africa/Khartoum', 'Africa/Kigali', 'Africa/Kinshasa', 'Africa/Lagos', 'Africa/Libreville', 'Africa/Lome', 'Africa/Luanda', 'Africa/Lubumbashi', 'Africa/Lusaka', 'Africa/Malabo', 'Africa/Maputo', 'Africa/Maseru', 'Africa/Mbabane', 'Africa/Mogadishu', 'Africa/Monrovia', 'Africa/Nairobi', 'Africa/Ndjamena', 'Africa/Niamey', 'Africa/Nouakchott', 'Africa/Ouagadougou', 'Africa/Porto-Novo', 'Africa/Sao_Tome', 'Africa/Timbuktu', 'Africa/Tripoli', 'Africa/Tunis', 'Africa/Windhoek', 'America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Araguaina', 'America/Argentina/Buenos_Aires', 'America/Argentina/Catamarca', 'America/Argentina/ComodRivadavia', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/La_Rioja', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Salta', 'America/Argentina/San_Juan', 'America/Argentina/San_Luis', 'America/Argentina/Tucuman', 'America/Argentina/Ushuaia', 'America/Aruba', 'America/Asuncion', 'America/Atikokan', 'America/Atka', 'America/Bahia', 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', 'America/Blanc-Sablon', 'America/Boa_Vista', 'America/Bogota', 'America/Boise', 'America/Buenos_Aires', 'America/Cambridge_Bay', 'America/Campo_Grande', 'America/Cancun', 'America/Caracas', 'America/Catamarca', 'America/Cayenne', 'America/Cayman', 'America/Chicago', 'America/Chihuahua', 'America/Ciudad_Juarez', 'America/Coral_Harbour', 'America/Cordoba', 'America/Costa_Rica', 'America/Creston', 'America/Cuiaba', 'America/Curacao', 'America/Danmarkshavn', 'America/Dawson', 'America/Dawson_Creek', 'America/Denver', 'America/Detroit', 'America/Dominica', 'America/Edmonton', 'America/Eirunepe', 'America/El_Salvador', 'America/Ensenada', 'America/Fort_Nelson', 'America/Fort_Wayne', 'America/Fortaleza', 'America/Glace_Bay', 'America/Godthab', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', 'America/Guadeloupe', 'America/Guatemala', 'America/Guayaquil', 'America/Guyana', 'America/Halifax', 'America/Havana', 'America/Hermosillo', 'America/Indiana/Indianapolis', 'America/Indiana/Knox', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Tell_City', 'America/Indiana/Vevay', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Indianapolis', 'America/Inuvik', 'America/Iqaluit', 'America/Jamaica', 'America/Jujuy', 'America/Juneau', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Knox_IN', 'America/Kralendijk', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Louisville', 'America/Lower_Princes', 'America/Maceio', 'America/Managua', 'America/Manaus', 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', 'America/Mendoza', 'America/Menominee', 'America/Merida', 'America/Metlakatla', 'America/Mexico_City', 'America/Miquelon', 'America/Moncton', 'America/Monterrey', 'America/Montevideo', 'America/Montreal', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/Nipigon', 'America/Nome', 'America/Noronha', 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Nuuk', 'America/Ojinaga', 'America/Panama', 'America/Pangnirtung', 'America/Paramaribo', 'America/Phoenix', 'America/Port-au-Prince', 'America/Port_of_Spain', 'America/Porto_Acre', 'America/Porto_Velho', 'America/Puerto_Rico', 'America/Punta_Arenas', 'America/Rainy_River', 'America/Rankin_Inlet', 'America/Recife', 'America/Regina', 'America/Resolute', 'America/Rio_Branco', 'America/Rosario', 'America/Santa_Isabel', 'America/Santarem', 'America/Santiago', 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', 'America/Shiprock', 'America/Sitka', 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Swift_Current', 'America/Tegucigalpa', 'America/Thule', 'America/Thunder_Bay', 'America/Tijuana', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Virgin', 'America/Whitehorse', 'America/Winnipeg', 'America/Yakutat', 'America/Yellowknife', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Macquarie', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/South_Pole', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok', 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Almaty', 'Asia/Amman', 'Asia/Anadyr', 'Asia/Aqtau', 'Asia/Aqtobe', 'Asia/Ashgabat', 'Asia/Ashkhabad', 'Asia/Atyrau', 'Asia/Baghdad', 'Asia/Bahrain', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Barnaul', 'Asia/Beirut', 'Asia/Bishkek', 'Asia/Brunei', 'Asia/Calcutta', 'Asia/Chita', 'Asia/Choibalsan', 'Asia/Chongqing', 'Asia/Chungking', 'Asia/Colombo', 'Asia/Dacca', 'Asia/Damascus', 'Asia/Dhaka', 'Asia/Dili', 'Asia/Dubai', 'Asia/Dushanbe', 'Asia/Famagusta', 'Asia/Gaza', 'Asia/Harbin', 'Asia/Hebron', 'Asia/Ho_Chi_Minh', 'Asia/Hong_Kong', 'Asia/Hovd', 'Asia/Irkutsk', 'Asia/Istanbul', 'Asia/Jakarta', 'Asia/Jayapura', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Kashgar', 'Asia/Kathmandu', 'Asia/Katmandu', 'Asia/Khandyga', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuching', 'Asia/Kuwait', 'Asia/Macao', 'Asia/Macau', 'Asia/Magadan', 'Asia/Makassar', 'Asia/Manila', 'Asia/Muscat', 'Asia/Nicosia', 'Asia/Novokuznetsk', 'Asia/Novosibirsk', 'Asia/Omsk', 'Asia/Oral', 'Asia/Phnom_Penh', 'Asia/Pontianak', 'Asia/Pyongyang', 'Asia/Qatar', 'Asia/Qostanay', 'Asia/Qyzylorda', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Saigon', 'Asia/Sakhalin', 'Asia/Samarkand', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tel_Aviv', 'Asia/Thimbu', 'Asia/Thimphu', 'Asia/Tokyo', 'Asia/Tomsk', 'Asia/Ujung_Pandang', 'Asia/Ulaanbaatar', 'Asia/Ulan_Bator', 'Asia/Urumqi', 'Asia/Ust-Nera', 'Asia/Vientiane', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yangon', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Bermuda', 'Atlantic/Canary', 'Atlantic/Cape_Verde', 'Atlantic/Faeroe', 'Atlantic/Faroe', 'Atlantic/Jan_Mayen', 'Atlantic/Madeira', 'Atlantic/Reykjavik', 'Atlantic/South_Georgia', 'Atlantic/St_Helena', 'Atlantic/Stanley', 'Australia/ACT', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Broken_Hill', 'Australia/Canberra', 'Australia/Currie', 'Australia/Darwin', 'Australia/Eucla', 'Australia/Hobart', 'Australia/LHI', 'Australia/Lindeman', 'Australia/Lord_Howe', 'Australia/Melbourne', 'Australia/NSW', 'Australia/North', 'Australia/Perth', 'Australia/Queensland', 'Australia/South', 'Australia/Sydney', 'Australia/Tasmania', 'Australia/Victoria', 'Australia/West', 'Australia/Yancowinna', 'Brazil/Acre', 'Brazil/DeNoronha', 'Brazil/East', 'Brazil/West', 'CET', 'CST6CDT', 'Canada/Atlantic', 'Canada/Central', 'Canada/Eastern', 'Canada/Mountain', 'Canada/Newfoundland', 'Canada/Pacific', 'Canada/Saskatchewan', 'Canada/Yukon', 'Chile/Continental', 'Chile/EasterIsland', 'Cuba', 'EET', 'EST', 'EST5EDT', 'Egypt', 'Eire', 'Etc/GMT', 'Etc/GMT+0', 'Etc/GMT+1', 'Etc/GMT+10', 'Etc/GMT+11', 'Etc/GMT+12', 'Etc/GMT+2', 'Etc/GMT+3', 'Etc/GMT+4', 'Etc/GMT+5', 'Etc/GMT+6', 'Etc/GMT+7', 'Etc/GMT+8', 'Etc/GMT+9', 'Etc/GMT-0', 'Etc/GMT-1', 'Etc/GMT-10', 'Etc/GMT-11', 'Etc/GMT-12', 'Etc/GMT-13', 'Etc/GMT-14', 'Etc/GMT-2', 'Etc/GMT-3', 'Etc/GMT-4', 'Etc/GMT-5', 'Etc/GMT-6', 'Etc/GMT-7', 'Etc/GMT-8', 'Etc/GMT-9', 'Etc/GMT0', 'Etc/Greenwich', 'Etc/UCT', 'Etc/UTC', 'Etc/Universal', 'Etc/Zulu', 'Europe/Amsterdam', 'Europe/Andorra', 'Europe/Astrakhan', 'Europe/Athens', 'Europe/Belfast', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Busingen', 'Europe/Chisinau', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Gibraltar', 'Europe/Guernsey', 'Europe/Helsinki', 'Europe/Isle_of_Man', 'Europe/Istanbul', 'Europe/Jersey', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Kirov', 'Europe/Kyiv', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/Luxembourg', 'Europe/Madrid', 'Europe/Malta', 'Europe/Mariehamn', 'Europe/Minsk', 'Europe/Monaco', 'Europe/Moscow', 'Europe/Nicosia', 'Europe/Oslo', 'Europe/Paris', 'Europe/Podgorica', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/San_Marino', 'Europe/Sarajevo', 'Europe/Saratov', 'Europe/Simferopol', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Tirane', 'Europe/Tiraspol', 'Europe/Ulyanovsk', 'Europe/Uzhgorod', 'Europe/Vaduz', 'Europe/Vatican', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zaporozhye', 'Europe/Zurich', 'Factory', 'GB', 'GB-Eire', 'GMT', 'GMT+0', 'GMT-0', 'GMT0', 'Greenwich', 'HST', 'Hongkong', 'Iceland', 'Indian/Antananarivo', 'Indian/Chagos', 'Indian/Christmas', 'Indian/Cocos', 'Indian/Comoro', 'Indian/Kerguelen', 'Indian/Mahe', 'Indian/Maldives', 'Indian/Mauritius', 'Indian/Mayotte', 'Indian/Reunion', 'Iran', 'Israel', 'Jamaica', 'Japan', 'Kwajalein', 'Libya', 'MET', 'MST', 'MST7MDT', 'Mexico/BajaNorte', 'Mexico/BajaSur', 'Mexico/General', 'NZ', 'NZ-CHAT', 'Navajo', 'PRC', 'PST8PDT', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Bougainville', 'Pacific/Chatham', 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Enderbury', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Funafuti', 'Pacific/Galapagos', 'Pacific/Gambier', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Johnston', 'Pacific/Kanton', 'Pacific/Kiritimati', 'Pacific/Kosrae', 'Pacific/Kwajalein', 'Pacific/Majuro', 'Pacific/Marquesas', 'Pacific/Midway', 'Pacific/Nauru', 'Pacific/Niue', 'Pacific/Norfolk', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', 'Pacific/Pohnpei', 'Pacific/Ponape', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', 'Pacific/Saipan', 'Pacific/Samoa', 'Pacific/Tahiti', 'Pacific/Tarawa', 'Pacific/Tongatapu', 'Pacific/Truk', 'Pacific/Wake', 'Pacific/Wallis', 'Pacific/Yap', 'Poland', 'Portugal', 'ROC', 'ROK', 'Singapore', 'Turkey', 'UCT', 'US/Alaska', 'US/Aleutian', 'US/Arizona', 'US/Central', 'US/East-Indiana', 'US/Eastern', 'US/Hawaii', 'US/Indiana-Starke', 'US/Michigan', 'US/Mountain', 'US/Pacific', 'US/Pacific-New', 'US/Samoa', 'UTC', 'Universal', 'W-SU', 'WET', 'Zulu']" + Literal[ + "Africa/Abidjan", + "Africa/Accra", + "Africa/Addis_Ababa", + "Africa/Algiers", + "Africa/Asmara", + "Africa/Asmera", + "Africa/Bamako", + "Africa/Bangui", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Blantyre", + "Africa/Brazzaville", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/Conakry", + "Africa/Dakar", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Douala", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Kigali", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Lome", + "Africa/Luanda", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Malabo", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Mogadishu", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Porto-Novo", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Anguilla", + "America/Antigua", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Aruba", + "America/Asuncion", + "America/Atikokan", + "America/Atka", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Buenos_Aires", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Catamarca", + "America/Cayenne", + "America/Cayman", + "America/Chicago", + "America/Chihuahua", + "America/Ciudad_Juarez", + "America/Coral_Harbour", + "America/Cordoba", + "America/Costa_Rica", + "America/Creston", + "America/Cuiaba", + "America/Curacao", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Dominica", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Ensenada", + "America/Fort_Nelson", + "America/Fort_Wayne", + "America/Fortaleza", + "America/Glace_Bay", + "America/Godthab", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Grenada", + "America/Guadeloupe", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Indianapolis", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Jujuy", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Knox_IN", + "America/Kralendijk", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Louisville", + "America/Lower_Princes", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Marigot", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Mendoza", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/Montreal", + "America/Montserrat", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port-au-Prince", + "America/Port_of_Spain", + "America/Porto_Acre", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Rosario", + "America/Santa_Isabel", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Shiprock", + "America/Sitka", + "America/St_Barthelemy", + "America/St_Johns", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Tortola", + "America/Vancouver", + "America/Virgin", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/DumontDUrville", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/McMurdo", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/South_Pole", + "Antarctica/Syowa", + "Antarctica/Troll", + "Antarctica/Vostok", + "Arctic/Longyearbyen", + "Asia/Aden", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Calcutta", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Chongqing", + "Asia/Chungking", + "Asia/Colombo", + "Asia/Dacca", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Harbin", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Istanbul", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kashgar", + "Asia/Kathmandu", + "Asia/Katmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Kuwait", + "Asia/Macao", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Muscat", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Rangoon", + "Asia/Riyadh", + "Asia/Saigon", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Tel_Aviv", + "Asia/Thimbu", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vientiane", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faeroe", + "Atlantic/Faroe", + "Atlantic/Jan_Mayen", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/St_Helena", + "Atlantic/Stanley", + "Australia/ACT", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Canberra", + "Australia/Currie", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/LHI", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/NSW", + "Australia/North", + "Australia/Perth", + "Australia/Queensland", + "Australia/South", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Australia/West", + "Australia/Yancowinna", + "Brazil/Acre", + "Brazil/DeNoronha", + "Brazil/East", + "Brazil/West", + "CET", + "CST6CDT", + "Canada/Atlantic", + "Canada/Central", + "Canada/Eastern", + "Canada/Mountain", + "Canada/Newfoundland", + "Canada/Pacific", + "Canada/Saskatchewan", + "Canada/Yukon", + "Chile/Continental", + "Chile/EasterIsland", + "Cuba", + "EET", + "EST", + "EST5EDT", + "Egypt", + "Eire", + "Etc/GMT", + "Etc/GMT+0", + "Etc/GMT+1", + "Etc/GMT+10", + "Etc/GMT+11", + "Etc/GMT+12", + "Etc/GMT+2", + "Etc/GMT+3", + "Etc/GMT+4", + "Etc/GMT+5", + "Etc/GMT+6", + "Etc/GMT+7", + "Etc/GMT+8", + "Etc/GMT+9", + "Etc/GMT-0", + "Etc/GMT-1", + "Etc/GMT-10", + "Etc/GMT-11", + "Etc/GMT-12", + "Etc/GMT-13", + "Etc/GMT-14", + "Etc/GMT-2", + "Etc/GMT-3", + "Etc/GMT-4", + "Etc/GMT-5", + "Etc/GMT-6", + "Etc/GMT-7", + "Etc/GMT-8", + "Etc/GMT-9", + "Etc/GMT0", + "Etc/Greenwich", + "Etc/UCT", + "Etc/UTC", + "Etc/Universal", + "Etc/Zulu", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belfast", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Busingen", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Guernsey", + "Europe/Helsinki", + "Europe/Isle_of_Man", + "Europe/Istanbul", + "Europe/Jersey", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Kyiv", + "Europe/Lisbon", + "Europe/Ljubljana", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Nicosia", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Skopje", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Tiraspol", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zaporozhye", + "Europe/Zurich", + "Factory", + "GB", + "GB-Eire", + "GMT", + "GMT+0", + "GMT-0", + "GMT0", + "Greenwich", + "HST", + "Hongkong", + "Iceland", + "Indian/Antananarivo", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Comoro", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Mayotte", + "Indian/Reunion", + "Iran", + "Israel", + "Jamaica", + "Japan", + "Kwajalein", + "Libya", + "MET", + "MST", + "MST7MDT", + "Mexico/BajaNorte", + "Mexico/BajaSur", + "Mexico/General", + "NZ", + "NZ-CHAT", + "Navajo", + "PRC", + "PST8PDT", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Enderbury", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Midway", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Ponape", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Saipan", + "Pacific/Samoa", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Truk", + "Pacific/Wake", + "Pacific/Wallis", + "Pacific/Yap", + "Poland", + "Portugal", + "ROC", + "ROK", + "Singapore", + "Turkey", + "UCT", + "US/Alaska", + "US/Aleutian", + "US/Arizona", + "US/Central", + "US/East-Indiana", + "US/Eastern", + "US/Hawaii", + "US/Indiana-Starke", + "US/Michigan", + "US/Mountain", + "US/Pacific", + "US/Pacific-New", + "US/Samoa", + "UTC", + "Universal", + "W-SU", + "WET", + "Zulu", + ] ] """ Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`. @@ -67,43 +705,43 @@ class ListParams(TypedDict): """ Only return Report Runs that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/reporting/_report_type.py b/stripe/reporting/_report_type.py index 3fa5375fe..7e0eeff2b 100644 --- a/stripe/reporting/_report_type.py +++ b/stripe/reporting/_report_type.py @@ -24,13 +24,13 @@ class ReportType(ListableAPIResource["ReportType"]): ] = "reporting.report_type" class ListParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/reporting/_report_type_service.py b/stripe/reporting/_report_type_service.py index e86703bee..b8075889f 100644 --- a/stripe/reporting/_report_type_service.py +++ b/stripe/reporting/_report_type_service.py @@ -11,13 +11,13 @@ class ReportTypeService(StripeService): class ListParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/sigma/_scheduled_query_run.py b/stripe/sigma/_scheduled_query_run.py index a31c701a6..1f8be909b 100644 --- a/stripe/sigma/_scheduled_query_run.py +++ b/stripe/sigma/_scheduled_query_run.py @@ -30,25 +30,25 @@ class Error(StripeObject): """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/sigma/_scheduled_query_run_service.py b/stripe/sigma/_scheduled_query_run_service.py index 1569042d0..3648820a1 100644 --- a/stripe/sigma/_scheduled_query_run_service.py +++ b/stripe/sigma/_scheduled_query_run_service.py @@ -11,25 +11,25 @@ class ScheduledQueryRunService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 3d9c22ce6..1af54da48 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -348,7 +348,7 @@ class CreateParams(RequestOptions): """ 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). """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of an existing customer to use for this calculation. If provided, the customer's address and tax IDs are copied to `customer_details`. """ @@ -358,7 +358,7 @@ class CreateParams(RequestOptions): """ Details about the customer, including address and tax IDs. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -370,7 +370,7 @@ class CreateParams(RequestOptions): """ Shipping cost details to be used for the calculation. """ - tax_date: NotRequired["int"] + tax_date: NotRequired[int] """ Timestamp of date at which the tax rules and rates in effect applies for the calculation. Measured in seconds since the Unix epoch. Can be up to 48 hours in the past, and up to 48 hours in the future. """ @@ -380,22 +380,22 @@ class CreateParamsCustomerDetails(TypedDict): """ The customer's postal address (for example, home or business location). """ - address_source: NotRequired["Literal['billing', 'shipping']"] + address_source: NotRequired[Literal["billing", "shipping"]] """ The type of customer address provided. """ - ip_address: NotRequired["str"] + ip_address: NotRequired[str] """ The customer's IP address (IPv4 or IPv6). """ tax_ids: NotRequired[ - "List[Calculation.CreateParamsCustomerDetailsTaxId]" + List["Calculation.CreateParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. Stripe Tax might consider a transaction with applicable tax IDs to be B2B, which might affect the tax calculation result. Stripe Tax doesn't validate tax IDs for correctness. """ taxability_override: NotRequired[ - "Literal['customer_exempt', 'none', 'reverse_charge']" + Literal["customer_exempt", "none", "reverse_charge"] ] """ Overrides the tax calculation result to allow you to not collect tax from your customer. Use this if you've manually checked your customer's tax exemptions. Prefer providing the customer's `tax_ids` where possible, which automatically determines whether `reverse_charge` applies. @@ -510,59 +510,59 @@ class CreateParamsLineItem(TypedDict): """ A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the line item's total price. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ - product: NotRequired["str"] + product: NotRequired[str] """ If provided, the product's `tax_code` will be used as the line item's `tax_code`. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The number of units of the item being purchased. Used to calculate the per-unit price from the total `amount` for the line. For example, if `amount=100` and `quantity=4`, the calculated unit price is 25. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A custom identifier for this line item, which must be unique across the line items in the calculation. The reference helps identify each line item in exported [tax reports](https://stripe.com/docs/tax/reports). """ - tax_behavior: NotRequired["Literal['exclusive', 'inclusive']"] + tax_behavior: NotRequired[Literal["exclusive", "inclusive"]] """ Specifies whether the `amount` includes taxes. Defaults to `exclusive`. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID to use for this line item. If not provided, we will use the tax code from the provided `product` param. If neither `tax_code` nor `product` is provided, we will use the default tax code from your Tax Settings. """ class CreateParamsShippingCost(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer in the [smallest currency unit](https://stripe.com/docs/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. """ - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ If provided, the [shipping rate](https://stripe.com/docs/api/shipping_rates/object)'s `amount`, `tax_code` and `tax_behavior` are used. If you provide a shipping rate, then you cannot pass the `amount`, `tax_code`, or `tax_behavior` parameters. """ - tax_behavior: NotRequired["Literal['exclusive', 'inclusive']"] + tax_behavior: NotRequired[Literal["exclusive", "inclusive"]] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. Defaults to `exclusive`. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ The [tax code](https://stripe.com/docs/tax/tax-categories) used to calculate tax on shipping. If not provided, the default shipping tax code from your [Tax Settings](https://stripe.com/settings/tax) is used. """ class ListLineItemsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ diff --git a/stripe/tax/_calculation_line_item_service.py b/stripe/tax/_calculation_line_item_service.py index 777d59f5d..7107782b9 100644 --- a/stripe/tax/_calculation_line_item_service.py +++ b/stripe/tax/_calculation_line_item_service.py @@ -11,19 +11,19 @@ class CalculationLineItemService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index cd75a18df..77c8d7096 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -20,7 +20,7 @@ class CreateParams(TypedDict): """ 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). """ - customer: NotRequired["str"] + customer: NotRequired[str] """ The ID of an existing customer to use for this calculation. If provided, the customer's address and tax IDs are copied to `customer_details`. """ @@ -30,7 +30,7 @@ class CreateParams(TypedDict): """ Details about the customer, including address and tax IDs. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -44,7 +44,7 @@ class CreateParams(TypedDict): """ Shipping cost details to be used for the calculation. """ - tax_date: NotRequired["int"] + tax_date: NotRequired[int] """ Timestamp of date at which the tax rules and rates in effect applies for the calculation. Measured in seconds since the Unix epoch. Can be up to 48 hours in the past, and up to 48 hours in the future. """ @@ -56,22 +56,22 @@ class CreateParamsCustomerDetails(TypedDict): """ The customer's postal address (for example, home or business location). """ - address_source: NotRequired["Literal['billing', 'shipping']"] + address_source: NotRequired[Literal["billing", "shipping"]] """ The type of customer address provided. """ - ip_address: NotRequired["str"] + ip_address: NotRequired[str] """ The customer's IP address (IPv4 or IPv6). """ tax_ids: NotRequired[ - "List[CalculationService.CreateParamsCustomerDetailsTaxId]" + List["CalculationService.CreateParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. Stripe Tax might consider a transaction with applicable tax IDs to be B2B, which might affect the tax calculation result. Stripe Tax doesn't validate tax IDs for correctness. """ taxability_override: NotRequired[ - "Literal['customer_exempt', 'none', 'reverse_charge']" + Literal["customer_exempt", "none", "reverse_charge"] ] """ Overrides the tax calculation result to allow you to not collect tax from your customer. Use this if you've manually checked your customer's tax exemptions. Prefer providing the customer's `tax_ids` where possible, which automatically determines whether `reverse_charge` applies. @@ -186,41 +186,41 @@ class CreateParamsLineItem(TypedDict): """ A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the line item's total price. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ - product: NotRequired["str"] + product: NotRequired[str] """ If provided, the product's `tax_code` will be used as the line item's `tax_code`. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The number of units of the item being purchased. Used to calculate the per-unit price from the total `amount` for the line. For example, if `amount=100` and `quantity=4`, the calculated unit price is 25. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A custom identifier for this line item, which must be unique across the line items in the calculation. The reference helps identify each line item in exported [tax reports](https://stripe.com/docs/tax/reports). """ - tax_behavior: NotRequired["Literal['exclusive', 'inclusive']"] + tax_behavior: NotRequired[Literal["exclusive", "inclusive"]] """ Specifies whether the `amount` includes taxes. Defaults to `exclusive`. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID to use for this line item. If not provided, we will use the tax code from the provided `product` param. If neither `tax_code` nor `product` is provided, we will use the default tax code from your Tax Settings. """ class CreateParamsShippingCost(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer in the [smallest currency unit](https://stripe.com/docs/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. """ - shipping_rate: NotRequired["str"] + shipping_rate: NotRequired[str] """ If provided, the [shipping rate](https://stripe.com/docs/api/shipping_rates/object)'s `amount`, `tax_code` and `tax_behavior` are used. If you provide a shipping rate, then you cannot pass the `amount`, `tax_code`, or `tax_behavior` parameters. """ - tax_behavior: NotRequired["Literal['exclusive', 'inclusive']"] + tax_behavior: NotRequired[Literal["exclusive", "inclusive"]] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. Defaults to `exclusive`. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ The [tax code](https://stripe.com/docs/tax/tax-categories) used to calculate tax on shipping. If not provided, the default shipping tax code from your [Tax Settings](https://stripe.com/settings/tax) is used. """ diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index c2e29d3c5..623063d09 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -687,11 +687,11 @@ class CreateParams(RequestOptions): """ Specific options for a registration in the specified `country`. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ If set, the Tax Registration stops being active at this time. If not set, the Tax Registration will be active indefinitely. Timestamp measured in seconds since the Unix epoch. """ @@ -1559,23 +1559,23 @@ class CreateParamsCountryOptionsZa(TypedDict): """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['active', 'all', 'expired', 'scheduled']"] + status: NotRequired[Literal["active", "all", "expired", "scheduled"]] """ The status of the Tax Registration. """ @@ -1585,7 +1585,7 @@ class ModifyParams(RequestOptions): """ Time at which the registration becomes active. It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -1595,7 +1595,7 @@ class ModifyParams(RequestOptions): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index de7f87694..bcaa78d14 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -23,11 +23,11 @@ class CreateParams(TypedDict): """ Specific options for a registration in the specified `country`. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["int"] + expires_at: NotRequired[int] """ If set, the Tax Registration stops being active at this time. If not set, the Tax Registration will be active indefinitely. Timestamp measured in seconds since the Unix epoch. """ @@ -899,29 +899,29 @@ class CreateParamsCountryOptionsZa(TypedDict): """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['active', 'all', 'expired', 'scheduled']"] + status: NotRequired[Literal["active", "all", "expired", "scheduled"]] """ The status of the Tax Registration. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -931,7 +931,7 @@ class UpdateParams(TypedDict): """ Time at which the registration becomes active. It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/tax/_settings.py b/stripe/tax/_settings.py index f7d7316a2..cf8615d50 100644 --- a/stripe/tax/_settings.py +++ b/stripe/tax/_settings.py @@ -81,7 +81,7 @@ class ModifyParams(RequestOptions): """ Default configuration to be used on Stripe Tax calculations. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -92,12 +92,12 @@ class ModifyParams(RequestOptions): class ModifyParamsDefaults(TypedDict): tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'inferred_by_currency']" + Literal["exclusive", "inclusive", "inferred_by_currency"] ] """ Specifies the default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) to be used when the item's price has unspecified tax behavior. One of inclusive, exclusive, or inferred_by_currency. Once specified, it cannot be changed back to null. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ @@ -109,33 +109,33 @@ class ModifyParamsHeadOffice(TypedDict): """ class ModifyParamsHeadOfficeAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/tax/_settings_service.py b/stripe/tax/_settings_service.py index fcc734488..542a4675f 100644 --- a/stripe/tax/_settings_service.py +++ b/stripe/tax/_settings_service.py @@ -9,7 +9,7 @@ class SettingsService(StripeService): class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -19,7 +19,7 @@ class UpdateParams(TypedDict): """ Default configuration to be used on Stripe Tax calculations. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -30,12 +30,12 @@ class UpdateParams(TypedDict): class UpdateParamsDefaults(TypedDict): tax_behavior: NotRequired[ - "Literal['exclusive', 'inclusive', 'inferred_by_currency']" + Literal["exclusive", "inclusive", "inferred_by_currency"] ] """ Specifies the default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) to be used when the item's price has unspecified tax behavior. One of inclusive, exclusive, or inferred_by_currency. Once specified, it cannot be changed back to null. """ - tax_code: NotRequired["str"] + tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ @@ -47,27 +47,27 @@ class UpdateParamsHeadOffice(TypedDict): """ class UpdateParamsHeadOfficeAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". """ diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index 2977affcb..6c9323bda 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -285,11 +285,11 @@ class CreateFromCalculationParams(RequestOptions): """ Tax Calculation ID to be used as input when creating the transaction. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -299,21 +299,21 @@ class CreateFromCalculationParams(RequestOptions): """ class CreateReversalParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - flat_amount: NotRequired["int"] + flat_amount: NotRequired[int] """ A flat amount to reverse across the entire transaction, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. This value represents the total amount to refund from the transaction, including taxes. """ line_items: NotRequired[ - "List[Transaction.CreateReversalParamsLineItem]" + List["Transaction.CreateReversalParamsLineItem"] ] """ The line item amounts to reverse. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -345,7 +345,7 @@ class CreateReversalParamsLineItem(TypedDict): """ The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ @@ -353,7 +353,7 @@ class CreateReversalParamsLineItem(TypedDict): """ The `id` of the line item to reverse in the original transaction. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity reversed. Appears in [tax exports](https://stripe.com/docs/tax/reports), but does not affect the amount of tax reversed. """ @@ -373,25 +373,25 @@ class CreateReversalParamsShippingCost(TypedDict): """ class ListLineItemsParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/tax/_transaction_line_item_service.py b/stripe/tax/_transaction_line_item_service.py index 69c2c7046..be470515c 100644 --- a/stripe/tax/_transaction_line_item_service.py +++ b/stripe/tax/_transaction_line_item_service.py @@ -11,19 +11,19 @@ class TransactionLineItemService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ diff --git a/stripe/tax/_transaction_service.py b/stripe/tax/_transaction_service.py index 64613640f..170184291 100644 --- a/stripe/tax/_transaction_service.py +++ b/stripe/tax/_transaction_service.py @@ -21,11 +21,11 @@ class CreateFromCalculationParams(TypedDict): """ Tax Calculation ID to be used as input when creating the transaction. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -35,21 +35,21 @@ class CreateFromCalculationParams(TypedDict): """ class CreateReversalParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - flat_amount: NotRequired["int"] + flat_amount: NotRequired[int] """ A flat amount to reverse across the entire transaction, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. This value represents the total amount to refund from the transaction, including taxes. """ line_items: NotRequired[ - "List[TransactionService.CreateReversalParamsLineItem]" + List["TransactionService.CreateReversalParamsLineItem"] ] """ The line item amounts to reverse. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -81,7 +81,7 @@ class CreateReversalParamsLineItem(TypedDict): """ The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ @@ -89,7 +89,7 @@ class CreateReversalParamsLineItem(TypedDict): """ The `id` of the line item to reverse in the original transaction. """ - quantity: NotRequired["int"] + quantity: NotRequired[int] """ The quantity reversed. Appears in [tax exports](https://stripe.com/docs/tax/reports), but does not affect the amount of tax reversed. """ @@ -109,7 +109,7 @@ class CreateReversalParamsShippingCost(TypedDict): """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index e996f7dee..e9c8c4135 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -287,11 +287,11 @@ class CreateParams(RequestOptions): """ An object containing device type specific settings for BBPOS WisePOS E readers """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the configuration """ @@ -379,197 +379,197 @@ class CreateParamsTipping(TypedDict): """ class CreateParamsTippingAud(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingCad(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingChf(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingCzk(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingDkk(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingEur(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingGbp(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingHkd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingMyr(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingNok(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingNzd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingSek(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingSgd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingUsd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ @@ -584,23 +584,23 @@ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - is_account_default: NotRequired["bool"] + is_account_default: NotRequired[bool] """ if present, only return the account default or non-default configurations. """ - limit: NotRequired["int"] + 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"] + 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. """ @@ -612,11 +612,11 @@ class ModifyParams(RequestOptions): """ An object containing device type specific settings for BBPOS WisePOS E readers """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the configuration """ @@ -706,197 +706,197 @@ class ModifyParamsTipping(TypedDict): """ class ModifyParamsTippingAud(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingCad(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingChf(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingCzk(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingDkk(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingEur(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingGbp(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingHkd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingMyr(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingNok(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingNzd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingSek(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingSgd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingUsd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ @@ -908,7 +908,7 @@ class ModifyParamsVerifoneP400(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index c9a90d1c4..b7544544f 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -17,11 +17,11 @@ class CreateParams(TypedDict): """ An object containing device type specific settings for BBPOS WisePOS E readers """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the configuration """ @@ -115,197 +115,197 @@ class CreateParamsTipping(TypedDict): """ class CreateParamsTippingAud(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingCad(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingChf(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingCzk(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingDkk(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingEur(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingGbp(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingHkd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingMyr(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingNok(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingNzd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingSek(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingSgd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingUsd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ @@ -320,29 +320,29 @@ class DeleteParams(TypedDict): pass class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - is_account_default: NotRequired["bool"] + is_account_default: NotRequired[bool] """ if present, only return the account default or non-default configurations. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -354,11 +354,11 @@ class UpdateParams(TypedDict): """ An object containing device type specific settings for BBPOS WisePOS E readers """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the configuration """ @@ -452,197 +452,197 @@ class UpdateParamsTipping(TypedDict): """ class UpdateParamsTippingAud(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingCad(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingChf(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingCzk(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingDkk(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingEur(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingGbp(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingHkd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingMyr(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingNok(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingNzd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingSek(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingSgd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingUsd(TypedDict): - fixed_amounts: NotRequired["List[int]"] + fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ - percentages: NotRequired["List[int]"] + percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ - smart_tip_threshold: NotRequired["int"] + smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ diff --git a/stripe/terminal/_connection_token.py b/stripe/terminal/_connection_token.py index d564a6088..df2e31c5b 100644 --- a/stripe/terminal/_connection_token.py +++ b/stripe/terminal/_connection_token.py @@ -18,11 +18,11 @@ class ConnectionToken(CreateableAPIResource["ConnectionToken"]): ] = "terminal.connection_token" class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - location: NotRequired["str"] + location: NotRequired[str] """ The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). """ diff --git a/stripe/terminal/_connection_token_service.py b/stripe/terminal/_connection_token_service.py index 027b897cc..20a7b937a 100644 --- a/stripe/terminal/_connection_token_service.py +++ b/stripe/terminal/_connection_token_service.py @@ -9,11 +9,11 @@ class ConnectionTokenService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - location: NotRequired["str"] + location: NotRequired[str] """ The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). """ diff --git a/stripe/terminal/_location.py b/stripe/terminal/_location.py index bb72c5baa..b27f80a78 100644 --- a/stripe/terminal/_location.py +++ b/stripe/terminal/_location.py @@ -57,7 +57,7 @@ class CreateParams(RequestOptions): """ The full address of the location. """ - configuration_overrides: NotRequired["str"] + configuration_overrides: NotRequired[str] """ The ID of a configuration that will be used to customize all readers in this location. """ @@ -65,7 +65,7 @@ class CreateParams(RequestOptions): """ A name for the location. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -75,7 +75,7 @@ class CreateParams(RequestOptions): """ class CreateParamsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ @@ -83,19 +83,19 @@ class CreateParamsAddress(TypedDict): """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -104,19 +104,19 @@ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ @@ -130,11 +130,11 @@ class ModifyParams(RequestOptions): """ The ID of a configuration that will be used to customize all readers in this location. """ - display_name: NotRequired["str"] + display_name: NotRequired[str] """ A name for the location. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -144,33 +144,33 @@ class ModifyParams(RequestOptions): """ class ModifyParamsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/terminal/_location_service.py b/stripe/terminal/_location_service.py index d902b6d02..7ef8789a0 100644 --- a/stripe/terminal/_location_service.py +++ b/stripe/terminal/_location_service.py @@ -15,7 +15,7 @@ class CreateParams(TypedDict): """ The full address of the location. """ - configuration_overrides: NotRequired["str"] + configuration_overrides: NotRequired[str] """ The ID of a configuration that will be used to customize all readers in this location. """ @@ -23,7 +23,7 @@ class CreateParams(TypedDict): """ A name for the location. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -33,7 +33,7 @@ class CreateParams(TypedDict): """ class CreateParamsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ @@ -41,19 +41,19 @@ class CreateParamsAddress(TypedDict): """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -62,25 +62,25 @@ class DeleteParams(TypedDict): pass class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -94,11 +94,11 @@ class UpdateParams(TypedDict): """ The ID of a configuration that will be used to customize all readers in this location. """ - display_name: NotRequired["str"] + display_name: NotRequired[str] """ A name for the location. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -108,27 +108,27 @@ class UpdateParams(TypedDict): """ class UpdateParamsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index 378c6cec9..2bd82d40b 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -232,21 +232,21 @@ class LineItem(StripeObject): } class CancelActionParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - label: NotRequired["str"] + label: NotRequired[str] """ Custom label given to the reader for easier identification. If no label is specified, the registration code will be used. """ - location: NotRequired["str"] + location: NotRequired[str] """ The location to assign the reader to. """ @@ -264,42 +264,49 @@ class DeleteParams(RequestOptions): class ListParams(RequestOptions): device_type: NotRequired[ - "Literal['bbpos_chipper2x', 'bbpos_wisepad3', 'bbpos_wisepos_e', 'simulated_wisepos_e', 'stripe_m2', 'verifone_P400']" + Literal[ + "bbpos_chipper2x", + "bbpos_wisepad3", + "bbpos_wisepos_e", + "simulated_wisepos_e", + "stripe_m2", + "verifone_P400", + ] ] """ Filters readers by device type """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - location: NotRequired["str"] + location: NotRequired[str] """ A location ID to filter the response list to only readers at the specific location """ - serial_number: NotRequired["str"] + serial_number: NotRequired[str] """ Filters readers by serial number """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['offline', 'online']"] + status: NotRequired[Literal["offline", "online"]] """ A status filter to filter readers to only offline or online readers """ class ModifyParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -313,7 +320,7 @@ class ModifyParams(RequestOptions): """ class PresentPaymentMethodParams(RequestOptions): - amount_tip: NotRequired["int"] + amount_tip: NotRequired[int] """ Simulated on-reader tip amount. """ @@ -323,7 +330,7 @@ class PresentPaymentMethodParams(RequestOptions): """ Simulated data for the card_present payment method. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -333,25 +340,25 @@ class PresentPaymentMethodParams(RequestOptions): """ Simulated data for the interac_present payment method. """ - type: NotRequired["Literal['card_present', 'interac_present']"] + type: NotRequired[Literal["card_present", "interac_present"]] """ Simulated payment type. """ class PresentPaymentMethodParamsCardPresent(TypedDict): - number: NotRequired["str"] + number: NotRequired[str] """ The card number, as a string without any separators. """ class PresentPaymentMethodParamsInteracPresent(TypedDict): - number: NotRequired["str"] + number: NotRequired[str] """ Card Number """ class ProcessPaymentIntentParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -367,11 +374,11 @@ class ProcessPaymentIntentParams(RequestOptions): """ class ProcessPaymentIntentParamsProcessConfig(TypedDict): - enable_customer_cancellation: NotRequired["bool"] + enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. """ - skip_tipping: NotRequired["bool"] + skip_tipping: NotRequired[bool] """ Override showing a tipping selection screen on this transaction. """ @@ -383,7 +390,7 @@ class ProcessPaymentIntentParamsProcessConfig(TypedDict): """ class ProcessPaymentIntentParamsProcessConfigTipping(TypedDict): - amount_eligible: NotRequired["int"] + amount_eligible: NotRequired[int] """ Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). """ @@ -393,7 +400,7 @@ class ProcessSetupIntentParams(RequestOptions): """ Customer Consent Collected """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -409,33 +416,33 @@ class ProcessSetupIntentParams(RequestOptions): """ class ProcessSetupIntentParamsProcessConfig(TypedDict): - enable_customer_cancellation: NotRequired["bool"] + enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. """ class RefundPaymentParams(RequestOptions): - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer in __cents__ representing how much of this charge to refund. """ - charge: NotRequired["str"] + charge: NotRequired[str] """ ID of the Charge to refund. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ ID of the PaymentIntent to refund. """ - refund_application_fee: NotRequired["bool"] + refund_application_fee: NotRequired[bool] """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ @@ -445,19 +452,19 @@ class RefundPaymentParams(RequestOptions): """ Configuration overrides """ - reverse_transfer: NotRequired["bool"] + reverse_transfer: NotRequired[bool] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ class RefundPaymentParamsRefundPaymentConfig(TypedDict): - enable_customer_cancellation: NotRequired["bool"] + enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -467,7 +474,7 @@ class SetReaderDisplayParams(RequestOptions): """ Cart """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -485,7 +492,7 @@ class SetReaderDisplayParamsCart(TypedDict): """ Array of line items that were purchased. """ - tax: NotRequired["int"] + tax: NotRequired[int] """ The amount of tax in cents. """ diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 0692e7bfb..7aa19439e 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -11,21 +11,21 @@ class ReaderService(StripeService): class CancelActionParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - label: NotRequired["str"] + label: NotRequired[str] """ Custom label given to the reader for easier identification. If no label is specified, the registration code will be used. """ - location: NotRequired["str"] + location: NotRequired[str] """ The location to assign the reader to. """ @@ -43,42 +43,49 @@ class DeleteParams(TypedDict): class ListParams(TypedDict): device_type: NotRequired[ - "Literal['bbpos_chipper2x', 'bbpos_wisepad3', 'bbpos_wisepos_e', 'simulated_wisepos_e', 'stripe_m2', 'verifone_P400']" + Literal[ + "bbpos_chipper2x", + "bbpos_wisepad3", + "bbpos_wisepos_e", + "simulated_wisepos_e", + "stripe_m2", + "verifone_P400", + ] ] """ Filters readers by device type """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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. """ - location: NotRequired["str"] + location: NotRequired[str] """ A location ID to filter the response list to only readers at the specific location """ - serial_number: NotRequired["str"] + serial_number: NotRequired[str] """ Filters readers by serial number """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['offline', 'online']"] + status: NotRequired[Literal["offline", "online"]] """ A status filter to filter readers to only offline or online readers """ class ProcessPaymentIntentParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -94,11 +101,11 @@ class ProcessPaymentIntentParams(TypedDict): """ class ProcessPaymentIntentParamsProcessConfig(TypedDict): - enable_customer_cancellation: NotRequired["bool"] + enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. """ - skip_tipping: NotRequired["bool"] + skip_tipping: NotRequired[bool] """ Override showing a tipping selection screen on this transaction. """ @@ -110,7 +117,7 @@ class ProcessPaymentIntentParamsProcessConfig(TypedDict): """ class ProcessPaymentIntentParamsProcessConfigTipping(TypedDict): - amount_eligible: NotRequired["int"] + amount_eligible: NotRequired[int] """ Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). """ @@ -120,7 +127,7 @@ class ProcessSetupIntentParams(TypedDict): """ Customer Consent Collected """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -136,33 +143,33 @@ class ProcessSetupIntentParams(TypedDict): """ class ProcessSetupIntentParamsProcessConfig(TypedDict): - enable_customer_cancellation: NotRequired["bool"] + enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. """ class RefundPaymentParams(TypedDict): - amount: NotRequired["int"] + amount: NotRequired[int] """ A positive integer in __cents__ representing how much of this charge to refund. """ - charge: NotRequired["str"] + charge: NotRequired[str] """ ID of the Charge to refund. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - payment_intent: NotRequired["str"] + payment_intent: NotRequired[str] """ ID of the PaymentIntent to refund. """ - refund_application_fee: NotRequired["bool"] + refund_application_fee: NotRequired[bool] """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ @@ -172,19 +179,19 @@ class RefundPaymentParams(TypedDict): """ Configuration overrides """ - reverse_transfer: NotRequired["bool"] + reverse_transfer: NotRequired[bool] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ class RefundPaymentParamsRefundPaymentConfig(TypedDict): - enable_customer_cancellation: NotRequired["bool"] + enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -194,7 +201,7 @@ class SetReaderDisplayParams(TypedDict): """ Cart """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -212,7 +219,7 @@ class SetReaderDisplayParamsCart(TypedDict): """ Array of line items that were purchased. """ - tax: NotRequired["int"] + tax: NotRequired[int] """ The amount of tax in cents. """ @@ -236,7 +243,7 @@ class SetReaderDisplayParamsCartLineItem(TypedDict): """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index 5a056b55c..78ccaa7f4 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -9,11 +9,11 @@ class ConfirmationTokenService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - payment_method: NotRequired["str"] + payment_method: NotRequired[str] """ ID of an existing PaymentMethod. """ @@ -23,11 +23,11 @@ class CreateParams(TypedDict): """ If provided, this hash will be used to create a PaymentMethod. """ - return_url: NotRequired["str"] + return_url: NotRequired[str] """ Return URL used to confirm the Intent. """ - setup_future_usage: NotRequired["Literal['off_session', 'on_session']"] + setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this ConfirmationToken's payment method. @@ -165,7 +165,7 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -332,11 +332,11 @@ class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): """ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ - sort_code: NotRequired["str"] + sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ @@ -365,27 +365,27 @@ class CreateParamsPaymentMethodDataBillingDetails(TypedDict): """ class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ @@ -407,14 +407,43 @@ class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): class CreateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ - "Literal['arzte_und_apotheker_bank', 'austrian_anadi_bank_ag', 'bank_austria', 'bankhaus_carl_spangler', 'bankhaus_schelhammer_und_schattera_ag', 'bawag_psk_ag', 'bks_bank_ag', 'brull_kallmus_bank_ag', 'btv_vier_lander_bank', 'capital_bank_grawe_gruppe_ag', 'deutsche_bank_ag', 'dolomitenbank', 'easybank_ag', 'erste_bank_und_sparkassen', 'hypo_alpeadriabank_international_ag', 'hypo_bank_burgenland_aktiengesellschaft', 'hypo_noe_lb_fur_niederosterreich_u_wien', 'hypo_oberosterreich_salzburg_steiermark', 'hypo_tirol_bank_ag', 'hypo_vorarlberg_bank_ag', 'marchfelder_bank', 'oberbank_ag', 'raiffeisen_bankengruppe_osterreich', 'schoellerbank_ag', 'sparda_bank_wien', 'volksbank_gruppe', 'volkskreditbank_ag', 'vr_bank_braunau']" + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ @@ -454,7 +483,24 @@ class CreateParamsPaymentMethodDataGrabpay(TypedDict): class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ - "Literal['abn_amro', 'asn_bank', 'bunq', 'handelsbanken', 'ing', 'knab', 'moneyou', 'n26', 'nn', 'rabobank', 'regiobank', 'revolut', 'sns_bank', 'triodos_bank', 'van_lanschot', 'yoursafe']" + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] ] """ The customer's bank. @@ -499,7 +545,34 @@ class CreateParamsPaymentMethodDataOxxo(TypedDict): class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']" + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ The customer's bank. @@ -518,7 +591,7 @@ class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass class CreateParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired["str"] + session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ @@ -542,23 +615,23 @@ class CreateParamsPaymentMethodDataSwish(TypedDict): pass class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -584,27 +657,27 @@ class CreateParamsShipping(TypedDict): """ class CreateParamsShippingAddress(TypedDict): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ diff --git a/stripe/test_helpers/_customer_service.py b/stripe/test_helpers/_customer_service.py index b88612626..104171afa 100644 --- a/stripe/test_helpers/_customer_service.py +++ b/stripe/test_helpers/_customer_service.py @@ -20,11 +20,11 @@ class FundCashBalanceParams(TypedDict): """ 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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A description of the test funding. This simulates free-text references supplied by customers when making bank transfers to their cash balance. You can use this to test how Stripe's [reconciliation algorithm](https://stripe.com/docs/payments/customer-balance/reconciliation) applies to different user inputs. """ diff --git a/stripe/test_helpers/_refund_service.py b/stripe/test_helpers/_refund_service.py index e4ac4b033..1db5c17ed 100644 --- a/stripe/test_helpers/_refund_service.py +++ b/stripe/test_helpers/_refund_service.py @@ -10,7 +10,7 @@ class RefundService(StripeService): class ExpireParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/test_helpers/_test_clock.py b/stripe/test_helpers/_test_clock.py index d1dc4e9ce..41fd31487 100644 --- a/stripe/test_helpers/_test_clock.py +++ b/stripe/test_helpers/_test_clock.py @@ -26,7 +26,7 @@ class TestClock( ] = "test_helpers.test_clock" class AdvanceParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -36,7 +36,7 @@ class AdvanceParams(RequestOptions): """ class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -44,7 +44,7 @@ class CreateParams(RequestOptions): """ The initial frozen time for this test clock. """ - name: NotRequired["str"] + name: NotRequired[str] """ The name for this test clock. """ @@ -53,25 +53,25 @@ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/test_helpers/_test_clock_service.py b/stripe/test_helpers/_test_clock_service.py index 3bf6be9cb..1bfeb0588 100644 --- a/stripe/test_helpers/_test_clock_service.py +++ b/stripe/test_helpers/_test_clock_service.py @@ -11,7 +11,7 @@ class TestClockService(StripeService): class AdvanceParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -21,7 +21,7 @@ class AdvanceParams(TypedDict): """ class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -29,7 +29,7 @@ class CreateParams(TypedDict): """ The initial frozen time for this test clock. """ - name: NotRequired["str"] + name: NotRequired[str] """ The name for this test clock. """ @@ -38,25 +38,25 @@ class DeleteParams(TypedDict): pass class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + 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"] + 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. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/test_helpers/issuing/_authorization_service.py b/stripe/test_helpers/issuing/_authorization_service.py index 8d5885062..954f43b33 100644 --- a/stripe/test_helpers/issuing/_authorization_service.py +++ b/stripe/test_helpers/issuing/_authorization_service.py @@ -10,15 +10,15 @@ class AuthorizationService(StripeService): class CaptureParams(TypedDict): - capture_amount: NotRequired["int"] + capture_amount: NotRequired[int] """ The amount to capture from the authorization. If not provided, the full amount of the authorization will be captured. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ - close_authorization: NotRequired["bool"] + close_authorization: NotRequired[bool] """ Whether to close the authorization after capture. Defaults to true. Set to false to enable multi-capture flows. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -49,101 +49,109 @@ class CaptureParamsPurchaseDetails(TypedDict): Information about lodging that was purchased with this transaction. """ receipt: NotRequired[ - "List[AuthorizationService.CaptureParamsPurchaseDetailsReceipt]" + List["AuthorizationService.CaptureParamsPurchaseDetailsReceipt"] ] """ The line items in the purchase. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A merchant-specific order number. """ class CaptureParamsPurchaseDetailsFlight(TypedDict): - departure_at: NotRequired["int"] + departure_at: NotRequired[int] """ The time that the flight departed. """ - passenger_name: NotRequired["str"] + passenger_name: NotRequired[str] """ The name of the passenger. """ - refundable: NotRequired["bool"] + refundable: NotRequired[bool] """ Whether the ticket is refundable. """ segments: NotRequired[ - "List[AuthorizationService.CaptureParamsPurchaseDetailsFlightSegment]" + List[ + "AuthorizationService.CaptureParamsPurchaseDetailsFlightSegment" + ] ] """ The legs of the trip. """ - travel_agency: NotRequired["str"] + travel_agency: NotRequired[str] """ The travel agency that issued the ticket. """ class CaptureParamsPurchaseDetailsFlightSegment(TypedDict): - arrival_airport_code: NotRequired["str"] + arrival_airport_code: NotRequired[str] """ The three-letter IATA airport code of the flight's destination. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The airline carrier code. """ - departure_airport_code: NotRequired["str"] + departure_airport_code: NotRequired[str] """ The three-letter IATA airport code that the flight departed from. """ - flight_number: NotRequired["str"] + flight_number: NotRequired[str] """ The flight number. """ - service_class: NotRequired["str"] + service_class: NotRequired[str] """ The flight's service class. """ - stopover_allowed: NotRequired["bool"] + stopover_allowed: NotRequired[bool] """ Whether a stopover is allowed on this flight. """ class CaptureParamsPurchaseDetailsFuel(TypedDict): type: NotRequired[ - "Literal['diesel', 'other', 'unleaded_plus', 'unleaded_regular', 'unleaded_super']" + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired["Literal['liter', 'us_gallon']"] + unit: NotRequired[Literal["liter", "us_gallon"]] """ The units for `volume_decimal`. One of `us_gallon` or `liter`. """ - unit_cost_decimal: NotRequired["str"] + unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: NotRequired["str"] + volume_decimal: NotRequired[str] """ The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. """ class CaptureParamsPurchaseDetailsLodging(TypedDict): - check_in_at: NotRequired["int"] + check_in_at: NotRequired[int] """ The time of checking into the lodging. """ - nights: NotRequired["int"] + nights: NotRequired[int] """ The number of nights stayed at the lodging. """ class CaptureParamsPurchaseDetailsReceipt(TypedDict): - description: NotRequired["str"] - quantity: NotRequired["str"] - total: NotRequired["int"] - unit_cost: NotRequired["int"] + description: NotRequired[str] + quantity: NotRequired[str] + total: NotRequired[int] + unit_cost: NotRequired[int] class CreateParams(TypedDict): amount: int @@ -157,7 +165,7 @@ class CreateParams(TypedDict): Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ authorization_method: NotRequired[ - "Literal['chip', 'contactless', 'keyed_in', 'online', 'swipe']" + Literal["chip", "contactless", "keyed_in", "online", "swipe"] ] """ How the card details were provided. Defaults to online. @@ -166,15 +174,15 @@ class CreateParams(TypedDict): """ Card associated with this authorization. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency of the authorization. If not provided, defaults to the currency of the card. 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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - is_amount_controllable: NotRequired["bool"] + is_amount_controllable: NotRequired[bool] """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. """ @@ -196,78 +204,371 @@ class CreateParams(TypedDict): """ Verifications that Stripe performed on information that the cardholder provided to the merchant. """ - wallet: NotRequired[ - "Literal['apple_pay', 'google_pay', 'samsung_pay']" - ] + wallet: NotRequired[Literal["apple_pay", "google_pay", "samsung_pay"]] """ The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized. """ class CreateParamsAmountDetails(TypedDict): - atm_fee: NotRequired["int"] + atm_fee: NotRequired[int] """ The ATM withdrawal fee. """ - cashback_amount: NotRequired["int"] + cashback_amount: NotRequired[int] """ The amount of cash requested by the cardholder. """ class CreateParamsMerchantData(TypedDict): category: NotRequired[ - "Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']" + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] ] """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ - city: NotRequired["str"] + city: NotRequired[str] """ City where the seller is located """ - country: NotRequired["str"] + country: NotRequired[str] """ Country where the seller is located """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the seller """ - network_id: NotRequired["str"] + network_id: NotRequired[str] """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code where the seller is located """ - state: NotRequired["str"] + state: NotRequired[str] """ State where the seller is located """ - terminal_id: NotRequired["str"] + terminal_id: NotRequired[str] """ An ID assigned by the seller to the location of the sale. """ - url: NotRequired["str"] + url: NotRequired[str] """ URL provided by the merchant on a 3DS request """ class CreateParamsNetworkData(TypedDict): - acquiring_institution_id: NotRequired["str"] + acquiring_institution_id: NotRequired[str] """ Identifier assigned to the acquirer by the card network. """ class CreateParamsVerificationData(TypedDict): address_line1_check: NotRequired[ - "Literal['match', 'mismatch', 'not_provided']" + Literal["match", "mismatch", "not_provided"] ] """ Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`. """ address_postal_code_check: NotRequired[ - "Literal['match', 'mismatch', 'not_provided']" + Literal["match", "mismatch", "not_provided"] ] """ Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`. @@ -278,13 +579,11 @@ class CreateParamsVerificationData(TypedDict): """ The exemption applied to this authorization. """ - cvc_check: NotRequired["Literal['match', 'mismatch', 'not_provided']"] + cvc_check: NotRequired[Literal["match", "mismatch", "not_provided"]] """ Whether the cardholder provided a CVC and if it matched Stripe's record. """ - expiry_check: NotRequired[ - "Literal['match', 'mismatch', 'not_provided']" - ] + expiry_check: NotRequired[Literal["match", "mismatch", "not_provided"]] """ Whether the cardholder provided an expiry date and if it matched Stripe's record. """ @@ -316,13 +615,13 @@ class CreateParamsVerificationDataThreeDSecure(TypedDict): """ class ExpireParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class IncrementParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -330,17 +629,17 @@ class IncrementParams(TypedDict): """ The amount to increment the authorization by. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ - is_amount_controllable: NotRequired["bool"] + is_amount_controllable: NotRequired[bool] """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. """ class ReverseParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - reverse_amount: NotRequired["int"] + reverse_amount: NotRequired[int] """ The amount to reverse from the authorization. If not provided, the full amount of the authorization will be reversed. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ diff --git a/stripe/test_helpers/issuing/_card_service.py b/stripe/test_helpers/issuing/_card_service.py index 3a1dd9e82..faa032617 100644 --- a/stripe/test_helpers/issuing/_card_service.py +++ b/stripe/test_helpers/issuing/_card_service.py @@ -10,25 +10,25 @@ class CardService(StripeService): class DeliverCardParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class FailCardParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnCardParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ShipCardParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/test_helpers/issuing/_personalization_design_service.py b/stripe/test_helpers/issuing/_personalization_design_service.py index a83a52a1d..0f3b7faf2 100644 --- a/stripe/test_helpers/issuing/_personalization_design_service.py +++ b/stripe/test_helpers/issuing/_personalization_design_service.py @@ -10,19 +10,19 @@ class PersonalizationDesignService(StripeService): class ActivateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class DeactivateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RejectParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -33,13 +33,34 @@ class RejectParams(TypedDict): class RejectParamsRejectionReasons(TypedDict): card_logo: NotRequired[ - "List[Literal['geographic_location', 'inappropriate', 'network_name', 'non_binary_image', 'non_fiat_currency', 'other', 'other_entity', 'promotional_material']]" + List[ + Literal[ + "geographic_location", + "inappropriate", + "network_name", + "non_binary_image", + "non_fiat_currency", + "other", + "other_entity", + "promotional_material", + ] + ] ] """ The reason(s) the card logo was rejected. """ carrier_text: NotRequired[ - "List[Literal['geographic_location', 'inappropriate', 'network_name', 'non_fiat_currency', 'other', 'other_entity', 'promotional_material']]" + List[ + Literal[ + "geographic_location", + "inappropriate", + "network_name", + "non_fiat_currency", + "other", + "other_entity", + "promotional_material", + ] + ] ] """ The reason(s) the carrier text was rejected. diff --git a/stripe/test_helpers/issuing/_transaction_service.py b/stripe/test_helpers/issuing/_transaction_service.py index f706b5112..bde260ed2 100644 --- a/stripe/test_helpers/issuing/_transaction_service.py +++ b/stripe/test_helpers/issuing/_transaction_service.py @@ -18,11 +18,11 @@ class CreateForceCaptureParams(TypedDict): """ Card associated with this transaction. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency of the capture. If not provided, defaults to the currency of the card. 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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -41,40 +41,335 @@ class CreateForceCaptureParams(TypedDict): class CreateForceCaptureParamsMerchantData(TypedDict): category: NotRequired[ - "Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']" + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] ] """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ - city: NotRequired["str"] + city: NotRequired[str] """ City where the seller is located """ - country: NotRequired["str"] + country: NotRequired[str] """ Country where the seller is located """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the seller """ - network_id: NotRequired["str"] + network_id: NotRequired[str] """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code where the seller is located """ - state: NotRequired["str"] + state: NotRequired[str] """ State where the seller is located """ - terminal_id: NotRequired["str"] + terminal_id: NotRequired[str] """ An ID assigned by the seller to the location of the sale. """ - url: NotRequired["str"] + url: NotRequired[str] """ URL provided by the merchant on a 3DS request """ @@ -99,101 +394,111 @@ class CreateForceCaptureParamsPurchaseDetails(TypedDict): Information about lodging that was purchased with this transaction. """ receipt: NotRequired[ - "List[TransactionService.CreateForceCaptureParamsPurchaseDetailsReceipt]" + List[ + "TransactionService.CreateForceCaptureParamsPurchaseDetailsReceipt" + ] ] """ The line items in the purchase. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A merchant-specific order number. """ class CreateForceCaptureParamsPurchaseDetailsFlight(TypedDict): - departure_at: NotRequired["int"] + departure_at: NotRequired[int] """ The time that the flight departed. """ - passenger_name: NotRequired["str"] + passenger_name: NotRequired[str] """ The name of the passenger. """ - refundable: NotRequired["bool"] + refundable: NotRequired[bool] """ Whether the ticket is refundable. """ segments: NotRequired[ - "List[TransactionService.CreateForceCaptureParamsPurchaseDetailsFlightSegment]" + List[ + "TransactionService.CreateForceCaptureParamsPurchaseDetailsFlightSegment" + ] ] """ The legs of the trip. """ - travel_agency: NotRequired["str"] + travel_agency: NotRequired[str] """ The travel agency that issued the ticket. """ class CreateForceCaptureParamsPurchaseDetailsFlightSegment(TypedDict): - arrival_airport_code: NotRequired["str"] + arrival_airport_code: NotRequired[str] """ The three-letter IATA airport code of the flight's destination. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The airline carrier code. """ - departure_airport_code: NotRequired["str"] + departure_airport_code: NotRequired[str] """ The three-letter IATA airport code that the flight departed from. """ - flight_number: NotRequired["str"] + flight_number: NotRequired[str] """ The flight number. """ - service_class: NotRequired["str"] + service_class: NotRequired[str] """ The flight's service class. """ - stopover_allowed: NotRequired["bool"] + stopover_allowed: NotRequired[bool] """ Whether a stopover is allowed on this flight. """ class CreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): type: NotRequired[ - "Literal['diesel', 'other', 'unleaded_plus', 'unleaded_regular', 'unleaded_super']" + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired["Literal['liter', 'us_gallon']"] + unit: NotRequired[Literal["liter", "us_gallon"]] """ The units for `volume_decimal`. One of `us_gallon` or `liter`. """ - unit_cost_decimal: NotRequired["str"] + unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: NotRequired["str"] + volume_decimal: NotRequired[str] """ The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. """ class CreateForceCaptureParamsPurchaseDetailsLodging(TypedDict): - check_in_at: NotRequired["int"] + check_in_at: NotRequired[int] """ The time of checking into the lodging. """ - nights: NotRequired["int"] + nights: NotRequired[int] """ The number of nights stayed at the lodging. """ class CreateForceCaptureParamsPurchaseDetailsReceipt(TypedDict): - description: NotRequired["str"] - quantity: NotRequired["str"] - total: NotRequired["int"] - unit_cost: NotRequired["int"] + description: NotRequired[str] + quantity: NotRequired[str] + total: NotRequired[int] + unit_cost: NotRequired[int] class CreateUnlinkedRefundParams(TypedDict): amount: int @@ -204,11 +509,11 @@ class CreateUnlinkedRefundParams(TypedDict): """ Card associated with this unlinked refund transaction. """ - currency: NotRequired["str"] + currency: NotRequired[str] """ The currency of the unlinked refund. If not provided, defaults to the currency of the card. 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). """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -227,40 +532,335 @@ class CreateUnlinkedRefundParams(TypedDict): class CreateUnlinkedRefundParamsMerchantData(TypedDict): category: NotRequired[ - "Literal['ac_refrigeration_repair', 'accounting_bookkeeping_services', 'advertising_services', 'agricultural_cooperative', 'airlines_air_carriers', 'airports_flying_fields', 'ambulance_services', 'amusement_parks_carnivals', 'antique_reproductions', 'antique_shops', 'aquariums', 'architectural_surveying_services', 'art_dealers_and_galleries', 'artists_supply_and_craft_shops', 'auto_and_home_supply_stores', 'auto_body_repair_shops', 'auto_paint_shops', 'auto_service_shops', 'automated_cash_disburse', 'automated_fuel_dispensers', 'automobile_associations', 'automotive_parts_and_accessories_stores', 'automotive_tire_stores', 'bail_and_bond_payments', 'bakeries', 'bands_orchestras', 'barber_and_beauty_shops', 'betting_casino_gambling', 'bicycle_shops', 'billiard_pool_establishments', 'boat_dealers', 'boat_rentals_and_leases', 'book_stores', 'books_periodicals_and_newspapers', 'bowling_alleys', 'bus_lines', 'business_secretarial_schools', 'buying_shopping_services', 'cable_satellite_and_other_pay_television_and_radio', 'camera_and_photographic_supply_stores', 'candy_nut_and_confectionery_stores', 'car_and_truck_dealers_new_used', 'car_and_truck_dealers_used_only', 'car_rental_agencies', 'car_washes', 'carpentry_services', 'carpet_upholstery_cleaning', 'caterers', 'charitable_and_social_service_organizations_fundraising', 'chemicals_and_allied_products', 'child_care_services', 'childrens_and_infants_wear_stores', 'chiropodists_podiatrists', 'chiropractors', 'cigar_stores_and_stands', 'civic_social_fraternal_associations', 'cleaning_and_maintenance', 'clothing_rental', 'colleges_universities', 'commercial_equipment', 'commercial_footwear', 'commercial_photography_art_and_graphics', 'commuter_transport_and_ferries', 'computer_network_services', 'computer_programming', 'computer_repair', 'computer_software_stores', 'computers_peripherals_and_software', 'concrete_work_services', 'construction_materials', 'consulting_public_relations', 'correspondence_schools', 'cosmetic_stores', 'counseling_services', 'country_clubs', 'courier_services', 'court_costs', 'credit_reporting_agencies', 'cruise_lines', 'dairy_products_stores', 'dance_hall_studios_schools', 'dating_escort_services', 'dentists_orthodontists', 'department_stores', 'detective_agencies', 'digital_goods_applications', 'digital_goods_games', 'digital_goods_large_volume', 'digital_goods_media', 'direct_marketing_catalog_merchant', 'direct_marketing_combination_catalog_and_retail_merchant', 'direct_marketing_inbound_telemarketing', 'direct_marketing_insurance_services', 'direct_marketing_other', 'direct_marketing_outbound_telemarketing', 'direct_marketing_subscription', 'direct_marketing_travel', 'discount_stores', 'doctors', 'door_to_door_sales', 'drapery_window_covering_and_upholstery_stores', 'drinking_places', 'drug_stores_and_pharmacies', 'drugs_drug_proprietaries_and_druggist_sundries', 'dry_cleaners', 'durable_goods', 'duty_free_stores', 'eating_places_restaurants', 'educational_services', 'electric_razor_stores', 'electric_vehicle_charging', 'electrical_parts_and_equipment', 'electrical_services', 'electronics_repair_shops', 'electronics_stores', 'elementary_secondary_schools', 'emergency_services_gcas_visa_use_only', 'employment_temp_agencies', 'equipment_rental', 'exterminating_services', 'family_clothing_stores', 'fast_food_restaurants', 'financial_institutions', 'fines_government_administrative_entities', 'fireplace_fireplace_screens_and_accessories_stores', 'floor_covering_stores', 'florists', 'florists_supplies_nursery_stock_and_flowers', 'freezer_and_locker_meat_provisioners', 'fuel_dealers_non_automotive', 'funeral_services_crematories', 'furniture_home_furnishings_and_equipment_stores_except_appliances', 'furniture_repair_refinishing', 'furriers_and_fur_shops', 'general_services', 'gift_card_novelty_and_souvenir_shops', 'glass_paint_and_wallpaper_stores', 'glassware_crystal_stores', 'golf_courses_public', 'government_licensed_horse_dog_racing_us_region_only', 'government_licensed_online_casions_online_gambling_us_region_only', 'government_owned_lotteries_non_us_region', 'government_owned_lotteries_us_region_only', 'government_services', 'grocery_stores_supermarkets', 'hardware_equipment_and_supplies', 'hardware_stores', 'health_and_beauty_spas', 'hearing_aids_sales_and_supplies', 'heating_plumbing_a_c', 'hobby_toy_and_game_shops', 'home_supply_warehouse_stores', 'hospitals', 'hotels_motels_and_resorts', 'household_appliance_stores', 'industrial_supplies', 'information_retrieval_services', 'insurance_default', 'insurance_underwriting_premiums', 'intra_company_purchases', 'jewelry_stores_watches_clocks_and_silverware_stores', 'landscaping_services', 'laundries', 'laundry_cleaning_services', 'legal_services_attorneys', 'luggage_and_leather_goods_stores', 'lumber_building_materials_stores', 'manual_cash_disburse', 'marinas_service_and_supplies', 'marketplaces', 'masonry_stonework_and_plaster', 'massage_parlors', 'medical_and_dental_labs', 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies', 'medical_services', 'membership_organizations', 'mens_and_boys_clothing_and_accessories_stores', 'mens_womens_clothing_stores', 'metal_service_centers', 'miscellaneous_apparel_and_accessory_shops', 'miscellaneous_auto_dealers', 'miscellaneous_business_services', 'miscellaneous_food_stores', 'miscellaneous_general_merchandise', 'miscellaneous_general_services', 'miscellaneous_home_furnishing_specialty_stores', 'miscellaneous_publishing_and_printing', 'miscellaneous_recreation_services', 'miscellaneous_repair_shops', 'miscellaneous_specialty_retail', 'mobile_home_dealers', 'motion_picture_theaters', 'motor_freight_carriers_and_trucking', 'motor_homes_dealers', 'motor_vehicle_supplies_and_new_parts', 'motorcycle_shops_and_dealers', 'motorcycle_shops_dealers', 'music_stores_musical_instruments_pianos_and_sheet_music', 'news_dealers_and_newsstands', 'non_fi_money_orders', 'non_fi_stored_value_card_purchase_load', 'nondurable_goods', 'nurseries_lawn_and_garden_supply_stores', 'nursing_personal_care', 'office_and_commercial_furniture', 'opticians_eyeglasses', 'optometrists_ophthalmologist', 'orthopedic_goods_prosthetic_devices', 'osteopaths', 'package_stores_beer_wine_and_liquor', 'paints_varnishes_and_supplies', 'parking_lots_garages', 'passenger_railways', 'pawn_shops', 'pet_shops_pet_food_and_supplies', 'petroleum_and_petroleum_products', 'photo_developing', 'photographic_photocopy_microfilm_equipment_and_supplies', 'photographic_studios', 'picture_video_production', 'piece_goods_notions_and_other_dry_goods', 'plumbing_heating_equipment_and_supplies', 'political_organizations', 'postal_services_government_only', 'precious_stones_and_metals_watches_and_jewelry', 'professional_services', 'public_warehousing_and_storage', 'quick_copy_repro_and_blueprint', 'railroads', 'real_estate_agents_and_managers_rentals', 'record_stores', 'recreational_vehicle_rentals', 'religious_goods_stores', 'religious_organizations', 'roofing_siding_sheet_metal', 'secretarial_support_services', 'security_brokers_dealers', 'service_stations', 'sewing_needlework_fabric_and_piece_goods_stores', 'shoe_repair_hat_cleaning', 'shoe_stores', 'small_appliance_repair', 'snowmobile_dealers', 'special_trade_services', 'specialty_cleaning', 'sporting_goods_stores', 'sporting_recreation_camps', 'sports_and_riding_apparel_stores', 'sports_clubs_fields', 'stamp_and_coin_stores', 'stationary_office_supplies_printing_and_writing_paper', 'stationery_stores_office_and_school_supply_stores', 'swimming_pools_sales', 't_ui_travel_germany', 'tailors_alterations', 'tax_payments_government_agencies', 'tax_preparation_services', 'taxicabs_limousines', 'telecommunication_equipment_and_telephone_sales', 'telecommunication_services', 'telegraph_services', 'tent_and_awning_shops', 'testing_laboratories', 'theatrical_ticket_agencies', 'timeshares', 'tire_retreading_and_repair', 'tolls_bridge_fees', 'tourist_attractions_and_exhibits', 'towing_services', 'trailer_parks_campgrounds', 'transportation_services', 'travel_agencies_tour_operators', 'truck_stop_iteration', 'truck_utility_trailer_rentals', 'typesetting_plate_making_and_related_services', 'typewriter_stores', 'u_s_federal_government_agencies_or_departments', 'uniforms_commercial_clothing', 'used_merchandise_and_secondhand_stores', 'utilities', 'variety_stores', 'veterinary_services', 'video_amusement_game_supplies', 'video_game_arcades', 'video_tape_rental_stores', 'vocational_trade_schools', 'watch_jewelry_repair', 'welding_repair', 'wholesale_clubs', 'wig_and_toupee_stores', 'wires_money_orders', 'womens_accessory_and_specialty_shops', 'womens_ready_to_wear_stores', 'wrecking_and_salvage_yards']" + Literal[ + "ac_refrigeration_repair", + "accounting_bookkeeping_services", + "advertising_services", + "agricultural_cooperative", + "airlines_air_carriers", + "airports_flying_fields", + "ambulance_services", + "amusement_parks_carnivals", + "antique_reproductions", + "antique_shops", + "aquariums", + "architectural_surveying_services", + "art_dealers_and_galleries", + "artists_supply_and_craft_shops", + "auto_and_home_supply_stores", + "auto_body_repair_shops", + "auto_paint_shops", + "auto_service_shops", + "automated_cash_disburse", + "automated_fuel_dispensers", + "automobile_associations", + "automotive_parts_and_accessories_stores", + "automotive_tire_stores", + "bail_and_bond_payments", + "bakeries", + "bands_orchestras", + "barber_and_beauty_shops", + "betting_casino_gambling", + "bicycle_shops", + "billiard_pool_establishments", + "boat_dealers", + "boat_rentals_and_leases", + "book_stores", + "books_periodicals_and_newspapers", + "bowling_alleys", + "bus_lines", + "business_secretarial_schools", + "buying_shopping_services", + "cable_satellite_and_other_pay_television_and_radio", + "camera_and_photographic_supply_stores", + "candy_nut_and_confectionery_stores", + "car_and_truck_dealers_new_used", + "car_and_truck_dealers_used_only", + "car_rental_agencies", + "car_washes", + "carpentry_services", + "carpet_upholstery_cleaning", + "caterers", + "charitable_and_social_service_organizations_fundraising", + "chemicals_and_allied_products", + "child_care_services", + "childrens_and_infants_wear_stores", + "chiropodists_podiatrists", + "chiropractors", + "cigar_stores_and_stands", + "civic_social_fraternal_associations", + "cleaning_and_maintenance", + "clothing_rental", + "colleges_universities", + "commercial_equipment", + "commercial_footwear", + "commercial_photography_art_and_graphics", + "commuter_transport_and_ferries", + "computer_network_services", + "computer_programming", + "computer_repair", + "computer_software_stores", + "computers_peripherals_and_software", + "concrete_work_services", + "construction_materials", + "consulting_public_relations", + "correspondence_schools", + "cosmetic_stores", + "counseling_services", + "country_clubs", + "courier_services", + "court_costs", + "credit_reporting_agencies", + "cruise_lines", + "dairy_products_stores", + "dance_hall_studios_schools", + "dating_escort_services", + "dentists_orthodontists", + "department_stores", + "detective_agencies", + "digital_goods_applications", + "digital_goods_games", + "digital_goods_large_volume", + "digital_goods_media", + "direct_marketing_catalog_merchant", + "direct_marketing_combination_catalog_and_retail_merchant", + "direct_marketing_inbound_telemarketing", + "direct_marketing_insurance_services", + "direct_marketing_other", + "direct_marketing_outbound_telemarketing", + "direct_marketing_subscription", + "direct_marketing_travel", + "discount_stores", + "doctors", + "door_to_door_sales", + "drapery_window_covering_and_upholstery_stores", + "drinking_places", + "drug_stores_and_pharmacies", + "drugs_drug_proprietaries_and_druggist_sundries", + "dry_cleaners", + "durable_goods", + "duty_free_stores", + "eating_places_restaurants", + "educational_services", + "electric_razor_stores", + "electric_vehicle_charging", + "electrical_parts_and_equipment", + "electrical_services", + "electronics_repair_shops", + "electronics_stores", + "elementary_secondary_schools", + "emergency_services_gcas_visa_use_only", + "employment_temp_agencies", + "equipment_rental", + "exterminating_services", + "family_clothing_stores", + "fast_food_restaurants", + "financial_institutions", + "fines_government_administrative_entities", + "fireplace_fireplace_screens_and_accessories_stores", + "floor_covering_stores", + "florists", + "florists_supplies_nursery_stock_and_flowers", + "freezer_and_locker_meat_provisioners", + "fuel_dealers_non_automotive", + "funeral_services_crematories", + "furniture_home_furnishings_and_equipment_stores_except_appliances", + "furniture_repair_refinishing", + "furriers_and_fur_shops", + "general_services", + "gift_card_novelty_and_souvenir_shops", + "glass_paint_and_wallpaper_stores", + "glassware_crystal_stores", + "golf_courses_public", + "government_licensed_horse_dog_racing_us_region_only", + "government_licensed_online_casions_online_gambling_us_region_only", + "government_owned_lotteries_non_us_region", + "government_owned_lotteries_us_region_only", + "government_services", + "grocery_stores_supermarkets", + "hardware_equipment_and_supplies", + "hardware_stores", + "health_and_beauty_spas", + "hearing_aids_sales_and_supplies", + "heating_plumbing_a_c", + "hobby_toy_and_game_shops", + "home_supply_warehouse_stores", + "hospitals", + "hotels_motels_and_resorts", + "household_appliance_stores", + "industrial_supplies", + "information_retrieval_services", + "insurance_default", + "insurance_underwriting_premiums", + "intra_company_purchases", + "jewelry_stores_watches_clocks_and_silverware_stores", + "landscaping_services", + "laundries", + "laundry_cleaning_services", + "legal_services_attorneys", + "luggage_and_leather_goods_stores", + "lumber_building_materials_stores", + "manual_cash_disburse", + "marinas_service_and_supplies", + "marketplaces", + "masonry_stonework_and_plaster", + "massage_parlors", + "medical_and_dental_labs", + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", + "medical_services", + "membership_organizations", + "mens_and_boys_clothing_and_accessories_stores", + "mens_womens_clothing_stores", + "metal_service_centers", + "miscellaneous_apparel_and_accessory_shops", + "miscellaneous_auto_dealers", + "miscellaneous_business_services", + "miscellaneous_food_stores", + "miscellaneous_general_merchandise", + "miscellaneous_general_services", + "miscellaneous_home_furnishing_specialty_stores", + "miscellaneous_publishing_and_printing", + "miscellaneous_recreation_services", + "miscellaneous_repair_shops", + "miscellaneous_specialty_retail", + "mobile_home_dealers", + "motion_picture_theaters", + "motor_freight_carriers_and_trucking", + "motor_homes_dealers", + "motor_vehicle_supplies_and_new_parts", + "motorcycle_shops_and_dealers", + "motorcycle_shops_dealers", + "music_stores_musical_instruments_pianos_and_sheet_music", + "news_dealers_and_newsstands", + "non_fi_money_orders", + "non_fi_stored_value_card_purchase_load", + "nondurable_goods", + "nurseries_lawn_and_garden_supply_stores", + "nursing_personal_care", + "office_and_commercial_furniture", + "opticians_eyeglasses", + "optometrists_ophthalmologist", + "orthopedic_goods_prosthetic_devices", + "osteopaths", + "package_stores_beer_wine_and_liquor", + "paints_varnishes_and_supplies", + "parking_lots_garages", + "passenger_railways", + "pawn_shops", + "pet_shops_pet_food_and_supplies", + "petroleum_and_petroleum_products", + "photo_developing", + "photographic_photocopy_microfilm_equipment_and_supplies", + "photographic_studios", + "picture_video_production", + "piece_goods_notions_and_other_dry_goods", + "plumbing_heating_equipment_and_supplies", + "political_organizations", + "postal_services_government_only", + "precious_stones_and_metals_watches_and_jewelry", + "professional_services", + "public_warehousing_and_storage", + "quick_copy_repro_and_blueprint", + "railroads", + "real_estate_agents_and_managers_rentals", + "record_stores", + "recreational_vehicle_rentals", + "religious_goods_stores", + "religious_organizations", + "roofing_siding_sheet_metal", + "secretarial_support_services", + "security_brokers_dealers", + "service_stations", + "sewing_needlework_fabric_and_piece_goods_stores", + "shoe_repair_hat_cleaning", + "shoe_stores", + "small_appliance_repair", + "snowmobile_dealers", + "special_trade_services", + "specialty_cleaning", + "sporting_goods_stores", + "sporting_recreation_camps", + "sports_and_riding_apparel_stores", + "sports_clubs_fields", + "stamp_and_coin_stores", + "stationary_office_supplies_printing_and_writing_paper", + "stationery_stores_office_and_school_supply_stores", + "swimming_pools_sales", + "t_ui_travel_germany", + "tailors_alterations", + "tax_payments_government_agencies", + "tax_preparation_services", + "taxicabs_limousines", + "telecommunication_equipment_and_telephone_sales", + "telecommunication_services", + "telegraph_services", + "tent_and_awning_shops", + "testing_laboratories", + "theatrical_ticket_agencies", + "timeshares", + "tire_retreading_and_repair", + "tolls_bridge_fees", + "tourist_attractions_and_exhibits", + "towing_services", + "trailer_parks_campgrounds", + "transportation_services", + "travel_agencies_tour_operators", + "truck_stop_iteration", + "truck_utility_trailer_rentals", + "typesetting_plate_making_and_related_services", + "typewriter_stores", + "u_s_federal_government_agencies_or_departments", + "uniforms_commercial_clothing", + "used_merchandise_and_secondhand_stores", + "utilities", + "variety_stores", + "veterinary_services", + "video_amusement_game_supplies", + "video_game_arcades", + "video_tape_rental_stores", + "vocational_trade_schools", + "watch_jewelry_repair", + "welding_repair", + "wholesale_clubs", + "wig_and_toupee_stores", + "wires_money_orders", + "womens_accessory_and_specialty_shops", + "womens_ready_to_wear_stores", + "wrecking_and_salvage_yards", + ] ] """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ - city: NotRequired["str"] + city: NotRequired[str] """ City where the seller is located """ - country: NotRequired["str"] + country: NotRequired[str] """ Country where the seller is located """ - name: NotRequired["str"] + name: NotRequired[str] """ Name of the seller """ - network_id: NotRequired["str"] + network_id: NotRequired[str] """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ Postal code where the seller is located """ - state: NotRequired["str"] + state: NotRequired[str] """ State where the seller is located """ - terminal_id: NotRequired["str"] + terminal_id: NotRequired[str] """ An ID assigned by the seller to the location of the sale. """ - url: NotRequired["str"] + url: NotRequired[str] """ URL provided by the merchant on a 3DS request """ @@ -285,108 +885,118 @@ class CreateUnlinkedRefundParamsPurchaseDetails(TypedDict): Information about lodging that was purchased with this transaction. """ receipt: NotRequired[ - "List[TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsReceipt]" + List[ + "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsReceipt" + ] ] """ The line items in the purchase. """ - reference: NotRequired["str"] + reference: NotRequired[str] """ A merchant-specific order number. """ class CreateUnlinkedRefundParamsPurchaseDetailsFlight(TypedDict): - departure_at: NotRequired["int"] + departure_at: NotRequired[int] """ The time that the flight departed. """ - passenger_name: NotRequired["str"] + passenger_name: NotRequired[str] """ The name of the passenger. """ - refundable: NotRequired["bool"] + refundable: NotRequired[bool] """ Whether the ticket is refundable. """ segments: NotRequired[ - "List[TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFlightSegment]" + List[ + "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFlightSegment" + ] ] """ The legs of the trip. """ - travel_agency: NotRequired["str"] + travel_agency: NotRequired[str] """ The travel agency that issued the ticket. """ class CreateUnlinkedRefundParamsPurchaseDetailsFlightSegment(TypedDict): - arrival_airport_code: NotRequired["str"] + arrival_airport_code: NotRequired[str] """ The three-letter IATA airport code of the flight's destination. """ - carrier: NotRequired["str"] + carrier: NotRequired[str] """ The airline carrier code. """ - departure_airport_code: NotRequired["str"] + departure_airport_code: NotRequired[str] """ The three-letter IATA airport code that the flight departed from. """ - flight_number: NotRequired["str"] + flight_number: NotRequired[str] """ The flight number. """ - service_class: NotRequired["str"] + service_class: NotRequired[str] """ The flight's service class. """ - stopover_allowed: NotRequired["bool"] + stopover_allowed: NotRequired[bool] """ Whether a stopover is allowed on this flight. """ class CreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): type: NotRequired[ - "Literal['diesel', 'other', 'unleaded_plus', 'unleaded_regular', 'unleaded_super']" + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired["Literal['liter', 'us_gallon']"] + unit: NotRequired[Literal["liter", "us_gallon"]] """ The units for `volume_decimal`. One of `us_gallon` or `liter`. """ - unit_cost_decimal: NotRequired["str"] + unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: NotRequired["str"] + volume_decimal: NotRequired[str] """ The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. """ class CreateUnlinkedRefundParamsPurchaseDetailsLodging(TypedDict): - check_in_at: NotRequired["int"] + check_in_at: NotRequired[int] """ The time of checking into the lodging. """ - nights: NotRequired["int"] + nights: NotRequired[int] """ The number of nights stayed at the lodging. """ class CreateUnlinkedRefundParamsPurchaseDetailsReceipt(TypedDict): - description: NotRequired["str"] - quantity: NotRequired["str"] - total: NotRequired["int"] - unit_cost: NotRequired["int"] + description: NotRequired[str] + quantity: NotRequired[str] + total: NotRequired[int] + unit_cost: NotRequired[int] class RefundParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - refund_amount: NotRequired["int"] + refund_amount: NotRequired[int] """ The total amount to attempt to refund. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ diff --git a/stripe/test_helpers/terminal/_reader_service.py b/stripe/test_helpers/terminal/_reader_service.py index 2ad9b9e00..545fc13eb 100644 --- a/stripe/test_helpers/terminal/_reader_service.py +++ b/stripe/test_helpers/terminal/_reader_service.py @@ -10,7 +10,7 @@ class ReaderService(StripeService): class PresentPaymentMethodParams(TypedDict): - amount_tip: NotRequired["int"] + amount_tip: NotRequired[int] """ Simulated on-reader tip amount. """ @@ -20,7 +20,7 @@ class PresentPaymentMethodParams(TypedDict): """ Simulated data for the card_present payment method. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -30,19 +30,19 @@ class PresentPaymentMethodParams(TypedDict): """ Simulated data for the interac_present payment method. """ - type: NotRequired["Literal['card_present', 'interac_present']"] + type: NotRequired[Literal["card_present", "interac_present"]] """ Simulated payment type. """ class PresentPaymentMethodParamsCardPresent(TypedDict): - number: NotRequired["str"] + number: NotRequired[str] """ The card number, as a string without any separators. """ class PresentPaymentMethodParamsInteracPresent(TypedDict): - number: NotRequired["str"] + number: NotRequired[str] """ Card Number """ diff --git a/stripe/test_helpers/treasury/_inbound_transfer_service.py b/stripe/test_helpers/treasury/_inbound_transfer_service.py index ba6fba9e3..cebd14247 100644 --- a/stripe/test_helpers/treasury/_inbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_inbound_transfer_service.py @@ -10,7 +10,7 @@ class InboundTransferService(StripeService): class FailParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -23,20 +23,34 @@ class FailParams(TypedDict): class FailParamsFailureDetails(TypedDict): code: NotRequired[ - "Literal['account_closed', 'account_frozen', 'bank_account_restricted', 'bank_ownership_changed', 'debit_not_authorized', 'incorrect_account_holder_address', 'incorrect_account_holder_name', 'incorrect_account_holder_tax_id', 'insufficient_funds', 'invalid_account_number', 'invalid_currency', 'no_account', 'other']" + Literal[ + "account_closed", + "account_frozen", + "bank_account_restricted", + "bank_ownership_changed", + "debit_not_authorized", + "incorrect_account_holder_address", + "incorrect_account_holder_name", + "incorrect_account_holder_tax_id", + "insufficient_funds", + "invalid_account_number", + "invalid_currency", + "no_account", + "other", + ] ] """ Reason for the failure. """ class ReturnInboundTransferParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SucceedParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/test_helpers/treasury/_outbound_payment_service.py b/stripe/test_helpers/treasury/_outbound_payment_service.py index 5e615c137..ffad5afb9 100644 --- a/stripe/test_helpers/treasury/_outbound_payment_service.py +++ b/stripe/test_helpers/treasury/_outbound_payment_service.py @@ -10,19 +10,19 @@ class OutboundPaymentService(StripeService): class FailParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class PostParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnOutboundPaymentParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -35,7 +35,18 @@ class ReturnOutboundPaymentParams(TypedDict): class ReturnOutboundPaymentParamsReturnedDetails(TypedDict): code: NotRequired[ - "Literal['account_closed', 'account_frozen', 'bank_account_restricted', 'bank_ownership_changed', 'declined', 'incorrect_account_holder_name', 'invalid_account_number', 'invalid_currency', 'no_account', 'other']" + Literal[ + "account_closed", + "account_frozen", + "bank_account_restricted", + "bank_ownership_changed", + "declined", + "incorrect_account_holder_name", + "invalid_account_number", + "invalid_currency", + "no_account", + "other", + ] ] """ The return code to be set on the OutboundPayment object. diff --git a/stripe/test_helpers/treasury/_outbound_transfer_service.py b/stripe/test_helpers/treasury/_outbound_transfer_service.py index 66697b587..46396fdce 100644 --- a/stripe/test_helpers/treasury/_outbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_outbound_transfer_service.py @@ -10,19 +10,19 @@ class OutboundTransferService(StripeService): class FailParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class PostParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnOutboundTransferParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -35,7 +35,18 @@ class ReturnOutboundTransferParams(TypedDict): class ReturnOutboundTransferParamsReturnedDetails(TypedDict): code: NotRequired[ - "Literal['account_closed', 'account_frozen', 'bank_account_restricted', 'bank_ownership_changed', 'declined', 'incorrect_account_holder_name', 'invalid_account_number', 'invalid_currency', 'no_account', 'other']" + Literal[ + "account_closed", + "account_frozen", + "bank_account_restricted", + "bank_ownership_changed", + "declined", + "incorrect_account_holder_name", + "invalid_account_number", + "invalid_currency", + "no_account", + "other", + ] ] """ Reason for the return. diff --git a/stripe/test_helpers/treasury/_received_credit_service.py b/stripe/test_helpers/treasury/_received_credit_service.py index 1dc4f3b63..dd71b4074 100644 --- a/stripe/test_helpers/treasury/_received_credit_service.py +++ b/stripe/test_helpers/treasury/_received_credit_service.py @@ -17,11 +17,11 @@ class CreateParams(TypedDict): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -53,15 +53,15 @@ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): """ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount(TypedDict): - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The bank account holder's name. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ The bank account number. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ The bank account's routing number. """ diff --git a/stripe/test_helpers/treasury/_received_debit_service.py b/stripe/test_helpers/treasury/_received_debit_service.py index e04d4652a..dd2b0882c 100644 --- a/stripe/test_helpers/treasury/_received_debit_service.py +++ b/stripe/test_helpers/treasury/_received_debit_service.py @@ -17,11 +17,11 @@ class CreateParams(TypedDict): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -53,15 +53,15 @@ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): """ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount(TypedDict): - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The bank account holder's name. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ The bank account number. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ The bank account's routing number. """ diff --git a/stripe/treasury/_credit_reversal.py b/stripe/treasury/_credit_reversal.py index 819b6ed02..64bdba4be 100644 --- a/stripe/treasury/_credit_reversal.py +++ b/stripe/treasury/_credit_reversal.py @@ -32,11 +32,11 @@ class StatusTransitions(StripeObject): """ class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -46,11 +46,11 @@ class CreateParams(RequestOptions): """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -58,25 +58,25 @@ class ListParams(RequestOptions): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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. """ - received_credit: NotRequired["str"] + received_credit: NotRequired[str] """ Only return CreditReversals for the ReceivedCredit ID. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['canceled', 'posted', 'processing']"] + status: NotRequired[Literal["canceled", "posted", "processing"]] """ Only return CreditReversals for a given status. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_credit_reversal_service.py b/stripe/treasury/_credit_reversal_service.py index 96c4e1812..5f3c21854 100644 --- a/stripe/treasury/_credit_reversal_service.py +++ b/stripe/treasury/_credit_reversal_service.py @@ -11,11 +11,11 @@ class CreditReversalService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -25,11 +25,11 @@ class CreateParams(TypedDict): """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -37,25 +37,25 @@ class ListParams(TypedDict): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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. """ - received_credit: NotRequired["str"] + received_credit: NotRequired[str] """ Only return CreditReversals for the ReceivedCredit ID. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['canceled', 'posted', 'processing']"] + status: NotRequired[Literal["canceled", "posted", "processing"]] """ Only return CreditReversals for a given status. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_debit_reversal.py b/stripe/treasury/_debit_reversal.py index 6205ed1df..980f16645 100644 --- a/stripe/treasury/_debit_reversal.py +++ b/stripe/treasury/_debit_reversal.py @@ -38,11 +38,11 @@ class StatusTransitions(StripeObject): """ class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -52,11 +52,11 @@ class CreateParams(RequestOptions): """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -64,29 +64,29 @@ class ListParams(RequestOptions): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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. """ - received_debit: NotRequired["str"] + received_debit: NotRequired[str] """ Only return DebitReversals for the ReceivedDebit ID. """ - resolution: NotRequired["Literal['lost', 'won']"] + resolution: NotRequired[Literal["lost", "won"]] """ Only return DebitReversals for a given resolution. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['canceled', 'completed', 'processing']"] + status: NotRequired[Literal["canceled", "completed", "processing"]] """ Only return DebitReversals for a given status. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_debit_reversal_service.py b/stripe/treasury/_debit_reversal_service.py index 8b8542213..ed207e9e9 100644 --- a/stripe/treasury/_debit_reversal_service.py +++ b/stripe/treasury/_debit_reversal_service.py @@ -11,11 +11,11 @@ class DebitReversalService(StripeService): class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -25,11 +25,11 @@ class CreateParams(TypedDict): """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -37,29 +37,29 @@ class ListParams(TypedDict): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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. """ - received_debit: NotRequired["str"] + received_debit: NotRequired[str] """ Only return DebitReversals for the ReceivedDebit ID. """ - resolution: NotRequired["Literal['lost', 'won']"] + resolution: NotRequired[Literal["lost", "won"]] """ Only return DebitReversals for a given resolution. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['canceled', 'completed', 'processing']"] + status: NotRequired[Literal["canceled", "completed", "processing"]] """ Only return DebitReversals for a given status. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index 2adb74cc8..76ea8eae6 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -113,7 +113,7 @@ class Closed(StripeObject): _inner_class_types = {"closed": Closed} class CreateParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -121,7 +121,7 @@ class CreateParams(RequestOptions): """ Encodes whether a FinancialAccount has access to a particular feature. Stripe or the platform can control features via the requested field. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -279,11 +279,11 @@ class CreateParamsFeaturesOutboundTransfersUsDomesticWire(TypedDict): """ class CreateParamsPlatformRestrictions(TypedDict): - inbound_flows: NotRequired["Literal['restricted', 'unrestricted']"] + inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all inbound money movement. """ - outbound_flows: NotRequired["Literal['restricted', 'unrestricted']"] + outbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all outbound money movement. """ @@ -293,43 +293,43 @@ class ListParams(RequestOptions): """ Only return FinancialAccounts that were created during the given date interval. """ - ending_before: NotRequired["str"] + ending_before: NotRequired[str] """ An object ID cursor for use in pagination. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + limit: NotRequired[int] """ A limit ranging from 1 to 100 (defaults to 10). """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ An object ID cursor for use in pagination. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -337,7 +337,7 @@ class ModifyParams(RequestOptions): """ Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. Stripe or the platform may control features via the requested field. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -491,23 +491,23 @@ class ModifyParamsFeaturesOutboundTransfersUsDomesticWire(TypedDict): """ class ModifyParamsPlatformRestrictions(TypedDict): - inbound_flows: NotRequired["Literal['restricted', 'unrestricted']"] + inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all inbound money movement. """ - outbound_flows: NotRequired["Literal['restricted', 'unrestricted']"] + outbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all outbound money movement. """ class RetrieveFeaturesParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -525,7 +525,7 @@ class UpdateFeaturesParams(RequestOptions): """ Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_financial_account_features_service.py b/stripe/treasury/_financial_account_features_service.py index db45e91bc..726df2448 100644 --- a/stripe/treasury/_financial_account_features_service.py +++ b/stripe/treasury/_financial_account_features_service.py @@ -24,7 +24,7 @@ class CreateParams(TypedDict): """ Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -158,13 +158,13 @@ class CreateParamsOutboundTransfersUsDomesticWire(TypedDict): """ class ListParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -182,7 +182,7 @@ class UpdateParams(TypedDict): """ Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index 70b71ad95..cd907c9f5 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -18,7 +18,7 @@ def __init__(self, requestor): self.features = FinancialAccountFeaturesService(self._requestor) class CreateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -26,7 +26,7 @@ class CreateParams(TypedDict): """ Encodes whether a FinancialAccount has access to a particular feature. Stripe or the platform can control features via the requested field. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -184,11 +184,11 @@ class CreateParamsFeaturesOutboundTransfersUsDomesticWire(TypedDict): """ class CreateParamsPlatformRestrictions(TypedDict): - inbound_flows: NotRequired["Literal['restricted', 'unrestricted']"] + inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all inbound money movement. """ - outbound_flows: NotRequired["Literal['restricted', 'unrestricted']"] + outbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all outbound money movement. """ @@ -198,49 +198,49 @@ class ListParams(TypedDict): """ Only return FinancialAccounts that were created during the given date interval. """ - ending_before: NotRequired["str"] + ending_before: NotRequired[str] """ An object ID cursor for use in pagination. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - limit: NotRequired["int"] + limit: NotRequired[int] """ A limit ranging from 1 to 100 (defaults to 10). """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ An object ID cursor for use in pagination. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -248,7 +248,7 @@ class UpdateParams(TypedDict): """ Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. Stripe or the platform may control features via the requested field. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -402,11 +402,11 @@ class UpdateParamsFeaturesOutboundTransfersUsDomesticWire(TypedDict): """ class UpdateParamsPlatformRestrictions(TypedDict): - inbound_flows: NotRequired["Literal['restricted', 'unrestricted']"] + inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all inbound money movement. """ - outbound_flows: NotRequired["Literal['restricted', 'unrestricted']"] + outbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all outbound money movement. """ diff --git a/stripe/treasury/_inbound_transfer.py b/stripe/treasury/_inbound_transfer.py index 24b9e16cf..3de62f4f6 100644 --- a/stripe/treasury/_inbound_transfer.py +++ b/stripe/treasury/_inbound_transfer.py @@ -155,7 +155,7 @@ class StatusTransitions(StripeObject): """ class CancelParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -169,11 +169,11 @@ class CreateParams(RequestOptions): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -181,7 +181,7 @@ class CreateParams(RequestOptions): """ The FinancialAccount to send funds to. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -189,13 +189,13 @@ class CreateParams(RequestOptions): """ The origin payment method to be debited for the InboundTransfer. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ The complete description that appears on your customers' statements. Maximum 10 characters. """ class FailParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -208,18 +208,32 @@ class FailParams(RequestOptions): class FailParamsFailureDetails(TypedDict): code: NotRequired[ - "Literal['account_closed', 'account_frozen', 'bank_account_restricted', 'bank_ownership_changed', 'debit_not_authorized', 'incorrect_account_holder_address', 'incorrect_account_holder_name', 'incorrect_account_holder_tax_id', 'insufficient_funds', 'invalid_account_number', 'invalid_currency', 'no_account', 'other']" + Literal[ + "account_closed", + "account_frozen", + "bank_account_restricted", + "bank_ownership_changed", + "debit_not_authorized", + "incorrect_account_holder_address", + "incorrect_account_holder_name", + "incorrect_account_holder_tax_id", + "insufficient_funds", + "invalid_account_number", + "invalid_currency", + "no_account", + "other", + ] ] """ Reason for the failure. """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -227,35 +241,35 @@ class ListParams(RequestOptions): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['canceled', 'failed', 'processing', 'succeeded']" + Literal["canceled", "failed", "processing", "succeeded"] ] """ Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnInboundTransferParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SucceedParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_inbound_transfer_service.py b/stripe/treasury/_inbound_transfer_service.py index 406612e21..3cb72d874 100644 --- a/stripe/treasury/_inbound_transfer_service.py +++ b/stripe/treasury/_inbound_transfer_service.py @@ -11,7 +11,7 @@ class InboundTransferService(StripeService): class CancelParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -25,11 +25,11 @@ class CreateParams(TypedDict): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -37,7 +37,7 @@ class CreateParams(TypedDict): """ The FinancialAccount to send funds to. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -45,17 +45,17 @@ class CreateParams(TypedDict): """ The origin payment method to be debited for the InboundTransfer. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ The complete description that appears on your customers' statements. Maximum 10 characters. """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -63,23 +63,23 @@ class ListParams(TypedDict): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['canceled', 'failed', 'processing', 'succeeded']" + Literal["canceled", "failed", "processing", "succeeded"] ] """ Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index aa0229c0d..7c4ad122e 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -178,7 +178,7 @@ class StatusTransitions(StripeObject): """ class CancelParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -192,15 +192,15 @@ class CreateParams(RequestOptions): """ 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). """ - customer: NotRequired["str"] + customer: NotRequired[str] """ ID of the customer to whom the OutboundPayment is sent. Must match the Customer attached to the `destination_payment_method` passed in. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - destination_payment_method: NotRequired["str"] + destination_payment_method: NotRequired[str] """ The PaymentMethod to use as the payment instrument for the OutboundPayment. Exclusive with `destination_payment_method_data`. """ @@ -222,7 +222,7 @@ class CreateParams(RequestOptions): """ End user details. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -230,11 +230,11 @@ class CreateParams(RequestOptions): """ The FinancialAccount to pull funds from. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). Maximum 10 characters for `ach` payments, 140 characters for `us_domestic_wire` payments, or 500 characters for `stripe` network transfers. The default value is "payment". """ @@ -246,11 +246,11 @@ class CreateParamsDestinationPaymentMethodData(TypedDict): """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ - financial_account: NotRequired["str"] + financial_account: NotRequired[str] """ Required if type is set to `financial_account`. The FinancialAccount ID to send funds to. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -288,49 +288,49 @@ class CreateParamsDestinationPaymentMethodDataBillingDetails(TypedDict): class CreateParamsDestinationPaymentMethodDataBillingDetailsAddress( TypedDict, ): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsDestinationPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -344,13 +344,13 @@ class CreateParamsDestinationPaymentMethodOptions(TypedDict): """ class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): - network: NotRequired["Literal['ach', 'us_domestic_wire']"] + network: NotRequired[Literal["ach", "us_domestic_wire"]] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsEndUserDetails(TypedDict): - ip_address: NotRequired["str"] + ip_address: NotRequired[str] """ IP address of the user initiating the OutboundPayment. Must be supplied if `present` is set to `true`. """ @@ -360,7 +360,7 @@ class CreateParamsEndUserDetails(TypedDict): """ class FailParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -370,15 +370,15 @@ class ListParams(RequestOptions): """ Only return OutboundPayments that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return OutboundPayments sent to this customer. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -386,53 +386,53 @@ class ListParams(RequestOptions): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['canceled', 'failed', 'posted', 'processing', 'returned']" + Literal["canceled", "failed", "posted", "processing", "returned"] ] """ Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class PostParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnOutboundPaymentParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -445,7 +445,18 @@ class ReturnOutboundPaymentParams(RequestOptions): class ReturnOutboundPaymentParamsReturnedDetails(TypedDict): code: NotRequired[ - "Literal['account_closed', 'account_frozen', 'bank_account_restricted', 'bank_ownership_changed', 'declined', 'incorrect_account_holder_name', 'invalid_account_number', 'invalid_currency', 'no_account', 'other']" + Literal[ + "account_closed", + "account_frozen", + "bank_account_restricted", + "bank_ownership_changed", + "declined", + "incorrect_account_holder_name", + "invalid_account_number", + "invalid_currency", + "no_account", + "other", + ] ] """ The return code to be set on the OutboundPayment object. diff --git a/stripe/treasury/_outbound_payment_service.py b/stripe/treasury/_outbound_payment_service.py index 91160ee4d..0cc5615e6 100644 --- a/stripe/treasury/_outbound_payment_service.py +++ b/stripe/treasury/_outbound_payment_service.py @@ -11,7 +11,7 @@ class OutboundPaymentService(StripeService): class CancelParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -25,15 +25,15 @@ class CreateParams(TypedDict): """ 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). """ - customer: NotRequired["str"] + customer: NotRequired[str] """ ID of the customer to whom the OutboundPayment is sent. Must match the Customer attached to the `destination_payment_method` passed in. """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - destination_payment_method: NotRequired["str"] + destination_payment_method: NotRequired[str] """ The PaymentMethod to use as the payment instrument for the OutboundPayment. Exclusive with `destination_payment_method_data`. """ @@ -55,7 +55,7 @@ class CreateParams(TypedDict): """ End user details. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -63,11 +63,11 @@ class CreateParams(TypedDict): """ The FinancialAccount to pull funds from. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). Maximum 10 characters for `ach` payments, 140 characters for `us_domestic_wire` payments, or 500 characters for `stripe` network transfers. The default value is "payment". """ @@ -79,11 +79,11 @@ class CreateParamsDestinationPaymentMethodData(TypedDict): """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ - financial_account: NotRequired["str"] + financial_account: NotRequired[str] """ Required if type is set to `financial_account`. The FinancialAccount ID to send funds to. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ @@ -121,49 +121,49 @@ class CreateParamsDestinationPaymentMethodDataBillingDetails(TypedDict): class CreateParamsDestinationPaymentMethodDataBillingDetailsAddress( TypedDict, ): - city: NotRequired["str"] + city: NotRequired[str] """ City, district, suburb, town, or village. """ - country: NotRequired["str"] + country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired["str"] + line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ - line2: NotRequired["str"] + line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ - postal_code: NotRequired["str"] + postal_code: NotRequired[str] """ ZIP or postal code. """ - state: NotRequired["str"] + state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsDestinationPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired["Literal['company', 'individual']"] + account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ Account number of the bank account. """ - account_type: NotRequired["Literal['checking', 'savings']"] + account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ - financial_connections_account: NotRequired["str"] + financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ Routing number of the bank account. """ @@ -177,13 +177,13 @@ class CreateParamsDestinationPaymentMethodOptions(TypedDict): """ class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): - network: NotRequired["Literal['ach', 'us_domestic_wire']"] + network: NotRequired[Literal["ach", "us_domestic_wire"]] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsEndUserDetails(TypedDict): - ip_address: NotRequired["str"] + ip_address: NotRequired[str] """ IP address of the user initiating the OutboundPayment. Must be supplied if `present` is set to `true`. """ @@ -197,15 +197,15 @@ class ListParams(TypedDict): """ Only return OutboundPayments that were created during the given date interval. """ - customer: NotRequired["str"] + customer: NotRequired[str] """ Only return OutboundPayments sent to this customer. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -213,41 +213,41 @@ class ListParams(TypedDict): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['canceled', 'failed', 'posted', 'processing', 'returned']" + Literal["canceled", "failed", "posted", "processing", "returned"] ] """ Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index 21084b909..bed025162 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -156,7 +156,7 @@ class StatusTransitions(StripeObject): """ class CancelParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -170,11 +170,11 @@ class CreateParams(RequestOptions): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - destination_payment_method: NotRequired["str"] + destination_payment_method: NotRequired[str] """ The PaymentMethod to use as the payment instrument for the OutboundTransfer. """ @@ -184,7 +184,7 @@ class CreateParams(RequestOptions): """ Hash describing payment method configuration details. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -192,11 +192,11 @@ class CreateParams(RequestOptions): """ The FinancialAccount to pull funds from. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". """ @@ -210,23 +210,23 @@ class CreateParamsDestinationPaymentMethodOptions(TypedDict): """ class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): - network: NotRequired["Literal['ach', 'us_domestic_wire']"] + network: NotRequired[Literal["ach", "us_domestic_wire"]] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class FailParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -234,35 +234,35 @@ class ListParams(RequestOptions): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['canceled', 'failed', 'posted', 'processing', 'returned']" + Literal["canceled", "failed", "posted", "processing", "returned"] ] """ Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. """ class PostParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnOutboundTransferParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -275,7 +275,18 @@ class ReturnOutboundTransferParams(RequestOptions): class ReturnOutboundTransferParamsReturnedDetails(TypedDict): code: NotRequired[ - "Literal['account_closed', 'account_frozen', 'bank_account_restricted', 'bank_ownership_changed', 'declined', 'incorrect_account_holder_name', 'invalid_account_number', 'invalid_currency', 'no_account', 'other']" + Literal[ + "account_closed", + "account_frozen", + "bank_account_restricted", + "bank_ownership_changed", + "declined", + "incorrect_account_holder_name", + "invalid_account_number", + "invalid_currency", + "no_account", + "other", + ] ] """ Reason for the return. diff --git a/stripe/treasury/_outbound_transfer_service.py b/stripe/treasury/_outbound_transfer_service.py index 752814833..40f6ea469 100644 --- a/stripe/treasury/_outbound_transfer_service.py +++ b/stripe/treasury/_outbound_transfer_service.py @@ -11,7 +11,7 @@ class OutboundTransferService(StripeService): class CancelParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -25,11 +25,11 @@ class CreateParams(TypedDict): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - destination_payment_method: NotRequired["str"] + destination_payment_method: NotRequired[str] """ The PaymentMethod to use as the payment instrument for the OutboundTransfer. """ @@ -39,7 +39,7 @@ class CreateParams(TypedDict): """ Hash describing payment method configuration details. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -47,11 +47,11 @@ class CreateParams(TypedDict): """ The FinancialAccount to pull funds from. """ - metadata: NotRequired["Dict[str, str]"] + metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - statement_descriptor: NotRequired["str"] + statement_descriptor: NotRequired[str] """ Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". """ @@ -65,17 +65,17 @@ class CreateParamsDestinationPaymentMethodOptions(TypedDict): """ class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): - network: NotRequired["Literal['ach', 'us_domestic_wire']"] + network: NotRequired[Literal["ach", "us_domestic_wire"]] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -83,23 +83,23 @@ class ListParams(TypedDict): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - "Literal['canceled', 'failed', 'posted', 'processing', 'returned']" + Literal["canceled", "failed", "posted", "processing", "returned"] ] """ Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 8b3d18101..5911ffba0 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -205,11 +205,11 @@ class CreateParams(RequestOptions): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -241,25 +241,25 @@ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): """ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount(TypedDict): - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The bank account holder's name. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ The bank account number. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ The bank account's routing number. """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -267,7 +267,7 @@ class ListParams(RequestOptions): """ The FinancialAccount that received the funds. """ - limit: NotRequired["int"] + 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. """ @@ -275,11 +275,11 @@ class ListParams(RequestOptions): """ Only return ReceivedCredits described by the flow. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['failed', 'succeeded']"] + status: NotRequired[Literal["failed", "succeeded"]] """ Only return ReceivedCredits that have the given status: `succeeded` or `failed`. """ @@ -293,7 +293,7 @@ class ListParamsLinkedFlows(TypedDict): """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_received_credit_service.py b/stripe/treasury/_received_credit_service.py index 96a3f003c..53012d627 100644 --- a/stripe/treasury/_received_credit_service.py +++ b/stripe/treasury/_received_credit_service.py @@ -11,11 +11,11 @@ class ReceivedCreditService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -23,7 +23,7 @@ class ListParams(TypedDict): """ The FinancialAccount that received the funds. """ - limit: NotRequired["int"] + 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. """ @@ -33,11 +33,11 @@ class ListParams(TypedDict): """ Only return ReceivedCredits described by the flow. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['failed', 'succeeded']"] + status: NotRequired[Literal["failed", "succeeded"]] """ Only return ReceivedCredits that have the given status: `succeeded` or `failed`. """ @@ -51,7 +51,7 @@ class ListParamsLinkedFlows(TypedDict): """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_received_debit.py b/stripe/treasury/_received_debit.py index f5ae9a38f..fc6a05814 100644 --- a/stripe/treasury/_received_debit.py +++ b/stripe/treasury/_received_debit.py @@ -168,11 +168,11 @@ class CreateParams(RequestOptions): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: NotRequired["str"] + description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -204,25 +204,25 @@ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): """ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount(TypedDict): - account_holder_name: NotRequired["str"] + account_holder_name: NotRequired[str] """ The bank account holder's name. """ - account_number: NotRequired["str"] + account_number: NotRequired[str] """ The bank account number. """ - routing_number: NotRequired["str"] + routing_number: NotRequired[str] """ The bank account's routing number. """ class ListParams(RequestOptions): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -230,21 +230,21 @@ class ListParams(RequestOptions): """ The FinancialAccount that funds were pulled from. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['failed', 'succeeded']"] + status: NotRequired[Literal["failed", "succeeded"]] """ Only return ReceivedDebits that have the given status: `succeeded` or `failed`. """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_received_debit_service.py b/stripe/treasury/_received_debit_service.py index 03d9d8666..d21649d86 100644 --- a/stripe/treasury/_received_debit_service.py +++ b/stripe/treasury/_received_debit_service.py @@ -11,11 +11,11 @@ class ReceivedDebitService(StripeService): class ListParams(TypedDict): - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -23,21 +23,21 @@ class ListParams(TypedDict): """ The FinancialAccount that funds were pulled from. """ - limit: NotRequired["int"] + 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"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['failed', 'succeeded']"] + status: NotRequired[Literal["failed", "succeeded"]] """ Only return ReceivedDebits that have the given status: `succeeded` or `failed`. """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_transaction.py b/stripe/treasury/_transaction.py index 078a4f728..e3921cd3d 100644 --- a/stripe/treasury/_transaction.py +++ b/stripe/treasury/_transaction.py @@ -119,11 +119,11 @@ class ListParams(RequestOptions): """ Only return Transactions that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -131,19 +131,19 @@ class ListParams(RequestOptions): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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. """ - order_by: NotRequired["Literal['created', 'posted_at']"] + order_by: NotRequired[Literal["created", "posted_at"]] """ The results are in reverse chronological order by `created` or `posted_at`. The default is `created`. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['open', 'posted', 'void']"] + status: NotRequired[Literal["open", "posted", "void"]] """ Only return Transactions that have the given status: `open`, `posted`, or `void`. """ @@ -155,19 +155,19 @@ class ListParams(RequestOptions): """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ @@ -181,25 +181,25 @@ class ListParamsStatusTransitions(TypedDict): """ class ListParamsStatusTransitionsPostedAt(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_transaction_entry.py b/stripe/treasury/_transaction_entry.py index 0ae9980b1..fe2ea9bee 100644 --- a/stripe/treasury/_transaction_entry.py +++ b/stripe/treasury/_transaction_entry.py @@ -111,11 +111,11 @@ class ListParams(RequestOptions): Only return TransactionEntries that were created during the given date interval. """ effective_at: NotRequired["TransactionEntry.ListParamsEffectiveAt|int"] - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -123,61 +123,61 @@ class ListParams(RequestOptions): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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. """ - order_by: NotRequired["Literal['created', 'effective_at']"] + order_by: NotRequired[Literal["created", "effective_at"]] """ The results are in reverse chronological order by `created` or `effective_at`. The default is `created`. """ - starting_after: NotRequired["str"] + 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. """ - transaction: NotRequired["str"] + transaction: NotRequired[str] """ Only return TransactionEntries associated with this Transaction. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsEffectiveAt(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_transaction_entry_service.py b/stripe/treasury/_transaction_entry_service.py index aeee3dfc0..9064309f7 100644 --- a/stripe/treasury/_transaction_entry_service.py +++ b/stripe/treasury/_transaction_entry_service.py @@ -18,11 +18,11 @@ class ListParams(TypedDict): effective_at: NotRequired[ "TransactionEntryService.ListParamsEffectiveAt|int" ] - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -30,61 +30,61 @@ class ListParams(TypedDict): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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. """ - order_by: NotRequired["Literal['created', 'effective_at']"] + order_by: NotRequired[Literal["created", "effective_at"]] """ The results are in reverse chronological order by `created` or `effective_at`. The default is `created`. """ - starting_after: NotRequired["str"] + 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. """ - transaction: NotRequired["str"] + transaction: NotRequired[str] """ Only return TransactionEntries associated with this Transaction. """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsEffectiveAt(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ diff --git a/stripe/treasury/_transaction_service.py b/stripe/treasury/_transaction_service.py index 1c43b9f84..41d301480 100644 --- a/stripe/treasury/_transaction_service.py +++ b/stripe/treasury/_transaction_service.py @@ -15,11 +15,11 @@ class ListParams(TypedDict): """ Only return Transactions that were created during the given date interval. """ - ending_before: NotRequired["str"] + 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]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ @@ -27,19 +27,19 @@ class ListParams(TypedDict): """ Returns objects associated with this FinancialAccount. """ - limit: NotRequired["int"] + 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. """ - order_by: NotRequired["Literal['created', 'posted_at']"] + order_by: NotRequired[Literal["created", "posted_at"]] """ The results are in reverse chronological order by `created` or `posted_at`. The default is `created`. """ - starting_after: NotRequired["str"] + starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired["Literal['open', 'posted', 'void']"] + status: NotRequired[Literal["open", "posted", "void"]] """ Only return Transactions that have the given status: `open`, `posted`, or `void`. """ @@ -51,19 +51,19 @@ class ListParams(TypedDict): """ class ListParamsCreated(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ @@ -77,25 +77,25 @@ class ListParamsStatusTransitions(TypedDict): """ class ListParamsStatusTransitionsPostedAt(TypedDict): - gt: NotRequired["int"] + gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ - gte: NotRequired["int"] + gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ - lt: NotRequired["int"] + lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ - lte: NotRequired["int"] + lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): - expand: NotRequired["List[str]"] + expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ From 2d76766b13a5cf834090e66d32c25503ecd150c0 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 12:10:48 -0700 Subject: [PATCH 031/179] Update generated code (#1276) * Update generated code for v907 * Update generated code for v908 * Update generated code for v909 * Update generated code for v910 * Update generated code for v911 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/__init__.py | 2 + stripe/_account.py | 18 + stripe/_account_service.py | 24 + stripe/_account_session.py | 18 +- stripe/_account_session_service.py | 8 + stripe/_bank_account.py | 2 + stripe/_billing_service.py | 18 + stripe/_capability.py | 2 + stripe/_charge.py | 8 +- stripe/_confirmation_token.py | 4 +- stripe/_invoice.py | 8 + stripe/_invoice_service.py | 2 + stripe/_object_classes.py | 4 + stripe/_payment_intent.py | 42 +- stripe/_payment_intent_service.py | 42 +- stripe/_person.py | 2 + stripe/_plan.py | 8 + stripe/_plan_service.py | 4 + stripe/_price.py | 12 + stripe/_price_service.py | 8 + stripe/_stripe_client.py | 2 + stripe/_subscription.py | 2 +- stripe/api_resources/__init__.py | 1 + stripe/api_resources/billing/__init__.py | 26 ++ stripe/api_resources/billing/meter.py | 21 + stripe/api_resources/billing/meter_event.py | 21 + .../billing/meter_event_adjustment.py | 21 + .../billing/meter_event_summary.py | 21 + stripe/billing/__init__.py | 20 + stripe/billing/_meter.py | 435 ++++++++++++++++++ stripe/billing/_meter_event.py | 84 ++++ stripe/billing/_meter_event_adjustment.py | 65 +++ .../_meter_event_adjustment_service.py | 49 ++ stripe/billing/_meter_event_service.py | 51 ++ stripe/billing/_meter_event_summary.py | 44 ++ .../billing/_meter_event_summary_service.py | 68 +++ stripe/billing/_meter_service.py | 248 ++++++++++ stripe/forwarding/_request.py | 2 + stripe/issuing/_card.py | 4 + stripe/issuing/_card_service.py | 4 + stripe/issuing/_token.py | 2 +- stripe/treasury/_inbound_transfer.py | 5 + stripe/treasury/_outbound_payment.py | 5 + stripe/treasury/_outbound_transfer.py | 5 + 45 files changed, 1395 insertions(+), 49 deletions(-) create mode 100644 stripe/_billing_service.py create mode 100644 stripe/api_resources/billing/__init__.py create mode 100644 stripe/api_resources/billing/meter.py create mode 100644 stripe/api_resources/billing/meter_event.py create mode 100644 stripe/api_resources/billing/meter_event_adjustment.py create mode 100644 stripe/api_resources/billing/meter_event_summary.py create mode 100644 stripe/billing/__init__.py create mode 100644 stripe/billing/_meter.py create mode 100644 stripe/billing/_meter_event.py create mode 100644 stripe/billing/_meter_event_adjustment.py create mode 100644 stripe/billing/_meter_event_adjustment_service.py create mode 100644 stripe/billing/_meter_event_service.py create mode 100644 stripe/billing/_meter_event_summary.py create mode 100644 stripe/billing/_meter_event_summary_service.py create mode 100644 stripe/billing/_meter_service.py diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 62a99e0ea..7044b5abc 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v896 \ No newline at end of file +v911 \ No newline at end of file diff --git a/stripe/__init__.py b/stripe/__init__.py index 0c0943da9..8942aabb3 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -210,6 +210,7 @@ def __getattr__(name): # The beginning of the section generated from our OpenAPI spec from stripe import ( apps as apps, + billing as billing, billing_portal as billing_portal, checkout as checkout, climate as climate, @@ -275,6 +276,7 @@ def __getattr__(name): from stripe._billing_portal_service import ( BillingPortalService as BillingPortalService, ) +from stripe._billing_service import BillingService as BillingService from stripe._capability import Capability as Capability from stripe._card import Card as Card from stripe._cash_balance import CashBalance as CashBalance diff --git a/stripe/_account.py b/stripe/_account.py index b3142da74..e48562fe3 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -165,6 +165,10 @@ class Capabilities(StripeObject): """ The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges. """ + amazon_pay_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the AmazonPay capability of the account, or whether the account can directly process AmazonPay payments. + """ au_becs_debit_payments: Optional[ Literal["active", "inactive", "pending"] ] @@ -655,6 +659,7 @@ class Error(StripeObject): "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", + "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", @@ -802,6 +807,7 @@ class Error(StripeObject): "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", + "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", @@ -1362,6 +1368,12 @@ class CreateParamsCapabilities(TypedDict): """ The afterpay_clearpay_payments capability. """ + amazon_pay_payments: NotRequired[ + "Account.CreateParamsCapabilitiesAmazonPayPayments" + ] + """ + The amazon_pay_payments capability. + """ au_becs_debit_payments: NotRequired[ "Account.CreateParamsCapabilitiesAuBecsDebitPayments" ] @@ -1593,6 +1605,12 @@ class CreateParamsCapabilitiesAfterpayClearpayPayments(TypedDict): 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 CreateParamsCapabilitiesAmazonPayPayments(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 CreateParamsCapabilitiesAuBecsDebitPayments(TypedDict): requested: NotRequired[bool] """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 97aff8509..de4b9fd87 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -245,6 +245,12 @@ class CreateParamsCapabilities(TypedDict): """ The afterpay_clearpay_payments capability. """ + amazon_pay_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesAmazonPayPayments" + ] + """ + The amazon_pay_payments capability. + """ au_becs_debit_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesAuBecsDebitPayments" ] @@ -480,6 +486,12 @@ class CreateParamsCapabilitiesAfterpayClearpayPayments(TypedDict): 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 CreateParamsCapabilitiesAmazonPayPayments(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 CreateParamsCapabilitiesAuBecsDebitPayments(TypedDict): requested: NotRequired[bool] """ @@ -1790,6 +1802,12 @@ class UpdateParamsCapabilities(TypedDict): """ The afterpay_clearpay_payments capability. """ + amazon_pay_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesAmazonPayPayments" + ] + """ + The amazon_pay_payments capability. + """ au_becs_debit_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesAuBecsDebitPayments" ] @@ -2025,6 +2043,12 @@ class UpdateParamsCapabilitiesAfterpayClearpayPayments(TypedDict): 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 UpdateParamsCapabilitiesAmazonPayPayments(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 UpdateParamsCapabilitiesAuBecsDebitPayments(TypedDict): requested: NotRequired[bool] """ diff --git a/stripe/_account_session.py b/stripe/_account_session.py index dac4f63b0..bd9f2156b 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -3,7 +3,7 @@ from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from typing import ClassVar, List, cast +from typing import ClassVar, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack @@ -49,6 +49,10 @@ class Features(StripeObject): """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ + destination_on_behalf_of_charge_management: Optional[bool] + """ + Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + """ dispute_management: bool """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. @@ -71,6 +75,10 @@ class Features(StripeObject): """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ + destination_on_behalf_of_charge_management: Optional[bool] + """ + Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + """ dispute_management: bool """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. @@ -211,6 +219,10 @@ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict): """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ + destination_on_behalf_of_charge_management: NotRequired[bool] + """ + Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + """ dispute_management: NotRequired[bool] """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. @@ -237,6 +249,10 @@ class CreateParamsComponentsPaymentsFeatures(TypedDict): """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ + destination_on_behalf_of_charge_management: NotRequired[bool] + """ + Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + """ dispute_management: NotRequired[bool] """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 7fddc7700..fa2f591ff 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -101,6 +101,10 @@ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict): """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ + destination_on_behalf_of_charge_management: NotRequired[bool] + """ + Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + """ dispute_management: NotRequired[bool] """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. @@ -127,6 +131,10 @@ class CreateParamsComponentsPaymentsFeatures(TypedDict): """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ + destination_on_behalf_of_charge_management: NotRequired[bool] + """ + Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + """ dispute_management: NotRequired[bool] """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index 9f253c840..fc1507494 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -117,6 +117,7 @@ class Error(StripeObject): "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", + "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", @@ -238,6 +239,7 @@ class Error(StripeObject): "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", + "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", diff --git a/stripe/_billing_service.py b/stripe/_billing_service.py new file mode 100644 index 000000000..8d4f279e7 --- /dev/null +++ b/stripe/_billing_service.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe.billing._meter_event_adjustment_service import ( + MeterEventAdjustmentService, +) +from stripe.billing._meter_event_service import MeterEventService +from stripe.billing._meter_service import MeterService + + +class BillingService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.meters = MeterService(self._requestor) + self.meter_events = MeterEventService(self._requestor) + self.meter_event_adjustments = MeterEventAdjustmentService( + self._requestor, + ) diff --git a/stripe/_capability.py b/stripe/_capability.py index af7250ce7..b4846bdfa 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -111,6 +111,7 @@ class Error(StripeObject): "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", + "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", @@ -258,6 +259,7 @@ class Error(StripeObject): "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", + "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", diff --git a/stripe/_charge.py b/stripe/_charge.py index 6e8c9bcc4..e3ee32f27 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -821,7 +821,7 @@ class Receipt(StripeObject): """ cardholder_verification_method: Optional[str] """ - How the cardholder verified ownership of the card. + Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. """ dedicated_file_name: Optional[str] """ @@ -1143,7 +1143,7 @@ class Receipt(StripeObject): """ cardholder_verification_method: Optional[str] """ - How the cardholder verified ownership of the card. + Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. """ dedicated_file_name: Optional[str] """ @@ -1539,6 +1539,10 @@ class UsBankAccount(StripeObject): """ Last four digits of the bank account number. """ + mandate: Optional[ExpandableField["Mandate"]] + """ + ID of the mandate used to make this payment. + """ payment_reference: Optional[str] """ Reference number to locate ACH payments with customer's bank. diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index db9f25f9c..e71973de0 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -26,7 +26,9 @@ class ConfirmationToken(APIResource["ConfirmationToken"]): to your server for confirming a PaymentIntent or SetupIntent. If the confirmation is successful, values present on the ConfirmationToken are written onto the Intent. - To learn more or request access, visit the related guided: [Finalize payments on the server using Confirmation Tokens](https://stripe.com/docs/payments/finalize-payments-on-the-server-confirmation-tokens). + To learn more about how to use ConfirmationToken, visit the related guides: + - [Finalize payments on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server) + - [Build two-step confirmation](https://stripe.com/docs/payments/build-a-two-step-confirmation). """ OBJECT_NAME: ClassVar[Literal["confirmation_token"]] = "confirmation_token" diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 69434b0a2..0859c88dd 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -4164,6 +4164,8 @@ def _cls_void_invoice( ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), 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://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( "Invoice", @@ -4183,6 +4185,8 @@ def void_invoice( ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), 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://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ ... @@ -4192,6 +4196,8 @@ def void_invoice( ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), 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://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ ... @@ -4201,6 +4207,8 @@ def void_invoice( # pyright: ignore[reportGeneralTypeIssues] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), 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://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( "Invoice", diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index e64dd5ac3..984e82415 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -2193,6 +2193,8 @@ def void_invoice( ) -> Invoice: """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), 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://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( Invoice, diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index f20225fe3..04e364b57 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -20,6 +20,10 @@ stripe.BankAccount.OBJECT_NAME: stripe.BankAccount, stripe.billing_portal.Configuration.OBJECT_NAME: stripe.billing_portal.Configuration, stripe.billing_portal.Session.OBJECT_NAME: stripe.billing_portal.Session, + stripe.billing.Meter.OBJECT_NAME: stripe.billing.Meter, + stripe.billing.MeterEvent.OBJECT_NAME: stripe.billing.MeterEvent, + stripe.billing.MeterEventAdjustment.OBJECT_NAME: stripe.billing.MeterEventAdjustment, + stripe.billing.MeterEventSummary.OBJECT_NAME: stripe.billing.MeterEventSummary, stripe.Capability.OBJECT_NAME: stripe.Capability, stripe.Card.OBJECT_NAME: stripe.Card, stripe.CashBalance.OBJECT_NAME: stripe.CashBalance, diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index c071514a7..2549e7680 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -2906,7 +2906,7 @@ class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -2930,7 +2930,7 @@ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -3049,7 +3049,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -3322,7 +3322,7 @@ class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -3477,7 +3477,7 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -3576,7 +3576,7 @@ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -3602,7 +3602,7 @@ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -5047,7 +5047,7 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -5071,7 +5071,7 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -5190,7 +5190,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -5463,7 +5463,7 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -5618,7 +5618,7 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -5717,7 +5717,7 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -5743,7 +5743,7 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -7184,7 +7184,7 @@ class ModifyParamsPaymentMethodOptionsAffirm(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -7208,7 +7208,7 @@ class ModifyParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -7327,7 +7327,7 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -7600,7 +7600,7 @@ class ModifyParamsPaymentMethodOptionsCashapp(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -7755,7 +7755,7 @@ class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -7854,7 +7854,7 @@ class ModifyParamsPaymentMethodOptionsLink(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -7880,7 +7880,7 @@ class ModifyParamsPaymentMethodOptionsMobilepay(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 525022225..6916c5495 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -1095,7 +1095,7 @@ class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -1119,7 +1119,7 @@ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -1238,7 +1238,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -1511,7 +1511,7 @@ class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -1666,7 +1666,7 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -1765,7 +1765,7 @@ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -1791,7 +1791,7 @@ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -3260,7 +3260,7 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -3284,7 +3284,7 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -3403,7 +3403,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -3676,7 +3676,7 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -3831,7 +3831,7 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -3930,7 +3930,7 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -3956,7 +3956,7 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -5449,7 +5449,7 @@ class UpdateParamsPaymentMethodOptionsAffirm(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -5473,7 +5473,7 @@ class UpdateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -5592,7 +5592,7 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -5865,7 +5865,7 @@ class UpdateParamsPaymentMethodOptionsCashapp(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -6020,7 +6020,7 @@ class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -6119,7 +6119,7 @@ class UpdateParamsPaymentMethodOptionsLink(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ @@ -6145,7 +6145,7 @@ class UpdateParamsPaymentMethodOptionsMobilepay(TypedDict): """ Controls when the funds will be captured from the customer's account. - If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. """ diff --git a/stripe/_person.py b/stripe/_person.py index 20c234088..8f8b4031e 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -235,6 +235,7 @@ class Error(StripeObject): "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", + "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", @@ -430,6 +431,7 @@ class Error(StripeObject): "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", + "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", diff --git a/stripe/_plan.py b/stripe/_plan.py index 65ce3506f..c1b7a611d 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -120,6 +120,10 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + meter: NotRequired[str] + """ + The meter tracking the usage of a metered price + """ nickname: NotRequired[str] """ A brief description of the plan, hidden from customers. @@ -343,6 +347,10 @@ class RetrieveParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ + meter: Optional[str] + """ + The meter tracking the usage of a metered price + """ nickname: Optional[str] """ A brief description of the plan, hidden from customers. diff --git a/stripe/_plan_service.py b/stripe/_plan_service.py index e60aebe1d..f27d9e25b 100644 --- a/stripe/_plan_service.py +++ b/stripe/_plan_service.py @@ -57,6 +57,10 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + meter: NotRequired[str] + """ + The meter tracking the usage of a metered price + """ nickname: NotRequired[str] """ A brief description of the plan, hidden from customers. diff --git a/stripe/_price.py b/stripe/_price.py index 67f7e2d8b..f19407a7b 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -133,6 +133,10 @@ class Recurring(StripeObject): """ The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. """ + meter: Optional[str] + """ + The meter tracking the usage of a metered price + """ trial_period_days: Optional[int] """ Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). @@ -387,6 +391,10 @@ class CreateParamsRecurring(TypedDict): """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + meter: NotRequired[str] + """ + The meter tracking the usage of a metered price + """ trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). @@ -497,6 +505,10 @@ class ListParamsRecurring(TypedDict): """ Filter by billing frequency. Either `day`, `week`, `month` or `year`. """ + meter: NotRequired[str] + """ + Filter by the price's meter. + """ usage_type: NotRequired[Literal["licensed", "metered"]] """ Filter by the usage type for this price. Can be either `metered` or `licensed`. diff --git a/stripe/_price_service.py b/stripe/_price_service.py index 05d9f7d5c..8b9bb8d67 100644 --- a/stripe/_price_service.py +++ b/stripe/_price_service.py @@ -230,6 +230,10 @@ class CreateParamsRecurring(TypedDict): """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + meter: NotRequired[str] + """ + The meter tracking the usage of a metered price + """ trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). @@ -340,6 +344,10 @@ class ListParamsRecurring(TypedDict): """ Filter by billing frequency. Either `day`, `week`, `month` or `year`. """ + meter: NotRequired[str] + """ + Filter by the price's meter. + """ usage_type: NotRequired[Literal["licensed", "metered"]] """ Filter by the usage type for this price. Can be either `metered` or `licensed`. diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 2879ffe77..ea5d6bdfe 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -32,6 +32,7 @@ from stripe._apps_service import AppsService from stripe._balance_service import BalanceService from stripe._balance_transaction_service import BalanceTransactionService +from stripe._billing_service import BillingService from stripe._billing_portal_service import BillingPortalService from stripe._charge_service import ChargeService from stripe._checkout_service import CheckoutService @@ -170,6 +171,7 @@ def __init__( self.apps = AppsService(self._requestor) self.balance = BalanceService(self._requestor) self.balance_transactions = BalanceTransactionService(self._requestor) + self.billing = BillingService(self._requestor) self.billing_portal = BillingPortalService(self._requestor) self.charges = ChargeService(self._requestor) self.checkout = CheckoutService(self._requestor) diff --git a/stripe/_subscription.py b/stripe/_subscription.py index f20b250d6..3b29c2b3b 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -2029,7 +2029,7 @@ class SearchParams(RequestOptions): A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. - A subscription can only enter a `paused` status [when a trial ends without a payment method](https://stripe.com/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://stripe.com/billing/subscriptions/pause-payment), which still generates invoices. + A subscription can only enter a `paused` status [when a trial ends without a payment method](https://stripe.com/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://stripe.com/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). diff --git a/stripe/api_resources/__init__.py b/stripe/api_resources/__init__.py index 9ec1c9830..62fb54950 100644 --- a/stripe/api_resources/__init__.py +++ b/stripe/api_resources/__init__.py @@ -18,6 +18,7 @@ from stripe.api_resources import ( abstract, apps, + billing, billing_portal, checkout, climate, diff --git a/stripe/api_resources/billing/__init__.py b/stripe/api_resources/billing/__init__.py new file mode 100644 index 000000000..8ce8db1e8 --- /dev/null +++ b/stripe/api_resources/billing/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.billing package is deprecated, please change your + imports to import from stripe.billing directly. + From: + from stripe.api_resources.billing import ... + To: + from stripe.billing import ... + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.api_resources.billing.meter import Meter + from stripe.api_resources.billing.meter_event import MeterEvent + from stripe.api_resources.billing.meter_event_adjustment import ( + MeterEventAdjustment, + ) + from stripe.api_resources.billing.meter_event_summary import ( + MeterEventSummary, + ) diff --git a/stripe/api_resources/billing/meter.py b/stripe/api_resources/billing/meter.py new file mode 100644 index 000000000..c750e21cb --- /dev/null +++ b/stripe/api_resources/billing/meter.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.billing.meter package is deprecated, please change your + imports to import from stripe.billing directly. + From: + from stripe.api_resources.billing.meter import Meter + To: + from stripe.billing import Meter + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.billing._meter import ( # noqa + Meter, + ) diff --git a/stripe/api_resources/billing/meter_event.py b/stripe/api_resources/billing/meter_event.py new file mode 100644 index 000000000..85e1f22fb --- /dev/null +++ b/stripe/api_resources/billing/meter_event.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.billing.meter_event package is deprecated, please change your + imports to import from stripe.billing directly. + From: + from stripe.api_resources.billing.meter_event import MeterEvent + To: + from stripe.billing import MeterEvent + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.billing._meter_event import ( # noqa + MeterEvent, + ) diff --git a/stripe/api_resources/billing/meter_event_adjustment.py b/stripe/api_resources/billing/meter_event_adjustment.py new file mode 100644 index 000000000..b2be2e010 --- /dev/null +++ b/stripe/api_resources/billing/meter_event_adjustment.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.billing.meter_event_adjustment package is deprecated, please change your + imports to import from stripe.billing directly. + From: + from stripe.api_resources.billing.meter_event_adjustment import MeterEventAdjustment + To: + from stripe.billing import MeterEventAdjustment + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.billing._meter_event_adjustment import ( # noqa + MeterEventAdjustment, + ) diff --git a/stripe/api_resources/billing/meter_event_summary.py b/stripe/api_resources/billing/meter_event_summary.py new file mode 100644 index 000000000..8cf6ee4c9 --- /dev/null +++ b/stripe/api_resources/billing/meter_event_summary.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.billing.meter_event_summary package is deprecated, please change your + imports to import from stripe.billing directly. + From: + from stripe.api_resources.billing.meter_event_summary import MeterEventSummary + To: + from stripe.billing import MeterEventSummary + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.billing._meter_event_summary import ( # noqa + MeterEventSummary, + ) diff --git a/stripe/billing/__init__.py b/stripe/billing/__init__.py new file mode 100644 index 000000000..45172d78a --- /dev/null +++ b/stripe/billing/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.billing._meter import Meter as Meter +from stripe.billing._meter_event import MeterEvent as MeterEvent +from stripe.billing._meter_event_adjustment import ( + MeterEventAdjustment as MeterEventAdjustment, +) +from stripe.billing._meter_event_adjustment_service import ( + MeterEventAdjustmentService as MeterEventAdjustmentService, +) +from stripe.billing._meter_event_service import ( + MeterEventService as MeterEventService, +) +from stripe.billing._meter_event_summary import ( + MeterEventSummary as MeterEventSummary, +) +from stripe.billing._meter_event_summary_service import ( + MeterEventSummaryService as MeterEventSummaryService, +) +from stripe.billing._meter_service import MeterService as MeterService diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py new file mode 100644 index 000000000..3b858f2b2 --- /dev/null +++ b/stripe/billing/_meter.py @@ -0,0 +1,435 @@ +# -*- 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._nested_resource_class_methods import nested_resource_class_methods +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, List, Optional, cast, overload +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from stripe.billing._meter_event_summary import MeterEventSummary + + +@nested_resource_class_methods("event_summary") +class Meter( + CreateableAPIResource["Meter"], + ListableAPIResource["Meter"], + UpdateableAPIResource["Meter"], +): + """ + A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then use the billing meter to charge the user for the number of API calls they make. + """ + + OBJECT_NAME: ClassVar[Literal["billing.meter"]] = "billing.meter" + + class CustomerMapping(StripeObject): + event_payload_key: str + """ + The key in the usage event payload to use for mapping the event to a customer. + """ + type: Literal["by_id"] + """ + The method for mapping a meter event to a customer. + """ + + class DefaultAggregation(StripeObject): + formula: Literal["count", "sum"] + """ + Specifies how events are aggregated. + """ + + class StatusTransitions(StripeObject): + deactivated_at: Optional[int] + """ + The time the meter was deactivated, if any. Measured in seconds since Unix epoch. + """ + + class ValueSettings(StripeObject): + event_payload_key: str + """ + The key in the usage event payload to use as the value for this meter. + """ + + class CreateParams(RequestOptions): + customer_mapping: NotRequired["Meter.CreateParamsCustomerMapping"] + """ + Fields that specify how to map a meter event to a customer. + """ + default_aggregation: "Meter.CreateParamsDefaultAggregation" + """ + The default settings to aggregate a meter's events with. + """ + display_name: str + """ + The meter's name. + """ + event_name: str + """ + The name of the usage event to record usage for. Corresponds with the `event_name` field on usage events. + """ + event_time_window: NotRequired[Literal["day", "hour"]] + """ + The time window to pre-aggregate usage events for, if any. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + value_settings: NotRequired["Meter.CreateParamsValueSettings"] + """ + Fields that specify how to calculate a usage event's value. + """ + + class CreateParamsCustomerMapping(TypedDict): + event_payload_key: str + """ + The key in the usage event payload to use for mapping the event to a customer. + """ + type: Literal["by_id"] + """ + The method for mapping a meter event to a customer. Must be `by_id`. + """ + + class CreateParamsDefaultAggregation(TypedDict): + formula: Literal["count", "sum"] + """ + Specifies how events are aggregated. Allowed values are `count` to count the number of events, `sum` to sum each event's value, or `last` to use the last event's value. + """ + + class CreateParamsValueSettings(TypedDict): + event_payload_key: str + """ + The key in the usage event payload to use as the value for this meter. For example, if the event payload contains usage on a `bytes_used` field, then set the event_payload_key to "bytes_used". + """ + + class DeactivateParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ListEventSummariesParams(RequestOptions): + customer: str + """ + The customer for which to fetch event summaries. + """ + end_time: int + """ + The timestamp from when to stop aggregating usage events (exclusive). + """ + 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. + """ + start_time: int + """ + The timestamp from when to start aggregating usage events (inclusive). + """ + 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. + """ + value_grouping_window: NotRequired[Literal["hour"]] + """ + Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range. + """ + + class ListParams(RequestOptions): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[Literal["active", "inactive"]] + """ + Filter results to only include meters with the given status. + """ + + class ModifyParams(RequestOptions): + display_name: NotRequired[str] + """ + The meter's name. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ReactivateParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + customer_mapping: CustomerMapping + default_aggregation: DefaultAggregation + display_name: str + """ + The meter's name. + """ + event_name: str + """ + The name of the usage event to record usage for. Corresponds with the `event_name` field on usage events. + """ + event_time_window: Optional[Literal["day", "hour"]] + """ + The time window to pre-aggregate usage events for, if any. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["billing.meter"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + status: Literal["active", "inactive"] + """ + The meter's status. + """ + status_transitions: StatusTransitions + updated: int + """ + Time at which the object was last updated. Measured in seconds since the Unix epoch. + """ + value_settings: ValueSettings + + @classmethod + def create(cls, **params: Unpack["Meter.CreateParams"]) -> "Meter": + """ + Creates a billing meter + """ + return cast( + "Meter", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def _cls_deactivate( + cls, id: str, **params: Unpack["Meter.DeactivateParams"] + ) -> "Meter": + """ + Deactivates a billing meter + """ + return cast( + "Meter", + cls._static_request( + "post", + "/v1/billing/meters/{id}/deactivate".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def deactivate( + id: str, **params: Unpack["Meter.DeactivateParams"] + ) -> "Meter": + """ + Deactivates a billing meter + """ + ... + + @overload + def deactivate( + self, **params: Unpack["Meter.DeactivateParams"] + ) -> "Meter": + """ + Deactivates a billing meter + """ + ... + + @class_method_variant("_cls_deactivate") + def deactivate( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Meter.DeactivateParams"] + ) -> "Meter": + """ + Deactivates a billing meter + """ + return cast( + "Meter", + self._request( + "post", + "/v1/billing/meters/{id}/deactivate".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def list(cls, **params: Unpack["Meter.ListParams"]) -> ListObject["Meter"]: + """ + Retrieve a list of billing meters. + """ + 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 + def modify( + cls, id: str, **params: Unpack["Meter.ModifyParams"] + ) -> "Meter": + """ + Updates a billing meter + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Meter", + cls._static_request( + "post", + url, + params=params, + ), + ) + + @classmethod + def _cls_reactivate( + cls, id: str, **params: Unpack["Meter.ReactivateParams"] + ) -> "Meter": + """ + Reactivates a billing meter + """ + return cast( + "Meter", + cls._static_request( + "post", + "/v1/billing/meters/{id}/reactivate".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def reactivate( + id: str, **params: Unpack["Meter.ReactivateParams"] + ) -> "Meter": + """ + Reactivates a billing meter + """ + ... + + @overload + def reactivate( + self, **params: Unpack["Meter.ReactivateParams"] + ) -> "Meter": + """ + Reactivates a billing meter + """ + ... + + @class_method_variant("_cls_reactivate") + def reactivate( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Meter.ReactivateParams"] + ) -> "Meter": + """ + Reactivates a billing meter + """ + return cast( + "Meter", + self._request( + "post", + "/v1/billing/meters/{id}/reactivate".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["Meter.RetrieveParams"] + ) -> "Meter": + """ + Retrieves a billing meter given an ID + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + def list_event_summaries( + cls, id: str, **params: Unpack["Meter.ListEventSummariesParams"] + ) -> ListObject["MeterEventSummary"]: + """ + Retrieve a list of billing meter event summaries. + """ + return cast( + ListObject["MeterEventSummary"], + cls._static_request( + "get", + "/v1/billing/meters/{id}/event_summaries".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + _inner_class_types = { + "customer_mapping": CustomerMapping, + "default_aggregation": DefaultAggregation, + "status_transitions": StatusTransitions, + "value_settings": ValueSettings, + } diff --git a/stripe/billing/_meter_event.py b/stripe/billing/_meter_event.py new file mode 100644 index 000000000..33890ea6d --- /dev/null +++ b/stripe/billing/_meter_event.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._request_options import RequestOptions +from typing import ClassVar, Dict, List, cast +from typing_extensions import Literal, NotRequired, Unpack + + +class MeterEvent(CreateableAPIResource["MeterEvent"]): + """ + A billing meter event represents a customer's usage of a product. Meter events are used to bill a customer based on their usage. + Meter events are associated with billing meters, which define the shape of the event's payload and how those events are aggregated for billing. + """ + + OBJECT_NAME: ClassVar[ + Literal["billing.meter_event"] + ] = "billing.meter_event" + + class CreateParams(RequestOptions): + event_name: str + """ + The name of the meter event. Corresponds with the `event_name` field on a meter. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + identifier: NotRequired[str] + """ + A unique identifier for the event. If not provided, one will be generated. + """ + payload: Dict[str, str] + """ + The payload of the event. This must contain a field with the event's numerical value and a field to map the event to a customer. + """ + timestamp: int + """ + The time of the event. Measured in seconds since the Unix epoch. + """ + + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + event_name: str + """ + The name of the meter event. Corresponds with the `event_name` field on a meter. + """ + identifier: str + """ + A unique identifier for the event. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["billing.meter_event"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payload: Dict[str, str] + """ + The payload of the event. + """ + timestamp: int + """ + The timestamp passed in when creating the event. Measured in seconds since the Unix epoch. + """ + + @classmethod + def create( + cls, **params: Unpack["MeterEvent.CreateParams"] + ) -> "MeterEvent": + """ + Creates a billing meter event + """ + return cast( + "MeterEvent", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) diff --git a/stripe/billing/_meter_event_adjustment.py b/stripe/billing/_meter_event_adjustment.py new file mode 100644 index 000000000..6ce5fbb55 --- /dev/null +++ b/stripe/billing/_meter_event_adjustment.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._request_options import RequestOptions +from typing import ClassVar, List, cast +from typing_extensions import Literal, NotRequired, TypedDict, Unpack + + +class MeterEventAdjustment(CreateableAPIResource["MeterEventAdjustment"]): + """ + A billing meter event adjustment represents the status of a meter event adjustment. + """ + + OBJECT_NAME: ClassVar[ + Literal["billing.meter_event_adjustment"] + ] = "billing.meter_event_adjustment" + + class CreateParams(RequestOptions): + cancel: "MeterEventAdjustment.CreateParamsCancel" + """ + Specifies which event to cancel. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + type: NotRequired[Literal["cancel"]] + """ + Specifies whether to cancel a single event or a range of events for a time period. + """ + + class CreateParamsCancel(TypedDict): + identifier: str + """ + Unique identifier for the event. + """ + + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["billing.meter_event_adjustment"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + status: Literal["complete", "pending"] + """ + The meter event adjustment's status. + """ + + @classmethod + def create( + cls, **params: Unpack["MeterEventAdjustment.CreateParams"] + ) -> "MeterEventAdjustment": + """ + Creates a billing meter event adjustment + """ + return cast( + "MeterEventAdjustment", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) diff --git a/stripe/billing/_meter_event_adjustment_service.py b/stripe/billing/_meter_event_adjustment_service.py new file mode 100644 index 000000000..083c0f9ab --- /dev/null +++ b/stripe/billing/_meter_event_adjustment_service.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe.billing._meter_event_adjustment import MeterEventAdjustment +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class MeterEventAdjustmentService(StripeService): + class CreateParams(TypedDict): + cancel: "MeterEventAdjustmentService.CreateParamsCancel" + """ + Specifies which event to cancel. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + type: NotRequired[Literal["cancel"]] + """ + Specifies whether to cancel a single event or a range of events for a time period. + """ + + class CreateParamsCancel(TypedDict): + identifier: str + """ + Unique identifier for the event. + """ + + def create( + self, + params: "MeterEventAdjustmentService.CreateParams", + options: RequestOptions = {}, + ) -> MeterEventAdjustment: + """ + Creates a billing meter event adjustment + """ + return cast( + MeterEventAdjustment, + self._request( + "post", + "/v1/billing/meter_event_adjustments", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing/_meter_event_service.py b/stripe/billing/_meter_event_service.py new file mode 100644 index 000000000..50ff09567 --- /dev/null +++ b/stripe/billing/_meter_event_service.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe.billing._meter_event import MeterEvent +from typing import Dict, List, cast +from typing_extensions import NotRequired, TypedDict + + +class MeterEventService(StripeService): + class CreateParams(TypedDict): + event_name: str + """ + The name of the meter event. Corresponds with the `event_name` field on a meter. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + identifier: NotRequired[str] + """ + A unique identifier for the event. If not provided, one will be generated. + """ + payload: Dict[str, str] + """ + The payload of the event. This must contain a field with the event's numerical value and a field to map the event to a customer. + """ + timestamp: int + """ + The time of the event. Measured in seconds since the Unix epoch. + """ + + def create( + self, + params: "MeterEventService.CreateParams", + options: RequestOptions = {}, + ) -> MeterEvent: + """ + Creates a billing meter event + """ + return cast( + MeterEvent, + self._request( + "post", + "/v1/billing/meter_events", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing/_meter_event_summary.py b/stripe/billing/_meter_event_summary.py new file mode 100644 index 000000000..e3fe6cc3a --- /dev/null +++ b/stripe/billing/_meter_event_summary.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar +from typing_extensions import Literal + + +class MeterEventSummary(StripeObject): + """ + A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much + usage was accrued by a customer for that period. + """ + + OBJECT_NAME: ClassVar[ + Literal["billing.meter_event_summary"] + ] = "billing.meter_event_summary" + aggregated_value: float + """ + Aggregated value of all the events within start_time (inclusive) and end_time (inclusive). The aggregation strategy is defined on meter via `default_aggregation``. + """ + end_time: int + """ + End timestamp for this usage summary (inclusive). + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + meter: str + """ + The meter associated with this usage summary. + """ + object: Literal["billing.meter_event_summary"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + start_time: int + """ + Start timestamp for this usage summary (inclusive). + """ diff --git a/stripe/billing/_meter_event_summary_service.py b/stripe/billing/_meter_event_summary_service.py new file mode 100644 index 000000000..422fc574b --- /dev/null +++ b/stripe/billing/_meter_event_summary_service.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.billing._meter_event_summary import MeterEventSummary +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class MeterEventSummaryService(StripeService): + class ListParams(TypedDict): + customer: str + """ + The customer for which to fetch event summaries. + """ + end_time: int + """ + The timestamp from when to stop aggregating usage events (exclusive). + """ + 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. + """ + start_time: int + """ + The timestamp from when to start aggregating usage events (inclusive). + """ + 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. + """ + value_grouping_window: NotRequired[Literal["hour"]] + """ + Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range. + """ + + def list( + self, + id: str, + params: "MeterEventSummaryService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[MeterEventSummary]: + """ + Retrieve a list of billing meter event summaries. + """ + return cast( + ListObject[MeterEventSummary], + self._request( + "get", + "/v1/billing/meters/{id}/event_summaries".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing/_meter_service.py b/stripe/billing/_meter_service.py new file mode 100644 index 000000000..a7e7597cd --- /dev/null +++ b/stripe/billing/_meter_service.py @@ -0,0 +1,248 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.billing._meter import Meter +from stripe.billing._meter_event_summary_service import ( + MeterEventSummaryService, +) +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class MeterService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.event_summaries = MeterEventSummaryService(self._requestor) + + class CreateParams(TypedDict): + customer_mapping: NotRequired[ + "MeterService.CreateParamsCustomerMapping" + ] + """ + Fields that specify how to map a meter event to a customer. + """ + default_aggregation: "MeterService.CreateParamsDefaultAggregation" + """ + The default settings to aggregate a meter's events with. + """ + display_name: str + """ + The meter's name. + """ + event_name: str + """ + The name of the usage event to record usage for. Corresponds with the `event_name` field on usage events. + """ + event_time_window: NotRequired[Literal["day", "hour"]] + """ + The time window to pre-aggregate usage events for, if any. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + value_settings: NotRequired["MeterService.CreateParamsValueSettings"] + """ + Fields that specify how to calculate a usage event's value. + """ + + class CreateParamsCustomerMapping(TypedDict): + event_payload_key: str + """ + The key in the usage event payload to use for mapping the event to a customer. + """ + type: Literal["by_id"] + """ + The method for mapping a meter event to a customer. Must be `by_id`. + """ + + class CreateParamsDefaultAggregation(TypedDict): + formula: Literal["count", "sum"] + """ + Specifies how events are aggregated. Allowed values are `count` to count the number of events, `sum` to sum each event's value, or `last` to use the last event's value. + """ + + class CreateParamsValueSettings(TypedDict): + event_payload_key: str + """ + The key in the usage event payload to use as the value for this meter. For example, if the event payload contains usage on a `bytes_used` field, then set the event_payload_key to "bytes_used". + """ + + class DeactivateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[Literal["active", "inactive"]] + """ + Filter results to only include meters with the given status. + """ + + class ReactivateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class UpdateParams(TypedDict): + display_name: NotRequired[str] + """ + The meter's name. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "MeterService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Meter]: + """ + Retrieve a list of billing meters. + """ + return cast( + ListObject[Meter], + self._request( + "get", + "/v1/billing/meters", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, params: "MeterService.CreateParams", options: RequestOptions = {} + ) -> Meter: + """ + Creates a billing meter + """ + return cast( + Meter, + self._request( + "post", + "/v1/billing/meters", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "MeterService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Meter: + """ + Retrieves a billing meter given an ID + """ + return cast( + Meter, + self._request( + "get", + "/v1/billing/meters/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + params: "MeterService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Meter: + """ + Updates a billing meter + """ + return cast( + Meter, + self._request( + "post", + "/v1/billing/meters/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def deactivate( + self, + id: str, + params: "MeterService.DeactivateParams" = {}, + options: RequestOptions = {}, + ) -> Meter: + """ + Deactivates a billing meter + """ + return cast( + Meter, + self._request( + "post", + "/v1/billing/meters/{id}/deactivate".format( + id=sanitize_id(id) + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def reactivate( + self, + id: str, + params: "MeterService.ReactivateParams" = {}, + options: RequestOptions = {}, + ) -> Meter: + """ + Reactivates a billing meter + """ + return cast( + Meter, + self._request( + "post", + "/v1/billing/meters/{id}/reactivate".format( + id=sanitize_id(id) + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/forwarding/_request.py b/stripe/forwarding/_request.py index 0ecf34d48..5f77b4f99 100644 --- a/stripe/forwarding/_request.py +++ b/stripe/forwarding/_request.py @@ -27,6 +27,8 @@ class Request( Forwarding Requests are synchronous requests that return a response or time out according to Stripe's limits. + + Related guide: [Forward card details to third-party API endpoints](https://docs.stripe.com/payments/forwarding). """ OBJECT_NAME: ClassVar[Literal["forwarding.request"]] = "forwarding.request" diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index c1092153f..5f82cedc5 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -1141,6 +1141,10 @@ class CreateParams(RequestOptions): """ If `replacement_for` is specified, this should indicate why that card is being replaced. """ + second_line: NotRequired["Literal['']|str"] + """ + The second line to print on the card. + """ shipping: NotRequired["Card.CreateParamsShipping"] """ The address where the card will be shipped. diff --git a/stripe/issuing/_card_service.py b/stripe/issuing/_card_service.py index ca570d27f..9e9e04ddb 100644 --- a/stripe/issuing/_card_service.py +++ b/stripe/issuing/_card_service.py @@ -46,6 +46,10 @@ class CreateParams(TypedDict): """ If `replacement_for` is specified, this should indicate why that card is being replaced. """ + second_line: NotRequired["Literal['']|str"] + """ + The second line to print on the card. + """ shipping: NotRequired["CardService.CreateParamsShipping"] """ The address where the card will be shipped. diff --git a/stripe/issuing/_token.py b/stripe/issuing/_token.py index 63387f7ab..1d3407e26 100644 --- a/stripe/issuing/_token.py +++ b/stripe/issuing/_token.py @@ -268,7 +268,7 @@ class RetrieveParams(RequestOptions): """ device_fingerprint: Optional[str] """ - The hashed ID derived from the device ID from the card network associated with the token + The hashed ID derived from the device ID from the card network associated with the token. """ id: str """ diff --git a/stripe/treasury/_inbound_transfer.py b/stripe/treasury/_inbound_transfer.py index 3de62f4f6..d34368541 100644 --- a/stripe/treasury/_inbound_transfer.py +++ b/stripe/treasury/_inbound_transfer.py @@ -19,6 +19,7 @@ ) if TYPE_CHECKING: + from stripe._mandate import Mandate from stripe.treasury._transaction import Transaction @@ -120,6 +121,10 @@ class UsBankAccount(StripeObject): """ Last four digits of the bank account number. """ + mandate: Optional[ExpandableField["Mandate"]] + """ + ID of the mandate used to make this payment. + """ network: Literal["ach"] """ The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index 7c4ad122e..af42babd1 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -19,6 +19,7 @@ ) if TYPE_CHECKING: + from stripe._mandate import Mandate from stripe.treasury._transaction import Transaction @@ -106,6 +107,10 @@ class UsBankAccount(StripeObject): """ Last four digits of the bank account number. """ + mandate: Optional[ExpandableField["Mandate"]] + """ + ID of the mandate used to make this payment. + """ network: Literal["ach", "us_domestic_wire"] """ The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index bed025162..7ff842f43 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -19,6 +19,7 @@ ) if TYPE_CHECKING: + from stripe._mandate import Mandate from stripe.treasury._transaction import Transaction @@ -96,6 +97,10 @@ class UsBankAccount(StripeObject): """ Last four digits of the bank account number. """ + mandate: Optional[ExpandableField["Mandate"]] + """ + ID of the mandate used to make this payment. + """ network: Literal["ach", "us_domestic_wire"] """ The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. From 1657f036266412b7ef38d46c77f1b30f5455d83b Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 28 Mar 2024 12:17:53 -0700 Subject: [PATCH 032/179] Bump version to 8.9.0 --- CHANGELOG.md | 14 ++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a77a757a..e24495789 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## 8.9.0 - 2024-03-28 +* [#1276](https://github.com/stripe/stripe-python/pull/1276) Update generated code + * Add support for new resources `Billing.MeterEventAdjustment`, `Billing.MeterEvent`, and `Billing.Meter` + * Add support for `create`, `deactivate`, `list`, `modify`, `reactivate`, and `retrieve` methods on resource `Meter` + * Add support for `create` method on resources `MeterEventAdjustment` and `MeterEvent` + * Add support for `amazon_pay_payments` on `Account.Capabilities`, `Account.CreateParamsCapabilities`, `Account.UpdateParamsCapabilities`,`AccountService.CreateParamsCapabilities`, and `AccountService.UpdateParamsCapabilities` + * Add support for new value `verification_failed_representative_authority` on enums `Account.FutureRequirements.Error.code`, `Account.Requirements.Errors.code`, `BankAccount.FutureRequirements.Error.code`, `BankAccount.Requirements.Errors.code`, `Capability.FutureRequirements.Error.code`, `Capability.Requirements.Errors.code`, `Person.FutureRequirements.Error.code`, `Person.Requirements.Errors.code`, + * Add support for `destination_on_behalf_of_charge_management` on `AccountSession.Components.PaymentDetails.Features`, `AccountSession.Components.Payments.Features`, `AccountSession.CreateParamsComponentsPaymentDetailsFeatures`, `AccountSession.CreateParamsComponentsPaymentsFeatures`, `AccountSessionService.CreateParamsComponentsPaymentDetailsFeatures` and `AccountSessionService.CreateParamsComponentsPaymentsFeatures` + * Add support for `meter` on `Plan.CreateParams`, `Plan`, `PlanService.CreateParams`, `Price.Recurring`, `Price.CreateParamsRecurring`, `Price.ListParamsRecurring`, `PriceService.CreateParamsRecurring`, and `PriceService.ListParamsRecurring` + * Add support for `mandate` on `Charge.PaymentMethodDetails.USBankAccount`, `Treasury.InboundTransfer.OriginPaymentMethodDetails.USBankAccount`, `Treasury.OutboundPayment.DestinationPaymentMethodDetails.USBankAccount`, and `Treasury.OutboundTransfer.DestinationPaymentMethodDetails.USBankAccount` + * Add support for `second_line` on `Issuing.Card.CreateParams` +* [#1278](https://github.com/stripe/stripe-python/pull/1278) Types: remove unnecessary quotes +* [#1279](https://github.com/stripe/stripe-python/pull/1279) Update README.md + ## 8.8.0 - 2024-03-21 * [#1273](https://github.com/stripe/stripe-python/pull/1273) Update generated code * Add support for new resources `ConfirmationToken` and `Forwarding.Request` diff --git a/VERSION b/VERSION index 3b6825376..e5c15102d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.8.0 +8.9.0 diff --git a/stripe/_version.py b/stripe/_version.py index 7d1384a5c..452d6c1f9 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "8.8.0" +VERSION = "8.9.0" From 44a22ec67582bd11b2f262f9738dbd1bf01d454b Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:01:08 -0700 Subject: [PATCH 033/179] Port async support from beta to the stable channel (#1288) * Port async support implementation from beta --------- Co-authored-by: Den Co-authored-by: Joel --- flake8_stripe/flake8_stripe.py | 3 + stripe/__init__.py | 3 + stripe/_account.py | 525 + stripe/_account_capability_service.py | 73 + stripe/_account_external_account_service.py | 123 + stripe/_account_link.py | 16 + stripe/_account_link_service.py | 20 + stripe/_account_login_link_service.py | 25 + stripe/_account_person_service.py | 121 + stripe/_account_service.py | 165 + stripe/_account_session.py | 16 + stripe/_account_session_service.py | 20 + stripe/_any_iterator.py | 34 + stripe/_api_requestor.py | 212 +- stripe/_api_resource.py | 126 +- stripe/_apple_pay_domain.py | 97 + stripe/_apple_pay_domain_service.py | 86 + stripe/_application_fee.py | 201 + stripe/_application_fee_refund_service.py | 102 + stripe/_application_fee_service.py | 41 + stripe/_balance.py | 12 + stripe/_balance_service.py | 21 + stripe/_balance_transaction.py | 36 + stripe/_balance_transaction_service.py | 45 + stripe/_bank_account.py | 49 + stripe/_card.py | 49 + stripe/_charge.py | 198 + stripe/_charge_service.py | 134 + stripe/_confirmation_token.py | 27 + stripe/_confirmation_token_service.py | 23 + stripe/_country_spec.py | 32 + stripe/_country_spec_service.py | 43 + stripe/_coupon.py | 116 + stripe/_coupon_service.py | 105 + stripe/_credit_note.py | 181 + stripe/_credit_note_line_item_service.py | 23 + stripe/_credit_note_preview_lines_service.py | 20 + stripe/_credit_note_service.py | 136 + stripe/_customer.py | 795 +- .../_customer_balance_transaction_service.py | 96 + stripe/_customer_cash_balance_service.py | 46 + ...stomer_cash_balance_transaction_service.py | 48 + .../_customer_funding_instructions_service.py | 25 + stripe/_customer_payment_method_service.py | 48 + stripe/_customer_payment_source_service.py | 150 + stripe/_customer_service.py | 157 + stripe/_customer_session.py | 16 + stripe/_customer_session_service.py | 20 + stripe/_customer_tax_id_service.py | 96 + stripe/_dispute.py | 114 + stripe/_dispute_service.py | 89 + stripe/_ephemeral_key.py | 49 + stripe/_ephemeral_key_service.py | 41 + stripe/_event.py | 32 + stripe/_event_service.py | 41 + stripe/_exchange_rate.py | 32 + stripe/_exchange_rate_service.py | 43 + stripe/_file.py | 52 + stripe/_file_link.py | 65 + stripe/_file_link_service.py | 82 + stripe/_file_service.py | 61 + stripe/_http_client.py | 529 +- stripe/_invoice.py | 467 + stripe/_invoice_item.py | 114 + stripe/_invoice_item_service.py | 109 + stripe/_invoice_line_item.py | 20 + stripe/_invoice_line_item_service.py | 51 + stripe/_invoice_service.py | 274 + stripe/_invoice_upcoming_lines_service.py | 20 + stripe/_list_object.py | 98 +- stripe/_mandate.py | 11 + stripe/_mandate_service.py | 21 + stripe/_payment_intent.py | 816 +- stripe/_payment_intent_service.py | 318 + stripe/_payment_link.py | 122 + stripe/_payment_link_line_item_service.py | 23 + stripe/_payment_link_service.py | 86 + stripe/_payment_method.py | 229 + stripe/_payment_method_configuration.py | 69 + .../_payment_method_configuration_service.py | 86 + stripe/_payment_method_domain.py | 143 + stripe/_payment_method_domain_service.py | 114 + stripe/_payment_method_service.py | 146 + stripe/_payout.py | 187 + stripe/_payout_service.py | 134 + stripe/_plan.py | 114 + stripe/_plan_service.py | 101 + stripe/_price.py | 96 +- stripe/_price_service.py | 101 + stripe/_product.py | 135 + stripe/_product_service.py | 126 + stripe/_promotion_code.py | 65 + stripe/_promotion_code_service.py | 86 + stripe/_quote.py | 389 + ...ote_computed_upfront_line_items_service.py | 23 + stripe/_quote_line_item_service.py | 23 + stripe/_quote_service.py | 166 + stripe/_refund.py | 195 + stripe/_refund_service.py | 119 + stripe/_review.py | 87 + stripe/_review_service.py | 64 + stripe/_search_result_object.py | 85 +- stripe/_searchable_api_resource.py | 15 + stripe/_setup_attempt.py | 21 + stripe/_setup_attempt_service.py | 20 + stripe/_setup_intent.py | 299 + stripe/_setup_intent_service.py | 177 + stripe/_shipping_rate.py | 65 + stripe/_shipping_rate_service.py | 86 + stripe/_source.py | 158 + stripe/_source_service.py | 112 + stripe/_source_transaction_service.py | 23 + stripe/_stripe_client.py | 12 +- stripe/_stripe_object.py | 67 +- stripe/_stripe_response.py | 21 +- stripe/_stripe_service.py | 52 +- stripe/_subscription.py | 303 + stripe/_subscription_item.py | 162 + stripe/_subscription_item_service.py | 103 + ..._subscription_item_usage_record_service.py | 29 + ...ption_item_usage_record_summary_service.py | 25 + stripe/_subscription_schedule.py | 179 + stripe/_subscription_schedule_service.py | 132 + stripe/_subscription_service.py | 216 + stripe/_tax_code.py | 32 + stripe/_tax_code_service.py | 41 + stripe/_tax_id.py | 97 + stripe/_tax_id_service.py | 80 + stripe/_tax_rate.py | 65 + stripe/_tax_rate_service.py | 86 + stripe/_test_helpers.py | 4 + stripe/_token.py | 28 + stripe/_token_service.py | 42 + stripe/_topup.py | 118 + stripe/_topup_service.py | 101 + stripe/_transfer.py | 147 + stripe/_transfer_reversal_service.py | 98 + stripe/_transfer_service.py | 88 + stripe/_updateable_api_resource.py | 2 +- stripe/_webhook_endpoint.py | 114 + stripe/_webhook_endpoint_service.py | 109 + stripe/apps/_secret.py | 69 + stripe/apps/_secret_service.py | 76 + stripe/billing/_meter.py | 193 + stripe/billing/_meter_event.py | 16 + stripe/billing/_meter_event_adjustment.py | 16 + .../_meter_event_adjustment_service.py | 20 + stripe/billing/_meter_event_service.py | 20 + .../billing/_meter_event_summary_service.py | 23 + stripe/billing/_meter_service.py | 126 + stripe/billing_portal/_configuration.py | 65 + .../billing_portal/_configuration_service.py | 86 + stripe/billing_portal/_session.py | 16 + stripe/billing_portal/_session_service.py | 20 + stripe/checkout/_session.py | 166 + stripe/checkout/_session_line_item_service.py | 23 + stripe/checkout/_session_service.py | 88 + stripe/climate/_order.py | 134 + stripe/climate/_order_service.py | 108 + stripe/climate/_product.py | 32 + stripe/climate/_product_service.py | 43 + stripe/climate/_supplier.py | 32 + stripe/climate/_supplier_service.py | 43 + stripe/financial_connections/_account.py | 307 + .../_account_owner_service.py | 23 + .../financial_connections/_account_service.py | 135 + stripe/financial_connections/_session.py | 27 + .../financial_connections/_session_service.py | 43 + stripe/financial_connections/_transaction.py | 32 + .../_transaction_service.py | 43 + stripe/forwarding/_request.py | 48 + stripe/forwarding/_request_service.py | 61 + stripe/identity/_verification_report.py | 32 + .../identity/_verification_report_service.py | 43 + stripe/identity/_verification_session.py | 267 + .../identity/_verification_session_service.py | 164 + stripe/issuing/_authorization.py | 416 + stripe/issuing/_authorization_service.py | 114 + stripe/issuing/_card.py | 285 + stripe/issuing/_card_service.py | 80 + stripe/issuing/_cardholder.py | 65 + stripe/issuing/_cardholder_service.py | 86 + stripe/issuing/_dispute.py | 120 + stripe/issuing/_dispute_service.py | 109 + stripe/issuing/_personalization_design.py | 251 + .../_personalization_design_service.py | 86 + stripe/issuing/_physical_bundle.py | 32 + stripe/issuing/_physical_bundle_service.py | 43 + stripe/issuing/_token.py | 49 + stripe/issuing/_token_service.py | 60 + stripe/issuing/_transaction.py | 136 + stripe/issuing/_transaction_service.py | 66 + stripe/radar/_early_fraud_warning.py | 34 + stripe/radar/_early_fraud_warning_service.py | 45 + stripe/radar/_value_list.py | 114 + stripe/radar/_value_list_item.py | 97 + stripe/radar/_value_list_item_service.py | 86 + stripe/radar/_value_list_service.py | 109 + stripe/reporting/_report_run.py | 48 + stripe/reporting/_report_run_service.py | 63 + stripe/reporting/_report_type.py | 32 + stripe/reporting/_report_type_service.py | 43 + stripe/sigma/_scheduled_query_run.py | 32 + stripe/sigma/_scheduled_query_run_service.py | 43 + stripe/tax/_calculation.py | 73 + stripe/tax/_calculation_line_item_service.py | 23 + stripe/tax/_calculation_service.py | 20 + stripe/tax/_registration.py | 67 + stripe/tax/_registration_service.py | 84 + stripe/tax/_settings.py | 27 + stripe/tax/_settings_service.py | 40 + stripe/tax/_transaction.py | 100 + stripe/tax/_transaction_line_item_service.py | 23 + stripe/tax/_transaction_service.py | 63 + stripe/terminal/_configuration.py | 114 + stripe/terminal/_configuration_service.py | 109 + stripe/terminal/_connection_token.py | 16 + stripe/terminal/_connection_token_service.py | 20 + stripe/terminal/_location.py | 115 + stripe/terminal/_location_service.py | 110 + stripe/terminal/_reader.py | 446 + stripe/terminal/_reader_service.py | 224 + .../_confirmation_token_service.py | 20 + stripe/test_helpers/_customer_service.py | 23 + stripe/test_helpers/_refund_service.py | 23 + stripe/test_helpers/_test_clock.py | 152 + stripe/test_helpers/_test_clock_service.py | 109 + .../issuing/_authorization_service.py | 112 + stripe/test_helpers/issuing/_card_service.py | 92 + .../_personalization_design_service.py | 69 + .../issuing/_transaction_service.py | 63 + .../test_helpers/terminal/_reader_service.py | 23 + .../treasury/_inbound_transfer_service.py | 69 + .../treasury/_outbound_payment_service.py | 69 + .../treasury/_outbound_transfer_service.py | 69 + .../treasury/_received_credit_service.py | 20 + .../treasury/_received_debit_service.py | 20 + stripe/treasury/_credit_reversal.py | 48 + stripe/treasury/_credit_reversal_service.py | 63 + stripe/treasury/_debit_reversal.py | 48 + stripe/treasury/_debit_reversal_service.py | 63 + stripe/treasury/_financial_account.py | 181 + .../_financial_account_features_service.py | 92 + stripe/treasury/_financial_account_service.py | 86 + stripe/treasury/_inbound_transfer.py | 275 + stripe/treasury/_inbound_transfer_service.py | 86 + stripe/treasury/_outbound_payment.py | 273 + stripe/treasury/_outbound_payment_service.py | 86 + stripe/treasury/_outbound_transfer.py | 282 + stripe/treasury/_outbound_transfer_service.py | 86 + stripe/treasury/_received_credit.py | 48 + stripe/treasury/_received_credit_service.py | 43 + stripe/treasury/_received_debit.py | 48 + stripe/treasury/_received_debit_service.py | 41 + stripe/treasury/_transaction.py | 32 + stripe/treasury/_transaction_entry.py | 32 + stripe/treasury/_transaction_entry_service.py | 43 + stripe/treasury/_transaction_service.py | 41 + test-requirements.txt | 10 + .../abstract/test_api_resource.py | 35 + tests/api_resources/test_list_object.py | 75 + .../test_search_result_object.py | 84 + tests/conftest.py | 4 + tests/http_client_mock.py | 14 +- tests/request_mock.py | 256 + tests/test_api_requestor.py | 64 +- tests/test_generated_examples.py | 29852 ++++++++++++---- tests/test_http_client.py | 918 +- tests/test_integration.py | 177 +- tests/test_stripe_object.py | 175 +- 270 files changed, 50241 insertions(+), 6559 deletions(-) create mode 100644 stripe/_any_iterator.py create mode 100644 tests/request_mock.py diff --git a/flake8_stripe/flake8_stripe.py b/flake8_stripe/flake8_stripe.py index 16750f997..88e49cd36 100644 --- a/flake8_stripe/flake8_stripe.py +++ b/flake8_stripe/flake8_stripe.py @@ -39,6 +39,8 @@ class TypingImportsChecker: allowed_typing_imports = [ "Any", + "AsyncIterator", + "AsyncIterable", "ClassVar", "Optional", "TypeVar", @@ -56,6 +58,7 @@ class TypingImportsChecker: "Set", "Callable", "Generator", + "Iterable", ] def __init__(self, tree: ast.AST): diff --git a/stripe/__init__.py b/stripe/__init__.py index 8942aabb3..ee824207d 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -134,6 +134,7 @@ def set_app_info( from stripe._stripe_response import StripeResponseBase as StripeResponseBase from stripe._stripe_response import ( StripeStreamResponse as StripeStreamResponse, + StripeStreamResponseAsync as StripeStreamResponseAsync, ) # Error types @@ -157,6 +158,8 @@ def set_app_info( PycurlClient as PycurlClient, RequestsClient as RequestsClient, UrlFetchClient as UrlFetchClient, + HTTPXClient as HTTPXClient, + AIOHTTPClient as AIOHTTPClient, new_default_http_client as new_default_http_client, ) diff --git a/stripe/_account.py b/stripe/_account.py index e48562fe3..385b6004d 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -3738,6 +3738,27 @@ def create(cls, **params: Unpack["Account.CreateParams"]) -> "Account": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Account.CreateParams"] + ) -> "Account": + """ + With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. + To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). + + If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when + creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. + You can prefill any information on the account. + """ + return cast( + "Account", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Account.DeleteParams"] @@ -3801,6 +3822,71 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["Account.DeleteParams"] + ) -> "Account": + """ + With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + + Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + + If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "Account", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["Account.DeleteParams"] + ) -> "Account": + """ + With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + + Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + + If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["Account.DeleteParams"] + ) -> "Account": + """ + With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + + Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + + If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Account.DeleteParams"] + ) -> "Account": + """ + With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + + Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + + If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["Account.ListParams"] @@ -3822,6 +3908,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Account.ListParams"] + ) -> ListObject["Account"]: + """ + Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. + """ + 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 _cls_persons( cls, account: str, **params: Unpack["Account.PersonsParams"] @@ -3877,6 +3984,61 @@ def persons( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_persons_async( + cls, account: str, **params: Unpack["Account.PersonsParams"] + ) -> ListObject["Person"]: + """ + Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. + """ + return cast( + ListObject["Person"], + await cls._static_request_async( + "get", + "/v1/accounts/{account}/persons".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def persons_async( + account: str, **params: Unpack["Account.PersonsParams"] + ) -> ListObject["Person"]: + """ + Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. + """ + ... + + @overload + async def persons_async( + self, **params: Unpack["Account.PersonsParams"] + ) -> ListObject["Person"]: + """ + Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. + """ + ... + + @class_method_variant("_cls_persons_async") + async def persons_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Account.PersonsParams"] + ) -> ListObject["Person"]: + """ + Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. + """ + return cast( + ListObject["Person"], + await self._request_async( + "get", + "/v1/accounts/{account}/persons".format( + account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_reject( cls, account: str, **params: Unpack["Account.RejectParams"] @@ -3938,17 +4100,94 @@ def reject( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_reject_async( + cls, account: str, **params: Unpack["Account.RejectParams"] + ) -> "Account": + """ + With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + + Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + """ + return cast( + "Account", + await cls._static_request_async( + "post", + "/v1/accounts/{account}/reject".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def reject_async( + account: str, **params: Unpack["Account.RejectParams"] + ) -> "Account": + """ + With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + + Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + """ + ... + + @overload + async def reject_async( + self, **params: Unpack["Account.RejectParams"] + ) -> "Account": + """ + With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + + Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + """ + ... + + @class_method_variant("_cls_reject_async") + async def reject_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Account.RejectParams"] + ) -> "Account": + """ + With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + + Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + """ + return cast( + "Account", + await self._request_async( + "post", + "/v1/accounts/{account}/reject".format( + account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve(cls, id=None, **params) -> "Account": instance = cls(id, **params) instance.refresh() return instance + @classmethod + async def retrieve_async(cls, id=None, **params) -> "Account": + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def modify(cls, id=None, **params) -> "Account": url = cls._build_instance_url(id) return cast("Account", cls._static_request("post", url, params=params)) + @classmethod + async def modify_async(cls, id=None, **params) -> "Account": + url = cls._build_instance_url(id) + return cast( + "Account", + await cls._static_request_async("post", url, params=params), + ) + @classmethod def _build_instance_url(cls, sid): if not sid: @@ -3996,6 +4235,28 @@ def retrieve_capability( ), ) + @classmethod + async def retrieve_capability_async( + cls, + account: str, + capability: str, + **params: Unpack["Account.RetrieveCapabilityParams"] + ) -> "Capability": + """ + Retrieves information about the specified Account Capability. + """ + return cast( + "Capability", + await cls._static_request_async( + "get", + "/v1/accounts/{account}/capabilities/{capability}".format( + account=sanitize_id(account), + capability=sanitize_id(capability), + ), + params=params, + ), + ) + @classmethod def modify_capability( cls, @@ -4018,6 +4279,28 @@ def modify_capability( ), ) + @classmethod + async def modify_capability_async( + cls, + account: str, + capability: str, + **params: Unpack["Account.ModifyCapabilityParams"] + ) -> "Capability": + """ + Updates an existing Account Capability. Request or remove a capability by updating its requested parameter. + """ + return cast( + "Capability", + await cls._static_request_async( + "post", + "/v1/accounts/{account}/capabilities/{capability}".format( + account=sanitize_id(account), + capability=sanitize_id(capability), + ), + params=params, + ), + ) + @classmethod def list_capabilities( cls, account: str, **params: Unpack["Account.ListCapabilitiesParams"] @@ -4036,6 +4319,24 @@ def list_capabilities( ), ) + @classmethod + async def list_capabilities_async( + cls, account: str, **params: Unpack["Account.ListCapabilitiesParams"] + ) -> ListObject["Capability"]: + """ + Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. + """ + return cast( + ListObject["Capability"], + await cls._static_request_async( + "get", + "/v1/accounts/{account}/capabilities".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + @classmethod def create_external_account( cls, @@ -4056,6 +4357,26 @@ def create_external_account( ), ) + @classmethod + async def create_external_account_async( + cls, + account: str, + **params: Unpack["Account.CreateExternalAccountParams"] + ) -> Union["BankAccount", "Card"]: + """ + Create an external account for a given account. + """ + return cast( + Union["BankAccount", "Card"], + await cls._static_request_async( + "post", + "/v1/accounts/{account}/external_accounts".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + @classmethod def retrieve_external_account( cls, @@ -4077,6 +4398,27 @@ def retrieve_external_account( ), ) + @classmethod + async def retrieve_external_account_async( + cls, + account: str, + id: str, + **params: Unpack["Account.RetrieveExternalAccountParams"] + ) -> Union["BankAccount", "Card"]: + """ + Retrieve a specified external account for a given account. + """ + return cast( + Union["BankAccount", "Card"], + await cls._static_request_async( + "get", + "/v1/accounts/{account}/external_accounts/{id}".format( + account=sanitize_id(account), id=sanitize_id(id) + ), + params=params, + ), + ) + @classmethod def modify_external_account( cls, @@ -4100,6 +4442,29 @@ def modify_external_account( ), ) + @classmethod + async def modify_external_account_async( + cls, + account: str, + id: str, + **params: Unpack["Account.ModifyExternalAccountParams"] + ) -> Union["BankAccount", "Card"]: + """ + Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. Other bank account details are not editable by design. + + You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + """ + return cast( + Union["BankAccount", "Card"], + await cls._static_request_async( + "post", + "/v1/accounts/{account}/external_accounts/{id}".format( + account=sanitize_id(account), id=sanitize_id(id) + ), + params=params, + ), + ) + @classmethod def delete_external_account( cls, @@ -4121,6 +4486,27 @@ def delete_external_account( ), ) + @classmethod + async def delete_external_account_async( + cls, + account: str, + id: str, + **params: Unpack["Account.DeleteExternalAccountParams"] + ) -> Union["BankAccount", "Card"]: + """ + Delete a specified external account for a given account. + """ + return cast( + Union["BankAccount", "Card"], + await cls._static_request_async( + "delete", + "/v1/accounts/{account}/external_accounts/{id}".format( + account=sanitize_id(account), id=sanitize_id(id) + ), + params=params, + ), + ) + @classmethod def list_external_accounts( cls, @@ -4141,6 +4527,26 @@ def list_external_accounts( ), ) + @classmethod + async def list_external_accounts_async( + cls, + account: str, + **params: Unpack["Account.ListExternalAccountsParams"] + ) -> ListObject[Union["BankAccount", "Card"]]: + """ + List external accounts for an account. + """ + return cast( + ListObject[Union["BankAccount", "Card"]], + await cls._static_request_async( + "get", + "/v1/accounts/{account}/external_accounts".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + @classmethod def create_login_link( cls, account: str, **params: Unpack["Account.CreateLoginLinkParams"] @@ -4161,6 +4567,26 @@ def create_login_link( ), ) + @classmethod + async def create_login_link_async( + cls, account: str, **params: Unpack["Account.CreateLoginLinkParams"] + ) -> "LoginLink": + """ + Creates a single-use login link for an Express account to access their Stripe dashboard. + + You may only create login links for [Express accounts](https://stripe.com/docs/connect/express-accounts) connected to your platform. + """ + return cast( + "LoginLink", + await cls._static_request_async( + "post", + "/v1/accounts/{account}/login_links".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + @classmethod def create_person( cls, account: str, **params: Unpack["Account.CreatePersonParams"] @@ -4179,6 +4605,24 @@ def create_person( ), ) + @classmethod + async def create_person_async( + cls, account: str, **params: Unpack["Account.CreatePersonParams"] + ) -> "Person": + """ + Creates a new person. + """ + return cast( + "Person", + await cls._static_request_async( + "post", + "/v1/accounts/{account}/persons".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + @classmethod def retrieve_person( cls, @@ -4200,6 +4644,27 @@ def retrieve_person( ), ) + @classmethod + async def retrieve_person_async( + cls, + account: str, + person: str, + **params: Unpack["Account.RetrievePersonParams"] + ) -> "Person": + """ + Retrieves an existing person. + """ + return cast( + "Person", + await cls._static_request_async( + "get", + "/v1/accounts/{account}/persons/{person}".format( + account=sanitize_id(account), person=sanitize_id(person) + ), + params=params, + ), + ) + @classmethod def modify_person( cls, @@ -4221,6 +4686,27 @@ def modify_person( ), ) + @classmethod + async def modify_person_async( + cls, + account: str, + person: str, + **params: Unpack["Account.ModifyPersonParams"] + ) -> "Person": + """ + Updates an existing person. + """ + return cast( + "Person", + await cls._static_request_async( + "post", + "/v1/accounts/{account}/persons/{person}".format( + account=sanitize_id(account), person=sanitize_id(person) + ), + params=params, + ), + ) + @classmethod def delete_person( cls, @@ -4242,6 +4728,27 @@ def delete_person( ), ) + @classmethod + async def delete_person_async( + cls, + account: str, + person: str, + **params: Unpack["Account.DeletePersonParams"] + ) -> "Person": + """ + Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. + """ + return cast( + "Person", + await cls._static_request_async( + "delete", + "/v1/accounts/{account}/persons/{person}".format( + account=sanitize_id(account), person=sanitize_id(person) + ), + params=params, + ), + ) + @classmethod def list_persons( cls, account: str, **params: Unpack["Account.ListPersonsParams"] @@ -4260,6 +4767,24 @@ def list_persons( ), ) + @classmethod + async def list_persons_async( + cls, account: str, **params: Unpack["Account.ListPersonsParams"] + ) -> ListObject["Person"]: + """ + Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. + """ + return cast( + ListObject["Person"], + await cls._static_request_async( + "get", + "/v1/accounts/{account}/persons".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + _inner_class_types = { "business_profile": BusinessProfile, "capabilities": Capabilities, diff --git a/stripe/_account_capability_service.py b/stripe/_account_capability_service.py index 6ce2f3647..c2deeefe8 100644 --- a/stripe/_account_capability_service.py +++ b/stripe/_account_capability_service.py @@ -57,6 +57,29 @@ def list( ), ) + async def list_async( + self, + account: str, + params: "AccountCapabilityService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Capability]: + """ + Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. + """ + return cast( + ListObject[Capability], + await self._request_async( + "get", + "/v1/accounts/{account}/capabilities".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, account: str, @@ -82,6 +105,31 @@ def retrieve( ), ) + async def retrieve_async( + self, + account: str, + capability: str, + params: "AccountCapabilityService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Capability: + """ + Retrieves information about the specified Account Capability. + """ + return cast( + Capability, + await self._request_async( + "get", + "/v1/accounts/{account}/capabilities/{capability}".format( + account=sanitize_id(account), + capability=sanitize_id(capability), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, account: str, @@ -106,3 +154,28 @@ def update( options=options, ), ) + + async def update_async( + self, + account: str, + capability: str, + params: "AccountCapabilityService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Capability: + """ + Updates an existing Account Capability. Request or remove a capability by updating its requested parameter. + """ + return cast( + Capability, + await self._request_async( + "post", + "/v1/accounts/{account}/capabilities/{capability}".format( + account=sanitize_id(account), + capability=sanitize_id(capability), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_account_external_account_service.py b/stripe/_account_external_account_service.py index 9f8b77e75..139a4dab0 100644 --- a/stripe/_account_external_account_service.py +++ b/stripe/_account_external_account_service.py @@ -227,6 +227,31 @@ def delete( ), ) + async def delete_async( + self, + account: str, + id: str, + params: "AccountExternalAccountService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Union[BankAccount, Card]: + """ + Delete a specified external account for a given account. + """ + return cast( + Union[BankAccount, Card], + await self._request_async( + "delete", + "/v1/accounts/{account}/external_accounts/{id}".format( + account=sanitize_id(account), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, account: str, @@ -252,6 +277,31 @@ def retrieve( ), ) + async def retrieve_async( + self, + account: str, + id: str, + params: "AccountExternalAccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Union[BankAccount, Card]: + """ + Retrieve a specified external account for a given account. + """ + return cast( + Union[BankAccount, Card], + await self._request_async( + "get", + "/v1/accounts/{account}/external_accounts/{id}".format( + account=sanitize_id(account), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, account: str, @@ -279,6 +329,33 @@ def update( ), ) + async def update_async( + self, + account: str, + id: str, + params: "AccountExternalAccountService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Union[BankAccount, Card]: + """ + Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. Other bank account details are not editable by design. + + You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + """ + return cast( + Union[BankAccount, Card], + await self._request_async( + "post", + "/v1/accounts/{account}/external_accounts/{id}".format( + account=sanitize_id(account), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, account: str, @@ -302,6 +379,29 @@ def list( ), ) + async def list_async( + self, + account: str, + params: "AccountExternalAccountService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Union[BankAccount, Card]]: + """ + List external accounts for an account. + """ + return cast( + ListObject[Union[BankAccount, Card]], + await self._request_async( + "get", + "/v1/accounts/{account}/external_accounts".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, account: str, @@ -324,3 +424,26 @@ def create( options=options, ), ) + + async def create_async( + self, + account: str, + params: "AccountExternalAccountService.CreateParams", + options: RequestOptions = {}, + ) -> Union[BankAccount, Card]: + """ + Create an external account for a given account. + """ + return cast( + Union[BankAccount, Card], + await self._request_async( + "post", + "/v1/accounts/{account}/external_accounts".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_account_link.py b/stripe/_account_link.py index 03aff08df..1e2452e4d 100644 --- a/stripe/_account_link.py +++ b/stripe/_account_link.py @@ -90,3 +90,19 @@ def create( params=params, ), ) + + @classmethod + async def create_async( + cls, **params: Unpack["AccountLink.CreateParams"] + ) -> "AccountLink": + """ + Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. + """ + return cast( + "AccountLink", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) diff --git a/stripe/_account_link_service.py b/stripe/_account_link_service.py index e55a9dbea..a24f1e788 100644 --- a/stripe/_account_link_service.py +++ b/stripe/_account_link_service.py @@ -69,3 +69,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "AccountLinkService.CreateParams", + options: RequestOptions = {}, + ) -> AccountLink: + """ + Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. + """ + return cast( + AccountLink, + await self._request_async( + "post", + "/v1/account_links", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_account_login_link_service.py b/stripe/_account_login_link_service.py index 20bbbb2ea..21a66ca38 100644 --- a/stripe/_account_login_link_service.py +++ b/stripe/_account_login_link_service.py @@ -39,3 +39,28 @@ def create( options=options, ), ) + + async def create_async( + self, + account: str, + params: "AccountLoginLinkService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> LoginLink: + """ + Creates a single-use login link for an Express account to access their Stripe dashboard. + + You may only create login links for [Express accounts](https://stripe.com/docs/connect/express-accounts) connected to your platform. + """ + return cast( + LoginLink, + await self._request_async( + "post", + "/v1/accounts/{account}/login_links".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_account_person_service.py b/stripe/_account_person_service.py index e308cfa86..4ec1741f2 100644 --- a/stripe/_account_person_service.py +++ b/stripe/_account_person_service.py @@ -838,6 +838,31 @@ def delete( ), ) + async def delete_async( + self, + account: str, + person: str, + params: "AccountPersonService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Person: + """ + Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. + """ + return cast( + Person, + await self._request_async( + "delete", + "/v1/accounts/{account}/persons/{person}".format( + account=sanitize_id(account), + person=sanitize_id(person), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, account: str, @@ -863,6 +888,31 @@ def retrieve( ), ) + async def retrieve_async( + self, + account: str, + person: str, + params: "AccountPersonService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Person: + """ + Retrieves an existing person. + """ + return cast( + Person, + await self._request_async( + "get", + "/v1/accounts/{account}/persons/{person}".format( + account=sanitize_id(account), + person=sanitize_id(person), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, account: str, @@ -888,6 +938,31 @@ def update( ), ) + async def update_async( + self, + account: str, + person: str, + params: "AccountPersonService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Person: + """ + Updates an existing person. + """ + return cast( + Person, + await self._request_async( + "post", + "/v1/accounts/{account}/persons/{person}".format( + account=sanitize_id(account), + person=sanitize_id(person), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, account: str, @@ -911,6 +986,29 @@ def list( ), ) + async def list_async( + self, + account: str, + params: "AccountPersonService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Person]: + """ + Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. + """ + return cast( + ListObject[Person], + await self._request_async( + "get", + "/v1/accounts/{account}/persons".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, account: str, @@ -933,3 +1031,26 @@ def create( options=options, ), ) + + async def create_async( + self, + account: str, + params: "AccountPersonService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Person: + """ + Creates a new person. + """ + return cast( + Person, + await self._request_async( + "post", + "/v1/accounts/{account}/persons".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_account_service.py b/stripe/_account_service.py index de4b9fd87..3bc43e433 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -3115,6 +3115,31 @@ def delete( ), ) + async def delete_async( + self, + account: str, + params: "AccountService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + + Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + + If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. + """ + return cast( + Account, + await self._request_async( + "delete", + "/v1/accounts/{account}".format(account=sanitize_id(account)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, account: str, @@ -3136,6 +3161,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + account: str, + params: "AccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + Retrieves the details of an account. + """ + return cast( + Account, + await self._request_async( + "get", + "/v1/accounts/{account}".format(account=sanitize_id(account)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, account: str, @@ -3165,6 +3211,35 @@ def update( ), ) + async def update_async( + self, + account: str, + params: "AccountService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are + left unchanged. + + For Custom accounts, you can update any information on the account. For other accounts, you can update all information until that + account has started to go through Connect Onboarding. Once you create an [Account Link or Account Session](https://stripe.com/docs/api/account_links), + some properties can only be changed or updated for Custom accounts. + + To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our + [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. + """ + return cast( + Account, + await self._request_async( + "post", + "/v1/accounts/{account}".format(account=sanitize_id(account)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve_current( self, params: "AccountService.RetrieveCurrentParams" = {}, @@ -3185,6 +3260,26 @@ def retrieve_current( ), ) + async def retrieve_current_async( + self, + params: "AccountService.RetrieveCurrentParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + Retrieves the details of an account. + """ + return cast( + Account, + await self._request_async( + "get", + "/v1/account", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "AccountService.ListParams" = {}, @@ -3205,6 +3300,26 @@ def list( ), ) + async def list_async( + self, + params: "AccountService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Account]: + """ + Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. + """ + return cast( + ListObject[Account], + await self._request_async( + "get", + "/v1/accounts", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "AccountService.CreateParams" = {}, @@ -3230,6 +3345,31 @@ def create( ), ) + async def create_async( + self, + params: "AccountService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. + To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). + + If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when + creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. + You can prefill any information on the account. + """ + return cast( + Account, + await self._request_async( + "post", + "/v1/accounts", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def reject( self, account: str, @@ -3254,3 +3394,28 @@ def reject( options=options, ), ) + + async def reject_async( + self, + account: str, + params: "AccountService.RejectParams", + options: RequestOptions = {}, + ) -> Account: + """ + With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + + Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + """ + return cast( + Account, + await self._request_async( + "post", + "/v1/accounts/{account}/reject".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_account_session.py b/stripe/_account_session.py index bd9f2156b..042c43bbb 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -330,4 +330,20 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["AccountSession.CreateParams"] + ) -> "AccountSession": + """ + Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. + """ + return cast( + "AccountSession", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + _inner_class_types = {"components": Components} diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index fa2f591ff..d3096d4f3 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -189,3 +189,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "AccountSessionService.CreateParams", + options: RequestOptions = {}, + ) -> AccountSession: + """ + Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. + """ + return cast( + AccountSession, + await self._request_async( + "post", + "/v1/account_sessions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_any_iterator.py b/stripe/_any_iterator.py new file mode 100644 index 000000000..0a7e6058a --- /dev/null +++ b/stripe/_any_iterator.py @@ -0,0 +1,34 @@ +from typing import TypeVar, Iterator, AsyncIterator + +T = TypeVar("T") + + +class AnyIterator(Iterator[T], AsyncIterator[T]): + """ + AnyIterator supports iteration through both `for ... in ` and `async for ... in syntaxes. + """ + + def __init__( + self, iterator: Iterator[T], async_iterator: AsyncIterator[T] + ) -> None: + self._iterator = iterator + self._async_iterator = async_iterator + + self._sync_iterated = False + self._async_iterated = False + + def __next__(self) -> T: + if self._async_iterated: + raise RuntimeError( + "AnyIterator error: cannot mix sync and async iteration" + ) + self._sync_iterated = True + return self._iterator.__next__() + + async def __anext__(self) -> T: + if self._sync_iterated: + raise RuntimeError( + "AnyIterator error: cannot mix sync and async iteration" + ) + self._async_iterated = True + return await self._async_iterator.__anext__() diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index a1c29edb1..a110fd5f9 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -3,6 +3,7 @@ import platform from typing import ( Any, + AsyncIterable, Dict, List, Mapping, @@ -12,7 +13,12 @@ cast, ClassVar, ) -from typing_extensions import TYPE_CHECKING, Literal, NoReturn, Unpack +from typing_extensions import ( + TYPE_CHECKING, + Literal, + NoReturn, + Unpack, +) import uuid from urllib.parse import urlsplit, urlunsplit @@ -32,13 +38,21 @@ from stripe._encode import ( _api_encode, ) -from stripe._stripe_response import StripeResponse, StripeStreamResponse +from stripe._stripe_response import ( + StripeResponse, + StripeStreamResponse, + StripeStreamResponseAsync, +) from stripe._request_options import RequestOptions, merge_options from stripe._requestor_options import ( RequestorOptions, _GlobalRequestorOptions, ) -from stripe._http_client import HTTPClient, new_default_http_client +from stripe._http_client import ( + HTTPClient, + new_default_http_client, + new_http_client_async_fallback, +) from stripe._app_info import AppInfo from stripe._base_address import BaseAddress @@ -74,12 +88,18 @@ def _get_http_client(self) -> HTTPClient: global _default_proxy if not stripe.default_http_client: + kwargs = { + "verify_ssl_certs": stripe.verify_ssl_certs, + "proxy": stripe.proxy, + } # If the stripe.default_http_client has not been set by the user # yet, we'll set it here. This way, we aren't creating a new # HttpClient for every request. stripe.default_http_client = new_default_http_client( - verify_ssl_certs=stripe.verify_ssl_certs, - proxy=stripe.proxy, + async_fallback_client=new_http_client_async_fallback( + **kwargs + ), + **kwargs, ) _default_proxy = stripe.proxy elif stripe.proxy != _default_proxy: @@ -160,7 +180,7 @@ def request( *, base_address: BaseAddress, api_mode: ApiMode, - _usage: Optional[List[str]] = None, + usage: Optional[List[str]] = None, ) -> "StripeObject": requestor = self._replace_options(options) rbody, rcode, rheaders = requestor.request_raw( @@ -171,7 +191,38 @@ def request( api_mode=api_mode, base_address=base_address, options=options, - _usage=_usage, + usage=usage, + ) + resp = requestor._interpret_response(rbody, rcode, rheaders) + + return _convert_to_stripe_object( + resp=resp, + params=params, + requestor=requestor, + api_mode=api_mode, + ) + + async def request_async( + self, + method: str, + url: str, + params: Optional[Mapping[str, Any]] = None, + options: Optional[RequestOptions] = None, + *, + base_address: BaseAddress, + api_mode: ApiMode, + usage: Optional[List[str]] = None, + ) -> "StripeObject": + requestor = self._replace_options(options) + rbody, rcode, rheaders = await requestor.request_raw_async( + method.lower(), + url, + params, + is_streaming=False, + api_mode=api_mode, + base_address=base_address, + options=options, + usage=usage, ) resp = requestor._interpret_response(rbody, rcode, rheaders) @@ -191,7 +242,7 @@ def request_stream( *, base_address: BaseAddress, api_mode: ApiMode, - _usage: Optional[List[str]] = None, + usage: Optional[List[str]] = None, ) -> StripeStreamResponse: stream, rcode, rheaders = self.request_raw( method.lower(), @@ -201,7 +252,7 @@ def request_stream( api_mode=api_mode, base_address=base_address, options=options, - _usage=_usage, + usage=usage, ) resp = self._interpret_streaming_response( # TODO: should be able to remove this cast once self._client.request_stream_with_retries @@ -212,6 +263,34 @@ def request_stream( ) return resp + async def request_stream_async( + self, + method: str, + url: str, + params: Optional[Mapping[str, Any]] = None, + options: Optional[RequestOptions] = None, + *, + base_address: BaseAddress, + api_mode: ApiMode, + usage: Optional[List[str]] = None, + ) -> StripeStreamResponseAsync: + stream, rcode, rheaders = await self.request_raw_async( + method.lower(), + url, + params, + is_streaming=True, + api_mode=api_mode, + base_address=base_address, + options=options, + usage=usage, + ) + resp = await self._interpret_streaming_response_async( + stream, + rcode, + rheaders, + ) + return resp + def handle_error_response(self, rbody, rcode, resp, rheaders) -> NoReturn: try: error_data = resp["error"] @@ -378,7 +457,7 @@ def _args_for_request_with_retries( *, base_address: BaseAddress, api_mode: ApiMode, - _usage: Optional[List[str]] = None, + usage: Optional[List[str]] = None, ): """ Mechanism for issuing an API call @@ -457,7 +536,7 @@ def _args_for_request_with_retries( headers, post_data, max_network_retries, - _usage, + usage, # For logging encoded_params, request_options.get("stripe_version"), @@ -473,7 +552,7 @@ def request_raw( *, base_address: BaseAddress, api_mode: ApiMode, - _usage: Optional[List[str]] = None, + usage: Optional[List[str]] = None, ) -> Tuple[object, int, Mapping[str, str]]: ( method, @@ -481,7 +560,7 @@ def request_raw( headers, post_data, max_network_retries, - _usage, + usage, encoded_params, api_version, ) = self._args_for_request_with_retries( @@ -491,7 +570,7 @@ def request_raw( options, base_address=base_address, api_mode=api_mode, - _usage=_usage, + usage=usage, ) log_info("Request to Stripe api", method=method, url=abs_url) @@ -510,7 +589,7 @@ def request_raw( headers, post_data, max_network_retries=max_network_retries, - _usage=_usage, + _usage=usage, ) else: ( @@ -523,7 +602,91 @@ def request_raw( headers, post_data, max_network_retries=max_network_retries, - _usage=_usage, + _usage=usage, + ) + + log_info("Stripe API response", path=abs_url, response_code=rcode) + log_debug("API response body", body=rcontent) + + if "Request-Id" in rheaders: + request_id = rheaders["Request-Id"] + log_debug( + "Dashboard link for request", + link=dashboard_link(request_id), + ) + + return rcontent, rcode, rheaders + + async def request_raw_async( + self, + method: str, + url: str, + params: Optional[Mapping[str, Any]] = None, + options: Optional[RequestOptions] = None, + is_streaming: bool = False, + *, + base_address: BaseAddress, + api_mode: ApiMode, + usage: Optional[List[str]] = None, + ) -> Tuple[AsyncIterable[bytes], int, Mapping[str, str]]: + """ + Mechanism for issuing an API call + """ + + usage = usage or [] + usage = usage + ["async"] + + ( + method, + abs_url, + headers, + post_data, + max_network_retries, + usage, + encoded_params, + api_version, + ) = self._args_for_request_with_retries( + method, + url, + params, + options, + base_address=base_address, + api_mode=api_mode, + usage=usage, + ) + + log_info("Request to Stripe api", method=method, url=abs_url) + log_debug( + "Post details", + post_data=encoded_params, + api_version=api_version, + ) + + if is_streaming: + ( + rcontent, + rcode, + rheaders, + ) = await self._get_http_client().request_stream_with_retries_async( + method, + abs_url, + headers, + post_data, + max_network_retries=max_network_retries, + _usage=usage, + ) + else: + ( + rcontent, + rcode, + rheaders, + ) = await self._get_http_client().request_with_retries_async( + method, + abs_url, + headers, + post_data, + max_network_retries=max_network_retries, + _usage=usage, ) log_info("Stripe API response", path=abs_url, response_code=rcode) @@ -569,6 +732,22 @@ def _interpret_response( self.handle_error_response(rbody, rcode, resp.data, rheaders) return resp + async def _interpret_streaming_response_async( + self, + stream: AsyncIterable[bytes], + rcode: int, + rheaders: Mapping[str, str], + ) -> StripeStreamResponseAsync: + if self._should_handle_code_as_error(rcode): + json_content = b"".join([chunk async for chunk in stream]) + self._interpret_response(json_content, rcode, rheaders) + # _interpret_response is guaranteed to throw since we've checked self._should_handle_code_as_error + raise RuntimeError( + "_interpret_response should have raised an error" + ) + else: + return StripeStreamResponseAsync(stream, rcode, rheaders) + def _interpret_streaming_response( self, stream: IOBase, @@ -588,6 +767,7 @@ def _interpret_streaming_response( raise NotImplementedError( "HTTP client %s does not return an IOBase object which " "can be consumed when streaming a response." + % self._get_http_client().name ) self._interpret_response(json_content, rcode, rheaders) diff --git a/stripe/_api_resource.py b/stripe/_api_resource.py index 1581e292a..ea456719a 100644 --- a/stripe/_api_resource.py +++ b/stripe/_api_resource.py @@ -37,6 +37,11 @@ def retrieve(cls, id, **params) -> T: def refresh(self) -> Self: return self._request_and_refresh("get", self.instance_url()) + async def refresh_async(self) -> Self: + return await self._request_and_refresh_async( + "get", self.instance_url() + ) + @classmethod def class_url(cls) -> str: if cls == APIResource: @@ -64,12 +69,10 @@ def instance_url(self) -> str: extn = quote_plus(id) return "%s/%s" % (base, extn) - # The `method_` and `url_` arguments are suffixed with an underscore to - # avoid conflicting with actual request parameters in `params`. def _request( self, - method_, - url_, + method, + url, params=None, *, base_address: BaseAddress = "api", @@ -77,8 +80,32 @@ def _request( ) -> StripeObject: obj = StripeObject._request( self, - method_, - url_, + method, + url, + params=params, + base_address=base_address, + api_mode=api_mode, + ) + + if type(self) is type(obj): + self._refresh_from(values=obj, api_mode=api_mode) + return self + else: + return obj + + async def _request_async( + self, + method, + url, + params=None, + *, + base_address: BaseAddress = "api", + api_mode: ApiMode = "V1", + ) -> StripeObject: + obj = await StripeObject._request_async( + self, + method, + url, params=params, base_address=base_address, api_mode=api_mode, @@ -90,33 +117,52 @@ def _request( else: return obj - # The `method_` and `url_` arguments are suffixed with an underscore to - # avoid conflicting with actual request parameters in `params`. def _request_and_refresh( self, - method_: Literal["get", "post", "delete"], - url_: str, + method: Literal["get", "post", "delete"], + url: str, params: Optional[Mapping[str, Any]] = None, - _usage: Optional[List[str]] = None, + usage: Optional[List[str]] = None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ) -> Self: obj = StripeObject._request( self, - method_, - url_, + method, + url, params=params, base_address=base_address, api_mode=api_mode, - _usage=_usage, + usage=usage, + ) + + self._refresh_from(values=obj, api_mode=api_mode) + return self + + async def _request_and_refresh_async( + self, + method: Literal["get", "post", "delete"], + url: str, + params: Optional[Mapping[str, Any]] = None, + usage: Optional[List[str]] = None, + *, + base_address: BaseAddress = "api", + api_mode: ApiMode = "V1", + ) -> Self: + obj = await StripeObject._request_async( + self, + method, + url, + params=params, + base_address=base_address, + api_mode=api_mode, + usage=usage, ) self._refresh_from(values=obj, api_mode=api_mode) return self - # The `method_` and `url_` arguments are suffixed with an underscore to - # avoid conflicting with actual request parameters in `params`. @classmethod def _static_request( cls, @@ -137,20 +183,18 @@ def _static_request( api_mode=api_mode, ) - # The `method_` and `url_` arguments are suffixed with an underscore to - # avoid conflicting with actual request parameters in `params`. @classmethod - def _static_request_stream( + async def _static_request_async( cls, method_, url_, - params=None, + params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ): request_options, request_params = extract_options_from_dict(params) - return _APIRequestor._global_instance().request_stream( + return await _APIRequestor._global_instance().request_async( method_, url_, params=request_params, @@ -158,3 +202,43 @@ def _static_request_stream( base_address=base_address, api_mode=api_mode, ) + + @classmethod + def _static_request_stream( + cls, + method, + url, + params: Optional[Mapping[str, Any]] = None, + *, + base_address: BaseAddress = "api", + api_mode: ApiMode = "V1", + ): + request_options, request_params = extract_options_from_dict(params) + return _APIRequestor._global_instance().request_stream( + method, + url, + params=request_params, + options=request_options, + base_address=base_address, + api_mode=api_mode, + ) + + @classmethod + async def _static_request_stream_async( + cls, + method, + url, + params: Optional[Mapping[str, Any]] = None, + *, + base_address: BaseAddress = "api", + api_mode: ApiMode = "V1", + ): + request_options, request_params = extract_options_from_dict(params) + return await _APIRequestor._global_instance().request_stream_async( + method, + url, + params=request_params, + options=request_options, + base_address=base_address, + api_mode=api_mode, + ) diff --git a/stripe/_apple_pay_domain.py b/stripe/_apple_pay_domain.py index c7842441f..254841b3f 100644 --- a/stripe/_apple_pay_domain.py +++ b/stripe/_apple_pay_domain.py @@ -90,6 +90,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["ApplePayDomain.CreateParams"] + ) -> "ApplePayDomain": + """ + Create an apple pay domain. + """ + return cast( + "ApplePayDomain", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["ApplePayDomain.DeleteParams"] @@ -139,6 +155,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["ApplePayDomain.DeleteParams"] + ) -> "ApplePayDomain": + """ + Delete an apple pay domain. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "ApplePayDomain", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["ApplePayDomain.DeleteParams"] + ) -> "ApplePayDomain": + """ + Delete an apple pay domain. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["ApplePayDomain.DeleteParams"] + ) -> "ApplePayDomain": + """ + Delete an apple pay domain. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["ApplePayDomain.DeleteParams"] + ) -> "ApplePayDomain": + """ + Delete an apple pay domain. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["ApplePayDomain.ListParams"] @@ -160,6 +225,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["ApplePayDomain.ListParams"] + ) -> ListObject["ApplePayDomain"]: + """ + List apple pay domains. + """ + 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["ApplePayDomain.RetrieveParams"] @@ -171,6 +257,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ApplePayDomain.RetrieveParams"] + ) -> "ApplePayDomain": + """ + Retrieve an apple pay domain. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def class_url(cls): return "/v1/apple_pay/domains" diff --git a/stripe/_apple_pay_domain_service.py b/stripe/_apple_pay_domain_service.py index 007d2d679..112d8da00 100644 --- a/stripe/_apple_pay_domain_service.py +++ b/stripe/_apple_pay_domain_service.py @@ -68,6 +68,29 @@ def delete( ), ) + async def delete_async( + self, + domain: str, + params: "ApplePayDomainService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> ApplePayDomain: + """ + Delete an apple pay domain. + """ + return cast( + ApplePayDomain, + await self._request_async( + "delete", + "/v1/apple_pay/domains/{domain}".format( + domain=sanitize_id(domain), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, domain: str, @@ -91,6 +114,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + domain: str, + params: "ApplePayDomainService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ApplePayDomain: + """ + Retrieve an apple pay domain. + """ + return cast( + ApplePayDomain, + await self._request_async( + "get", + "/v1/apple_pay/domains/{domain}".format( + domain=sanitize_id(domain), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "ApplePayDomainService.ListParams" = {}, @@ -111,6 +157,26 @@ def list( ), ) + async def list_async( + self, + params: "ApplePayDomainService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ApplePayDomain]: + """ + List apple pay domains. + """ + return cast( + ListObject[ApplePayDomain], + await self._request_async( + "get", + "/v1/apple_pay/domains", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "ApplePayDomainService.CreateParams", @@ -130,3 +196,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "ApplePayDomainService.CreateParams", + options: RequestOptions = {}, + ) -> ApplePayDomain: + """ + Create an apple pay domain. + """ + return cast( + ApplePayDomain, + await self._request_async( + "post", + "/v1/apple_pay/domains", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_application_fee.py b/stripe/_application_fee.py index fa20c5433..d0f617b5a 100644 --- a/stripe/_application_fee.py +++ b/stripe/_application_fee.py @@ -217,6 +217,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["ApplicationFee.ListParams"] + ) -> ListObject["ApplicationFee"]: + """ + Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. + """ + 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 _cls_refund( cls, id: str, **params: Unpack["ApplicationFee.RefundParams"] @@ -302,6 +323,91 @@ def refund( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_refund_async( + cls, id: str, **params: Unpack["ApplicationFee.RefundParams"] + ) -> "ApplicationFeeRefund": + """ + Refunds an application fee that has previously been collected but not yet refunded. + Funds will be refunded to the Stripe account from which the fee was originally collected. + + You can optionally refund only part of an application fee. + You can do so multiple times, until the entire fee has been refunded. + + Once entirely refunded, an application fee can't be refunded again. + This method will raise an error when called on an already-refunded application fee, + or when trying to refund more money than is left on an application fee. + """ + return cast( + "ApplicationFeeRefund", + await cls._static_request_async( + "post", + "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + async def refund_async( + id: str, **params: Unpack["ApplicationFee.RefundParams"] + ) -> "ApplicationFeeRefund": + """ + Refunds an application fee that has previously been collected but not yet refunded. + Funds will be refunded to the Stripe account from which the fee was originally collected. + + You can optionally refund only part of an application fee. + You can do so multiple times, until the entire fee has been refunded. + + Once entirely refunded, an application fee can't be refunded again. + This method will raise an error when called on an already-refunded application fee, + or when trying to refund more money than is left on an application fee. + """ + ... + + @overload + async def refund_async( + self, **params: Unpack["ApplicationFee.RefundParams"] + ) -> "ApplicationFeeRefund": + """ + Refunds an application fee that has previously been collected but not yet refunded. + Funds will be refunded to the Stripe account from which the fee was originally collected. + + You can optionally refund only part of an application fee. + You can do so multiple times, until the entire fee has been refunded. + + Once entirely refunded, an application fee can't be refunded again. + This method will raise an error when called on an already-refunded application fee, + or when trying to refund more money than is left on an application fee. + """ + ... + + @class_method_variant("_cls_refund_async") + async def refund_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["ApplicationFee.RefundParams"] + ) -> "ApplicationFeeRefund": + """ + Refunds an application fee that has previously been collected but not yet refunded. + Funds will be refunded to the Stripe account from which the fee was originally collected. + + You can optionally refund only part of an application fee. + You can do so multiple times, until the entire fee has been refunded. + + Once entirely refunded, an application fee can't be refunded again. + This method will raise an error when called on an already-refunded application fee, + or when trying to refund more money than is left on an application fee. + """ + return cast( + "ApplicationFeeRefund", + await self._request_async( + "post", + "/v1/application_fees/{id}/refunds".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["ApplicationFee.RetrieveParams"] @@ -313,6 +419,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ApplicationFee.RetrieveParams"] + ) -> "ApplicationFee": + """ + Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def create_refund( cls, id: str, **params: Unpack["ApplicationFee.CreateRefundParams"] @@ -337,6 +454,30 @@ def create_refund( ), ) + @classmethod + async def create_refund_async( + cls, id: str, **params: Unpack["ApplicationFee.CreateRefundParams"] + ) -> "ApplicationFeeRefund": + """ + Refunds an application fee that has previously been collected but not yet refunded. + Funds will be refunded to the Stripe account from which the fee was originally collected. + + You can optionally refund only part of an application fee. + You can do so multiple times, until the entire fee has been refunded. + + Once entirely refunded, an application fee can't be refunded again. + This method will raise an error when called on an already-refunded application fee, + or when trying to refund more money than is left on an application fee. + """ + return cast( + "ApplicationFeeRefund", + await cls._static_request_async( + "post", + "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), + params=params, + ), + ) + @classmethod def retrieve_refund( cls, @@ -358,6 +499,27 @@ def retrieve_refund( ), ) + @classmethod + async def retrieve_refund_async( + cls, + fee: str, + id: str, + **params: Unpack["ApplicationFee.RetrieveRefundParams"] + ) -> "ApplicationFeeRefund": + """ + By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. + """ + return cast( + "ApplicationFeeRefund", + await cls._static_request_async( + "get", + "/v1/application_fees/{fee}/refunds/{id}".format( + fee=sanitize_id(fee), id=sanitize_id(id) + ), + params=params, + ), + ) + @classmethod def modify_refund( cls, @@ -381,6 +543,29 @@ def modify_refund( ), ) + @classmethod + async def modify_refund_async( + cls, + fee: str, + id: str, + **params: Unpack["ApplicationFee.ModifyRefundParams"] + ) -> "ApplicationFeeRefund": + """ + Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + + This request only accepts metadata as an argument. + """ + return cast( + "ApplicationFeeRefund", + await cls._static_request_async( + "post", + "/v1/application_fees/{fee}/refunds/{id}".format( + fee=sanitize_id(fee), id=sanitize_id(id) + ), + params=params, + ), + ) + @classmethod def list_refunds( cls, id: str, **params: Unpack["ApplicationFee.ListRefundsParams"] @@ -396,3 +581,19 @@ def list_refunds( params=params, ), ) + + @classmethod + async def list_refunds_async( + cls, id: str, **params: Unpack["ApplicationFee.ListRefundsParams"] + ) -> ListObject["ApplicationFeeRefund"]: + """ + You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. + """ + return cast( + ListObject["ApplicationFeeRefund"], + await cls._static_request_async( + "get", + "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), + params=params, + ), + ) diff --git a/stripe/_application_fee_refund_service.py b/stripe/_application_fee_refund_service.py index d96a68514..4f620585e 100644 --- a/stripe/_application_fee_refund_service.py +++ b/stripe/_application_fee_refund_service.py @@ -83,6 +83,31 @@ def retrieve( ), ) + async def retrieve_async( + self, + fee: str, + id: str, + params: "ApplicationFeeRefundService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ApplicationFeeRefund: + """ + By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. + """ + return cast( + ApplicationFeeRefund, + await self._request_async( + "get", + "/v1/application_fees/{fee}/refunds/{id}".format( + fee=sanitize_id(fee), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, fee: str, @@ -110,6 +135,33 @@ def update( ), ) + async def update_async( + self, + fee: str, + id: str, + params: "ApplicationFeeRefundService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> ApplicationFeeRefund: + """ + Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + + This request only accepts metadata as an argument. + """ + return cast( + ApplicationFeeRefund, + await self._request_async( + "post", + "/v1/application_fees/{fee}/refunds/{id}".format( + fee=sanitize_id(fee), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, id: str, @@ -131,6 +183,27 @@ def list( ), ) + async def list_async( + self, + id: str, + params: "ApplicationFeeRefundService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ApplicationFeeRefund]: + """ + You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. + """ + return cast( + ListObject[ApplicationFeeRefund], + await self._request_async( + "get", + "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, id: str, @@ -159,3 +232,32 @@ def create( options=options, ), ) + + async def create_async( + self, + id: str, + params: "ApplicationFeeRefundService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> ApplicationFeeRefund: + """ + Refunds an application fee that has previously been collected but not yet refunded. + Funds will be refunded to the Stripe account from which the fee was originally collected. + + You can optionally refund only part of an application fee. + You can do so multiple times, until the entire fee has been refunded. + + Once entirely refunded, an application fee can't be refunded again. + This method will raise an error when called on an already-refunded application fee, + or when trying to refund more money than is left on an application fee. + """ + return cast( + ApplicationFeeRefund, + await self._request_async( + "post", + "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_application_fee_service.py b/stripe/_application_fee_service.py index 799fe1f6d..b3db0ae8b 100644 --- a/stripe/_application_fee_service.py +++ b/stripe/_application_fee_service.py @@ -85,6 +85,26 @@ def list( ), ) + async def list_async( + self, + params: "ApplicationFeeService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ApplicationFee]: + """ + Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. + """ + return cast( + ListObject[ApplicationFee], + await self._request_async( + "get", + "/v1/application_fees", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -105,3 +125,24 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + id: str, + params: "ApplicationFeeService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ApplicationFee: + """ + Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. + """ + return cast( + ApplicationFee, + await self._request_async( + "get", + "/v1/application_fees/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_balance.py b/stripe/_balance.py index 3921d42f0..50b24f8e2 100644 --- a/stripe/_balance.py +++ b/stripe/_balance.py @@ -203,6 +203,18 @@ def retrieve(cls, **params: Unpack["Balance.RetrieveParams"]) -> "Balance": instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, **params: Unpack["Balance.RetrieveParams"] + ) -> "Balance": + """ + Retrieves the current account balance, based on the authentication that was used to make the request. + For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). + """ + instance = cls(None, **params) + await instance.refresh_async() + return instance + @classmethod def class_url(cls): return "/v1/balance" diff --git a/stripe/_balance_service.py b/stripe/_balance_service.py index 49780a444..7220f5030 100644 --- a/stripe/_balance_service.py +++ b/stripe/_balance_service.py @@ -34,3 +34,24 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + params: "BalanceService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Balance: + """ + Retrieves the current account balance, based on the authentication that was used to make the request. + For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). + """ + return cast( + Balance, + await self._request_async( + "get", + "/v1/balance", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_balance_transaction.py b/stripe/_balance_transaction.py index d75d48b4d..71c433385 100644 --- a/stripe/_balance_transaction.py +++ b/stripe/_balance_transaction.py @@ -283,6 +283,29 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["BalanceTransaction.ListParams"] + ) -> ListObject["BalanceTransaction"]: + """ + Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. + + Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. + """ + 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["BalanceTransaction.RetrieveParams"] @@ -296,4 +319,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["BalanceTransaction.RetrieveParams"] + ) -> "BalanceTransaction": + """ + Retrieves the balance transaction with the given ID. + + Note that this endpoint previously used the path /v1/balance/history/:id. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"fee_details": FeeDetail} diff --git a/stripe/_balance_transaction_service.py b/stripe/_balance_transaction_service.py index 2c0412f33..d6abe402c 100644 --- a/stripe/_balance_transaction_service.py +++ b/stripe/_balance_transaction_service.py @@ -94,6 +94,28 @@ def list( ), ) + async def list_async( + self, + params: "BalanceTransactionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[BalanceTransaction]: + """ + Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. + + Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. + """ + return cast( + ListObject[BalanceTransaction], + await self._request_async( + "get", + "/v1/balance_transactions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -116,3 +138,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + id: str, + params: "BalanceTransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> BalanceTransaction: + """ + Retrieves the balance transaction with the given ID. + + Note that this endpoint previously used the path /v1/balance/history/:id. + """ + return cast( + BalanceTransaction, + await self._request_async( + "get", + "/v1/balance_transactions/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index fc1507494..049e0859b 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -413,6 +413,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["BankAccount.DeleteParams"] + ) -> Union["BankAccount", "Card"]: + """ + Delete a specified external account for a given account. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + Union["BankAccount", "Card"], + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["BankAccount.DeleteParams"] + ) -> Union["BankAccount", "Card"]: + """ + Delete a specified external account for a given account. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["BankAccount.DeleteParams"] + ) -> Union["BankAccount", "Card"]: + """ + Delete a specified external account for a given account. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["BankAccount.DeleteParams"] + ) -> Union["BankAccount", "Card"]: + """ + Delete a specified external account for a given account. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + def instance_url(self): token = self.id extn = sanitize_id(token) diff --git a/stripe/_card.py b/stripe/_card.py index 7a79b0563..a83c74af9 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -217,6 +217,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["Card.DeleteParams"] + ) -> Union["BankAccount", "Card"]: + """ + Delete a specified external account for a given account. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + Union["BankAccount", "Card"], + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["Card.DeleteParams"] + ) -> Union["BankAccount", "Card"]: + """ + Delete a specified external account for a given account. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["Card.DeleteParams"] + ) -> Union["BankAccount", "Card"]: + """ + Delete a specified external account for a given account. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Card.DeleteParams"] + ) -> Union["BankAccount", "Card"]: + """ + Delete a specified external account for a given account. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + def instance_url(self): token = self.id extn = sanitize_id(token) diff --git a/stripe/_charge.py b/stripe/_charge.py index e3ee32f27..ecdd97c3e 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -12,6 +12,7 @@ from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ( + AsyncIterator, ClassVar, Dict, Iterator, @@ -2359,6 +2360,77 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_capture_async( + cls, charge: str, **params: Unpack["Charge.CaptureParams"] + ) -> "Charge": + """ + Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. + + Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. + + Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). + """ + return cast( + "Charge", + await cls._static_request_async( + "post", + "/v1/charges/{charge}/capture".format( + charge=sanitize_id(charge) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def capture_async( + charge: str, **params: Unpack["Charge.CaptureParams"] + ) -> "Charge": + """ + Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. + + Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. + + Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). + """ + ... + + @overload + async def capture_async( + self, **params: Unpack["Charge.CaptureParams"] + ) -> "Charge": + """ + Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. + + Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. + + Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). + """ + ... + + @class_method_variant("_cls_capture_async") + async def capture_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Charge.CaptureParams"] + ) -> "Charge": + """ + Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. + + Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. + + Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). + """ + return cast( + "Charge", + await self._request_async( + "post", + "/v1/charges/{charge}/capture".format( + charge=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create(cls, **params: Unpack["Charge.CreateParams"]) -> "Charge": """ @@ -2375,6 +2447,24 @@ def create(cls, **params: Unpack["Charge.CreateParams"]) -> "Charge": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Charge.CreateParams"] + ) -> "Charge": + """ + This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) + to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge + object used to request payment. + """ + return cast( + "Charge", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Charge.ListParams"] @@ -2396,6 +2486,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Charge.ListParams"] + ) -> ListObject["Charge"]: + """ + Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Charge.ModifyParams"] @@ -2413,6 +2524,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Charge.ModifyParams"] + ) -> "Charge": + """ + Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Charge", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Charge.RetrieveParams"] @@ -2424,6 +2552,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Charge.RetrieveParams"] + ) -> "Charge": + """ + Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def search( cls, *args, **kwargs: Unpack["Charge.SearchParams"] @@ -2436,12 +2575,32 @@ def search( """ return cls._search(search_url="/v1/charges/search", *args, **kwargs) + @classmethod + async def search_async( + cls, *args, **kwargs: Unpack["Charge.SearchParams"] + ) -> SearchResultObject["Charge"]: + """ + Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return await cls._search_async( + search_url="/v1/charges/search", *args, **kwargs + ) + @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["Charge.SearchParams"] ) -> Iterator["Charge"]: return cls.search(*args, **kwargs).auto_paging_iter() + @classmethod + async def search_auto_paging_iter_async( + cls, *args, **kwargs: Unpack["Charge.SearchParams"] + ) -> AsyncIterator["Charge"]: + return (await cls.search_async(*args, **kwargs)).auto_paging_iter() + def mark_as_fraudulent(self, idempotency_key=None) -> "Charge": params = { "fraud_details": {"user_report": "fraudulent"}, @@ -2481,6 +2640,27 @@ def retrieve_refund( ), ) + @classmethod + async def retrieve_refund_async( + cls, + charge: str, + refund: str, + **params: Unpack["Charge.RetrieveRefundParams"] + ) -> "Refund": + """ + Retrieves the details of an existing refund. + """ + return cast( + "Refund", + await cls._static_request_async( + "get", + "/v1/charges/{charge}/refunds/{refund}".format( + charge=sanitize_id(charge), refund=sanitize_id(refund) + ), + params=params, + ), + ) + @classmethod def list_refunds( cls, charge: str, **params: Unpack["Charge.ListRefundsParams"] @@ -2499,6 +2679,24 @@ def list_refunds( ), ) + @classmethod + async def list_refunds_async( + cls, charge: str, **params: Unpack["Charge.ListRefundsParams"] + ) -> ListObject["Refund"]: + """ + You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. + """ + return cast( + ListObject["Refund"], + await cls._static_request_async( + "get", + "/v1/charges/{charge}/refunds".format( + charge=sanitize_id(charge) + ), + params=params, + ), + ) + _inner_class_types = { "billing_details": BillingDetails, "fraud_details": FraudDetails, diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index 33f157ede..f7ffe65b6 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -385,6 +385,26 @@ def list( ), ) + async def list_async( + self, + params: "ChargeService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Charge]: + """ + Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. + """ + return cast( + ListObject[Charge], + await self._request_async( + "get", + "/v1/charges", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "ChargeService.CreateParams" = {}, @@ -407,6 +427,28 @@ def create( ), ) + async def create_async( + self, + params: "ChargeService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Charge: + """ + This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) + to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge + object used to request payment. + """ + return cast( + Charge, + await self._request_async( + "post", + "/v1/charges", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, charge: str, @@ -428,6 +470,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + charge: str, + params: "ChargeService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Charge: + """ + Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. + """ + return cast( + Charge, + await self._request_async( + "get", + "/v1/charges/{charge}".format(charge=sanitize_id(charge)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, charge: str, @@ -449,6 +512,27 @@ def update( ), ) + async def update_async( + self, + charge: str, + params: "ChargeService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Charge: + """ + Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + return cast( + Charge, + await self._request_async( + "post", + "/v1/charges/{charge}".format(charge=sanitize_id(charge)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def search( self, params: "ChargeService.SearchParams", @@ -472,6 +556,29 @@ def search( ), ) + async def search_async( + self, + params: "ChargeService.SearchParams", + options: RequestOptions = {}, + ) -> SearchResultObject[Charge]: + """ + Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return cast( + SearchResultObject[Charge], + await self._request_async( + "get", + "/v1/charges/search", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def capture( self, charge: str, @@ -498,3 +605,30 @@ def capture( options=options, ), ) + + async def capture_async( + self, + charge: str, + params: "ChargeService.CaptureParams" = {}, + options: RequestOptions = {}, + ) -> Charge: + """ + Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. + + Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. + + Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). + """ + return cast( + Charge, + await self._request_async( + "post", + "/v1/charges/{charge}/capture".format( + charge=sanitize_id(charge), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index e71973de0..f00c11ace 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -1899,6 +1899,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ConfirmationToken.RetrieveParams"] + ) -> "ConfirmationToken": + """ + Retrieves an existing ConfirmationToken object + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + class TestHelpers(APIResourceTestHelpers["ConfirmationToken"]): _resource_cls: Type["ConfirmationToken"] @@ -1918,6 +1929,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["ConfirmationToken.CreateParams"] + ) -> "ConfirmationToken": + """ + Creates a test mode Confirmation Token server side for your integration tests. + """ + return cast( + "ConfirmationToken", + await cls._static_request_async( + "post", + "/v1/test_helpers/confirmation_tokens", + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/_confirmation_token_service.py b/stripe/_confirmation_token_service.py index 768ac0a2d..c26ce0038 100644 --- a/stripe/_confirmation_token_service.py +++ b/stripe/_confirmation_token_service.py @@ -37,3 +37,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + confirmation_token: str, + params: "ConfirmationTokenService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ConfirmationToken: + """ + Retrieves an existing ConfirmationToken object + """ + return cast( + ConfirmationToken, + await self._request_async( + "get", + "/v1/confirmation_tokens/{confirmation_token}".format( + confirmation_token=sanitize_id(confirmation_token), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_country_spec.py b/stripe/_country_spec.py index 94a861e99..15c4886ba 100644 --- a/stripe/_country_spec.py +++ b/stripe/_country_spec.py @@ -120,6 +120,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["CountrySpec.ListParams"] + ) -> ListObject["CountrySpec"]: + """ + Lists all Country Spec objects available in the API. + """ + 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["CountrySpec.RetrieveParams"] @@ -131,4 +152,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["CountrySpec.RetrieveParams"] + ) -> "CountrySpec": + """ + Returns a Country Spec for a given Country code. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"verification_fields": VerificationFields} diff --git a/stripe/_country_spec_service.py b/stripe/_country_spec_service.py index 959a6a517..dbaa2b77b 100644 --- a/stripe/_country_spec_service.py +++ b/stripe/_country_spec_service.py @@ -54,6 +54,26 @@ def list( ), ) + async def list_async( + self, + params: "CountrySpecService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[CountrySpec]: + """ + Lists all Country Spec objects available in the API. + """ + return cast( + ListObject[CountrySpec], + await self._request_async( + "get", + "/v1/country_specs", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, country: str, @@ -76,3 +96,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + country: str, + params: "CountrySpecService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> CountrySpec: + """ + Returns a Country Spec for a given Country code. + """ + return cast( + CountrySpec, + await self._request_async( + "get", + "/v1/country_specs/{country}".format( + country=sanitize_id(country), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_coupon.py b/stripe/_coupon.py index 24573b5f8..f1d55a169 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -267,6 +267,24 @@ def create(cls, **params: Unpack["Coupon.CreateParams"]) -> "Coupon": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Coupon.CreateParams"] + ) -> "Coupon": + """ + You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. + + A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. + """ + return cast( + "Coupon", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Coupon.DeleteParams"] @@ -312,6 +330,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["Coupon.DeleteParams"] + ) -> "Coupon": + """ + You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "Coupon", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["Coupon.DeleteParams"] + ) -> "Coupon": + """ + You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["Coupon.DeleteParams"] + ) -> "Coupon": + """ + You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Coupon.DeleteParams"] + ) -> "Coupon": + """ + You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["Coupon.ListParams"] @@ -333,6 +400,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Coupon.ListParams"] + ) -> ListObject["Coupon"]: + """ + Returns a list of your coupons. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Coupon.ModifyParams"] @@ -350,6 +438,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Coupon.ModifyParams"] + ) -> "Coupon": + """ + Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Coupon", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Coupon.RetrieveParams"] @@ -361,6 +466,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Coupon.RetrieveParams"] + ) -> "Coupon": + """ + Retrieves the coupon with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "applies_to": AppliesTo, "currency_options": CurrencyOptions, diff --git a/stripe/_coupon_service.py b/stripe/_coupon_service.py index b66efcae3..15bda53f1 100644 --- a/stripe/_coupon_service.py +++ b/stripe/_coupon_service.py @@ -174,6 +174,27 @@ def delete( ), ) + async def delete_async( + self, + coupon: str, + params: "CouponService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Coupon: + """ + You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. + """ + return cast( + Coupon, + await self._request_async( + "delete", + "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, coupon: str, @@ -195,6 +216,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + coupon: str, + params: "CouponService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Coupon: + """ + Retrieves the coupon with the given ID. + """ + return cast( + Coupon, + await self._request_async( + "get", + "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, coupon: str, @@ -216,6 +258,27 @@ def update( ), ) + async def update_async( + self, + coupon: str, + params: "CouponService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Coupon: + """ + Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. + """ + return cast( + Coupon, + await self._request_async( + "post", + "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "CouponService.ListParams" = {}, @@ -236,6 +299,26 @@ def list( ), ) + async def list_async( + self, + params: "CouponService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Coupon]: + """ + Returns a list of your coupons. + """ + return cast( + ListObject[Coupon], + await self._request_async( + "get", + "/v1/coupons", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "CouponService.CreateParams" = {}, @@ -257,3 +340,25 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "CouponService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Coupon: + """ + You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. + + A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. + """ + return cast( + Coupon, + await self._request_async( + "post", + "/v1/coupons", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index e5b672bfe..90d00a1ed 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -777,6 +777,35 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["CreditNote.CreateParams"] + ) -> "CreditNote": + """ + Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces + its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result + in any combination of the following: + + + Refund: create a new refund (using refund_amount) or link an existing refund (using refund). + Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. + Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). + + + For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. + + You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount + or post_payment_credit_notes_amount depending on its status at the time of credit note creation. + """ + return cast( + "CreditNote", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["CreditNote.ListParams"] @@ -798,6 +827,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["CreditNote.ListParams"] + ) -> ListObject["CreditNote"]: + """ + Returns a list of credit notes. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["CreditNote.ModifyParams"] @@ -815,6 +865,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["CreditNote.ModifyParams"] + ) -> "CreditNote": + """ + Updates an existing credit note. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "CreditNote", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def preview( cls, **params: Unpack["CreditNote.PreviewParams"] @@ -831,6 +898,22 @@ def preview( ), ) + @classmethod + async def preview_async( + cls, **params: Unpack["CreditNote.PreviewParams"] + ) -> "CreditNote": + """ + Get a preview of a credit note without creating it. + """ + return cast( + "CreditNote", + await cls._static_request_async( + "get", + "/v1/credit_notes/preview", + params=params, + ), + ) + @classmethod def preview_lines( cls, **params: Unpack["CreditNote.PreviewLinesParams"] @@ -847,6 +930,22 @@ def preview_lines( ), ) + @classmethod + async def preview_lines_async( + cls, **params: Unpack["CreditNote.PreviewLinesParams"] + ) -> ListObject["CreditNoteLineItem"]: + """ + When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["CreditNoteLineItem"], + await cls._static_request_async( + "get", + "/v1/credit_notes/preview/lines", + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["CreditNote.RetrieveParams"] @@ -858,6 +957,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["CreditNote.RetrieveParams"] + ) -> "CreditNote": + """ + Retrieves the credit note object with the given identifier. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def _cls_void_credit_note( cls, id: str, **params: Unpack["CreditNote.VoidCreditNoteParams"] @@ -911,6 +1021,59 @@ def void_credit_note( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_void_credit_note_async( + cls, id: str, **params: Unpack["CreditNote.VoidCreditNoteParams"] + ) -> "CreditNote": + """ + Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + """ + return cast( + "CreditNote", + await cls._static_request_async( + "post", + "/v1/credit_notes/{id}/void".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + async def void_credit_note_async( + id: str, **params: Unpack["CreditNote.VoidCreditNoteParams"] + ) -> "CreditNote": + """ + Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + """ + ... + + @overload + async def void_credit_note_async( + self, **params: Unpack["CreditNote.VoidCreditNoteParams"] + ) -> "CreditNote": + """ + Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + """ + ... + + @class_method_variant("_cls_void_credit_note_async") + async def void_credit_note_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["CreditNote.VoidCreditNoteParams"] + ) -> "CreditNote": + """ + Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + """ + return cast( + "CreditNote", + await self._request_async( + "post", + "/v1/credit_notes/{id}/void".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def list_lines( cls, credit_note: str, **params: Unpack["CreditNote.ListLinesParams"] @@ -929,6 +1092,24 @@ def list_lines( ), ) + @classmethod + async def list_lines_async( + cls, credit_note: str, **params: Unpack["CreditNote.ListLinesParams"] + ) -> ListObject["CreditNoteLineItem"]: + """ + When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["CreditNoteLineItem"], + await cls._static_request_async( + "get", + "/v1/credit_notes/{credit_note}/lines".format( + credit_note=sanitize_id(credit_note) + ), + params=params, + ), + ) + _inner_class_types = { "discount_amounts": DiscountAmount, "shipping_cost": ShippingCost, diff --git a/stripe/_credit_note_line_item_service.py b/stripe/_credit_note_line_item_service.py index 53d4109a0..2baa2f65f 100644 --- a/stripe/_credit_note_line_item_service.py +++ b/stripe/_credit_note_line_item_service.py @@ -50,3 +50,26 @@ def list( options=options, ), ) + + async def list_async( + self, + credit_note: str, + params: "CreditNoteLineItemService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[CreditNoteLineItem]: + """ + When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject[CreditNoteLineItem], + await self._request_async( + "get", + "/v1/credit_notes/{credit_note}/lines".format( + credit_note=sanitize_id(credit_note), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_credit_note_preview_lines_service.py b/stripe/_credit_note_preview_lines_service.py index b2a4a73c0..72f949caa 100644 --- a/stripe/_credit_note_preview_lines_service.py +++ b/stripe/_credit_note_preview_lines_service.py @@ -165,3 +165,23 @@ def list( options=options, ), ) + + async def list_async( + self, + params: "CreditNotePreviewLinesService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[CreditNoteLineItem]: + """ + When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject[CreditNoteLineItem], + await self._request_async( + "get", + "/v1/credit_notes/preview/lines", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index 92210819d..e70713b8d 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -359,6 +359,26 @@ def list( ), ) + async def list_async( + self, + params: "CreditNoteService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[CreditNote]: + """ + Returns a list of credit notes. + """ + return cast( + ListObject[CreditNote], + await self._request_async( + "get", + "/v1/credit_notes", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "CreditNoteService.CreateParams", @@ -392,6 +412,39 @@ def create( ), ) + async def create_async( + self, + params: "CreditNoteService.CreateParams", + options: RequestOptions = {}, + ) -> CreditNote: + """ + Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces + its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result + in any combination of the following: + + + Refund: create a new refund (using refund_amount) or link an existing refund (using refund). + Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. + Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). + + + For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. + + You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount + or post_payment_credit_notes_amount depending on its status at the time of credit note creation. + """ + return cast( + CreditNote, + await self._request_async( + "post", + "/v1/credit_notes", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -413,6 +466,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + id: str, + params: "CreditNoteService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> CreditNote: + """ + Retrieves the credit note object with the given identifier. + """ + return cast( + CreditNote, + await self._request_async( + "get", + "/v1/credit_notes/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, id: str, @@ -434,6 +508,27 @@ def update( ), ) + async def update_async( + self, + id: str, + params: "CreditNoteService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> CreditNote: + """ + Updates an existing credit note. + """ + return cast( + CreditNote, + await self._request_async( + "post", + "/v1/credit_notes/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def preview( self, params: "CreditNoteService.PreviewParams", @@ -454,6 +549,26 @@ def preview( ), ) + async def preview_async( + self, + params: "CreditNoteService.PreviewParams", + options: RequestOptions = {}, + ) -> CreditNote: + """ + Get a preview of a credit note without creating it. + """ + return cast( + CreditNote, + await self._request_async( + "get", + "/v1/credit_notes/preview", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def void_credit_note( self, id: str, @@ -474,3 +589,24 @@ def void_credit_note( options=options, ), ) + + async def void_credit_note_async( + self, + id: str, + params: "CreditNoteService.VoidCreditNoteParams" = {}, + options: RequestOptions = {}, + ) -> CreditNote: + """ + Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + """ + return cast( + CreditNote, + await self._request_async( + "post", + "/v1/credit_notes/{id}/void".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_customer.py b/stripe/_customer.py index 9ae66eeb7..95ea863e0 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -14,6 +14,7 @@ from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ( + AsyncIterator, ClassVar, Dict, Iterator, @@ -1433,6 +1434,22 @@ def create(cls, **params: Unpack["Customer.CreateParams"]) -> "Customer": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Customer.CreateParams"] + ) -> "Customer": + """ + Creates a new customer object. + """ + return cast( + "Customer", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_create_funding_instructions( cls, @@ -1499,6 +1516,72 @@ def create_funding_instructions( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_create_funding_instructions_async( + cls, + customer: str, + **params: Unpack["Customer.CreateFundingInstructionsParams"] + ) -> "FundingInstructions": + """ + Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new + funding instructions will be created. If funding instructions have already been created for a given customer, the same + funding instructions will be retrieved. In other words, we will return the same funding instructions each time. + """ + return cast( + "FundingInstructions", + await cls._static_request_async( + "post", + "/v1/customers/{customer}/funding_instructions".format( + customer=sanitize_id(customer) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def create_funding_instructions_async( + customer: str, + **params: Unpack["Customer.CreateFundingInstructionsParams"] + ) -> "FundingInstructions": + """ + Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new + funding instructions will be created. If funding instructions have already been created for a given customer, the same + funding instructions will be retrieved. In other words, we will return the same funding instructions each time. + """ + ... + + @overload + async def create_funding_instructions_async( + self, **params: Unpack["Customer.CreateFundingInstructionsParams"] + ) -> "FundingInstructions": + """ + Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new + funding instructions will be created. If funding instructions have already been created for a given customer, the same + funding instructions will be retrieved. In other words, we will return the same funding instructions each time. + """ + ... + + @class_method_variant("_cls_create_funding_instructions_async") + async def create_funding_instructions_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Customer.CreateFundingInstructionsParams"] + ) -> "FundingInstructions": + """ + Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new + funding instructions will be created. If funding instructions have already been created for a given customer, the same + funding instructions will be retrieved. In other words, we will return the same funding instructions each time. + """ + return cast( + "FundingInstructions", + await self._request_async( + "post", + "/v1/customers/{customer}/funding_instructions".format( + customer=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Customer.DeleteParams"] @@ -1546,6 +1629,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["Customer.DeleteParams"] + ) -> "Customer": + """ + Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "Customer", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["Customer.DeleteParams"] + ) -> "Customer": + """ + Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["Customer.DeleteParams"] + ) -> "Customer": + """ + Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Customer.DeleteParams"] + ) -> "Customer": + """ + Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def _cls_delete_discount( cls, customer: str, **params: Unpack["Customer.DeleteDiscountParams"] @@ -1601,6 +1733,61 @@ def delete_discount( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_delete_discount_async( + cls, customer: str, **params: Unpack["Customer.DeleteDiscountParams"] + ) -> "Discount": + """ + Removes the currently applied discount on a customer. + """ + return cast( + "Discount", + await cls._static_request_async( + "delete", + "/v1/customers/{customer}/discount".format( + customer=sanitize_id(customer) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def delete_discount_async( + customer: str, **params: Unpack["Customer.DeleteDiscountParams"] + ) -> "Discount": + """ + Removes the currently applied discount on a customer. + """ + ... + + @overload + async def delete_discount_async( + self, **params: Unpack["Customer.DeleteDiscountParams"] + ) -> "Discount": + """ + Removes the currently applied discount on a customer. + """ + ... + + @class_method_variant("_cls_delete_discount_async") + async def delete_discount_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Customer.DeleteDiscountParams"] + ) -> "Discount": + """ + Removes the currently applied discount on a customer. + """ + return cast( + "Discount", + await self._request_async( + "delete", + "/v1/customers/{customer}/discount".format( + customer=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Customer.ListParams"] @@ -1622,6 +1809,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Customer.ListParams"] + ) -> ListObject["Customer"]: + """ + Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. + """ + 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 _cls_list_payment_methods( cls, @@ -1679,6 +1887,63 @@ def list_payment_methods( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_list_payment_methods_async( + cls, + customer: str, + **params: Unpack["Customer.ListPaymentMethodsParams"] + ) -> ListObject["PaymentMethod"]: + """ + Returns a list of PaymentMethods for a given Customer + """ + return cast( + ListObject["PaymentMethod"], + await cls._static_request_async( + "get", + "/v1/customers/{customer}/payment_methods".format( + customer=sanitize_id(customer) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def list_payment_methods_async( + customer: str, **params: Unpack["Customer.ListPaymentMethodsParams"] + ) -> ListObject["PaymentMethod"]: + """ + Returns a list of PaymentMethods for a given Customer + """ + ... + + @overload + async def list_payment_methods_async( + self, **params: Unpack["Customer.ListPaymentMethodsParams"] + ) -> ListObject["PaymentMethod"]: + """ + Returns a list of PaymentMethods for a given Customer + """ + ... + + @class_method_variant("_cls_list_payment_methods_async") + async def list_payment_methods_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Customer.ListPaymentMethodsParams"] + ) -> ListObject["PaymentMethod"]: + """ + Returns a list of PaymentMethods for a given Customer + """ + return cast( + ListObject["PaymentMethod"], + await self._request_async( + "get", + "/v1/customers/{customer}/payment_methods".format( + customer=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def modify( cls, id: str, **params: Unpack["Customer.ModifyParams"] @@ -1698,6 +1963,25 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Customer.ModifyParams"] + ) -> "Customer": + """ + Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior. + + This request accepts mostly the same arguments as the customer creation call. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Customer", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Customer.RetrieveParams"] @@ -1709,6 +1993,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Customer.RetrieveParams"] + ) -> "Customer": + """ + Retrieves a Customer object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def _cls_retrieve_payment_method( cls, @@ -1775,6 +2070,72 @@ def retrieve_payment_method( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_retrieve_payment_method_async( + cls, + customer: str, + payment_method: str, + **params: Unpack["Customer.RetrievePaymentMethodParams"] + ) -> "PaymentMethod": + """ + Retrieves a PaymentMethod object for a given Customer. + """ + return cast( + "PaymentMethod", + await cls._static_request_async( + "get", + "/v1/customers/{customer}/payment_methods/{payment_method}".format( + customer=sanitize_id(customer), + payment_method=sanitize_id(payment_method), + ), + params=params, + ), + ) + + @overload + @staticmethod + async def retrieve_payment_method_async( + customer: str, + payment_method: str, + **params: Unpack["Customer.RetrievePaymentMethodParams"] + ) -> "PaymentMethod": + """ + Retrieves a PaymentMethod object for a given Customer. + """ + ... + + @overload + async def retrieve_payment_method_async( + self, + payment_method: str, + **params: Unpack["Customer.RetrievePaymentMethodParams"] + ) -> "PaymentMethod": + """ + Retrieves a PaymentMethod object for a given Customer. + """ + ... + + @class_method_variant("_cls_retrieve_payment_method_async") + async def retrieve_payment_method_async( # pyright: ignore[reportGeneralTypeIssues] + self, + payment_method: str, + **params: Unpack["Customer.RetrievePaymentMethodParams"] + ) -> "PaymentMethod": + """ + Retrieves a PaymentMethod object for a given Customer. + """ + return cast( + "PaymentMethod", + await self._request_async( + "get", + "/v1/customers/{customer}/payment_methods/{payment_method}".format( + customer=sanitize_id(self.get("id")), + payment_method=sanitize_id(payment_method), + ), + params=params, + ), + ) + @classmethod def search( cls, *args, **kwargs: Unpack["Customer.SearchParams"] @@ -1787,12 +2148,32 @@ def search( """ return cls._search(search_url="/v1/customers/search", *args, **kwargs) + @classmethod + async def search_async( + cls, *args, **kwargs: Unpack["Customer.SearchParams"] + ) -> SearchResultObject["Customer"]: + """ + Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return await cls._search_async( + search_url="/v1/customers/search", *args, **kwargs + ) + @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["Customer.SearchParams"] ) -> Iterator["Customer"]: return cls.search(*args, **kwargs).auto_paging_iter() + @classmethod + async def search_auto_paging_iter_async( + cls, *args, **kwargs: Unpack["Customer.SearchParams"] + ) -> AsyncIterator["Customer"]: + return (await cls.search_async(*args, **kwargs)).auto_paging_iter() + @classmethod def create_balance_transaction( cls, @@ -1813,6 +2194,26 @@ def create_balance_transaction( ), ) + @classmethod + async def create_balance_transaction_async( + cls, + customer: str, + **params: Unpack["Customer.CreateBalanceTransactionParams"] + ) -> "CustomerBalanceTransaction": + """ + Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). + """ + return cast( + "CustomerBalanceTransaction", + await cls._static_request_async( + "post", + "/v1/customers/{customer}/balance_transactions".format( + customer=sanitize_id(customer) + ), + params=params, + ), + ) + @classmethod def retrieve_balance_transaction( cls, @@ -1835,6 +2236,28 @@ def retrieve_balance_transaction( ), ) + @classmethod + async def retrieve_balance_transaction_async( + cls, + customer: str, + transaction: str, + **params: Unpack["Customer.RetrieveBalanceTransactionParams"] + ) -> "CustomerBalanceTransaction": + """ + Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). + """ + return cast( + "CustomerBalanceTransaction", + await cls._static_request_async( + "get", + "/v1/customers/{customer}/balance_transactions/{transaction}".format( + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), + ), + params=params, + ), + ) + @classmethod def modify_balance_transaction( cls, @@ -1857,6 +2280,28 @@ def modify_balance_transaction( ), ) + @classmethod + async def modify_balance_transaction_async( + cls, + customer: str, + transaction: str, + **params: Unpack["Customer.ModifyBalanceTransactionParams"] + ) -> "CustomerBalanceTransaction": + """ + Most credit balance transaction fields are immutable, but you may update its description and metadata. + """ + return cast( + "CustomerBalanceTransaction", + await cls._static_request_async( + "post", + "/v1/customers/{customer}/balance_transactions/{transaction}".format( + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), + ), + params=params, + ), + ) + @classmethod def list_balance_transactions( cls, @@ -1877,6 +2322,26 @@ def list_balance_transactions( ), ) + @classmethod + async def list_balance_transactions_async( + cls, + customer: str, + **params: Unpack["Customer.ListBalanceTransactionsParams"] + ) -> ListObject["CustomerBalanceTransaction"]: + """ + Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). + """ + return cast( + ListObject["CustomerBalanceTransaction"], + await cls._static_request_async( + "get", + "/v1/customers/{customer}/balance_transactions".format( + customer=sanitize_id(customer) + ), + params=params, + ), + ) + @classmethod def retrieve_cash_balance_transaction( cls, @@ -1891,16 +2356,58 @@ def retrieve_cash_balance_transaction( "CustomerCashBalanceTransaction", cls._static_request( "get", - "/v1/customers/{customer}/cash_balance_transactions/{transaction}".format( - customer=sanitize_id(customer), - transaction=sanitize_id(transaction), + "/v1/customers/{customer}/cash_balance_transactions/{transaction}".format( + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), + ), + params=params, + ), + ) + + @classmethod + async def retrieve_cash_balance_transaction_async( + cls, + customer: str, + transaction: str, + **params: Unpack["Customer.RetrieveCashBalanceTransactionParams"] + ) -> "CustomerCashBalanceTransaction": + """ + Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). + """ + return cast( + "CustomerCashBalanceTransaction", + await cls._static_request_async( + "get", + "/v1/customers/{customer}/cash_balance_transactions/{transaction}".format( + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), + ), + params=params, + ), + ) + + @classmethod + def list_cash_balance_transactions( + cls, + customer: str, + **params: Unpack["Customer.ListCashBalanceTransactionsParams"] + ) -> ListObject["CustomerCashBalanceTransaction"]: + """ + Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). + """ + return cast( + ListObject["CustomerCashBalanceTransaction"], + cls._static_request( + "get", + "/v1/customers/{customer}/cash_balance_transactions".format( + customer=sanitize_id(customer) ), params=params, ), ) @classmethod - def list_cash_balance_transactions( + async def list_cash_balance_transactions_async( cls, customer: str, **params: Unpack["Customer.ListCashBalanceTransactionsParams"] @@ -1910,7 +2417,7 @@ def list_cash_balance_transactions( """ return cast( ListObject["CustomerCashBalanceTransaction"], - cls._static_request( + await cls._static_request_async( "get", "/v1/customers/{customer}/cash_balance_transactions".format( customer=sanitize_id(customer) @@ -1941,6 +2448,28 @@ def create_source( ), ) + @classmethod + async def create_source_async( + cls, customer: str, **params: Unpack["Customer.CreateSourceParams"] + ) -> Union["Account", "BankAccount", "Card", "Source"]: + """ + When you create a new credit card, you must specify a customer or recipient on which to create it. + + 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://stripe.com/docs/api#update_customer) to have a new default_source. + """ + return cast( + Union["Account", "BankAccount", "Card", "Source"], + await cls._static_request_async( + "post", + "/v1/customers/{customer}/sources".format( + customer=sanitize_id(customer) + ), + params=params, + ), + ) + @classmethod def retrieve_source( cls, @@ -1962,6 +2491,27 @@ def retrieve_source( ), ) + @classmethod + async def retrieve_source_async( + cls, + customer: str, + id: str, + **params: Unpack["Customer.RetrieveSourceParams"] + ) -> Union["Account", "BankAccount", "Card", "Source"]: + """ + Retrieve a specified source for a given customer. + """ + return cast( + Union["Account", "BankAccount", "Card", "Source"], + await cls._static_request_async( + "get", + "/v1/customers/{customer}/sources/{id}".format( + customer=sanitize_id(customer), id=sanitize_id(id) + ), + params=params, + ), + ) + @classmethod def modify_source( cls, @@ -1983,6 +2533,27 @@ def modify_source( ), ) + @classmethod + async def modify_source_async( + cls, + customer: str, + id: str, + **params: Unpack["Customer.ModifySourceParams"] + ) -> Union["Account", "BankAccount", "Card", "Source"]: + """ + Update a specified source for a given customer. + """ + return cast( + Union["Account", "BankAccount", "Card", "Source"], + await cls._static_request_async( + "post", + "/v1/customers/{customer}/sources/{id}".format( + customer=sanitize_id(customer), id=sanitize_id(id) + ), + params=params, + ), + ) + @classmethod def delete_source( cls, @@ -2004,6 +2575,27 @@ def delete_source( ), ) + @classmethod + async def delete_source_async( + cls, + customer: str, + id: str, + **params: Unpack["Customer.DeleteSourceParams"] + ) -> Union["Account", "BankAccount", "Card", "Source"]: + """ + Delete a specified source for a given customer. + """ + return cast( + Union["Account", "BankAccount", "Card", "Source"], + await cls._static_request_async( + "delete", + "/v1/customers/{customer}/sources/{id}".format( + customer=sanitize_id(customer), id=sanitize_id(id) + ), + params=params, + ), + ) + @classmethod def list_sources( cls, customer: str, **params: Unpack["Customer.ListSourcesParams"] @@ -2022,6 +2614,24 @@ def list_sources( ), ) + @classmethod + async def list_sources_async( + cls, customer: str, **params: Unpack["Customer.ListSourcesParams"] + ) -> ListObject[Union["Account", "BankAccount", "Card", "Source"]]: + """ + List sources for a specified customer. + """ + return cast( + ListObject[Union["Account", "BankAccount", "Card", "Source"]], + await cls._static_request_async( + "get", + "/v1/customers/{customer}/sources".format( + customer=sanitize_id(customer) + ), + params=params, + ), + ) + @classmethod def create_tax_id( cls, customer: str, **params: Unpack["Customer.CreateTaxIdParams"] @@ -2040,6 +2650,24 @@ def create_tax_id( ), ) + @classmethod + async def create_tax_id_async( + cls, customer: str, **params: Unpack["Customer.CreateTaxIdParams"] + ) -> "TaxId": + """ + Creates a new tax_id object for a customer. + """ + return cast( + "TaxId", + await cls._static_request_async( + "post", + "/v1/customers/{customer}/tax_ids".format( + customer=sanitize_id(customer) + ), + params=params, + ), + ) + @classmethod def retrieve_tax_id( cls, @@ -2061,6 +2689,27 @@ def retrieve_tax_id( ), ) + @classmethod + async def retrieve_tax_id_async( + cls, + customer: str, + id: str, + **params: Unpack["Customer.RetrieveTaxIdParams"] + ) -> "TaxId": + """ + Retrieves the tax_id object with the given identifier. + """ + return cast( + "TaxId", + await cls._static_request_async( + "get", + "/v1/customers/{customer}/tax_ids/{id}".format( + customer=sanitize_id(customer), id=sanitize_id(id) + ), + params=params, + ), + ) + @classmethod def delete_tax_id( cls, @@ -2082,6 +2731,27 @@ def delete_tax_id( ), ) + @classmethod + async def delete_tax_id_async( + cls, + customer: str, + id: str, + **params: Unpack["Customer.DeleteTaxIdParams"] + ) -> "TaxId": + """ + Deletes an existing tax_id object. + """ + return cast( + "TaxId", + await cls._static_request_async( + "delete", + "/v1/customers/{customer}/tax_ids/{id}".format( + customer=sanitize_id(customer), id=sanitize_id(id) + ), + params=params, + ), + ) + @classmethod def list_tax_ids( cls, customer: str, **params: Unpack["Customer.ListTaxIdsParams"] @@ -2100,6 +2770,24 @@ def list_tax_ids( ), ) + @classmethod + async def list_tax_ids_async( + cls, customer: str, **params: Unpack["Customer.ListTaxIdsParams"] + ) -> ListObject["TaxId"]: + """ + Returns a list of tax IDs for a customer. + """ + return cast( + ListObject["TaxId"], + await cls._static_request_async( + "get", + "/v1/customers/{customer}/tax_ids".format( + customer=sanitize_id(customer) + ), + params=params, + ), + ) + @classmethod def retrieve_cash_balance( cls, @@ -2120,6 +2808,26 @@ def retrieve_cash_balance( ), ) + @classmethod + async def retrieve_cash_balance_async( + cls, + customer: str, + **params: Unpack["Customer.RetrieveCashBalanceParams"] + ) -> "CashBalance": + """ + Retrieves a customer's cash balance. + """ + return cast( + "CashBalance", + await cls._static_request_async( + "get", + "/v1/customers/{customer}/cash_balance".format( + customer=sanitize_id(customer) + ), + params=params, + ), + ) + @classmethod def modify_cash_balance( cls, @@ -2140,6 +2848,26 @@ def modify_cash_balance( ), ) + @classmethod + async def modify_cash_balance_async( + cls, + customer: str, + **params: Unpack["Customer.ModifyCashBalanceParams"] + ) -> "CashBalance": + """ + Changes the settings on a customer's cash balance. + """ + return cast( + "CashBalance", + await cls._static_request_async( + "post", + "/v1/customers/{customer}/cash_balance".format( + customer=sanitize_id(customer) + ), + params=params, + ), + ) + class TestHelpers(APIResourceTestHelpers["Customer"]): _resource_cls: Type["Customer"] @@ -2200,6 +2928,63 @@ def fund_cash_balance( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_fund_cash_balance_async( + cls, + customer: str, + **params: Unpack["Customer.FundCashBalanceParams"] + ) -> "CustomerCashBalanceTransaction": + """ + Create an incoming testmode bank transfer + """ + return cast( + "CustomerCashBalanceTransaction", + await cls._static_request_async( + "post", + "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( + customer=sanitize_id(customer) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def fund_cash_balance_async( + customer: str, **params: Unpack["Customer.FundCashBalanceParams"] + ) -> "CustomerCashBalanceTransaction": + """ + Create an incoming testmode bank transfer + """ + ... + + @overload + async def fund_cash_balance_async( + self, **params: Unpack["Customer.FundCashBalanceParams"] + ) -> "CustomerCashBalanceTransaction": + """ + Create an incoming testmode bank transfer + """ + ... + + @class_method_variant("_cls_fund_cash_balance_async") + async def fund_cash_balance_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Customer.FundCashBalanceParams"] + ) -> "CustomerCashBalanceTransaction": + """ + Create an incoming testmode bank transfer + """ + return cast( + "CustomerCashBalanceTransaction", + await self.resource._request_async( + "post", + "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( + customer=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/_customer_balance_transaction_service.py b/stripe/_customer_balance_transaction_service.py index 8f03d1edf..20291adac 100644 --- a/stripe/_customer_balance_transaction_service.py +++ b/stripe/_customer_balance_transaction_service.py @@ -93,6 +93,29 @@ def list( ), ) + async def list_async( + self, + customer: str, + params: "CustomerBalanceTransactionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[CustomerBalanceTransaction]: + """ + Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). + """ + return cast( + ListObject[CustomerBalanceTransaction], + await self._request_async( + "get", + "/v1/customers/{customer}/balance_transactions".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, customer: str, @@ -116,6 +139,29 @@ def create( ), ) + async def create_async( + self, + customer: str, + params: "CustomerBalanceTransactionService.CreateParams", + options: RequestOptions = {}, + ) -> CustomerBalanceTransaction: + """ + Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). + """ + return cast( + CustomerBalanceTransaction, + await self._request_async( + "post", + "/v1/customers/{customer}/balance_transactions".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, customer: str, @@ -141,6 +187,31 @@ def retrieve( ), ) + async def retrieve_async( + self, + customer: str, + transaction: str, + params: "CustomerBalanceTransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> CustomerBalanceTransaction: + """ + Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). + """ + return cast( + CustomerBalanceTransaction, + await self._request_async( + "get", + "/v1/customers/{customer}/balance_transactions/{transaction}".format( + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, customer: str, @@ -165,3 +236,28 @@ def update( options=options, ), ) + + async def update_async( + self, + customer: str, + transaction: str, + params: "CustomerBalanceTransactionService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> CustomerBalanceTransaction: + """ + Most credit balance transaction fields are immutable, but you may update its description and metadata. + """ + return cast( + CustomerBalanceTransaction, + await self._request_async( + "post", + "/v1/customers/{customer}/balance_transactions/{transaction}".format( + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_customer_cash_balance_service.py b/stripe/_customer_cash_balance_service.py index 7c6640e8b..5d50a3302 100644 --- a/stripe/_customer_cash_balance_service.py +++ b/stripe/_customer_cash_balance_service.py @@ -58,6 +58,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + customer: str, + params: "CustomerCashBalanceService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> CashBalance: + """ + Retrieves a customer's cash balance. + """ + return cast( + CashBalance, + await self._request_async( + "get", + "/v1/customers/{customer}/cash_balance".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, customer: str, @@ -80,3 +103,26 @@ def update( options=options, ), ) + + async def update_async( + self, + customer: str, + params: "CustomerCashBalanceService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> CashBalance: + """ + Changes the settings on a customer's cash balance. + """ + return cast( + CashBalance, + await self._request_async( + "post", + "/v1/customers/{customer}/cash_balance".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_customer_cash_balance_transaction_service.py b/stripe/_customer_cash_balance_transaction_service.py index eef64ebd4..5e8a8bbb1 100644 --- a/stripe/_customer_cash_balance_transaction_service.py +++ b/stripe/_customer_cash_balance_transaction_service.py @@ -59,6 +59,29 @@ def list( ), ) + async def list_async( + self, + customer: str, + params: "CustomerCashBalanceTransactionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[CustomerCashBalanceTransaction]: + """ + Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). + """ + return cast( + ListObject[CustomerCashBalanceTransaction], + await self._request_async( + "get", + "/v1/customers/{customer}/cash_balance_transactions".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, customer: str, @@ -83,3 +106,28 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + customer: str, + transaction: str, + params: "CustomerCashBalanceTransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> CustomerCashBalanceTransaction: + """ + Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). + """ + return cast( + CustomerCashBalanceTransaction, + await self._request_async( + "get", + "/v1/customers/{customer}/cash_balance_transactions/{transaction}".format( + customer=sanitize_id(customer), + transaction=sanitize_id(transaction), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_customer_funding_instructions_service.py b/stripe/_customer_funding_instructions_service.py index 3085eb0aa..b397991a2 100644 --- a/stripe/_customer_funding_instructions_service.py +++ b/stripe/_customer_funding_instructions_service.py @@ -83,3 +83,28 @@ def create( options=options, ), ) + + async def create_async( + self, + customer: str, + params: "CustomerFundingInstructionsService.CreateParams", + options: RequestOptions = {}, + ) -> FundingInstructions: + """ + Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new + funding instructions will be created. If funding instructions have already been created for a given customer, the same + funding instructions will be retrieved. In other words, we will return the same funding instructions each time. + """ + return cast( + FundingInstructions, + await self._request_async( + "post", + "/v1/customers/{customer}/funding_instructions".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index fd13c63dc..0d8741e8c 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -98,6 +98,29 @@ def list( ), ) + async def list_async( + self, + customer: str, + params: "CustomerPaymentMethodService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PaymentMethod]: + """ + Returns a list of PaymentMethods for a given Customer + """ + return cast( + ListObject[PaymentMethod], + await self._request_async( + "get", + "/v1/customers/{customer}/payment_methods".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, customer: str, @@ -122,3 +145,28 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + customer: str, + payment_method: str, + params: "CustomerPaymentMethodService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PaymentMethod: + """ + Retrieves a PaymentMethod object for a given Customer. + """ + return cast( + PaymentMethod, + await self._request_async( + "get", + "/v1/customers/{customer}/payment_methods/{payment_method}".format( + customer=sanitize_id(customer), + payment_method=sanitize_id(payment_method), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_customer_payment_source_service.py b/stripe/_customer_payment_source_service.py index 6be1c22a4..0c70b7de2 100644 --- a/stripe/_customer_payment_source_service.py +++ b/stripe/_customer_payment_source_service.py @@ -196,6 +196,29 @@ def list( ), ) + async def list_async( + self, + customer: str, + params: "CustomerPaymentSourceService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Union[Account, BankAccount, Card, Source]]: + """ + List sources for a specified customer. + """ + return cast( + ListObject[Union[Account, BankAccount, Card, Source]], + await self._request_async( + "get", + "/v1/customers/{customer}/sources".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, customer: str, @@ -223,6 +246,33 @@ def create( ), ) + async def create_async( + self, + customer: str, + params: "CustomerPaymentSourceService.CreateParams", + options: RequestOptions = {}, + ) -> Union[Account, BankAccount, Card, Source]: + """ + When you create a new credit card, you must specify a customer or recipient on which to create it. + + 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://stripe.com/docs/api#update_customer) to have a new default_source. + """ + return cast( + Union[Account, BankAccount, Card, Source], + await self._request_async( + "post", + "/v1/customers/{customer}/sources".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, customer: str, @@ -248,6 +298,31 @@ def retrieve( ), ) + async def retrieve_async( + self, + customer: str, + id: str, + params: "CustomerPaymentSourceService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Union[Account, BankAccount, Card, Source]: + """ + Retrieve a specified source for a given customer. + """ + return cast( + Union[Account, BankAccount, Card, Source], + await self._request_async( + "get", + "/v1/customers/{customer}/sources/{id}".format( + customer=sanitize_id(customer), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, customer: str, @@ -273,6 +348,31 @@ def update( ), ) + async def update_async( + self, + customer: str, + id: str, + params: "CustomerPaymentSourceService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Union[Account, BankAccount, Card, Source]: + """ + Update a specified source for a given customer. + """ + return cast( + Union[Account, BankAccount, Card, Source], + await self._request_async( + "post", + "/v1/customers/{customer}/sources/{id}".format( + customer=sanitize_id(customer), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def delete( self, customer: str, @@ -298,6 +398,31 @@ def delete( ), ) + async def delete_async( + self, + customer: str, + id: str, + params: "CustomerPaymentSourceService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Union[Account, BankAccount, Card, Source]: + """ + Delete a specified source for a given customer. + """ + return cast( + Union[Account, BankAccount, Card, Source], + await self._request_async( + "delete", + "/v1/customers/{customer}/sources/{id}".format( + customer=sanitize_id(customer), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def verify( self, customer: str, @@ -322,3 +447,28 @@ def verify( options=options, ), ) + + async def verify_async( + self, + customer: str, + id: str, + params: "CustomerPaymentSourceService.VerifyParams" = {}, + options: RequestOptions = {}, + ) -> BankAccount: + """ + Verify a specified bank account for a given customer. + """ + return cast( + BankAccount, + await self._request_async( + "post", + "/v1/customers/{customer}/sources/{id}/verify".format( + customer=sanitize_id(customer), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index ec9fbb6c9..5bc91e415 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -667,6 +667,29 @@ def delete( ), ) + async def delete_async( + self, + customer: str, + params: "CustomerService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Customer: + """ + Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. + """ + return cast( + Customer, + await self._request_async( + "delete", + "/v1/customers/{customer}".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, customer: str, @@ -690,6 +713,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + customer: str, + params: "CustomerService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Customer: + """ + Retrieves a Customer object. + """ + return cast( + Customer, + await self._request_async( + "get", + "/v1/customers/{customer}".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, customer: str, @@ -715,6 +761,31 @@ def update( ), ) + async def update_async( + self, + customer: str, + params: "CustomerService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Customer: + """ + Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior. + + This request accepts mostly the same arguments as the customer creation call. + """ + return cast( + Customer, + await self._request_async( + "post", + "/v1/customers/{customer}".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def delete_discount( self, customer: str, @@ -738,6 +809,29 @@ def delete_discount( ), ) + async def delete_discount_async( + self, + customer: str, + params: "CustomerService.DeleteDiscountParams" = {}, + options: RequestOptions = {}, + ) -> Discount: + """ + Removes the currently applied discount on a customer. + """ + return cast( + Discount, + await self._request_async( + "delete", + "/v1/customers/{customer}/discount".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "CustomerService.ListParams" = {}, @@ -758,6 +852,26 @@ def list( ), ) + async def list_async( + self, + params: "CustomerService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Customer]: + """ + Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. + """ + return cast( + ListObject[Customer], + await self._request_async( + "get", + "/v1/customers", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "CustomerService.CreateParams" = {}, @@ -778,6 +892,26 @@ def create( ), ) + async def create_async( + self, + params: "CustomerService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Customer: + """ + Creates a new customer object. + """ + return cast( + Customer, + await self._request_async( + "post", + "/v1/customers", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def search( self, params: "CustomerService.SearchParams", @@ -800,3 +934,26 @@ def search( options=options, ), ) + + async def search_async( + self, + params: "CustomerService.SearchParams", + options: RequestOptions = {}, + ) -> SearchResultObject[Customer]: + """ + Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return cast( + SearchResultObject[Customer], + await self._request_async( + "get", + "/v1/customers/search", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index b91f74a20..296199474 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -138,4 +138,20 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["CustomerSession.CreateParams"] + ) -> "CustomerSession": + """ + Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. + """ + return cast( + "CustomerSession", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + _inner_class_types = {"components": Components} diff --git a/stripe/_customer_session_service.py b/stripe/_customer_session_service.py index 0658ceba0..737e6f775 100644 --- a/stripe/_customer_session_service.py +++ b/stripe/_customer_session_service.py @@ -67,3 +67,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "CustomerSessionService.CreateParams", + options: RequestOptions = {}, + ) -> CustomerSession: + """ + Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. + """ + return cast( + CustomerSession, + await self._request_async( + "post", + "/v1/customer_sessions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index 6f9e9114c..2b89ca5e1 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -144,6 +144,31 @@ def delete( ), ) + async def delete_async( + self, + customer: str, + id: str, + params: "CustomerTaxIdService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> TaxId: + """ + Deletes an existing tax_id object. + """ + return cast( + TaxId, + await self._request_async( + "delete", + "/v1/customers/{customer}/tax_ids/{id}".format( + customer=sanitize_id(customer), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, customer: str, @@ -169,6 +194,31 @@ def retrieve( ), ) + async def retrieve_async( + self, + customer: str, + id: str, + params: "CustomerTaxIdService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> TaxId: + """ + Retrieves the tax_id object with the given identifier. + """ + return cast( + TaxId, + await self._request_async( + "get", + "/v1/customers/{customer}/tax_ids/{id}".format( + customer=sanitize_id(customer), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, customer: str, @@ -192,6 +242,29 @@ def list( ), ) + async def list_async( + self, + customer: str, + params: "CustomerTaxIdService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[TaxId]: + """ + Returns a list of tax IDs for a customer. + """ + return cast( + ListObject[TaxId], + await self._request_async( + "get", + "/v1/customers/{customer}/tax_ids".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, customer: str, @@ -214,3 +287,26 @@ def create( options=options, ), ) + + async def create_async( + self, + customer: str, + params: "CustomerTaxIdService.CreateParams", + options: RequestOptions = {}, + ) -> TaxId: + """ + Creates a new tax_id object for a customer. + """ + return cast( + TaxId, + await self._request_async( + "post", + "/v1/customers/{customer}/tax_ids".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_dispute.py b/stripe/_dispute.py index 9e8aac29d..bf0b246b5 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -499,6 +499,69 @@ def close( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_close_async( + cls, dispute: str, **params: Unpack["Dispute.CloseParams"] + ) -> "Dispute": + """ + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + + The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. + """ + return cast( + "Dispute", + await cls._static_request_async( + "post", + "/v1/disputes/{dispute}/close".format( + dispute=sanitize_id(dispute) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def close_async( + dispute: str, **params: Unpack["Dispute.CloseParams"] + ) -> "Dispute": + """ + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + + The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. + """ + ... + + @overload + async def close_async( + self, **params: Unpack["Dispute.CloseParams"] + ) -> "Dispute": + """ + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + + The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. + """ + ... + + @class_method_variant("_cls_close_async") + async def close_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Dispute.CloseParams"] + ) -> "Dispute": + """ + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + + The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. + """ + return cast( + "Dispute", + await self._request_async( + "post", + "/v1/disputes/{dispute}/close".format( + dispute=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Dispute.ListParams"] @@ -520,6 +583,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Dispute.ListParams"] + ) -> ListObject["Dispute"]: + """ + Returns a list of your disputes. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Dispute.ModifyParams"] @@ -539,6 +623,25 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Dispute.ModifyParams"] + ) -> "Dispute": + """ + When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. + + Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Dispute", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Dispute.RetrieveParams"] @@ -550,6 +653,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Dispute.RetrieveParams"] + ) -> "Dispute": + """ + Retrieves the dispute with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "evidence": Evidence, "evidence_details": EvidenceDetails, diff --git a/stripe/_dispute_service.py b/stripe/_dispute_service.py index b586cfa6f..fb5c273b4 100644 --- a/stripe/_dispute_service.py +++ b/stripe/_dispute_service.py @@ -215,6 +215,26 @@ def list( ), ) + async def list_async( + self, + params: "DisputeService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Dispute]: + """ + Returns a list of your disputes. + """ + return cast( + ListObject[Dispute], + await self._request_async( + "get", + "/v1/disputes", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, dispute: str, @@ -236,6 +256,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + dispute: str, + params: "DisputeService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Dispute: + """ + Retrieves the dispute with the given ID. + """ + return cast( + Dispute, + await self._request_async( + "get", + "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, dispute: str, @@ -259,6 +300,29 @@ def update( ), ) + async def update_async( + self, + dispute: str, + params: "DisputeService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Dispute: + """ + When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. + + Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). + """ + return cast( + Dispute, + await self._request_async( + "post", + "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def close( self, dispute: str, @@ -283,3 +347,28 @@ def close( options=options, ), ) + + async def close_async( + self, + dispute: str, + params: "DisputeService.CloseParams" = {}, + options: RequestOptions = {}, + ) -> Dispute: + """ + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + + The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. + """ + return cast( + Dispute, + await self._request_async( + "post", + "/v1/disputes/{dispute}/close".format( + dispute=sanitize_id(dispute), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_ephemeral_key.py b/stripe/_ephemeral_key.py index 26a6acf0a..9fd5fd5ca 100644 --- a/stripe/_ephemeral_key.py +++ b/stripe/_ephemeral_key.py @@ -94,6 +94,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["EphemeralKey.DeleteParams"] + ) -> "EphemeralKey": + """ + Invalidates a short-lived API key for a given resource. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "EphemeralKey", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["EphemeralKey.DeleteParams"] + ) -> "EphemeralKey": + """ + Invalidates a short-lived API key for a given resource. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["EphemeralKey.DeleteParams"] + ) -> "EphemeralKey": + """ + Invalidates a short-lived API key for a given resource. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["EphemeralKey.DeleteParams"] + ) -> "EphemeralKey": + """ + Invalidates a short-lived API key for a given resource. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def create(cls, **params): if params.get("stripe_version") is None: diff --git a/stripe/_ephemeral_key_service.py b/stripe/_ephemeral_key_service.py index db984fa10..1e3c139a6 100644 --- a/stripe/_ephemeral_key_service.py +++ b/stripe/_ephemeral_key_service.py @@ -58,6 +58,27 @@ def delete( ), ) + async def delete_async( + self, + key: str, + params: "EphemeralKeyService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> EphemeralKey: + """ + Invalidates a short-lived API key for a given resource. + """ + return cast( + EphemeralKey, + await self._request_async( + "delete", + "/v1/ephemeral_keys/{key}".format(key=sanitize_id(key)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "EphemeralKeyService.CreateParams" = {}, @@ -77,3 +98,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "EphemeralKeyService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> EphemeralKey: + """ + Creates a short-lived API key for a given resource. + """ + return cast( + EphemeralKey, + await self._request_async( + "post", + "/v1/ephemeral_keys", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_event.py b/stripe/_event.py index fc2c2d936..2cb4f1ca2 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -414,6 +414,27 @@ def list(cls, **params: Unpack["Event.ListParams"]) -> ListObject["Event"]: return result + @classmethod + async def list_async( + cls, **params: Unpack["Event.ListParams"] + ) -> ListObject["Event"]: + """ + List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). + """ + 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["Event.RetrieveParams"] @@ -425,4 +446,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Event.RetrieveParams"] + ) -> "Event": + """ + Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"data": Data, "request": Request} diff --git a/stripe/_event_service.py b/stripe/_event_service.py index 52ca9768e..bb816594f 100644 --- a/stripe/_event_service.py +++ b/stripe/_event_service.py @@ -88,6 +88,26 @@ def list( ), ) + async def list_async( + self, + params: "EventService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Event]: + """ + List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). + """ + return cast( + ListObject[Event], + await self._request_async( + "get", + "/v1/events", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -108,3 +128,24 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + id: str, + params: "EventService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Event: + """ + Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. + """ + return cast( + Event, + await self._request_async( + "get", + "/v1/events/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_exchange_rate.py b/stripe/_exchange_rate.py index e352dff1e..443400403 100644 --- a/stripe/_exchange_rate.py +++ b/stripe/_exchange_rate.py @@ -97,6 +97,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["ExchangeRate.ListParams"] + ) -> ListObject["ExchangeRate"]: + """ + Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports. + """ + 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["ExchangeRate.RetrieveParams"] @@ -107,3 +128,14 @@ def retrieve( instance = cls(id, **params) instance.refresh() return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ExchangeRate.RetrieveParams"] + ) -> "ExchangeRate": + """ + Retrieves the exchange rates from the given currency to every supported currency. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/_exchange_rate_service.py b/stripe/_exchange_rate_service.py index 4285867e9..a187e2b36 100644 --- a/stripe/_exchange_rate_service.py +++ b/stripe/_exchange_rate_service.py @@ -54,6 +54,26 @@ def list( ), ) + async def list_async( + self, + params: "ExchangeRateService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ExchangeRate]: + """ + Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports. + """ + return cast( + ListObject[ExchangeRate], + await self._request_async( + "get", + "/v1/exchange_rates", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, rate_id: str, @@ -76,3 +96,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + rate_id: str, + params: "ExchangeRateService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ExchangeRate: + """ + Retrieves the exchange rates from the given currency to every supported currency. + """ + return cast( + ExchangeRate, + await self._request_async( + "get", + "/v1/exchange_rates/{rate_id}".format( + rate_id=sanitize_id(rate_id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_file.py b/stripe/_file.py index e8cef02bb..c83b91752 100644 --- a/stripe/_file.py +++ b/stripe/_file.py @@ -220,6 +220,26 @@ def create(cls, **params: Unpack["File.CreateParams"]) -> "File": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["File.CreateParams"] + ) -> "File": + """ + To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. + + All of Stripe's officially supported Client libraries support sending multipart/form-data. + """ + return cast( + "File", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + base_address="files", + api_mode="V1FILES", + ), + ) + @classmethod def list(cls, **params: Unpack["File.ListParams"]) -> ListObject["File"]: """ @@ -239,6 +259,27 @@ def list(cls, **params: Unpack["File.ListParams"]) -> ListObject["File"]: return result + @classmethod + async def list_async( + cls, **params: Unpack["File.ListParams"] + ) -> ListObject["File"]: + """ + Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. + """ + 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["File.RetrieveParams"] @@ -250,6 +291,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["File.RetrieveParams"] + ) -> "File": + """ + Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + # This resource can have two different object names. In latter API # versions, only `file` is used, but since stripe-python may be used with # any API version, we need to support deserializing the older diff --git a/stripe/_file_link.py b/stripe/_file_link.py index a7230ffbf..e03684b86 100644 --- a/stripe/_file_link.py +++ b/stripe/_file_link.py @@ -170,6 +170,22 @@ def create(cls, **params: Unpack["FileLink.CreateParams"]) -> "FileLink": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["FileLink.CreateParams"] + ) -> "FileLink": + """ + Creates a new file link object. + """ + return cast( + "FileLink", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["FileLink.ListParams"] @@ -191,6 +207,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["FileLink.ListParams"] + ) -> ListObject["FileLink"]: + """ + Returns a list of file links. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["FileLink.ModifyParams"] @@ -208,6 +245,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["FileLink.ModifyParams"] + ) -> "FileLink": + """ + Updates an existing file link object. Expired links can no longer be updated. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "FileLink", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["FileLink.RetrieveParams"] @@ -218,3 +272,14 @@ def retrieve( instance = cls(id, **params) instance.refresh() return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["FileLink.RetrieveParams"] + ) -> "FileLink": + """ + Retrieves the file link with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/_file_link_service.py b/stripe/_file_link_service.py index c7724fbf1..a7426ea13 100644 --- a/stripe/_file_link_service.py +++ b/stripe/_file_link_service.py @@ -116,6 +116,26 @@ def list( ), ) + async def list_async( + self, + params: "FileLinkService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[FileLink]: + """ + Returns a list of file links. + """ + return cast( + ListObject[FileLink], + await self._request_async( + "get", + "/v1/file_links", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "FileLinkService.CreateParams", @@ -136,6 +156,26 @@ def create( ), ) + async def create_async( + self, + params: "FileLinkService.CreateParams", + options: RequestOptions = {}, + ) -> FileLink: + """ + Creates a new file link object. + """ + return cast( + FileLink, + await self._request_async( + "post", + "/v1/file_links", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, link: str, @@ -157,6 +197,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + link: str, + params: "FileLinkService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FileLink: + """ + Retrieves the file link with the given ID. + """ + return cast( + FileLink, + await self._request_async( + "get", + "/v1/file_links/{link}".format(link=sanitize_id(link)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, link: str, @@ -177,3 +238,24 @@ def update( options=options, ), ) + + async def update_async( + self, + link: str, + params: "FileLinkService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> FileLink: + """ + Updates an existing file link object. Expired links can no longer be updated. + """ + return cast( + FileLink, + await self._request_async( + "post", + "/v1/file_links/{link}".format(link=sanitize_id(link)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_file_service.py b/stripe/_file_service.py index f315c8ec5..9d11bdfab 100644 --- a/stripe/_file_service.py +++ b/stripe/_file_service.py @@ -141,6 +141,26 @@ def list( ), ) + async def list_async( + self, + params: "FileService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[File]: + """ + Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. + """ + return cast( + ListObject[File], + await self._request_async( + "get", + "/v1/files", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "FileService.CreateParams", options: RequestOptions = {} ) -> File: @@ -161,6 +181,26 @@ def create( ), ) + async def create_async( + self, params: "FileService.CreateParams", options: RequestOptions = {} + ) -> File: + """ + To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. + + All of Stripe's officially supported Client libraries support sending multipart/form-data. + """ + return cast( + File, + await self._request_async( + "post", + "/v1/files", + api_mode="V1FILES", + base_address="files", + params=params, + options=options, + ), + ) + def retrieve( self, file: str, @@ -181,3 +221,24 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + file: str, + params: "FileService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> File: + """ + Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). + """ + return cast( + File, + await self._request_async( + "get", + "/v1/files/{file}".format(file=sanitize_id(file)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_http_client.py b/stripe/_http_client.py index 659ba0c73..f7969a5b5 100644 --- a/stripe/_http_client.py +++ b/stripe/_http_client.py @@ -6,6 +6,8 @@ import random import threading import json +import asyncio +import ssl from http.client import HTTPResponse # Used for global variables @@ -17,6 +19,7 @@ from typing import ( Any, Dict, + Iterable, List, Mapping, MutableMapping, @@ -26,11 +29,14 @@ Union, cast, overload, + AsyncIterable, ) from typing_extensions import ( Literal, NoReturn, TypedDict, + Awaitable, + Never, ) # - Requests is the preferred HTTP library @@ -49,6 +55,22 @@ except ImportError: pycurl = None +try: + import httpx + import anyio + from httpx import Timeout as HTTPXTimeout + from httpx import Client as HTTPXClientType +except ImportError: + httpx = None + anyio = None + +try: + import aiohttp + from aiohttp import ClientTimeout as AIOHTTPTimeout + from aiohttp import StreamReader as AIOHTTPStreamReader +except ImportError: + aiohttp = None + try: import requests from requests import Session as RequestsSession @@ -106,6 +128,17 @@ def new_default_http_client(*args: Any, **kwargs: Any) -> "HTTPClient": return impl(*args, **kwargs) +def new_http_client_async_fallback(*args: Any, **kwargs: Any) -> "HTTPClient": + if httpx: + impl = HTTPXClient + elif aiohttp: + impl = AIOHTTPClient + else: + impl = NoImportFoundAsyncClient + + return impl(*args, **kwargs) + + class HTTPClient(object): name: ClassVar[str] @@ -123,6 +156,7 @@ def __init__( self, verify_ssl_certs: bool = True, proxy: Optional[Union[str, _Proxy]] = None, + async_fallback_client: Optional["HTTPClient"] = None, ): self._verify_ssl_certs = verify_ssl_certs if proxy: @@ -141,6 +175,7 @@ def __init__( " keys." ) self._proxy = proxy.copy() if proxy else None + self._async_fallback_client = async_fallback_client self._thread_local = threading.local() @@ -258,7 +293,6 @@ def _record_request_metrics(self, response, request_start, usage): request_id, request_duration_ms, usage=usage ) - # TODO: more specific types here would be helpful def request_with_retries( self, method: str, @@ -389,6 +423,171 @@ def close(self): "HTTPClient subclasses must implement `close`" ) + async def request_with_retries_async( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data=None, + max_network_retries: Optional[int] = None, + *, + _usage: Optional[List[str]] = None + ) -> Tuple[Any, int, Any]: + return await self._request_with_retries_internal_async( + method, + url, + headers, + post_data, + is_streaming=False, + max_network_retries=max_network_retries, + _usage=_usage, + ) + + async def request_stream_with_retries_async( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data=None, + max_network_retries=None, + *, + _usage: Optional[List[str]] = None + ) -> Tuple[AsyncIterable[bytes], int, Any]: + return await self._request_with_retries_internal_async( + method, + url, + headers, + post_data, + is_streaming=True, + max_network_retries=max_network_retries, + _usage=_usage, + ) + + @overload + async def _request_with_retries_internal_async( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data, + is_streaming: Literal[False], + max_network_retries: Optional[int], + *, + _usage: Optional[List[str]] = None + ) -> Tuple[Any, int, Mapping[str, str]]: + ... + + @overload + async def _request_with_retries_internal_async( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data, + is_streaming: Literal[True], + max_network_retries: Optional[int], + *, + _usage: Optional[List[str]] = None + ) -> Tuple[AsyncIterable[bytes], int, Mapping[str, str]]: + ... + + async def _request_with_retries_internal_async( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data, + is_streaming: bool, + max_network_retries: Optional[int], + *, + _usage: Optional[List[str]] = None + ) -> Tuple[Any, int, Mapping[str, str]]: + headers = self._add_telemetry_header(headers) + + num_retries = 0 + + while True: + request_start = _now_ms() + + try: + if is_streaming: + response = await self.request_stream_async( + method, url, headers, post_data + ) + else: + response = await self.request_async( + method, url, headers, post_data + ) + connection_error = None + except APIConnectionError as e: + connection_error = e + response = None + + if self._should_retry( + response, connection_error, num_retries, max_network_retries + ): + if connection_error: + _util.log_info( + "Encountered a retryable error %s" + % connection_error.user_message + ) + num_retries += 1 + sleep_time = self._sleep_time_seconds(num_retries, response) + _util.log_info( + ( + "Initiating retry %i for request %s %s after " + "sleeping %.2f seconds." + % (num_retries, method, url, sleep_time) + ) + ) + await self.sleep_async(sleep_time) + else: + if response is not None: + self._record_request_metrics( + response, request_start, usage=_usage + ) + + return response + else: + assert connection_error is not None + raise connection_error + + async def request_async( + self, method: str, url: str, headers: Mapping[str, str], post_data=None + ) -> Tuple[bytes, int, Mapping[str, str]]: + if self._async_fallback_client is not None: + return await self._async_fallback_client.request_async( + method, url, headers, post_data + ) + raise NotImplementedError( + "HTTPClient subclasses must implement `request_async`" + ) + + async def request_stream_async( + self, method: str, url: str, headers: Mapping[str, str], post_data=None + ) -> Tuple[AsyncIterable[bytes], int, Mapping[str, str]]: + if self._async_fallback_client is not None: + return await self._async_fallback_client.request_stream_async( + method, url, headers, post_data + ) + raise NotImplementedError( + "HTTPClient subclasses must implement `request_stream_async`" + ) + + async def close_async(self): + if self._async_fallback_client is not None: + return await self._async_fallback_client.close_async() + raise NotImplementedError( + "HTTPClient subclasses must implement `close_async`" + ) + + def sleep_async(self, secs: float) -> Awaitable[None]: + if self._async_fallback_client is not None: + return self._async_fallback_client.sleep_async(secs) + raise NotImplementedError( + "HTTPClient subclasses must implement `sleep`" + ) + class RequestsClient(HTTPClient): name = "requests" @@ -399,10 +598,13 @@ def __init__( session: Optional["RequestsSession"] = None, verify_ssl_certs: bool = True, proxy: Optional[Union[str, HTTPClient._Proxy]] = None, + async_fallback_client: Optional[HTTPClient] = None, **kwargs ): super(RequestsClient, self).__init__( - verify_ssl_certs=verify_ssl_certs, proxy=proxy + verify_ssl_certs=verify_ssl_certs, + proxy=proxy, + async_fallback_client=async_fallback_client, ) self._session = session self._timeout = timeout @@ -583,9 +785,12 @@ def __init__( verify_ssl_certs: bool = True, proxy: Optional[HTTPClient._Proxy] = None, deadline: int = 55, + async_fallback_client: Optional[HTTPClient] = None, ): super(UrlFetchClient, self).__init__( - verify_ssl_certs=verify_ssl_certs, proxy=proxy + verify_ssl_certs=verify_ssl_certs, + proxy=proxy, + async_fallback_client=async_fallback_client, ) # no proxy support in urlfetch. for a patch, see: @@ -713,9 +918,12 @@ def __init__( self, verify_ssl_certs: bool = True, proxy: Optional[HTTPClient._Proxy] = None, + async_fallback_client: Optional[HTTPClient] = None, ): super(PycurlClient, self).__init__( - verify_ssl_certs=verify_ssl_certs, proxy=proxy + verify_ssl_certs=verify_ssl_certs, + proxy=proxy, + async_fallback_client=async_fallback_client, ) assert pycurl is not None @@ -902,9 +1110,12 @@ def __init__( self, verify_ssl_certs: bool = True, proxy: Optional[HTTPClient._Proxy] = None, + async_fallback_client: Optional[HTTPClient] = None, ): super(Urllib2Client, self).__init__( - verify_ssl_certs=verify_ssl_certs, proxy=proxy + verify_ssl_certs=verify_ssl_certs, + proxy=proxy, + async_fallback_client=async_fallback_client, ) # prepare and cache proxy tied opener here self._opener = None @@ -1005,3 +1216,311 @@ def _handle_request_error(self, e) -> NoReturn: def close(self): pass + + +class HTTPXClient(HTTPClient): + name = "httpx" + + _client: Optional["HTTPXClientType"] + + def __init__( + self, + timeout: Optional[Union[float, "HTTPXTimeout"]] = 80, + allow_sync_methods=False, + **kwargs + ): + super(HTTPXClient, self).__init__(**kwargs) + + if httpx is None: + raise ImportError( + "Unexpected: tried to initialize HTTPXClient but the httpx module is not present." + ) + + if anyio is None: + raise ImportError( + "Unexpected: tried to initialize HTTPXClient but the anyio module is not present." + ) + + self.httpx = httpx + self.anyio = anyio + + kwargs = {} + if self._verify_ssl_certs: + kwargs["verify"] = stripe.ca_bundle_path + else: + kwargs["verify"] = False + + self._client_async = httpx.AsyncClient(**kwargs) + self._client = None + if allow_sync_methods: + self._client = httpx.Client(**kwargs) + self._timeout = timeout + + def sleep_async(self, secs): + return self.anyio.sleep(secs) + + def _get_request_args_kwargs( + self, method: str, url: str, headers: Mapping[str, str], post_data + ): + kwargs = {} + + if self._proxy: + kwargs["proxies"] = self._proxy + + if self._timeout: + kwargs["timeout"] = self._timeout + return [ + (method, url), + {"headers": headers, "data": post_data or {}, **kwargs}, + ] + + def request( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data=None, + ) -> Tuple[bytes, int, Mapping[str, str]]: + if self._client is None: + raise RuntimeError( + "Stripe: HTTPXClient was initialized with allow_sync_methods=False, " + "so it cannot be used for synchronous requests." + ) + args, kwargs = self._get_request_args_kwargs( + method, url, headers, post_data + ) + try: + response = self._client.request(*args, **kwargs) + except Exception as e: + self._handle_request_error(e) + + content = response.content + status_code = response.status_code + response_headers = response.headers + return content, status_code, response_headers + + async def request_async( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data=None, + ) -> Tuple[bytes, int, Mapping[str, str]]: + args, kwargs = self._get_request_args_kwargs( + method, url, headers, post_data + ) + try: + response = await self._client_async.request(*args, **kwargs) + except Exception as e: + self._handle_request_error(e) + + content = response.content + status_code = response.status_code + response_headers = response.headers + return content, status_code, response_headers + + def _handle_request_error(self, e) -> NoReturn: + msg = ( + "Unexpected error communicating with Stripe. If this " + "problem persists, let us know at support@stripe.com." + ) + err = "A %s was raised" % (type(e).__name__,) + should_retry = True + + msg = textwrap.fill(msg) + "\n\n(Network error: %s)" % (err,) + raise APIConnectionError(msg, should_retry=should_retry) + + def request_stream( + self, method: str, url: str, headers: Mapping[str, str], post_data=None + ) -> Tuple[Iterable[bytes], int, Mapping[str, str]]: + if self._client is None: + raise RuntimeError( + "Stripe: HTTPXClient was not initialized with allow_sync_methods=True, " + "so it cannot be used for synchronous requests." + ) + args, kwargs = self._get_request_args_kwargs( + method, url, headers, post_data + ) + try: + response = self._client.send( + request=self._client_async.build_request(*args, **kwargs), + stream=True, + ) + except Exception as e: + self._handle_request_error(e) + content = response.iter_bytes() + status_code = response.status_code + headers = response.headers + + return content, status_code, headers + + async def request_stream_async( + self, method: str, url: str, headers: Mapping[str, str], post_data=None + ) -> Tuple[AsyncIterable[bytes], int, Mapping[str, str]]: + args, kwargs = self._get_request_args_kwargs( + method, url, headers, post_data + ) + try: + response = await self._client_async.send( + request=self._client_async.build_request(*args, **kwargs), + stream=True, + ) + except Exception as e: + self._handle_request_error(e) + content = response.aiter_bytes() + status_code = response.status_code + headers = response.headers + + return content, status_code, headers + + def close(self): + if self._client is not None: + self._client.close() + + async def close_async(self): + await self._client_async.aclose() + + +class AIOHTTPClient(HTTPClient): + name = "aiohttp" + + def __init__( + self, timeout: Optional[Union[float, "AIOHTTPTimeout"]] = 80, **kwargs + ): + super(AIOHTTPClient, self).__init__(**kwargs) + + if aiohttp is None: + raise ImportError( + "Unexpected: tried to initialize AIOHTTPClient but the aiohttp module is not present." + ) + + self._timeout = timeout + self._cached_session = None + + @property + def _session(self): + assert aiohttp is not None + + if self._cached_session is None: + kwargs = {} + if self._verify_ssl_certs: + ssl_context = ssl.create_default_context( + cafile=stripe.ca_bundle_path + ) + kwargs["connector"] = aiohttp.TCPConnector(ssl=ssl_context) + else: + kwargs["connector"] = aiohttp.TCPConnector(verify_ssl=False) + + self._cached_session = aiohttp.ClientSession(**kwargs) + + return self._cached_session + + def sleep_async(self, secs): + return asyncio.sleep(secs) + + def request(self) -> Tuple[bytes, int, Mapping[str, str]]: + raise NotImplementedError( + "AIOHTTPClient does not support synchronous requests." + ) + + def _get_request_args_kwargs( + self, method: str, url: str, headers: Mapping[str, str], post_data + ): + args = (method, url) + kwargs = {} + if self._proxy: + if self._proxy["http"] != self._proxy["https"]: + raise ValueError( + "AIOHTTPClient does not support different proxies for HTTP and HTTPS." + ) + kwargs["proxy"] = self._proxy["https"] + if self._timeout: + kwargs["timeout"] = self._timeout + + kwargs["headers"] = headers + kwargs["data"] = post_data + return args, kwargs + + async def request_async( + self, + method: str, + url: str, + headers: Mapping[str, str], + post_data=None, + ) -> Tuple[bytes, int, Mapping[str, str]]: + ( + content, + status_code, + response_headers, + ) = await self.request_stream_async( + method, url, headers, post_data=post_data + ) + + return (await content.read()), status_code, response_headers + + def _handle_request_error(self, e) -> NoReturn: + msg = ( + "Unexpected error communicating with Stripe. If this " + "problem persists, let us know at support@stripe.com." + ) + err = "A %s was raised" % (type(e).__name__,) + should_retry = True + + msg = textwrap.fill(msg) + "\n\n(Network error: %s)" % (err,) + raise APIConnectionError(msg, should_retry=should_retry) + + def request_stream(self) -> Tuple[Iterable[bytes], int, Mapping[str, str]]: + raise NotImplementedError( + "AIOHTTPClient does not support synchronous requests." + ) + + async def request_stream_async( + self, method: str, url: str, headers: Mapping[str, str], post_data=None + ) -> Tuple["AIOHTTPStreamReader", int, Mapping[str, str]]: + args, kwargs = self._get_request_args_kwargs( + method, url, headers, post_data + ) + try: + response = await self._session.request(*args, **kwargs) + except Exception as e: + self._handle_request_error(e) + + content = response.content + status_code = response.status + response_headers = response.headers + return content, status_code, response_headers + + def close(self): + pass + + async def close_async(self): + await self._session.close() + + +class NoImportFoundAsyncClient(HTTPClient): + def __init__(self, **kwargs): + super(NoImportFoundAsyncClient, self).__init__(**kwargs) + + @staticmethod + def raise_async_client_import_error() -> Never: + raise ImportError( + ( + "Import httpx not found. To make async http requests," + "You must either install httpx or define your own" + "async http client by subclassing stripe.HTTPClient" + "and setting stripe.default_http_client to an instance of it." + ) + ) + + async def request_async( + self, method: str, url: str, headers: Mapping[str, str], post_data=None + ) -> Tuple[bytes, int, Mapping[str, str]]: + self.raise_async_client_import_error() + + async def request_stream_async( + self, method: str, url: str, headers: Mapping[str, str], post_data=None + ): + self.raise_async_client_import_error() + + async def close_async(self): + self.raise_async_client_import_error() diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 0859c88dd..716a04f92 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -12,6 +12,7 @@ from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ( + AsyncIterator, ClassVar, Dict, Iterator, @@ -3799,6 +3800,22 @@ def create(cls, **params: Unpack["Invoice.CreateParams"]) -> "Invoice": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Invoice.CreateParams"] + ) -> "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](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers. + """ + return cast( + "Invoice", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Invoice.DeleteParams"] @@ -3846,6 +3863,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["Invoice.DeleteParams"] + ) -> "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://stripe.com/docs/api#void_invoice). + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "Invoice", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["Invoice.DeleteParams"] + ) -> "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://stripe.com/docs/api#void_invoice). + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["Invoice.DeleteParams"] + ) -> "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://stripe.com/docs/api#void_invoice). + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Invoice.DeleteParams"] + ) -> "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://stripe.com/docs/api#void_invoice). + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def _cls_finalize_invoice( cls, invoice: str, **params: Unpack["Invoice.FinalizeInvoiceParams"] @@ -3901,6 +3967,61 @@ def finalize_invoice( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_finalize_invoice_async( + cls, invoice: str, **params: Unpack["Invoice.FinalizeInvoiceParams"] + ) -> "Invoice": + """ + Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. + """ + return cast( + "Invoice", + await cls._static_request_async( + "post", + "/v1/invoices/{invoice}/finalize".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def finalize_invoice_async( + invoice: str, **params: Unpack["Invoice.FinalizeInvoiceParams"] + ) -> "Invoice": + """ + Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. + """ + ... + + @overload + async def finalize_invoice_async( + self, **params: Unpack["Invoice.FinalizeInvoiceParams"] + ) -> "Invoice": + """ + Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. + """ + ... + + @class_method_variant("_cls_finalize_invoice_async") + async def finalize_invoice_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Invoice.FinalizeInvoiceParams"] + ) -> "Invoice": + """ + Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. + """ + return cast( + "Invoice", + await self._request_async( + "post", + "/v1/invoices/{invoice}/finalize".format( + invoice=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Invoice.ListParams"] @@ -3922,6 +4043,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Invoice.ListParams"] + ) -> ListObject["Invoice"]: + """ + You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. + """ + 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 _cls_mark_uncollectible( cls, invoice: str, **params: Unpack["Invoice.MarkUncollectibleParams"] @@ -3977,6 +4119,61 @@ def mark_uncollectible( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_mark_uncollectible_async( + cls, invoice: str, **params: Unpack["Invoice.MarkUncollectibleParams"] + ) -> "Invoice": + """ + Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. + """ + return cast( + "Invoice", + await cls._static_request_async( + "post", + "/v1/invoices/{invoice}/mark_uncollectible".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def mark_uncollectible_async( + invoice: str, **params: Unpack["Invoice.MarkUncollectibleParams"] + ) -> "Invoice": + """ + Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. + """ + ... + + @overload + async def mark_uncollectible_async( + self, **params: Unpack["Invoice.MarkUncollectibleParams"] + ) -> "Invoice": + """ + Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. + """ + ... + + @class_method_variant("_cls_mark_uncollectible_async") + async def mark_uncollectible_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Invoice.MarkUncollectibleParams"] + ) -> "Invoice": + """ + Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. + """ + return cast( + "Invoice", + await self._request_async( + "post", + "/v1/invoices/{invoice}/mark_uncollectible".format( + invoice=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def modify( cls, id: str, **params: Unpack["Invoice.ModifyParams"] @@ -3999,6 +4196,28 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Invoice.ModifyParams"] + ) -> "Invoice": + """ + Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), + monetary values, as well as collection_method, become uneditable. + + If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, + sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass + auto_advance=false. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Invoice", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def _cls_pay( cls, invoice: str, **params: Unpack["Invoice.PayParams"] @@ -4050,6 +4269,61 @@ def pay( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_pay_async( + cls, invoice: str, **params: Unpack["Invoice.PayParams"] + ) -> "Invoice": + """ + Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. + """ + return cast( + "Invoice", + await cls._static_request_async( + "post", + "/v1/invoices/{invoice}/pay".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def pay_async( + invoice: str, **params: Unpack["Invoice.PayParams"] + ) -> "Invoice": + """ + Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. + """ + ... + + @overload + async def pay_async( + self, **params: Unpack["Invoice.PayParams"] + ) -> "Invoice": + """ + Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. + """ + ... + + @class_method_variant("_cls_pay_async") + async def pay_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Invoice.PayParams"] + ) -> "Invoice": + """ + Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. + """ + return cast( + "Invoice", + await self._request_async( + "post", + "/v1/invoices/{invoice}/pay".format( + invoice=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Invoice.RetrieveParams"] @@ -4061,6 +4335,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Invoice.RetrieveParams"] + ) -> "Invoice": + """ + Retrieves the invoice with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def _cls_send_invoice( cls, invoice: str, **params: Unpack["Invoice.SendInvoiceParams"] @@ -4124,6 +4409,69 @@ def send_invoice( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_send_invoice_async( + cls, invoice: str, **params: Unpack["Invoice.SendInvoiceParams"] + ) -> "Invoice": + """ + Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. + + Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. + """ + return cast( + "Invoice", + await cls._static_request_async( + "post", + "/v1/invoices/{invoice}/send".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def send_invoice_async( + invoice: str, **params: Unpack["Invoice.SendInvoiceParams"] + ) -> "Invoice": + """ + Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. + + Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. + """ + ... + + @overload + async def send_invoice_async( + self, **params: Unpack["Invoice.SendInvoiceParams"] + ) -> "Invoice": + """ + Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. + + Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. + """ + ... + + @class_method_variant("_cls_send_invoice_async") + async def send_invoice_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Invoice.SendInvoiceParams"] + ) -> "Invoice": + """ + Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. + + Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. + """ + return cast( + "Invoice", + await self._request_async( + "post", + "/v1/invoices/{invoice}/send".format( + invoice=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def upcoming(cls, **params: Unpack["Invoice.UpcomingParams"]) -> "Invoice": """ @@ -4142,6 +4490,26 @@ def upcoming(cls, **params: Unpack["Invoice.UpcomingParams"]) -> "Invoice": ), ) + @classmethod + async def upcoming_async( + cls, **params: Unpack["Invoice.UpcomingParams"] + ) -> "Invoice": + """ + At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. + + Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. + + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date on the upcoming invoice resource. + """ + return cast( + "Invoice", + await cls._static_request_async( + "get", + "/v1/invoices/upcoming", + params=params, + ), + ) + @classmethod def upcoming_lines( cls, **params: Unpack["Invoice.UpcomingLinesParams"] @@ -4158,6 +4526,22 @@ def upcoming_lines( ), ) + @classmethod + async def upcoming_lines_async( + cls, **params: Unpack["Invoice.UpcomingLinesParams"] + ) -> ListObject["InvoiceLineItem"]: + """ + When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["InvoiceLineItem"], + await cls._static_request_async( + "get", + "/v1/invoices/upcoming/lines", + params=params, + ), + ) + @classmethod def _cls_void_invoice( cls, invoice: str, **params: Unpack["Invoice.VoidInvoiceParams"] @@ -4221,6 +4605,69 @@ def void_invoice( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_void_invoice_async( + cls, invoice: str, **params: Unpack["Invoice.VoidInvoiceParams"] + ) -> "Invoice": + """ + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), 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://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + """ + return cast( + "Invoice", + await cls._static_request_async( + "post", + "/v1/invoices/{invoice}/void".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def void_invoice_async( + invoice: str, **params: Unpack["Invoice.VoidInvoiceParams"] + ) -> "Invoice": + """ + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), 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://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + """ + ... + + @overload + async def void_invoice_async( + self, **params: Unpack["Invoice.VoidInvoiceParams"] + ) -> "Invoice": + """ + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), 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://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + """ + ... + + @class_method_variant("_cls_void_invoice_async") + async def void_invoice_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Invoice.VoidInvoiceParams"] + ) -> "Invoice": + """ + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), 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://stripe.com/docs/api#create_invoice) 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")) + ), + params=params, + ), + ) + @classmethod def search( cls, *args, **kwargs: Unpack["Invoice.SearchParams"] @@ -4233,12 +4680,32 @@ def search( """ return cls._search(search_url="/v1/invoices/search", *args, **kwargs) + @classmethod + async def search_async( + cls, *args, **kwargs: Unpack["Invoice.SearchParams"] + ) -> SearchResultObject["Invoice"]: + """ + Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return await cls._search_async( + search_url="/v1/invoices/search", *args, **kwargs + ) + @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["Invoice.SearchParams"] ) -> Iterator["Invoice"]: return cls.search(*args, **kwargs).auto_paging_iter() + @classmethod + async def search_auto_paging_iter_async( + cls, *args, **kwargs: Unpack["Invoice.SearchParams"] + ) -> AsyncIterator["Invoice"]: + return (await cls.search_async(*args, **kwargs)).auto_paging_iter() + _inner_class_types = { "automatic_tax": AutomaticTax, "custom_fields": CustomField, diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index 8ee40ee7a..869e9e793 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -468,6 +468,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["InvoiceItem.CreateParams"] + ) -> "InvoiceItem": + """ + Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. + """ + return cast( + "InvoiceItem", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["InvoiceItem.DeleteParams"] @@ -517,6 +533,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["InvoiceItem.DeleteParams"] + ) -> "InvoiceItem": + """ + Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "InvoiceItem", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["InvoiceItem.DeleteParams"] + ) -> "InvoiceItem": + """ + Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["InvoiceItem.DeleteParams"] + ) -> "InvoiceItem": + """ + Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["InvoiceItem.DeleteParams"] + ) -> "InvoiceItem": + """ + Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["InvoiceItem.ListParams"] @@ -538,6 +603,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["InvoiceItem.ListParams"] + ) -> ListObject["InvoiceItem"]: + """ + Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["InvoiceItem.ModifyParams"] @@ -555,6 +641,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["InvoiceItem.ModifyParams"] + ) -> "InvoiceItem": + """ + Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "InvoiceItem", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["InvoiceItem.RetrieveParams"] @@ -566,4 +669,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["InvoiceItem.RetrieveParams"] + ) -> "InvoiceItem": + """ + Retrieves the invoice item with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"period": Period} diff --git a/stripe/_invoice_item_service.py b/stripe/_invoice_item_service.py index 5305d2e8b..2918a24aa 100644 --- a/stripe/_invoice_item_service.py +++ b/stripe/_invoice_item_service.py @@ -330,6 +330,29 @@ def delete( ), ) + async def delete_async( + self, + invoiceitem: str, + params: "InvoiceItemService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> InvoiceItem: + """ + Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. + """ + return cast( + InvoiceItem, + await self._request_async( + "delete", + "/v1/invoiceitems/{invoiceitem}".format( + invoiceitem=sanitize_id(invoiceitem), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, invoiceitem: str, @@ -353,6 +376,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + invoiceitem: str, + params: "InvoiceItemService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> InvoiceItem: + """ + Retrieves the invoice item with the given ID. + """ + return cast( + InvoiceItem, + await self._request_async( + "get", + "/v1/invoiceitems/{invoiceitem}".format( + invoiceitem=sanitize_id(invoiceitem), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, invoiceitem: str, @@ -376,6 +422,29 @@ def update( ), ) + async def update_async( + self, + invoiceitem: str, + params: "InvoiceItemService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> InvoiceItem: + """ + Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. + """ + return cast( + InvoiceItem, + await self._request_async( + "post", + "/v1/invoiceitems/{invoiceitem}".format( + invoiceitem=sanitize_id(invoiceitem), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "InvoiceItemService.ListParams" = {}, @@ -396,6 +465,26 @@ def list( ), ) + async def list_async( + self, + params: "InvoiceItemService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[InvoiceItem]: + """ + Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. + """ + return cast( + ListObject[InvoiceItem], + await self._request_async( + "get", + "/v1/invoiceitems", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "InvoiceItemService.CreateParams", @@ -415,3 +504,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "InvoiceItemService.CreateParams", + options: RequestOptions = {}, + ) -> InvoiceItem: + """ + Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. + """ + return cast( + InvoiceItem, + await self._request_async( + "post", + "/v1/invoiceitems", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 8e177a54d..7a589d05c 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -414,6 +414,26 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["InvoiceLineItem.ModifyParams"] + ) -> "InvoiceLineItem": + """ + Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, + so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice + item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. + Updating an invoice's line item is only possible before the invoice is finalized. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "InvoiceLineItem", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + _inner_class_types = { "discount_amounts": DiscountAmount, "period": Period, diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index fa0f3d35b..3d864fa7d 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -243,6 +243,29 @@ def list( ), ) + async def list_async( + self, + invoice: str, + params: "InvoiceLineItemService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[InvoiceLineItem]: + """ + When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject[InvoiceLineItem], + await self._request_async( + "get", + "/v1/invoices/{invoice}/lines".format( + invoice=sanitize_id(invoice), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, invoice: str, @@ -270,3 +293,31 @@ def update( options=options, ), ) + + async def update_async( + self, + invoice: str, + line_item_id: str, + params: "InvoiceLineItemService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> InvoiceLineItem: + """ + Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, + so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice + item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. + Updating an invoice's line item is only possible before the invoice is finalized. + """ + return cast( + InvoiceLineItem, + await self._request_async( + "post", + "/v1/invoices/{invoice}/lines/{line_item_id}".format( + invoice=sanitize_id(invoice), + line_item_id=sanitize_id(line_item_id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 984e82415..d9e2c3b35 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -1957,6 +1957,27 @@ def delete( ), ) + async def delete_async( + self, + invoice: str, + params: "InvoiceService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> 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://stripe.com/docs/api#void_invoice). + """ + return cast( + Invoice, + await self._request_async( + "delete", + "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, invoice: str, @@ -1978,6 +1999,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + invoice: str, + params: "InvoiceService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Invoice: + """ + Retrieves the invoice with the given ID. + """ + return cast( + Invoice, + await self._request_async( + "get", + "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, invoice: str, @@ -2004,6 +2046,32 @@ def update( ), ) + async def update_async( + self, + invoice: str, + params: "InvoiceService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Invoice: + """ + Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), + monetary values, as well as collection_method, become uneditable. + + If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, + sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass + auto_advance=false. + """ + return cast( + Invoice, + await self._request_async( + "post", + "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "InvoiceService.ListParams" = {}, @@ -2024,6 +2092,26 @@ def list( ), ) + async def list_async( + self, + params: "InvoiceService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Invoice]: + """ + You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. + """ + return cast( + ListObject[Invoice], + await self._request_async( + "get", + "/v1/invoices", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "InvoiceService.CreateParams" = {}, @@ -2044,6 +2132,26 @@ def create( ), ) + async def create_async( + self, + params: "InvoiceService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> 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](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers. + """ + return cast( + Invoice, + await self._request_async( + "post", + "/v1/invoices", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def search( self, params: "InvoiceService.SearchParams", @@ -2067,6 +2175,29 @@ def search( ), ) + async def search_async( + self, + params: "InvoiceService.SearchParams", + options: RequestOptions = {}, + ) -> SearchResultObject[Invoice]: + """ + Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return cast( + SearchResultObject[Invoice], + await self._request_async( + "get", + "/v1/invoices/search", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def upcoming( self, params: "InvoiceService.UpcomingParams" = {}, @@ -2091,6 +2222,30 @@ def upcoming( ), ) + async def upcoming_async( + self, + params: "InvoiceService.UpcomingParams" = {}, + options: RequestOptions = {}, + ) -> Invoice: + """ + At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. + + Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. + + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date on the upcoming invoice resource. + """ + return cast( + Invoice, + await self._request_async( + "get", + "/v1/invoices/upcoming", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def finalize_invoice( self, invoice: str, @@ -2114,6 +2269,29 @@ def finalize_invoice( ), ) + async def finalize_invoice_async( + self, + invoice: str, + params: "InvoiceService.FinalizeInvoiceParams" = {}, + options: RequestOptions = {}, + ) -> Invoice: + """ + Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. + """ + return cast( + Invoice, + await self._request_async( + "post", + "/v1/invoices/{invoice}/finalize".format( + invoice=sanitize_id(invoice), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def mark_uncollectible( self, invoice: str, @@ -2137,6 +2315,29 @@ def mark_uncollectible( ), ) + async def mark_uncollectible_async( + self, + invoice: str, + params: "InvoiceService.MarkUncollectibleParams" = {}, + options: RequestOptions = {}, + ) -> Invoice: + """ + Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. + """ + return cast( + Invoice, + await self._request_async( + "post", + "/v1/invoices/{invoice}/mark_uncollectible".format( + invoice=sanitize_id(invoice), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def pay( self, invoice: str, @@ -2160,6 +2361,29 @@ def pay( ), ) + async def pay_async( + self, + invoice: str, + params: "InvoiceService.PayParams" = {}, + options: RequestOptions = {}, + ) -> Invoice: + """ + Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. + """ + return cast( + Invoice, + await self._request_async( + "post", + "/v1/invoices/{invoice}/pay".format( + invoice=sanitize_id(invoice), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def send_invoice( self, invoice: str, @@ -2185,6 +2409,31 @@ def send_invoice( ), ) + async def send_invoice_async( + self, + invoice: str, + params: "InvoiceService.SendInvoiceParams" = {}, + options: RequestOptions = {}, + ) -> Invoice: + """ + Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. + + Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. + """ + return cast( + Invoice, + await self._request_async( + "post", + "/v1/invoices/{invoice}/send".format( + invoice=sanitize_id(invoice), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def void_invoice( self, invoice: str, @@ -2209,3 +2458,28 @@ def void_invoice( options=options, ), ) + + async def void_invoice_async( + self, + invoice: str, + params: "InvoiceService.VoidInvoiceParams" = {}, + options: RequestOptions = {}, + ) -> Invoice: + """ + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), 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://stripe.com/docs/api#create_invoice) 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(invoice), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index e147bc6f5..e9bc6a0bf 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -592,3 +592,23 @@ def list( options=options, ), ) + + async def list_async( + self, + params: "InvoiceUpcomingLinesService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[InvoiceLineItem]: + """ + When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject[InvoiceLineItem], + await self._request_async( + "get", + "/v1/invoices/upcoming/lines", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_list_object.py b/stripe/_list_object.py index fddf71bbc..2e2d03ff1 100644 --- a/stripe/_list_object.py +++ b/stripe/_list_object.py @@ -5,6 +5,7 @@ from typing import ( Any, + AsyncIterator, Iterator, List, Generic, @@ -15,11 +16,13 @@ from stripe._api_requestor import ( _APIRequestor, # pyright: ignore[reportPrivateUsage] ) +from stripe._any_iterator import AnyIterator from stripe._stripe_object import StripeObject from stripe._request_options import RequestOptions, extract_options_from_dict from urllib.parse import quote_plus + T = TypeVar("T", bound=StripeObject) @@ -29,17 +32,32 @@ class ListObject(StripeObject, Generic[T]): has_more: bool url: str - def list(self, **params: Mapping[str, Any]) -> Self: + def _get_url_for_list(self) -> str: url = self.get("url") if not isinstance(url, str): raise ValueError( 'Cannot call .list on a list object without a string "url" property' ) + return url + + def list(self, **params: Mapping[str, Any]) -> Self: return cast( Self, self._request( "get", - url, + self._get_url_for_list(), + params=params, + base_address="api", + api_mode="V1", + ), + ) + + async def list_async(self, **params: Mapping[str, Any]) -> Self: + return cast( + Self, + await self._request_async( + "get", + self._get_url_for_list(), params=params, base_address="api", api_mode="V1", @@ -107,7 +125,13 @@ def __len__(self) -> int: def __reversed__(self) -> Iterator[T]: # pyright: ignore (see above) return getattr(self, "data", []).__reversed__() - def auto_paging_iter(self) -> Iterator[T]: + def auto_paging_iter(self) -> AnyIterator[T]: + return AnyIterator( + self._auto_paging_iter(), + self._auto_paging_iter_async(), + ) + + def _auto_paging_iter(self) -> Iterator[T]: page = self while True: @@ -126,6 +150,25 @@ def auto_paging_iter(self) -> Iterator[T]: if page.is_empty: break + async def _auto_paging_iter_async(self) -> AsyncIterator[T]: + page = self + + while True: + if ( + "ending_before" in self._retrieve_params + and "starting_after" not in self._retrieve_params + ): + for item in reversed(page): + yield item + page = await page.previous_page_async() + else: + for item in page: + yield item + page = await page.next_page_async() + + if page.is_empty: + break + @classmethod def _empty_list( cls, @@ -144,12 +187,9 @@ def _empty_list( def is_empty(self) -> bool: return not self.data - def next_page(self, **params: Unpack[RequestOptions]) -> Self: - if not self.has_more: - request_options, _ = extract_options_from_dict(params) - return self._empty_list( - **request_options, - ) + def _get_filters_for_next_page( + self, params: RequestOptions + ) -> Mapping[str, Any]: last_id = getattr(self.data[-1], "id") if not last_id: @@ -160,18 +200,30 @@ def next_page(self, **params: Unpack[RequestOptions]) -> Self: params_with_filters = dict(self._retrieve_params) params_with_filters.update({"starting_after": last_id}) params_with_filters.update(params) + return params_with_filters + def next_page(self, **params: Unpack[RequestOptions]) -> Self: + if not self.has_more: + request_options, _ = extract_options_from_dict(params) + return self._empty_list( + **request_options, + ) return self.list( - **params_with_filters, + **self._get_filters_for_next_page(params), ) - def previous_page(self, **params: Unpack[RequestOptions]) -> Self: + async def next_page_async(self, **params: Unpack[RequestOptions]) -> Self: if not self.has_more: request_options, _ = extract_options_from_dict(params) return self._empty_list( **request_options, ) + return await self.list_async(**self._get_filters_for_next_page(params)) + + def _get_filters_for_previous_page( + self, params: RequestOptions + ) -> Mapping[str, Any]: first_id = getattr(self.data[0], "id") if not first_id: raise ValueError( @@ -181,8 +233,30 @@ def previous_page(self, **params: Unpack[RequestOptions]) -> Self: params_with_filters = dict(self._retrieve_params) params_with_filters.update({"ending_before": first_id}) params_with_filters.update(params) + return params_with_filters + + def previous_page(self, **params: Unpack[RequestOptions]) -> Self: + if not self.has_more: + request_options, _ = extract_options_from_dict(params) + return self._empty_list( + **request_options, + ) result = self.list( - **params_with_filters, + **self._get_filters_for_previous_page(params), + ) + return result + + async def previous_page_async( + self, **params: Unpack[RequestOptions] + ) -> Self: + if not self.has_more: + request_options, _ = extract_options_from_dict(params) + return self._empty_list( + **request_options, + ) + + result = await self.list_async( + **self._get_filters_for_previous_page(params) ) return result diff --git a/stripe/_mandate.py b/stripe/_mandate.py index ea611d0aa..84e56fb05 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -220,6 +220,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Mandate.RetrieveParams"] + ) -> "Mandate": + """ + Retrieves a Mandate object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "customer_acceptance": CustomerAcceptance, "multi_use": MultiUse, diff --git a/stripe/_mandate_service.py b/stripe/_mandate_service.py index 7c20daf4f..52c0c6ca1 100644 --- a/stripe/_mandate_service.py +++ b/stripe/_mandate_service.py @@ -35,3 +35,24 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + mandate: str, + params: "MandateService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Mandate: + """ + Retrieves a Mandate object. + """ + return cast( + Mandate, + await self._request_async( + "get", + "/v1/mandates/{mandate}".format(mandate=sanitize_id(mandate)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 2549e7680..34440ea37 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -12,6 +12,7 @@ from stripe._util import class_method_variant, sanitize_id from typing import ( Any, + AsyncIterator, ClassVar, Dict, Iterator, @@ -8556,6 +8557,64 @@ def apply_customer_balance( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_apply_customer_balance_async( + cls, + intent: str, + **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] + ) -> "PaymentIntent": + """ + Manually reconcile the remaining amount for a customer_balance PaymentIntent. + """ + return cast( + "PaymentIntent", + await cls._static_request_async( + "post", + "/v1/payment_intents/{intent}/apply_customer_balance".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def apply_customer_balance_async( + intent: str, + **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] + ) -> "PaymentIntent": + """ + Manually reconcile the remaining amount for a customer_balance PaymentIntent. + """ + ... + + @overload + async def apply_customer_balance_async( + self, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] + ) -> "PaymentIntent": + """ + Manually reconcile the remaining amount for a customer_balance PaymentIntent. + """ + ... + + @class_method_variant("_cls_apply_customer_balance_async") + async def apply_customer_balance_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] + ) -> "PaymentIntent": + """ + Manually reconcile the remaining amount for a customer_balance PaymentIntent. + """ + return cast( + "PaymentIntent", + await self._request_async( + "post", + "/v1/payment_intents/{intent}/apply_customer_balance".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_cancel( cls, intent: str, **params: Unpack["PaymentIntent.CancelParams"] @@ -8627,6 +8686,77 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, intent: str, **params: Unpack["PaymentIntent.CancelParams"] + ) -> "PaymentIntent": + """ + You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. + + 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://stripe.com/docs/api/checkout/sessions/expire) instead. + """ + return cast( + "PaymentIntent", + await cls._static_request_async( + "post", + "/v1/payment_intents/{intent}/cancel".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + intent: str, **params: Unpack["PaymentIntent.CancelParams"] + ) -> "PaymentIntent": + """ + You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. + + 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://stripe.com/docs/api/checkout/sessions/expire) instead. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["PaymentIntent.CancelParams"] + ) -> "PaymentIntent": + """ + You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. + + 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://stripe.com/docs/api/checkout/sessions/expire) instead. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.CancelParams"] + ) -> "PaymentIntent": + """ + You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. + + 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://stripe.com/docs/api/checkout/sessions/expire) instead. + """ + return cast( + "PaymentIntent", + await self._request_async( + "post", + "/v1/payment_intents/{intent}/cancel".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_capture( cls, intent: str, **params: Unpack["PaymentIntent.CaptureParams"] @@ -8698,6 +8828,77 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_capture_async( + cls, intent: str, **params: Unpack["PaymentIntent.CaptureParams"] + ) -> "PaymentIntent": + """ + Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. + + Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. + + Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). + """ + return cast( + "PaymentIntent", + await cls._static_request_async( + "post", + "/v1/payment_intents/{intent}/capture".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def capture_async( + intent: str, **params: Unpack["PaymentIntent.CaptureParams"] + ) -> "PaymentIntent": + """ + Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. + + Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. + + Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). + """ + ... + + @overload + async def capture_async( + self, **params: Unpack["PaymentIntent.CaptureParams"] + ) -> "PaymentIntent": + """ + Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. + + Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. + + Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). + """ + ... + + @class_method_variant("_cls_capture_async") + async def capture_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.CaptureParams"] + ) -> "PaymentIntent": + """ + Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. + + Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. + + Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). + """ + return cast( + "PaymentIntent", + await self._request_async( + "post", + "/v1/payment_intents/{intent}/capture".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_confirm( cls, intent: str, **params: Unpack["PaymentIntent.ConfirmParams"] @@ -8769,101 +8970,415 @@ def confirm( ... @overload - def confirm( - self, **params: Unpack["PaymentIntent.ConfirmParams"] + def confirm( + self, **params: Unpack["PaymentIntent.ConfirmParams"] + ) -> "PaymentIntent": + """ + Confirm that your customer intends to pay with current or provided + payment method. Upon confirmation, the PaymentIntent will attempt to initiate + a payment. + If the selected payment method requires additional authentication steps, the + PaymentIntent will transition to the requires_action status and + suggest additional actions via next_action. If payment fails, + the PaymentIntent transitions to the requires_payment_method status or the + canceled status if the confirmation limit is reached. If + payment succeeds, the PaymentIntent will transition to the succeeded + status (or requires_capture, if capture_method is set to manual). + If the confirmation_method is automatic, payment may be attempted + using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) + and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). + After next_actions are handled by the client, no additional + confirmation is required to complete the payment. + If the confirmation_method is manual, all payment attempts must be + initiated using a secret key. + If any actions are required for the payment, the PaymentIntent will + return to the requires_confirmation state + after those actions are completed. Your server needs to then + explicitly re-confirm the PaymentIntent to initiate the next payment + attempt. + """ + ... + + @class_method_variant("_cls_confirm") + def confirm( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.ConfirmParams"] + ) -> "PaymentIntent": + """ + Confirm that your customer intends to pay with current or provided + payment method. Upon confirmation, the PaymentIntent will attempt to initiate + a payment. + If the selected payment method requires additional authentication steps, the + PaymentIntent will transition to the requires_action status and + suggest additional actions via next_action. If payment fails, + the PaymentIntent transitions to the requires_payment_method status or the + canceled status if the confirmation limit is reached. If + payment succeeds, the PaymentIntent will transition to the succeeded + status (or requires_capture, if capture_method is set to manual). + If the confirmation_method is automatic, payment may be attempted + using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) + and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). + After next_actions are handled by the client, no additional + confirmation is required to complete the payment. + If the confirmation_method is manual, all payment attempts must be + initiated using a secret key. + If any actions are required for the payment, the PaymentIntent will + return to the requires_confirmation state + after those actions are completed. Your server needs to then + explicitly re-confirm the PaymentIntent to initiate the next payment + attempt. + """ + return cast( + "PaymentIntent", + self._request( + "post", + "/v1/payment_intents/{intent}/confirm".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_confirm_async( + cls, intent: str, **params: Unpack["PaymentIntent.ConfirmParams"] + ) -> "PaymentIntent": + """ + Confirm that your customer intends to pay with current or provided + payment method. Upon confirmation, the PaymentIntent will attempt to initiate + a payment. + If the selected payment method requires additional authentication steps, the + PaymentIntent will transition to the requires_action status and + suggest additional actions via next_action. If payment fails, + the PaymentIntent transitions to the requires_payment_method status or the + canceled status if the confirmation limit is reached. If + payment succeeds, the PaymentIntent will transition to the succeeded + status (or requires_capture, if capture_method is set to manual). + If the confirmation_method is automatic, payment may be attempted + using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) + and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). + After next_actions are handled by the client, no additional + confirmation is required to complete the payment. + If the confirmation_method is manual, all payment attempts must be + initiated using a secret key. + If any actions are required for the payment, the PaymentIntent will + return to the requires_confirmation state + after those actions are completed. Your server needs to then + explicitly re-confirm the PaymentIntent to initiate the next payment + attempt. + """ + return cast( + "PaymentIntent", + await cls._static_request_async( + "post", + "/v1/payment_intents/{intent}/confirm".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def confirm_async( + intent: str, **params: Unpack["PaymentIntent.ConfirmParams"] + ) -> "PaymentIntent": + """ + Confirm that your customer intends to pay with current or provided + payment method. Upon confirmation, the PaymentIntent will attempt to initiate + a payment. + If the selected payment method requires additional authentication steps, the + PaymentIntent will transition to the requires_action status and + suggest additional actions via next_action. If payment fails, + the PaymentIntent transitions to the requires_payment_method status or the + canceled status if the confirmation limit is reached. If + payment succeeds, the PaymentIntent will transition to the succeeded + status (or requires_capture, if capture_method is set to manual). + If the confirmation_method is automatic, payment may be attempted + using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) + and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). + After next_actions are handled by the client, no additional + confirmation is required to complete the payment. + If the confirmation_method is manual, all payment attempts must be + initiated using a secret key. + If any actions are required for the payment, the PaymentIntent will + return to the requires_confirmation state + after those actions are completed. Your server needs to then + explicitly re-confirm the PaymentIntent to initiate the next payment + attempt. + """ + ... + + @overload + async def confirm_async( + self, **params: Unpack["PaymentIntent.ConfirmParams"] + ) -> "PaymentIntent": + """ + Confirm that your customer intends to pay with current or provided + payment method. Upon confirmation, the PaymentIntent will attempt to initiate + a payment. + If the selected payment method requires additional authentication steps, the + PaymentIntent will transition to the requires_action status and + suggest additional actions via next_action. If payment fails, + the PaymentIntent transitions to the requires_payment_method status or the + canceled status if the confirmation limit is reached. If + payment succeeds, the PaymentIntent will transition to the succeeded + status (or requires_capture, if capture_method is set to manual). + If the confirmation_method is automatic, payment may be attempted + using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) + and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). + After next_actions are handled by the client, no additional + confirmation is required to complete the payment. + If the confirmation_method is manual, all payment attempts must be + initiated using a secret key. + If any actions are required for the payment, the PaymentIntent will + return to the requires_confirmation state + after those actions are completed. Your server needs to then + explicitly re-confirm the PaymentIntent to initiate the next payment + attempt. + """ + ... + + @class_method_variant("_cls_confirm_async") + async def confirm_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.ConfirmParams"] + ) -> "PaymentIntent": + """ + Confirm that your customer intends to pay with current or provided + payment method. Upon confirmation, the PaymentIntent will attempt to initiate + a payment. + If the selected payment method requires additional authentication steps, the + PaymentIntent will transition to the requires_action status and + suggest additional actions via next_action. If payment fails, + the PaymentIntent transitions to the requires_payment_method status or the + canceled status if the confirmation limit is reached. If + payment succeeds, the PaymentIntent will transition to the succeeded + status (or requires_capture, if capture_method is set to manual). + If the confirmation_method is automatic, payment may be attempted + using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) + and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). + After next_actions are handled by the client, no additional + confirmation is required to complete the payment. + If the confirmation_method is manual, all payment attempts must be + initiated using a secret key. + If any actions are required for the payment, the PaymentIntent will + return to the requires_confirmation state + after those actions are completed. Your server needs to then + explicitly re-confirm the PaymentIntent to initiate the next payment + attempt. + """ + return cast( + "PaymentIntent", + await self._request_async( + "post", + "/v1/payment_intents/{intent}/confirm".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def create( + cls, **params: Unpack["PaymentIntent.CreateParams"] + ) -> "PaymentIntent": + """ + Creates a PaymentIntent object. + + After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) + to continue the payment. Learn more about the available payment flows + with the Payment Intents API. + + When you use confirm=true during creation, it's equivalent to creating + and confirming the PaymentIntent in the same call. You can use any parameters + available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply + confirm=true. + """ + return cast( + "PaymentIntent", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["PaymentIntent.CreateParams"] + ) -> "PaymentIntent": + """ + Creates a PaymentIntent object. + + After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) + to continue the payment. Learn more about the available payment flows + with the Payment Intents API. + + When you use confirm=true during creation, it's equivalent to creating + and confirming the PaymentIntent in the same call. You can use any parameters + available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply + confirm=true. + """ + return cast( + "PaymentIntent", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def _cls_increment_authorization( + cls, + intent: str, + **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] + ) -> "PaymentIntent": + """ + Perform an incremental authorization on an eligible + [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) + must be true. + + Incremental authorizations attempt to increase the authorized amount on + your customer's card to the new, higher amount provided. Similar to the + initial authorization, incremental authorizations can be declined. A + single PaymentIntent can call this endpoint multiple times to further + increase the authorized amount. + + If the incremental authorization succeeds, the PaymentIntent object + returns with the updated + [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + If the incremental authorization fails, a + [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other + fields on the PaymentIntent or Charge update. The PaymentIntent + object remains capturable for the previously authorized amount. + + Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. + After it's captured, a PaymentIntent can no longer be incremented. + + Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). + """ + return cast( + "PaymentIntent", + cls._static_request( + "post", + "/v1/payment_intents/{intent}/increment_authorization".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + def increment_authorization( + intent: str, + **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] + ) -> "PaymentIntent": + """ + Perform an incremental authorization on an eligible + [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) + must be true. + + Incremental authorizations attempt to increase the authorized amount on + your customer's card to the new, higher amount provided. Similar to the + initial authorization, incremental authorizations can be declined. A + single PaymentIntent can call this endpoint multiple times to further + increase the authorized amount. + + If the incremental authorization succeeds, the PaymentIntent object + returns with the updated + [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + If the incremental authorization fails, a + [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other + fields on the PaymentIntent or Charge update. The PaymentIntent + object remains capturable for the previously authorized amount. + + Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. + After it's captured, a PaymentIntent can no longer be incremented. + + Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). + """ + ... + + @overload + def increment_authorization( + self, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": """ - Confirm that your customer intends to pay with current or provided - payment method. Upon confirmation, the PaymentIntent will attempt to initiate - a payment. - If the selected payment method requires additional authentication steps, the - PaymentIntent will transition to the requires_action status and - suggest additional actions via next_action. If payment fails, - the PaymentIntent transitions to the requires_payment_method status or the - canceled status if the confirmation limit is reached. If - payment succeeds, the PaymentIntent will transition to the succeeded - status (or requires_capture, if capture_method is set to manual). - If the confirmation_method is automatic, payment may be attempted - using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) - and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). - After next_actions are handled by the client, no additional - confirmation is required to complete the payment. - If the confirmation_method is manual, all payment attempts must be - initiated using a secret key. - If any actions are required for the payment, the PaymentIntent will - return to the requires_confirmation state - after those actions are completed. Your server needs to then - explicitly re-confirm the PaymentIntent to initiate the next payment - attempt. + Perform an incremental authorization on an eligible + [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) + must be true. + + Incremental authorizations attempt to increase the authorized amount on + your customer's card to the new, higher amount provided. Similar to the + initial authorization, incremental authorizations can be declined. A + single PaymentIntent can call this endpoint multiple times to further + increase the authorized amount. + + If the incremental authorization succeeds, the PaymentIntent object + returns with the updated + [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + If the incremental authorization fails, a + [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other + fields on the PaymentIntent or Charge update. The PaymentIntent + object remains capturable for the previously authorized amount. + + Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. + After it's captured, a PaymentIntent can no longer be incremented. + + Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). """ ... - @class_method_variant("_cls_confirm") - def confirm( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["PaymentIntent.ConfirmParams"] + @class_method_variant("_cls_increment_authorization") + def increment_authorization( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": """ - Confirm that your customer intends to pay with current or provided - payment method. Upon confirmation, the PaymentIntent will attempt to initiate - a payment. - If the selected payment method requires additional authentication steps, the - PaymentIntent will transition to the requires_action status and - suggest additional actions via next_action. If payment fails, - the PaymentIntent transitions to the requires_payment_method status or the - canceled status if the confirmation limit is reached. If - payment succeeds, the PaymentIntent will transition to the succeeded - status (or requires_capture, if capture_method is set to manual). - If the confirmation_method is automatic, payment may be attempted - using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) - and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). - After next_actions are handled by the client, no additional - confirmation is required to complete the payment. - If the confirmation_method is manual, all payment attempts must be - initiated using a secret key. - If any actions are required for the payment, the PaymentIntent will - return to the requires_confirmation state - after those actions are completed. Your server needs to then - explicitly re-confirm the PaymentIntent to initiate the next payment - attempt. - """ - return cast( - "PaymentIntent", - self._request( - "post", - "/v1/payment_intents/{intent}/confirm".format( - intent=sanitize_id(self.get("id")) - ), - params=params, - ), - ) + Perform an incremental authorization on an eligible + [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) + must be true. - @classmethod - def create( - cls, **params: Unpack["PaymentIntent.CreateParams"] - ) -> "PaymentIntent": - """ - Creates a PaymentIntent object. + Incremental authorizations attempt to increase the authorized amount on + your customer's card to the new, higher amount provided. Similar to the + initial authorization, incremental authorizations can be declined. A + single PaymentIntent can call this endpoint multiple times to further + increase the authorized amount. - After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) - to continue the payment. Learn more about the available payment flows - with the Payment Intents API. + If the incremental authorization succeeds, the PaymentIntent object + returns with the updated + [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + If the incremental authorization fails, a + [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other + fields on the PaymentIntent or Charge update. The PaymentIntent + object remains capturable for the previously authorized amount. - When you use confirm=true during creation, it's equivalent to creating - and confirming the PaymentIntent in the same call. You can use any parameters - available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply - confirm=true. + Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. + After it's captured, a PaymentIntent can no longer be incremented. + + Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). """ return cast( "PaymentIntent", - cls._static_request( + self._request( "post", - cls.class_url(), + "/v1/payment_intents/{intent}/increment_authorization".format( + intent=sanitize_id(self.get("id")) + ), params=params, ), ) @classmethod - def _cls_increment_authorization( + async def _cls_increment_authorization_async( cls, intent: str, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] @@ -8896,7 +9411,7 @@ def _cls_increment_authorization( """ return cast( "PaymentIntent", - cls._static_request( + await cls._static_request_async( "post", "/v1/payment_intents/{intent}/increment_authorization".format( intent=sanitize_id(intent) @@ -8907,7 +9422,7 @@ def _cls_increment_authorization( @overload @staticmethod - def increment_authorization( + async def increment_authorization_async( intent: str, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": @@ -8940,7 +9455,7 @@ def increment_authorization( ... @overload - def increment_authorization( + async def increment_authorization_async( self, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": """ @@ -8971,8 +9486,8 @@ def increment_authorization( """ ... - @class_method_variant("_cls_increment_authorization") - def increment_authorization( # pyright: ignore[reportGeneralTypeIssues] + @class_method_variant("_cls_increment_authorization_async") + async def increment_authorization_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": """ @@ -9003,7 +9518,7 @@ def increment_authorization( # pyright: ignore[reportGeneralTypeIssues] """ return cast( "PaymentIntent", - self._request( + await self._request_async( "post", "/v1/payment_intents/{intent}/increment_authorization".format( intent=sanitize_id(self.get("id")) @@ -9033,6 +9548,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["PaymentIntent.ListParams"] + ) -> ListObject["PaymentIntent"]: + """ + Returns a list of PaymentIntents. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["PaymentIntent.ModifyParams"] @@ -9056,6 +9592,29 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["PaymentIntent.ModifyParams"] + ) -> "PaymentIntent": + """ + Updates properties on a PaymentIntent object without confirming. + + Depending on which properties you update, you might need to confirm the + PaymentIntent again. For example, updating the payment_method + always requires you to confirm the PaymentIntent again. If you prefer to + update and confirm at the same time, we recommend updating properties through + the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "PaymentIntent", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["PaymentIntent.RetrieveParams"] @@ -9071,6 +9630,21 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["PaymentIntent.RetrieveParams"] + ) -> "PaymentIntent": + """ + Retrieves the details of a PaymentIntent that has previously been created. + + You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. + + If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def _cls_verify_microdeposits( cls, @@ -9129,6 +9703,64 @@ def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_verify_microdeposits_async( + cls, + intent: str, + **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] + ) -> "PaymentIntent": + """ + Verifies microdeposits on a PaymentIntent object. + """ + return cast( + "PaymentIntent", + await cls._static_request_async( + "post", + "/v1/payment_intents/{intent}/verify_microdeposits".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def verify_microdeposits_async( + intent: str, + **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] + ) -> "PaymentIntent": + """ + Verifies microdeposits on a PaymentIntent object. + """ + ... + + @overload + async def verify_microdeposits_async( + self, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] + ) -> "PaymentIntent": + """ + Verifies microdeposits on a PaymentIntent object. + """ + ... + + @class_method_variant("_cls_verify_microdeposits_async") + async def verify_microdeposits_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] + ) -> "PaymentIntent": + """ + Verifies microdeposits on a PaymentIntent object. + """ + return cast( + "PaymentIntent", + await self._request_async( + "post", + "/v1/payment_intents/{intent}/verify_microdeposits".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def search( cls, *args, **kwargs: Unpack["PaymentIntent.SearchParams"] @@ -9143,12 +9775,32 @@ def search( search_url="/v1/payment_intents/search", *args, **kwargs ) + @classmethod + async def search_async( + cls, *args, **kwargs: Unpack["PaymentIntent.SearchParams"] + ) -> SearchResultObject["PaymentIntent"]: + """ + Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return await cls._search_async( + search_url="/v1/payment_intents/search", *args, **kwargs + ) + @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["PaymentIntent.SearchParams"] ) -> Iterator["PaymentIntent"]: return cls.search(*args, **kwargs).auto_paging_iter() + @classmethod + async def search_auto_paging_iter_async( + cls, *args, **kwargs: Unpack["PaymentIntent.SearchParams"] + ) -> AsyncIterator["PaymentIntent"]: + return (await cls.search_async(*args, **kwargs)).auto_paging_iter() + _inner_class_types = { "amount_details": AmountDetails, "automatic_payment_methods": AutomaticPaymentMethods, diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 6916c5495..e23dd0236 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -6561,6 +6561,26 @@ def list( ), ) + async def list_async( + self, + params: "PaymentIntentService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PaymentIntent]: + """ + Returns a list of PaymentIntents. + """ + return cast( + ListObject[PaymentIntent], + await self._request_async( + "get", + "/v1/payment_intents", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "PaymentIntentService.CreateParams", @@ -6590,6 +6610,35 @@ def create( ), ) + async def create_async( + self, + params: "PaymentIntentService.CreateParams", + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Creates a PaymentIntent object. + + After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) + to continue the payment. Learn more about the available payment flows + with the Payment Intents API. + + When you use confirm=true during creation, it's equivalent to creating + and confirming the PaymentIntent in the same call. You can use any parameters + available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply + confirm=true. + """ + return cast( + PaymentIntent, + await self._request_async( + "post", + "/v1/payment_intents", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, intent: str, @@ -6617,6 +6666,33 @@ def retrieve( ), ) + async def retrieve_async( + self, + intent: str, + params: "PaymentIntentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Retrieves the details of a PaymentIntent that has previously been created. + + You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. + + If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. + """ + return cast( + PaymentIntent, + await self._request_async( + "get", + "/v1/payment_intents/{intent}".format( + intent=sanitize_id(intent), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, intent: str, @@ -6646,6 +6722,35 @@ def update( ), ) + async def update_async( + self, + intent: str, + params: "PaymentIntentService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Updates properties on a PaymentIntent object without confirming. + + Depending on which properties you update, you might need to confirm the + PaymentIntent again. For example, updating the payment_method + always requires you to confirm the PaymentIntent again. If you prefer to + update and confirm at the same time, we recommend updating properties through + the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. + """ + return cast( + PaymentIntent, + await self._request_async( + "post", + "/v1/payment_intents/{intent}".format( + intent=sanitize_id(intent), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def search( self, params: "PaymentIntentService.SearchParams", @@ -6669,6 +6774,29 @@ def search( ), ) + async def search_async( + self, + params: "PaymentIntentService.SearchParams", + options: RequestOptions = {}, + ) -> SearchResultObject[PaymentIntent]: + """ + Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return cast( + SearchResultObject[PaymentIntent], + await self._request_async( + "get", + "/v1/payment_intents/search", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def apply_customer_balance( self, intent: str, @@ -6692,6 +6820,29 @@ def apply_customer_balance( ), ) + async def apply_customer_balance_async( + self, + intent: str, + params: "PaymentIntentService.ApplyCustomerBalanceParams" = {}, + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Manually reconcile the remaining amount for a customer_balance PaymentIntent. + """ + return cast( + PaymentIntent, + await self._request_async( + "post", + "/v1/payment_intents/{intent}/apply_customer_balance".format( + intent=sanitize_id(intent), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, intent: str, @@ -6719,6 +6870,33 @@ def cancel( ), ) + async def cancel_async( + self, + intent: str, + params: "PaymentIntentService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. + + 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://stripe.com/docs/api/checkout/sessions/expire) instead. + """ + return cast( + PaymentIntent, + await self._request_async( + "post", + "/v1/payment_intents/{intent}/cancel".format( + intent=sanitize_id(intent), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def capture( self, intent: str, @@ -6746,6 +6924,33 @@ def capture( ), ) + async def capture_async( + self, + intent: str, + params: "PaymentIntentService.CaptureParams" = {}, + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. + + Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. + + Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). + """ + return cast( + PaymentIntent, + await self._request_async( + "post", + "/v1/payment_intents/{intent}/capture".format( + intent=sanitize_id(intent), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def confirm( self, intent: str, @@ -6790,6 +6995,50 @@ def confirm( ), ) + async def confirm_async( + self, + intent: str, + params: "PaymentIntentService.ConfirmParams" = {}, + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Confirm that your customer intends to pay with current or provided + payment method. Upon confirmation, the PaymentIntent will attempt to initiate + a payment. + If the selected payment method requires additional authentication steps, the + PaymentIntent will transition to the requires_action status and + suggest additional actions via next_action. If payment fails, + the PaymentIntent transitions to the requires_payment_method status or the + canceled status if the confirmation limit is reached. If + payment succeeds, the PaymentIntent will transition to the succeeded + status (or requires_capture, if capture_method is set to manual). + If the confirmation_method is automatic, payment may be attempted + using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) + and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). + After next_actions are handled by the client, no additional + confirmation is required to complete the payment. + If the confirmation_method is manual, all payment attempts must be + initiated using a secret key. + If any actions are required for the payment, the PaymentIntent will + return to the requires_confirmation state + after those actions are completed. Your server needs to then + explicitly re-confirm the PaymentIntent to initiate the next payment + attempt. + """ + return cast( + PaymentIntent, + await self._request_async( + "post", + "/v1/payment_intents/{intent}/confirm".format( + intent=sanitize_id(intent), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def increment_authorization( self, intent: str, @@ -6836,6 +7085,52 @@ def increment_authorization( ), ) + async def increment_authorization_async( + self, + intent: str, + params: "PaymentIntentService.IncrementAuthorizationParams", + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Perform an incremental authorization on an eligible + [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) + must be true. + + Incremental authorizations attempt to increase the authorized amount on + your customer's card to the new, higher amount provided. Similar to the + initial authorization, incremental authorizations can be declined. A + single PaymentIntent can call this endpoint multiple times to further + increase the authorized amount. + + If the incremental authorization succeeds, the PaymentIntent object + returns with the updated + [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + If the incremental authorization fails, a + [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other + fields on the PaymentIntent or Charge update. The PaymentIntent + object remains capturable for the previously authorized amount. + + Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. + After it's captured, a PaymentIntent can no longer be incremented. + + Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). + """ + return cast( + PaymentIntent, + await self._request_async( + "post", + "/v1/payment_intents/{intent}/increment_authorization".format( + intent=sanitize_id(intent), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def verify_microdeposits( self, intent: str, @@ -6858,3 +7153,26 @@ def verify_microdeposits( options=options, ), ) + + async def verify_microdeposits_async( + self, + intent: str, + params: "PaymentIntentService.VerifyMicrodepositsParams" = {}, + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Verifies microdeposits on a PaymentIntent object. + """ + return cast( + PaymentIntent, + await self._request_async( + "post", + "/v1/payment_intents/{intent}/verify_microdeposits".format( + intent=sanitize_id(intent), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index f2dee5ab0..b8d0ae6f2 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -2472,6 +2472,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["PaymentLink.CreateParams"] + ) -> "PaymentLink": + """ + Creates a payment link. + """ + return cast( + "PaymentLink", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["PaymentLink.ListParams"] @@ -2493,6 +2509,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["PaymentLink.ListParams"] + ) -> ListObject["PaymentLink"]: + """ + Returns a list of your payment links. + """ + 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 _cls_list_line_items( cls, @@ -2550,6 +2587,63 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_list_line_items_async( + cls, + payment_link: str, + **params: Unpack["PaymentLink.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["LineItem"], + await cls._static_request_async( + "get", + "/v1/payment_links/{payment_link}/line_items".format( + payment_link=sanitize_id(payment_link) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def list_line_items_async( + payment_link: str, **params: Unpack["PaymentLink.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + ... + + @overload + async def list_line_items_async( + self, **params: Unpack["PaymentLink.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + ... + + @class_method_variant("_cls_list_line_items_async") + async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentLink.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["LineItem"], + await self._request_async( + "get", + "/v1/payment_links/{payment_link}/line_items".format( + payment_link=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def modify( cls, id: str, **params: Unpack["PaymentLink.ModifyParams"] @@ -2567,6 +2661,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["PaymentLink.ModifyParams"] + ) -> "PaymentLink": + """ + Updates a payment link. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "PaymentLink", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["PaymentLink.RetrieveParams"] @@ -2578,6 +2689,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["PaymentLink.RetrieveParams"] + ) -> "PaymentLink": + """ + Retrieve a payment link. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "after_completion": AfterCompletion, "automatic_tax": AutomaticTax, diff --git a/stripe/_payment_link_line_item_service.py b/stripe/_payment_link_line_item_service.py index 655d77f79..93bdead2e 100644 --- a/stripe/_payment_link_line_item_service.py +++ b/stripe/_payment_link_line_item_service.py @@ -50,3 +50,26 @@ def list( options=options, ), ) + + async def list_async( + self, + payment_link: str, + params: "PaymentLinkLineItemService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[LineItem]: + """ + When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject[LineItem], + await self._request_async( + "get", + "/v1/payment_links/{payment_link}/line_items".format( + payment_link=sanitize_id(payment_link), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 3dd6d8a5b..cfcea8d8c 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -1672,6 +1672,26 @@ def list( ), ) + async def list_async( + self, + params: "PaymentLinkService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PaymentLink]: + """ + Returns a list of your payment links. + """ + return cast( + ListObject[PaymentLink], + await self._request_async( + "get", + "/v1/payment_links", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "PaymentLinkService.CreateParams", @@ -1692,6 +1712,26 @@ def create( ), ) + async def create_async( + self, + params: "PaymentLinkService.CreateParams", + options: RequestOptions = {}, + ) -> PaymentLink: + """ + Creates a payment link. + """ + return cast( + PaymentLink, + await self._request_async( + "post", + "/v1/payment_links", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, payment_link: str, @@ -1715,6 +1755,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + payment_link: str, + params: "PaymentLinkService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PaymentLink: + """ + Retrieve a payment link. + """ + return cast( + PaymentLink, + await self._request_async( + "get", + "/v1/payment_links/{payment_link}".format( + payment_link=sanitize_id(payment_link), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, payment_link: str, @@ -1737,3 +1800,26 @@ def update( options=options, ), ) + + async def update_async( + self, + payment_link: str, + params: "PaymentLinkService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> PaymentLink: + """ + Updates a payment link. + """ + return cast( + PaymentLink, + await self._request_async( + "post", + "/v1/payment_links/{payment_link}".format( + payment_link=sanitize_id(payment_link), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 8bb209daf..5697697aa 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -1986,6 +1986,111 @@ def attach( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_attach_async( + cls, + payment_method: str, + **params: Unpack["PaymentMethod.AttachParams"] + ) -> "PaymentMethod": + """ + Attaches a PaymentMethod object to a Customer. + + To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) + or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). + These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach + endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for + future use, which makes later declines and payment friction more likely. + See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up + future payments. + + To use this PaymentMethod as the default for invoice or subscription payments, + set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), + on the Customer to the PaymentMethod's ID. + """ + return cast( + "PaymentMethod", + await cls._static_request_async( + "post", + "/v1/payment_methods/{payment_method}/attach".format( + payment_method=sanitize_id(payment_method) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def attach_async( + payment_method: str, **params: Unpack["PaymentMethod.AttachParams"] + ) -> "PaymentMethod": + """ + Attaches a PaymentMethod object to a Customer. + + To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) + or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). + These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach + endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for + future use, which makes later declines and payment friction more likely. + See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up + future payments. + + To use this PaymentMethod as the default for invoice or subscription payments, + set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), + on the Customer to the PaymentMethod's ID. + """ + ... + + @overload + async def attach_async( + self, **params: Unpack["PaymentMethod.AttachParams"] + ) -> "PaymentMethod": + """ + Attaches a PaymentMethod object to a Customer. + + To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) + or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). + These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach + endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for + future use, which makes later declines and payment friction more likely. + See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up + future payments. + + To use this PaymentMethod as the default for invoice or subscription payments, + set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), + on the Customer to the PaymentMethod's ID. + """ + ... + + @class_method_variant("_cls_attach_async") + async def attach_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentMethod.AttachParams"] + ) -> "PaymentMethod": + """ + Attaches a PaymentMethod object to a Customer. + + To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) + or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). + These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach + endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for + future use, which makes later declines and payment friction more likely. + See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up + future payments. + + To use this PaymentMethod as the default for invoice or subscription payments, + set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), + on the Customer to the PaymentMethod's ID. + """ + return cast( + "PaymentMethod", + await self._request_async( + "post", + "/v1/payment_methods/{payment_method}/attach".format( + payment_method=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create( cls, **params: Unpack["PaymentMethod.CreateParams"] @@ -2004,6 +2109,24 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["PaymentMethod.CreateParams"] + ) -> "PaymentMethod": + """ + Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. + + Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment. + """ + return cast( + "PaymentMethod", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_detach( cls, @@ -2061,6 +2184,63 @@ def detach( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_detach_async( + cls, + payment_method: str, + **params: Unpack["PaymentMethod.DetachParams"] + ) -> "PaymentMethod": + """ + Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + """ + return cast( + "PaymentMethod", + await cls._static_request_async( + "post", + "/v1/payment_methods/{payment_method}/detach".format( + payment_method=sanitize_id(payment_method) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def detach_async( + payment_method: str, **params: Unpack["PaymentMethod.DetachParams"] + ) -> "PaymentMethod": + """ + Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + """ + ... + + @overload + async def detach_async( + self, **params: Unpack["PaymentMethod.DetachParams"] + ) -> "PaymentMethod": + """ + Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + """ + ... + + @class_method_variant("_cls_detach_async") + async def detach_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentMethod.DetachParams"] + ) -> "PaymentMethod": + """ + Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + """ + return cast( + "PaymentMethod", + await self._request_async( + "post", + "/v1/payment_methods/{payment_method}/detach".format( + payment_method=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["PaymentMethod.ListParams"] @@ -2082,6 +2262,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["PaymentMethod.ListParams"] + ) -> ListObject["PaymentMethod"]: + """ + Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["PaymentMethod.ModifyParams"] @@ -2099,6 +2300,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["PaymentMethod.ModifyParams"] + ) -> "PaymentMethod": + """ + Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "PaymentMethod", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["PaymentMethod.RetrieveParams"] @@ -2110,6 +2328,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["PaymentMethod.RetrieveParams"] + ) -> "PaymentMethod": + """ + Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer) + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "acss_debit": AcssDebit, "affirm": Affirm, diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 89bbeceeb..7bc9677d5 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -2347,6 +2347,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["PaymentMethodConfiguration.CreateParams"] + ) -> "PaymentMethodConfiguration": + """ + Creates a payment method configuration + """ + return cast( + "PaymentMethodConfiguration", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["PaymentMethodConfiguration.ListParams"] @@ -2368,6 +2384,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["PaymentMethodConfiguration.ListParams"] + ) -> ListObject["PaymentMethodConfiguration"]: + """ + List payment method configurations + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, @@ -2387,6 +2424,25 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, + id: str, + **params: Unpack["PaymentMethodConfiguration.ModifyParams"] + ) -> "PaymentMethodConfiguration": + """ + Update payment method configuration + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "PaymentMethodConfiguration", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, @@ -2400,6 +2456,19 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, + id: str, + **params: Unpack["PaymentMethodConfiguration.RetrieveParams"] + ) -> "PaymentMethodConfiguration": + """ + Retrieve payment method configuration + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "acss_debit": AcssDebit, "affirm": Affirm, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index 842dfee47..e23604a23 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -1442,6 +1442,26 @@ def list( ), ) + async def list_async( + self, + params: "PaymentMethodConfigurationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PaymentMethodConfiguration]: + """ + List payment method configurations + """ + return cast( + ListObject[PaymentMethodConfiguration], + await self._request_async( + "get", + "/v1/payment_method_configurations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "PaymentMethodConfigurationService.CreateParams" = {}, @@ -1462,6 +1482,26 @@ def create( ), ) + async def create_async( + self, + params: "PaymentMethodConfigurationService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> PaymentMethodConfiguration: + """ + Creates a payment method configuration + """ + return cast( + PaymentMethodConfiguration, + await self._request_async( + "post", + "/v1/payment_method_configurations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, configuration: str, @@ -1485,6 +1525,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + configuration: str, + params: "PaymentMethodConfigurationService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PaymentMethodConfiguration: + """ + Retrieve payment method configuration + """ + return cast( + PaymentMethodConfiguration, + await self._request_async( + "get", + "/v1/payment_method_configurations/{configuration}".format( + configuration=sanitize_id(configuration), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, configuration: str, @@ -1507,3 +1570,26 @@ def update( options=options, ), ) + + async def update_async( + self, + configuration: str, + params: "PaymentMethodConfigurationService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> PaymentMethodConfiguration: + """ + Update payment method configuration + """ + return cast( + PaymentMethodConfiguration, + await self._request_async( + "post", + "/v1/payment_method_configurations/{configuration}".format( + configuration=sanitize_id(configuration), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payment_method_domain.py b/stripe/_payment_method_domain.py index 4f69771af..c92a4c5c2 100644 --- a/stripe/_payment_method_domain.py +++ b/stripe/_payment_method_domain.py @@ -214,6 +214,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["PaymentMethodDomain.CreateParams"] + ) -> "PaymentMethodDomain": + """ + Creates a payment method domain. + """ + return cast( + "PaymentMethodDomain", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["PaymentMethodDomain.ListParams"] @@ -235,6 +251,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["PaymentMethodDomain.ListParams"] + ) -> ListObject["PaymentMethodDomain"]: + """ + Lists the details of existing payment method domains. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["PaymentMethodDomain.ModifyParams"] @@ -252,6 +289,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["PaymentMethodDomain.ModifyParams"] + ) -> "PaymentMethodDomain": + """ + Updates an existing payment method domain. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "PaymentMethodDomain", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["PaymentMethodDomain.RetrieveParams"] @@ -263,6 +317,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["PaymentMethodDomain.RetrieveParams"] + ) -> "PaymentMethodDomain": + """ + Retrieves the details of an existing payment method domain. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def _cls_validate( cls, @@ -341,6 +406,84 @@ def validate( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_validate_async( + cls, + payment_method_domain: str, + **params: Unpack["PaymentMethodDomain.ValidateParams"] + ) -> "PaymentMethodDomain": + """ + Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements for this domain until it is active. + + To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + + Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). + """ + return cast( + "PaymentMethodDomain", + await cls._static_request_async( + "post", + "/v1/payment_method_domains/{payment_method_domain}/validate".format( + payment_method_domain=sanitize_id(payment_method_domain) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def validate_async( + payment_method_domain: str, + **params: Unpack["PaymentMethodDomain.ValidateParams"] + ) -> "PaymentMethodDomain": + """ + Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements for this domain until it is active. + + To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + + Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). + """ + ... + + @overload + async def validate_async( + self, **params: Unpack["PaymentMethodDomain.ValidateParams"] + ) -> "PaymentMethodDomain": + """ + Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements for this domain until it is active. + + To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + + Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). + """ + ... + + @class_method_variant("_cls_validate_async") + async def validate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentMethodDomain.ValidateParams"] + ) -> "PaymentMethodDomain": + """ + Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements for this domain until it is active. + + To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + + Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). + """ + return cast( + "PaymentMethodDomain", + await self._request_async( + "post", + "/v1/payment_method_domains/{payment_method_domain}/validate".format( + payment_method_domain=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + _inner_class_types = { "apple_pay": ApplePay, "google_pay": GooglePay, diff --git a/stripe/_payment_method_domain_service.py b/stripe/_payment_method_domain_service.py index a4c0283dc..24692f54a 100644 --- a/stripe/_payment_method_domain_service.py +++ b/stripe/_payment_method_domain_service.py @@ -92,6 +92,26 @@ def list( ), ) + async def list_async( + self, + params: "PaymentMethodDomainService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PaymentMethodDomain]: + """ + Lists the details of existing payment method domains. + """ + return cast( + ListObject[PaymentMethodDomain], + await self._request_async( + "get", + "/v1/payment_method_domains", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "PaymentMethodDomainService.CreateParams", @@ -112,6 +132,26 @@ def create( ), ) + async def create_async( + self, + params: "PaymentMethodDomainService.CreateParams", + options: RequestOptions = {}, + ) -> PaymentMethodDomain: + """ + Creates a payment method domain. + """ + return cast( + PaymentMethodDomain, + await self._request_async( + "post", + "/v1/payment_method_domains", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, payment_method_domain: str, @@ -135,6 +175,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + payment_method_domain: str, + params: "PaymentMethodDomainService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PaymentMethodDomain: + """ + Retrieves the details of an existing payment method domain. + """ + return cast( + PaymentMethodDomain, + await self._request_async( + "get", + "/v1/payment_method_domains/{payment_method_domain}".format( + payment_method_domain=sanitize_id(payment_method_domain), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, payment_method_domain: str, @@ -158,6 +221,29 @@ def update( ), ) + async def update_async( + self, + payment_method_domain: str, + params: "PaymentMethodDomainService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> PaymentMethodDomain: + """ + Updates an existing payment method domain. + """ + return cast( + PaymentMethodDomain, + await self._request_async( + "post", + "/v1/payment_method_domains/{payment_method_domain}".format( + payment_method_domain=sanitize_id(payment_method_domain), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def validate( self, payment_method_domain: str, @@ -185,3 +271,31 @@ def validate( options=options, ), ) + + async def validate_async( + self, + payment_method_domain: str, + params: "PaymentMethodDomainService.ValidateParams" = {}, + options: RequestOptions = {}, + ) -> PaymentMethodDomain: + """ + Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements for this domain until it is active. + + To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + + Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). + """ + return cast( + PaymentMethodDomain, + await self._request_async( + "post", + "/v1/payment_method_domains/{payment_method_domain}/validate".format( + payment_method_domain=sanitize_id(payment_method_domain), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 1094cf384..80db60433 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -823,6 +823,26 @@ def list( ), ) + async def list_async( + self, + params: "PaymentMethodService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PaymentMethod]: + """ + Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. + """ + return cast( + ListObject[PaymentMethod], + await self._request_async( + "get", + "/v1/payment_methods", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "PaymentMethodService.CreateParams" = {}, @@ -845,6 +865,28 @@ def create( ), ) + async def create_async( + self, + params: "PaymentMethodService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> PaymentMethod: + """ + Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. + + Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment. + """ + return cast( + PaymentMethod, + await self._request_async( + "post", + "/v1/payment_methods", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, payment_method: str, @@ -868,6 +910,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + payment_method: str, + params: "PaymentMethodService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PaymentMethod: + """ + Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer) + """ + return cast( + PaymentMethod, + await self._request_async( + "get", + "/v1/payment_methods/{payment_method}".format( + payment_method=sanitize_id(payment_method), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, payment_method: str, @@ -891,6 +956,29 @@ def update( ), ) + async def update_async( + self, + payment_method: str, + params: "PaymentMethodService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> PaymentMethod: + """ + Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. + """ + return cast( + PaymentMethod, + await self._request_async( + "post", + "/v1/payment_methods/{payment_method}".format( + payment_method=sanitize_id(payment_method), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def attach( self, payment_method: str, @@ -926,6 +1014,41 @@ def attach( ), ) + async def attach_async( + self, + payment_method: str, + params: "PaymentMethodService.AttachParams", + options: RequestOptions = {}, + ) -> PaymentMethod: + """ + Attaches a PaymentMethod object to a Customer. + + To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) + or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). + These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach + endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for + future use, which makes later declines and payment friction more likely. + See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up + future payments. + + To use this PaymentMethod as the default for invoice or subscription payments, + set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), + on the Customer to the PaymentMethod's ID. + """ + return cast( + PaymentMethod, + await self._request_async( + "post", + "/v1/payment_methods/{payment_method}/attach".format( + payment_method=sanitize_id(payment_method), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def detach( self, payment_method: str, @@ -948,3 +1071,26 @@ def detach( options=options, ), ) + + async def detach_async( + self, + payment_method: str, + params: "PaymentMethodService.DetachParams" = {}, + options: RequestOptions = {}, + ) -> PaymentMethod: + """ + Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + """ + return cast( + PaymentMethod, + await self._request_async( + "post", + "/v1/payment_methods/{payment_method}/detach".format( + payment_method=sanitize_id(payment_method), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payout.py b/stripe/_payout.py index 10fbd4b8b..6becddf37 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -330,6 +330,61 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, payout: str, **params: Unpack["Payout.CancelParams"] + ) -> "Payout": + """ + You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. + """ + return cast( + "Payout", + await cls._static_request_async( + "post", + "/v1/payouts/{payout}/cancel".format( + payout=sanitize_id(payout) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + payout: str, **params: Unpack["Payout.CancelParams"] + ) -> "Payout": + """ + You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["Payout.CancelParams"] + ) -> "Payout": + """ + You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Payout.CancelParams"] + ) -> "Payout": + """ + You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. + """ + return cast( + "Payout", + await self._request_async( + "post", + "/v1/payouts/{payout}/cancel".format( + payout=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create(cls, **params: Unpack["Payout.CreateParams"]) -> "Payout": """ @@ -348,6 +403,26 @@ def create(cls, **params: Unpack["Payout.CreateParams"]) -> "Payout": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Payout.CreateParams"] + ) -> "Payout": + """ + To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error. + + 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://stripe.com/docs/api#balance_object) details available and pending amounts by source type. + """ + return cast( + "Payout", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Payout.ListParams"] @@ -369,6 +444,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Payout.ListParams"] + ) -> ListObject["Payout"]: + """ + Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Payout.ModifyParams"] @@ -386,6 +482,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Payout.ModifyParams"] + ) -> "Payout": + """ + Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Payout", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Payout.RetrieveParams"] @@ -397,6 +510,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Payout.RetrieveParams"] + ) -> "Payout": + """ + Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list. Stripe returns the corresponding payout information. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def _cls_reverse( cls, payout: str, **params: Unpack["Payout.ReverseParams"] @@ -457,3 +581,66 @@ def reverse( # pyright: ignore[reportGeneralTypeIssues] params=params, ), ) + + @classmethod + async def _cls_reverse_async( + cls, payout: str, **params: Unpack["Payout.ReverseParams"] + ) -> "Payout": + """ + Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. + + By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. + """ + return cast( + "Payout", + await cls._static_request_async( + "post", + "/v1/payouts/{payout}/reverse".format( + payout=sanitize_id(payout) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def reverse_async( + payout: str, **params: Unpack["Payout.ReverseParams"] + ) -> "Payout": + """ + Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. + + By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. + """ + ... + + @overload + async def reverse_async( + self, **params: Unpack["Payout.ReverseParams"] + ) -> "Payout": + """ + Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. + + By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. + """ + ... + + @class_method_variant("_cls_reverse_async") + async def reverse_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Payout.ReverseParams"] + ) -> "Payout": + """ + Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. + + By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. + """ + return cast( + "Payout", + await self._request_async( + "post", + "/v1/payouts/{payout}/reverse".format( + payout=sanitize_id(self.get("id")) + ), + params=params, + ), + ) diff --git a/stripe/_payout_service.py b/stripe/_payout_service.py index a4ccae75d..2d579cd7a 100644 --- a/stripe/_payout_service.py +++ b/stripe/_payout_service.py @@ -170,6 +170,26 @@ def list( ), ) + async def list_async( + self, + params: "PayoutService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Payout]: + """ + Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first. + """ + return cast( + ListObject[Payout], + await self._request_async( + "get", + "/v1/payouts", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "PayoutService.CreateParams", @@ -194,6 +214,30 @@ def create( ), ) + async def create_async( + self, + params: "PayoutService.CreateParams", + options: RequestOptions = {}, + ) -> Payout: + """ + To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error. + + 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://stripe.com/docs/api#balance_object) details available and pending amounts by source type. + """ + return cast( + Payout, + await self._request_async( + "post", + "/v1/payouts", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, payout: str, @@ -215,6 +259,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + payout: str, + params: "PayoutService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Payout: + """ + Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list. Stripe returns the corresponding payout information. + """ + return cast( + Payout, + await self._request_async( + "get", + "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, payout: str, @@ -236,6 +301,27 @@ def update( ), ) + async def update_async( + self, + payout: str, + params: "PayoutService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Payout: + """ + Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. + """ + return cast( + Payout, + await self._request_async( + "post", + "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, payout: str, @@ -259,6 +345,29 @@ def cancel( ), ) + async def cancel_async( + self, + payout: str, + params: "PayoutService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> Payout: + """ + You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. + """ + return cast( + Payout, + await self._request_async( + "post", + "/v1/payouts/{payout}/cancel".format( + payout=sanitize_id(payout), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def reverse( self, payout: str, @@ -283,3 +392,28 @@ def reverse( options=options, ), ) + + async def reverse_async( + self, + payout: str, + params: "PayoutService.ReverseParams" = {}, + options: RequestOptions = {}, + ) -> Payout: + """ + Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. + + By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. + """ + return cast( + Payout, + await self._request_async( + "post", + "/v1/payouts/{payout}/reverse".format( + payout=sanitize_id(payout), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_plan.py b/stripe/_plan.py index c1b7a611d..7d2343e04 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -402,6 +402,22 @@ def create(cls, **params: Unpack["Plan.CreateParams"]) -> "Plan": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Plan.CreateParams"] + ) -> "Plan": + """ + You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. + """ + return cast( + "Plan", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Plan.DeleteParams"] @@ -447,6 +463,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["Plan.DeleteParams"] + ) -> "Plan": + """ + Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "Plan", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["Plan.DeleteParams"] + ) -> "Plan": + """ + Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["Plan.DeleteParams"] + ) -> "Plan": + """ + Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Plan.DeleteParams"] + ) -> "Plan": + """ + Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list(cls, **params: Unpack["Plan.ListParams"]) -> ListObject["Plan"]: """ @@ -466,6 +531,27 @@ def list(cls, **params: Unpack["Plan.ListParams"]) -> ListObject["Plan"]: return result + @classmethod + async def list_async( + cls, **params: Unpack["Plan.ListParams"] + ) -> ListObject["Plan"]: + """ + Returns a list of your plans. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify(cls, id: str, **params: Unpack["Plan.ModifyParams"]) -> "Plan": """ @@ -481,6 +567,23 @@ def modify(cls, id: str, **params: Unpack["Plan.ModifyParams"]) -> "Plan": ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Plan.ModifyParams"] + ) -> "Plan": + """ + Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Plan", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Plan.RetrieveParams"] @@ -492,4 +595,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Plan.RetrieveParams"] + ) -> "Plan": + """ + Retrieves the plan with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"tiers": Tier, "transform_usage": TransformUsage} diff --git a/stripe/_plan_service.py b/stripe/_plan_service.py index f27d9e25b..1e6e35759 100644 --- a/stripe/_plan_service.py +++ b/stripe/_plan_service.py @@ -255,6 +255,27 @@ def delete( ), ) + async def delete_async( + self, + plan: str, + params: "PlanService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Plan: + """ + Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. + """ + return cast( + Plan, + await self._request_async( + "delete", + "/v1/plans/{plan}".format(plan=sanitize_id(plan)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, plan: str, @@ -276,6 +297,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + plan: str, + params: "PlanService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Plan: + """ + Retrieves the plan with the given ID. + """ + return cast( + Plan, + await self._request_async( + "get", + "/v1/plans/{plan}".format(plan=sanitize_id(plan)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, plan: str, @@ -297,6 +339,27 @@ def update( ), ) + async def update_async( + self, + plan: str, + params: "PlanService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Plan: + """ + Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. + """ + return cast( + Plan, + await self._request_async( + "post", + "/v1/plans/{plan}".format(plan=sanitize_id(plan)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "PlanService.ListParams" = {}, @@ -317,6 +380,26 @@ def list( ), ) + async def list_async( + self, + params: "PlanService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Plan]: + """ + Returns a list of your plans. + """ + return cast( + ListObject[Plan], + await self._request_async( + "get", + "/v1/plans", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "PlanService.CreateParams", options: RequestOptions = {} ) -> Plan: @@ -334,3 +417,21 @@ def create( options=options, ), ) + + async def create_async( + self, params: "PlanService.CreateParams", options: RequestOptions = {} + ) -> Plan: + """ + You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. + """ + return cast( + Plan, + await self._request_async( + "post", + "/v1/plans", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_price.py b/stripe/_price.py index f19407a7b..955c35396 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -10,7 +10,16 @@ from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id -from typing import ClassVar, Dict, Iterator, List, Optional, Union, cast +from typing import ( + AsyncIterator, + ClassVar, + Dict, + Iterator, + List, + Optional, + Union, + cast, +) from typing_extensions import ( Literal, NotRequired, @@ -745,6 +754,22 @@ def create(cls, **params: Unpack["Price.CreateParams"]) -> "Price": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Price.CreateParams"] + ) -> "Price": + """ + Creates a new price for an existing product. The price can be recurring or one-time. + """ + return cast( + "Price", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list(cls, **params: Unpack["Price.ListParams"]) -> ListObject["Price"]: """ @@ -764,6 +789,27 @@ def list(cls, **params: Unpack["Price.ListParams"]) -> ListObject["Price"]: return result + @classmethod + async def list_async( + cls, **params: Unpack["Price.ListParams"] + ) -> ListObject["Price"]: + """ + Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Price.ModifyParams"] @@ -781,6 +827,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Price.ModifyParams"] + ) -> "Price": + """ + Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Price", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Price.RetrieveParams"] @@ -792,6 +855,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Price.RetrieveParams"] + ) -> "Price": + """ + Retrieves the price with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def search( cls, *args, **kwargs: Unpack["Price.SearchParams"] @@ -804,12 +878,32 @@ def search( """ return cls._search(search_url="/v1/prices/search", *args, **kwargs) + @classmethod + async def search_async( + cls, *args, **kwargs: Unpack["Price.SearchParams"] + ) -> SearchResultObject["Price"]: + """ + Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return await cls._search_async( + search_url="/v1/prices/search", *args, **kwargs + ) + @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["Price.SearchParams"] ) -> Iterator["Price"]: return cls.search(*args, **kwargs).auto_paging_iter() + @classmethod + async def search_auto_paging_iter_async( + cls, *args, **kwargs: Unpack["Price.SearchParams"] + ) -> AsyncIterator["Price"]: + return (await cls.search_async(*args, **kwargs)).auto_paging_iter() + _inner_class_types = { "currency_options": CurrencyOptions, "custom_unit_amount": CustomUnitAmount, diff --git a/stripe/_price_service.py b/stripe/_price_service.py index 8b9bb8d67..ce990af5f 100644 --- a/stripe/_price_service.py +++ b/stripe/_price_service.py @@ -503,6 +503,26 @@ def list( ), ) + async def list_async( + self, + params: "PriceService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Price]: + """ + Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false. + """ + return cast( + ListObject[Price], + await self._request_async( + "get", + "/v1/prices", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "PriceService.CreateParams", options: RequestOptions = {} ) -> Price: @@ -521,6 +541,24 @@ def create( ), ) + async def create_async( + self, params: "PriceService.CreateParams", options: RequestOptions = {} + ) -> Price: + """ + Creates a new price for an existing product. The price can be recurring or one-time. + """ + return cast( + Price, + await self._request_async( + "post", + "/v1/prices", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, price: str, @@ -542,6 +580,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + price: str, + params: "PriceService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Price: + """ + Retrieves the price with the given ID. + """ + return cast( + Price, + await self._request_async( + "get", + "/v1/prices/{price}".format(price=sanitize_id(price)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, price: str, @@ -563,6 +622,27 @@ def update( ), ) + async def update_async( + self, + price: str, + params: "PriceService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Price: + """ + Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. + """ + return cast( + Price, + await self._request_async( + "post", + "/v1/prices/{price}".format(price=sanitize_id(price)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def search( self, params: "PriceService.SearchParams", options: RequestOptions = {} ) -> SearchResultObject[Price]: @@ -583,3 +663,24 @@ def search( options=options, ), ) + + async def search_async( + self, params: "PriceService.SearchParams", options: RequestOptions = {} + ) -> SearchResultObject[Price]: + """ + Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return cast( + SearchResultObject[Price], + await self._request_async( + "get", + "/v1/prices/search", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_product.py b/stripe/_product.py index 04953c6ab..4609c2118 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -12,6 +12,7 @@ from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ( + AsyncIterator, ClassVar, Dict, Iterator, @@ -552,6 +553,22 @@ def create(cls, **params: Unpack["Product.CreateParams"]) -> "Product": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Product.CreateParams"] + ) -> "Product": + """ + Creates a new product object. + """ + return cast( + "Product", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Product.DeleteParams"] @@ -599,6 +616,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["Product.DeleteParams"] + ) -> "Product": + """ + Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "Product", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["Product.DeleteParams"] + ) -> "Product": + """ + Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["Product.DeleteParams"] + ) -> "Product": + """ + Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Product.DeleteParams"] + ) -> "Product": + """ + Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["Product.ListParams"] @@ -620,6 +686,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Product.ListParams"] + ) -> ListObject["Product"]: + """ + Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Product.ModifyParams"] @@ -637,6 +724,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Product.ModifyParams"] + ) -> "Product": + """ + Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Product", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Product.RetrieveParams"] @@ -648,6 +752,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Product.RetrieveParams"] + ) -> "Product": + """ + Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def search( cls, *args, **kwargs: Unpack["Product.SearchParams"] @@ -660,12 +775,32 @@ def search( """ return cls._search(search_url="/v1/products/search", *args, **kwargs) + @classmethod + async def search_async( + cls, *args, **kwargs: Unpack["Product.SearchParams"] + ) -> SearchResultObject["Product"]: + """ + Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return await cls._search_async( + search_url="/v1/products/search", *args, **kwargs + ) + @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["Product.SearchParams"] ) -> Iterator["Product"]: return cls.search(*args, **kwargs).auto_paging_iter() + @classmethod + async def search_auto_paging_iter_async( + cls, *args, **kwargs: Unpack["Product.SearchParams"] + ) -> AsyncIterator["Product"]: + return (await cls.search_async(*args, **kwargs)).auto_paging_iter() + _inner_class_types = { "features": Feature, "package_dimensions": PackageDimensions, diff --git a/stripe/_product_service.py b/stripe/_product_service.py index d005dce13..9f71f245d 100644 --- a/stripe/_product_service.py +++ b/stripe/_product_service.py @@ -422,6 +422,27 @@ def delete( ), ) + async def delete_async( + self, + id: str, + params: "ProductService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Product: + """ + Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. + """ + return cast( + Product, + await self._request_async( + "delete", + "/v1/products/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -443,6 +464,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + id: str, + params: "ProductService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Product: + """ + Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. + """ + return cast( + Product, + await self._request_async( + "get", + "/v1/products/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, id: str, @@ -464,6 +506,27 @@ def update( ), ) + async def update_async( + self, + id: str, + params: "ProductService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Product: + """ + Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + return cast( + Product, + await self._request_async( + "post", + "/v1/products/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "ProductService.ListParams" = {}, @@ -484,6 +547,26 @@ def list( ), ) + async def list_async( + self, + params: "ProductService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Product]: + """ + Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. + """ + return cast( + ListObject[Product], + await self._request_async( + "get", + "/v1/products", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "ProductService.CreateParams", @@ -504,6 +587,26 @@ def create( ), ) + async def create_async( + self, + params: "ProductService.CreateParams", + options: RequestOptions = {}, + ) -> Product: + """ + Creates a new product object. + """ + return cast( + Product, + await self._request_async( + "post", + "/v1/products", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def search( self, params: "ProductService.SearchParams", @@ -526,3 +629,26 @@ def search( options=options, ), ) + + async def search_async( + self, + params: "ProductService.SearchParams", + options: RequestOptions = {}, + ) -> SearchResultObject[Product]: + """ + Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return cast( + SearchResultObject[Product], + await self._request_async( + "get", + "/v1/products/search", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_promotion_code.py b/stripe/_promotion_code.py index 37096b92f..f785facd4 100644 --- a/stripe/_promotion_code.py +++ b/stripe/_promotion_code.py @@ -286,6 +286,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["PromotionCode.CreateParams"] + ) -> "PromotionCode": + """ + A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. + """ + return cast( + "PromotionCode", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["PromotionCode.ListParams"] @@ -307,6 +323,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["PromotionCode.ListParams"] + ) -> ListObject["PromotionCode"]: + """ + Returns a list of your promotion codes. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["PromotionCode.ModifyParams"] @@ -324,6 +361,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["PromotionCode.ModifyParams"] + ) -> "PromotionCode": + """ + Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "PromotionCode", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["PromotionCode.RetrieveParams"] @@ -335,4 +389,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["PromotionCode.RetrieveParams"] + ) -> "PromotionCode": + """ + Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"restrictions": Restrictions} diff --git a/stripe/_promotion_code_service.py b/stripe/_promotion_code_service.py index 4e6fdbb4a..bdd6734b2 100644 --- a/stripe/_promotion_code_service.py +++ b/stripe/_promotion_code_service.py @@ -198,6 +198,26 @@ def list( ), ) + async def list_async( + self, + params: "PromotionCodeService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PromotionCode]: + """ + Returns a list of your promotion codes. + """ + return cast( + ListObject[PromotionCode], + await self._request_async( + "get", + "/v1/promotion_codes", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "PromotionCodeService.CreateParams", @@ -218,6 +238,26 @@ def create( ), ) + async def create_async( + self, + params: "PromotionCodeService.CreateParams", + options: RequestOptions = {}, + ) -> PromotionCode: + """ + A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. + """ + return cast( + PromotionCode, + await self._request_async( + "post", + "/v1/promotion_codes", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, promotion_code: str, @@ -241,6 +281,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + promotion_code: str, + params: "PromotionCodeService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PromotionCode: + """ + Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code. + """ + return cast( + PromotionCode, + await self._request_async( + "get", + "/v1/promotion_codes/{promotion_code}".format( + promotion_code=sanitize_id(promotion_code), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, promotion_code: str, @@ -263,3 +326,26 @@ def update( options=options, ), ) + + async def update_async( + self, + promotion_code: str, + params: "PromotionCodeService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> PromotionCode: + """ + Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. + """ + return cast( + PromotionCode, + await self._request_async( + "post", + "/v1/promotion_codes/{promotion_code}".format( + promotion_code=sanitize_id(promotion_code), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_quote.py b/stripe/_quote.py index eeff64e15..4ed8427b4 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -1151,6 +1151,59 @@ def accept( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_accept_async( + cls, quote: str, **params: Unpack["Quote.AcceptParams"] + ) -> "Quote": + """ + Accepts the specified quote. + """ + return cast( + "Quote", + await cls._static_request_async( + "post", + "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), + params=params, + ), + ) + + @overload + @staticmethod + async def accept_async( + quote: str, **params: Unpack["Quote.AcceptParams"] + ) -> "Quote": + """ + Accepts the specified quote. + """ + ... + + @overload + async def accept_async( + self, **params: Unpack["Quote.AcceptParams"] + ) -> "Quote": + """ + Accepts the specified quote. + """ + ... + + @class_method_variant("_cls_accept_async") + async def accept_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.AcceptParams"] + ) -> "Quote": + """ + Accepts the specified quote. + """ + return cast( + "Quote", + await self._request_async( + "post", + "/v1/quotes/{quote}/accept".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_cancel( cls, quote: str, **params: Unpack["Quote.CancelParams"] @@ -1200,6 +1253,59 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, quote: str, **params: Unpack["Quote.CancelParams"] + ) -> "Quote": + """ + Cancels the quote. + """ + return cast( + "Quote", + await cls._static_request_async( + "post", + "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + quote: str, **params: Unpack["Quote.CancelParams"] + ) -> "Quote": + """ + Cancels the quote. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["Quote.CancelParams"] + ) -> "Quote": + """ + Cancels the quote. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.CancelParams"] + ) -> "Quote": + """ + Cancels the quote. + """ + return cast( + "Quote", + await self._request_async( + "post", + "/v1/quotes/{quote}/cancel".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create(cls, **params: Unpack["Quote.CreateParams"]) -> "Quote": """ @@ -1214,6 +1320,22 @@ def create(cls, **params: Unpack["Quote.CreateParams"]) -> "Quote": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Quote.CreateParams"] + ) -> "Quote": + """ + A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). + """ + return cast( + "Quote", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_finalize_quote( cls, quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] @@ -1267,6 +1389,59 @@ def finalize_quote( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_finalize_quote_async( + cls, quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] + ) -> "Quote": + """ + Finalizes the quote. + """ + return cast( + "Quote", + await cls._static_request_async( + "post", + "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), + params=params, + ), + ) + + @overload + @staticmethod + async def finalize_quote_async( + quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] + ) -> "Quote": + """ + Finalizes the quote. + """ + ... + + @overload + async def finalize_quote_async( + self, **params: Unpack["Quote.FinalizeQuoteParams"] + ) -> "Quote": + """ + Finalizes the quote. + """ + ... + + @class_method_variant("_cls_finalize_quote_async") + async def finalize_quote_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.FinalizeQuoteParams"] + ) -> "Quote": + """ + Finalizes the quote. + """ + return cast( + "Quote", + await self._request_async( + "post", + "/v1/quotes/{quote}/finalize".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def list(cls, **params: Unpack["Quote.ListParams"]) -> ListObject["Quote"]: """ @@ -1286,6 +1461,27 @@ def list(cls, **params: Unpack["Quote.ListParams"]) -> ListObject["Quote"]: return result + @classmethod + async def list_async( + cls, **params: Unpack["Quote.ListParams"] + ) -> ListObject["Quote"]: + """ + Returns a list of your quotes. + """ + 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 _cls_list_computed_upfront_line_items( cls, @@ -1344,6 +1540,64 @@ def list_computed_upfront_line_items( # pyright: ignore[reportGeneralTypeIssues ), ) + @classmethod + async def _cls_list_computed_upfront_line_items_async( + cls, + quote: str, + **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + """ + return cast( + ListObject["LineItem"], + await cls._static_request_async( + "get", + "/v1/quotes/{quote}/computed_upfront_line_items".format( + quote=sanitize_id(quote) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def list_computed_upfront_line_items_async( + quote: str, + **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + """ + ... + + @overload + async def list_computed_upfront_line_items_async( + self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + """ + ... + + @class_method_variant("_cls_list_computed_upfront_line_items_async") + async def list_computed_upfront_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + """ + return cast( + ListObject["LineItem"], + await self._request_async( + "get", + "/v1/quotes/{quote}/computed_upfront_line_items".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_list_line_items( cls, quote: str, **params: Unpack["Quote.ListLineItemsParams"] @@ -1399,6 +1653,61 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_list_line_items_async( + cls, quote: str, **params: Unpack["Quote.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["LineItem"], + await cls._static_request_async( + "get", + "/v1/quotes/{quote}/line_items".format( + quote=sanitize_id(quote) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def list_line_items_async( + quote: str, **params: Unpack["Quote.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + ... + + @overload + async def list_line_items_async( + self, **params: Unpack["Quote.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + ... + + @class_method_variant("_cls_list_line_items_async") + async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["LineItem"], + await self._request_async( + "get", + "/v1/quotes/{quote}/line_items".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def modify( cls, id: str, **params: Unpack["Quote.ModifyParams"] @@ -1416,6 +1725,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Quote.ModifyParams"] + ) -> "Quote": + """ + A quote models prices and services for a customer. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Quote", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def _cls_pdf(cls, quote: str, **params: Unpack["Quote.PdfParams"]) -> Any: """ @@ -1464,6 +1790,58 @@ def pdf( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_pdf_async( + cls, quote: str, **params: Unpack["Quote.PdfParams"] + ) -> Any: + """ + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + """ + return cast( + Any, + await cls._static_request_stream_async( + "get", + "/v1/quotes/{quote}/pdf".format(quote=sanitize_id(quote)), + params=params, + base_address="files", + ), + ) + + @overload + @staticmethod + async def pdf_async( + quote: str, **params: Unpack["Quote.PdfParams"] + ) -> Any: + """ + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + """ + ... + + @overload + async def pdf_async(self, **params: Unpack["Quote.PdfParams"]) -> Any: + """ + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + """ + ... + + @class_method_variant("_cls_pdf_async") + async def pdf_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.PdfParams"] + ) -> Any: + """ + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + """ + return cast( + Any, + await self._request_stream_async( + "get", + "/v1/quotes/{quote}/pdf".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Quote.RetrieveParams"] @@ -1475,6 +1853,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Quote.RetrieveParams"] + ) -> "Quote": + """ + Retrieves the quote with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "automatic_tax": AutomaticTax, "computed": Computed, diff --git a/stripe/_quote_computed_upfront_line_items_service.py b/stripe/_quote_computed_upfront_line_items_service.py index 470752f14..f653aeac3 100644 --- a/stripe/_quote_computed_upfront_line_items_service.py +++ b/stripe/_quote_computed_upfront_line_items_service.py @@ -50,3 +50,26 @@ def list( options=options, ), ) + + async def list_async( + self, + quote: str, + params: "QuoteComputedUpfrontLineItemsService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[LineItem]: + """ + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + """ + return cast( + ListObject[LineItem], + await self._request_async( + "get", + "/v1/quotes/{quote}/computed_upfront_line_items".format( + quote=sanitize_id(quote), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_quote_line_item_service.py b/stripe/_quote_line_item_service.py index 358c7a6c7..b69093b44 100644 --- a/stripe/_quote_line_item_service.py +++ b/stripe/_quote_line_item_service.py @@ -50,3 +50,26 @@ def list( options=options, ), ) + + async def list_async( + self, + quote: str, + params: "QuoteLineItemService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[LineItem]: + """ + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject[LineItem], + await self._request_async( + "get", + "/v1/quotes/{quote}/line_items".format( + quote=sanitize_id(quote), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 91fc43396..504d6feb1 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -585,6 +585,26 @@ def list( ), ) + async def list_async( + self, + params: "QuoteService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Quote]: + """ + Returns a list of your quotes. + """ + return cast( + ListObject[Quote], + await self._request_async( + "get", + "/v1/quotes", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "QuoteService.CreateParams" = {}, @@ -605,6 +625,26 @@ def create( ), ) + async def create_async( + self, + params: "QuoteService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Quote: + """ + A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). + """ + return cast( + Quote, + await self._request_async( + "post", + "/v1/quotes", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, quote: str, @@ -626,6 +666,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + quote: str, + params: "QuoteService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Quote: + """ + Retrieves the quote with the given ID. + """ + return cast( + Quote, + await self._request_async( + "get", + "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, quote: str, @@ -647,6 +708,27 @@ def update( ), ) + async def update_async( + self, + quote: str, + params: "QuoteService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Quote: + """ + A quote models prices and services for a customer. + """ + return cast( + Quote, + await self._request_async( + "post", + "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def accept( self, quote: str, @@ -668,6 +750,27 @@ def accept( ), ) + async def accept_async( + self, + quote: str, + params: "QuoteService.AcceptParams" = {}, + options: RequestOptions = {}, + ) -> Quote: + """ + Accepts the specified quote. + """ + return cast( + Quote, + await self._request_async( + "post", + "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, quote: str, @@ -689,6 +792,27 @@ def cancel( ), ) + async def cancel_async( + self, + quote: str, + params: "QuoteService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> Quote: + """ + Cancels the quote. + """ + return cast( + Quote, + await self._request_async( + "post", + "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def finalize_quote( self, quote: str, @@ -710,6 +834,27 @@ def finalize_quote( ), ) + async def finalize_quote_async( + self, + quote: str, + params: "QuoteService.FinalizeQuoteParams" = {}, + options: RequestOptions = {}, + ) -> Quote: + """ + Finalizes the quote. + """ + return cast( + Quote, + await self._request_async( + "post", + "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def pdf( self, quote: str, @@ -730,3 +875,24 @@ def pdf( options=options, ), ) + + async def pdf_async( + self, + quote: str, + params: "QuoteService.PdfParams" = {}, + options: RequestOptions = {}, + ) -> Any: + """ + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + """ + return cast( + Any, + await self._request_stream_async( + "get", + "/v1/quotes/{quote}/pdf".format(quote=sanitize_id(quote)), + api_mode="V1", + base_address="files", + params=params, + options=options, + ), + ) diff --git a/stripe/_refund.py b/stripe/_refund.py index 3c3aa87f8..eb2dd9b5f 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -575,6 +575,69 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, refund: str, **params: Unpack["Refund.CancelParams"] + ) -> "Refund": + """ + Cancels a refund with a status of requires_action. + + You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. + """ + return cast( + "Refund", + await cls._static_request_async( + "post", + "/v1/refunds/{refund}/cancel".format( + refund=sanitize_id(refund) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + refund: str, **params: Unpack["Refund.CancelParams"] + ) -> "Refund": + """ + Cancels a refund with a status of requires_action. + + You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["Refund.CancelParams"] + ) -> "Refund": + """ + Cancels a refund with a status of requires_action. + + You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Refund.CancelParams"] + ) -> "Refund": + """ + Cancels a refund with a status of requires_action. + + You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. + """ + return cast( + "Refund", + await self._request_async( + "post", + "/v1/refunds/{refund}/cancel".format( + refund=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create(cls, **params: Unpack["Refund.CreateParams"]) -> "Refund": """ @@ -599,6 +662,32 @@ def create(cls, **params: Unpack["Refund.CreateParams"]) -> "Refund": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Refund.CreateParams"] + ) -> "Refund": + """ + When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. + + Creating a new refund will refund a charge that has previously been created but not yet refunded. + Funds will be refunded to the credit or debit card that was originally charged. + + You can optionally refund only part of a charge. + You can do so multiple times, until the entire charge has been refunded. + + Once entirely refunded, a charge can't be refunded again. + This method will raise an error when called on an already-refunded charge, + or when trying to refund more money than is left on a charge. + """ + return cast( + "Refund", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Refund.ListParams"] @@ -620,6 +709,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Refund.ListParams"] + ) -> ListObject["Refund"]: + """ + Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Refund.ModifyParams"] @@ -639,6 +749,25 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Refund.ModifyParams"] + ) -> "Refund": + """ + Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. + + This request only accepts metadata as an argument. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Refund", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Refund.RetrieveParams"] @@ -650,6 +779,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Refund.RetrieveParams"] + ) -> "Refund": + """ + Retrieves the details of an existing refund. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + class TestHelpers(APIResourceTestHelpers["Refund"]): _resource_cls: Type["Refund"] @@ -706,6 +846,61 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_expire_async( + cls, refund: str, **params: Unpack["Refund.ExpireParams"] + ) -> "Refund": + """ + Expire a refund with a status of requires_action. + """ + return cast( + "Refund", + await cls._static_request_async( + "post", + "/v1/test_helpers/refunds/{refund}/expire".format( + refund=sanitize_id(refund) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def expire_async( + refund: str, **params: Unpack["Refund.ExpireParams"] + ) -> "Refund": + """ + Expire a refund with a status of requires_action. + """ + ... + + @overload + async def expire_async( + self, **params: Unpack["Refund.ExpireParams"] + ) -> "Refund": + """ + Expire a refund with a status of requires_action. + """ + ... + + @class_method_variant("_cls_expire_async") + async def expire_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Refund.ExpireParams"] + ) -> "Refund": + """ + Expire a refund with a status of requires_action. + """ + return cast( + "Refund", + await self.resource._request_async( + "post", + "/v1/test_helpers/refunds/{refund}/expire".format( + refund=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/_refund_service.py b/stripe/_refund_service.py index 806b2f957..42a240ea5 100644 --- a/stripe/_refund_service.py +++ b/stripe/_refund_service.py @@ -151,6 +151,26 @@ def list( ), ) + async def list_async( + self, + params: "RefundService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Refund]: + """ + Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. + """ + return cast( + ListObject[Refund], + await self._request_async( + "get", + "/v1/refunds", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "RefundService.CreateParams" = {}, @@ -181,6 +201,36 @@ def create( ), ) + async def create_async( + self, + params: "RefundService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Refund: + """ + When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. + + Creating a new refund will refund a charge that has previously been created but not yet refunded. + Funds will be refunded to the credit or debit card that was originally charged. + + You can optionally refund only part of a charge. + You can do so multiple times, until the entire charge has been refunded. + + Once entirely refunded, a charge can't be refunded again. + This method will raise an error when called on an already-refunded charge, + or when trying to refund more money than is left on a charge. + """ + return cast( + Refund, + await self._request_async( + "post", + "/v1/refunds", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, refund: str, @@ -202,6 +252,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + refund: str, + params: "RefundService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Refund: + """ + Retrieves the details of an existing refund. + """ + return cast( + Refund, + await self._request_async( + "get", + "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, refund: str, @@ -225,6 +296,29 @@ def update( ), ) + async def update_async( + self, + refund: str, + params: "RefundService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Refund: + """ + Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. + + This request only accepts metadata as an argument. + """ + return cast( + Refund, + await self._request_async( + "post", + "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, refund: str, @@ -249,3 +343,28 @@ def cancel( options=options, ), ) + + async def cancel_async( + self, + refund: str, + params: "RefundService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> Refund: + """ + Cancels a refund with a status of requires_action. + + You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. + """ + return cast( + Refund, + await self._request_async( + "post", + "/v1/refunds/{refund}/cancel".format( + refund=sanitize_id(refund), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_review.py b/stripe/_review.py index d209cbcd8..82c4a8cf6 100644 --- a/stripe/_review.py +++ b/stripe/_review.py @@ -236,6 +236,61 @@ def approve( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_approve_async( + cls, review: str, **params: Unpack["Review.ApproveParams"] + ) -> "Review": + """ + Approves a Review object, closing it and removing it from the list of reviews. + """ + return cast( + "Review", + await cls._static_request_async( + "post", + "/v1/reviews/{review}/approve".format( + review=sanitize_id(review) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def approve_async( + review: str, **params: Unpack["Review.ApproveParams"] + ) -> "Review": + """ + Approves a Review object, closing it and removing it from the list of reviews. + """ + ... + + @overload + async def approve_async( + self, **params: Unpack["Review.ApproveParams"] + ) -> "Review": + """ + Approves a Review object, closing it and removing it from the list of reviews. + """ + ... + + @class_method_variant("_cls_approve_async") + async def approve_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Review.ApproveParams"] + ) -> "Review": + """ + Approves a Review object, closing it and removing it from the list of reviews. + """ + return cast( + "Review", + await self._request_async( + "post", + "/v1/reviews/{review}/approve".format( + review=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Review.ListParams"] @@ -257,6 +312,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Review.ListParams"] + ) -> ListObject["Review"]: + """ + Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + 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["Review.RetrieveParams"] @@ -268,6 +344,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Review.RetrieveParams"] + ) -> "Review": + """ + Retrieves a Review object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "ip_address_location": IpAddressLocation, "session": Session, diff --git a/stripe/_review_service.py b/stripe/_review_service.py index f1b8db8cf..5d09a3301 100644 --- a/stripe/_review_service.py +++ b/stripe/_review_service.py @@ -82,6 +82,26 @@ def list( ), ) + async def list_async( + self, + params: "ReviewService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Review]: + """ + Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[Review], + await self._request_async( + "get", + "/v1/reviews", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, review: str, @@ -103,6 +123,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + review: str, + params: "ReviewService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Review: + """ + Retrieves a Review object. + """ + return cast( + Review, + await self._request_async( + "get", + "/v1/reviews/{review}".format(review=sanitize_id(review)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def approve( self, review: str, @@ -125,3 +166,26 @@ def approve( options=options, ), ) + + async def approve_async( + self, + review: str, + params: "ReviewService.ApproveParams" = {}, + options: RequestOptions = {}, + ) -> Review: + """ + Approves a Review object, closing it and removing it from the list of reviews. + """ + return cast( + Review, + await self._request_async( + "post", + "/v1/reviews/{review}/approve".format( + review=sanitize_id(review), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_search_result_object.py b/stripe/_search_result_object.py index dbef55f4a..9b78c848e 100644 --- a/stripe/_search_result_object.py +++ b/stripe/_search_result_object.py @@ -8,6 +8,8 @@ Any, Mapping, Iterator, + AsyncIterator, + Optional, ) from stripe._api_requestor import ( @@ -17,6 +19,7 @@ from stripe import _util import warnings from stripe._request_options import RequestOptions, extract_options_from_dict +from stripe._any_iterator import AnyIterator T = TypeVar("T", bound=StripeObject) @@ -34,20 +37,35 @@ def _search(self, **params: Mapping[str, Any]) -> Self: **params, ) - @_util.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: + def _get_url_for_search(self) -> str: url = self.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( + "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: return cast( Self, self._request( "get", - url, + self._get_url_for_search(), + params=params, + base_address="api", + api_mode="V1", + ), + ) + + async def _search_async(self, **params: Mapping[str, Any]) -> Self: + return cast( + Self, + await self._request_async( + "get", + self._get_url_for_search(), params=params, base_address="api", api_mode="V1", @@ -74,7 +92,7 @@ def __iter__(self) -> Iterator[T]: # pyright: ignore def __len__(self) -> int: return getattr(self, "data", []).__len__() - def auto_paging_iter(self) -> Iterator[T]: + def _auto_paging_iter(self) -> Iterator[T]: page = self while True: @@ -85,6 +103,22 @@ def auto_paging_iter(self) -> Iterator[T]: if page.is_empty: break + def auto_paging_iter(self) -> AnyIterator[T]: + return AnyIterator( + self._auto_paging_iter(), self._auto_paging_iter_async() + ) + + async def _auto_paging_iter_async(self) -> AsyncIterator[T]: + page = self + + while True: + for item in page: + yield item + page = await page.next_search_result_page_async() + + if page.is_empty: + break + @classmethod def _empty_search_result( cls, @@ -103,9 +137,15 @@ def _empty_search_result( def is_empty(self) -> bool: return not self.data - def next_search_result_page( - self, **params: Unpack[RequestOptions] - ) -> Self: + def _get_filters_for_next_page( + self, params: RequestOptions + ) -> Mapping[str, Any]: + params_with_filters = dict(self._retrieve_params) + params_with_filters.update({"page": self.next_page}) + params_with_filters.update(params) + return params_with_filters + + def _maybe_empty_result(self, params: RequestOptions) -> Optional[Self]: if not self.has_more: options, _ = extract_options_from_dict(params) return self._empty_search_result( @@ -113,11 +153,28 @@ def next_search_result_page( stripe_version=options.get("stripe_version"), stripe_account=options.get("stripe_account"), ) + return None - params_with_filters = dict(self._retrieve_params) - params_with_filters.update({"page": self.next_page}) - params_with_filters.update(params) + def next_search_result_page( + self, **params: Unpack[RequestOptions] + ) -> Self: + empty = self._maybe_empty_result(params) + return ( + empty + if empty is not None + else self._search( + **self._get_filters_for_next_page(params), + ) + ) - return self._search( - **params_with_filters, + async def next_search_result_page_async( + self, **params: Unpack[RequestOptions] + ) -> Self: + empty = self._maybe_empty_result(params) + return ( + empty + if empty is not None + else await self._search_async( + **self._get_filters_for_next_page(params), + ) ) diff --git a/stripe/_searchable_api_resource.py b/stripe/_searchable_api_resource.py index 8aab0bdb9..037476da4 100644 --- a/stripe/_searchable_api_resource.py +++ b/stripe/_searchable_api_resource.py @@ -25,6 +25,21 @@ def _search(cls, search_url, **params): return ret + @classmethod + async def _search_async(cls, search_url, **params): + ret = await cls._static_request_async( + "get", + search_url, + params=params, + ) + if not isinstance(ret, SearchResultObject): + raise TypeError( + "Expected search result from API, got %s" + % (type(ret).__name__,) + ) + + return ret + @classmethod def search(cls, *args, **kwargs): raise NotImplementedError diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 4b41575e5..92e660154 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -791,6 +791,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["SetupAttempt.ListParams"] + ) -> ListObject["SetupAttempt"]: + """ + Returns a list of SetupAttempts that associate with a provided SetupIntent. + """ + 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 + _inner_class_types = { "payment_method_details": PaymentMethodDetails, "setup_error": SetupError, diff --git a/stripe/_setup_attempt_service.py b/stripe/_setup_attempt_service.py index 2a7d2468a..ba3ff2065 100644 --- a/stripe/_setup_attempt_service.py +++ b/stripe/_setup_attempt_service.py @@ -75,3 +75,23 @@ def list( options=options, ), ) + + async def list_async( + self, + params: "SetupAttemptService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[SetupAttempt]: + """ + Returns a list of SetupAttempts that associate with a provided SetupIntent. + """ + return cast( + ListObject[SetupAttempt], + await self._request_async( + "get", + "/v1/setup_attempts", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 2b07dd8ff..5c55d7c07 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -3865,6 +3865,69 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, intent: str, **params: Unpack["SetupIntent.CancelParams"] + ) -> "SetupIntent": + """ + You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. + + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + """ + return cast( + "SetupIntent", + await cls._static_request_async( + "post", + "/v1/setup_intents/{intent}/cancel".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + intent: str, **params: Unpack["SetupIntent.CancelParams"] + ) -> "SetupIntent": + """ + You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. + + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["SetupIntent.CancelParams"] + ) -> "SetupIntent": + """ + You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. + + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["SetupIntent.CancelParams"] + ) -> "SetupIntent": + """ + You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. + + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + """ + return cast( + "SetupIntent", + await self._request_async( + "post", + "/v1/setup_intents/{intent}/cancel".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_confirm( cls, intent: str, **params: Unpack["SetupIntent.ConfirmParams"] @@ -3972,6 +4035,113 @@ def confirm( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_confirm_async( + cls, intent: str, **params: Unpack["SetupIntent.ConfirmParams"] + ) -> "SetupIntent": + """ + Confirm that your customer intends to set up the current or + provided payment method. For example, you would confirm a SetupIntent + when a customer hits the “Save” button on a payment method management + page on your website. + + If the selected payment method does not require any additional + steps from the customer, the SetupIntent will transition to the + succeeded status. + + Otherwise, it will transition to the requires_action status and + suggest additional actions via next_action. If setup fails, + the SetupIntent will transition to the + requires_payment_method status or the canceled status if the + confirmation limit is reached. + """ + return cast( + "SetupIntent", + await cls._static_request_async( + "post", + "/v1/setup_intents/{intent}/confirm".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def confirm_async( + intent: str, **params: Unpack["SetupIntent.ConfirmParams"] + ) -> "SetupIntent": + """ + Confirm that your customer intends to set up the current or + provided payment method. For example, you would confirm a SetupIntent + when a customer hits the “Save” button on a payment method management + page on your website. + + If the selected payment method does not require any additional + steps from the customer, the SetupIntent will transition to the + succeeded status. + + Otherwise, it will transition to the requires_action status and + suggest additional actions via next_action. If setup fails, + the SetupIntent will transition to the + requires_payment_method status or the canceled status if the + confirmation limit is reached. + """ + ... + + @overload + async def confirm_async( + self, **params: Unpack["SetupIntent.ConfirmParams"] + ) -> "SetupIntent": + """ + Confirm that your customer intends to set up the current or + provided payment method. For example, you would confirm a SetupIntent + when a customer hits the “Save” button on a payment method management + page on your website. + + If the selected payment method does not require any additional + steps from the customer, the SetupIntent will transition to the + succeeded status. + + Otherwise, it will transition to the requires_action status and + suggest additional actions via next_action. If setup fails, + the SetupIntent will transition to the + requires_payment_method status or the canceled status if the + confirmation limit is reached. + """ + ... + + @class_method_variant("_cls_confirm_async") + async def confirm_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["SetupIntent.ConfirmParams"] + ) -> "SetupIntent": + """ + Confirm that your customer intends to set up the current or + provided payment method. For example, you would confirm a SetupIntent + when a customer hits the “Save” button on a payment method management + page on your website. + + If the selected payment method does not require any additional + steps from the customer, the SetupIntent will transition to the + succeeded status. + + Otherwise, it will transition to the requires_action status and + suggest additional actions via next_action. If setup fails, + the SetupIntent will transition to the + requires_payment_method status or the canceled status if the + confirmation limit is reached. + """ + return cast( + "SetupIntent", + await self._request_async( + "post", + "/v1/setup_intents/{intent}/confirm".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create( cls, **params: Unpack["SetupIntent.CreateParams"] @@ -3991,6 +4161,25 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["SetupIntent.CreateParams"] + ) -> "SetupIntent": + """ + Creates a SetupIntent object. + + After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) + it to collect any required permissions to charge the payment method later. + """ + return cast( + "SetupIntent", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["SetupIntent.ListParams"] @@ -4012,6 +4201,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["SetupIntent.ListParams"] + ) -> ListObject["SetupIntent"]: + """ + Returns a list of SetupIntents. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["SetupIntent.ModifyParams"] @@ -4029,6 +4239,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["SetupIntent.ModifyParams"] + ) -> "SetupIntent": + """ + Updates a SetupIntent object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "SetupIntent", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["SetupIntent.RetrieveParams"] @@ -4044,6 +4271,21 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["SetupIntent.RetrieveParams"] + ) -> "SetupIntent": + """ + Retrieves the details of a SetupIntent that has previously been created. + + Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. + + When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def _cls_verify_microdeposits( cls, @@ -4101,6 +4343,63 @@ def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_verify_microdeposits_async( + cls, + intent: str, + **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] + ) -> "SetupIntent": + """ + Verifies microdeposits on a SetupIntent object. + """ + return cast( + "SetupIntent", + await cls._static_request_async( + "post", + "/v1/setup_intents/{intent}/verify_microdeposits".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def verify_microdeposits_async( + intent: str, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] + ) -> "SetupIntent": + """ + Verifies microdeposits on a SetupIntent object. + """ + ... + + @overload + async def verify_microdeposits_async( + self, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] + ) -> "SetupIntent": + """ + Verifies microdeposits on a SetupIntent object. + """ + ... + + @class_method_variant("_cls_verify_microdeposits_async") + async def verify_microdeposits_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] + ) -> "SetupIntent": + """ + Verifies microdeposits on a SetupIntent object. + """ + return cast( + "SetupIntent", + await self._request_async( + "post", + "/v1/setup_intents/{intent}/verify_microdeposits".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + _inner_class_types = { "automatic_payment_methods": AutomaticPaymentMethods, "last_setup_error": LastSetupError, diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index a773f7647..a6724ff5f 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -3206,6 +3206,26 @@ def list( ), ) + async def list_async( + self, + params: "SetupIntentService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[SetupIntent]: + """ + Returns a list of SetupIntents. + """ + return cast( + ListObject[SetupIntent], + await self._request_async( + "get", + "/v1/setup_intents", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "SetupIntentService.CreateParams" = {}, @@ -3229,6 +3249,29 @@ def create( ), ) + async def create_async( + self, + params: "SetupIntentService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> SetupIntent: + """ + Creates a SetupIntent object. + + After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) + it to collect any required permissions to charge the payment method later. + """ + return cast( + SetupIntent, + await self._request_async( + "post", + "/v1/setup_intents", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, intent: str, @@ -3256,6 +3299,33 @@ def retrieve( ), ) + async def retrieve_async( + self, + intent: str, + params: "SetupIntentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> SetupIntent: + """ + Retrieves the details of a SetupIntent that has previously been created. + + Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. + + When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. + """ + return cast( + SetupIntent, + await self._request_async( + "get", + "/v1/setup_intents/{intent}".format( + intent=sanitize_id(intent) + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, intent: str, @@ -3279,6 +3349,29 @@ def update( ), ) + async def update_async( + self, + intent: str, + params: "SetupIntentService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> SetupIntent: + """ + Updates a SetupIntent object. + """ + return cast( + SetupIntent, + await self._request_async( + "post", + "/v1/setup_intents/{intent}".format( + intent=sanitize_id(intent) + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, intent: str, @@ -3304,6 +3397,31 @@ def cancel( ), ) + async def cancel_async( + self, + intent: str, + params: "SetupIntentService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> SetupIntent: + """ + You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. + + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + """ + return cast( + SetupIntent, + await self._request_async( + "post", + "/v1/setup_intents/{intent}/cancel".format( + intent=sanitize_id(intent), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def confirm( self, intent: str, @@ -3340,6 +3458,42 @@ def confirm( ), ) + async def confirm_async( + self, + intent: str, + params: "SetupIntentService.ConfirmParams" = {}, + options: RequestOptions = {}, + ) -> SetupIntent: + """ + Confirm that your customer intends to set up the current or + provided payment method. For example, you would confirm a SetupIntent + when a customer hits the “Save” button on a payment method management + page on your website. + + If the selected payment method does not require any additional + steps from the customer, the SetupIntent will transition to the + succeeded status. + + Otherwise, it will transition to the requires_action status and + suggest additional actions via next_action. If setup fails, + the SetupIntent will transition to the + requires_payment_method status or the canceled status if the + confirmation limit is reached. + """ + return cast( + SetupIntent, + await self._request_async( + "post", + "/v1/setup_intents/{intent}/confirm".format( + intent=sanitize_id(intent), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def verify_microdeposits( self, intent: str, @@ -3362,3 +3516,26 @@ def verify_microdeposits( options=options, ), ) + + async def verify_microdeposits_async( + self, + intent: str, + params: "SetupIntentService.VerifyMicrodepositsParams" = {}, + options: RequestOptions = {}, + ) -> SetupIntent: + """ + Verifies microdeposits on a SetupIntent object. + """ + return cast( + SetupIntent, + await self._request_async( + "post", + "/v1/setup_intents/{intent}/verify_microdeposits".format( + intent=sanitize_id(intent), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_shipping_rate.py b/stripe/_shipping_rate.py index e93870df5..fa424e3c9 100644 --- a/stripe/_shipping_rate.py +++ b/stripe/_shipping_rate.py @@ -350,6 +350,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["ShippingRate.CreateParams"] + ) -> "ShippingRate": + """ + Creates a new shipping rate object. + """ + return cast( + "ShippingRate", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["ShippingRate.ListParams"] @@ -371,6 +387,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["ShippingRate.ListParams"] + ) -> ListObject["ShippingRate"]: + """ + Returns a list of your shipping rates. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["ShippingRate.ModifyParams"] @@ -388,6 +425,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["ShippingRate.ModifyParams"] + ) -> "ShippingRate": + """ + Updates an existing shipping rate object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "ShippingRate", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["ShippingRate.RetrieveParams"] @@ -399,6 +453,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ShippingRate.RetrieveParams"] + ) -> "ShippingRate": + """ + Returns the shipping rate object with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "delivery_estimate": DeliveryEstimate, "fixed_amount": FixedAmount, diff --git a/stripe/_shipping_rate_service.py b/stripe/_shipping_rate_service.py index e4b5e9b96..962d50b24 100644 --- a/stripe/_shipping_rate_service.py +++ b/stripe/_shipping_rate_service.py @@ -238,6 +238,26 @@ def list( ), ) + async def list_async( + self, + params: "ShippingRateService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ShippingRate]: + """ + Returns a list of your shipping rates. + """ + return cast( + ListObject[ShippingRate], + await self._request_async( + "get", + "/v1/shipping_rates", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "ShippingRateService.CreateParams", @@ -258,6 +278,26 @@ def create( ), ) + async def create_async( + self, + params: "ShippingRateService.CreateParams", + options: RequestOptions = {}, + ) -> ShippingRate: + """ + Creates a new shipping rate object. + """ + return cast( + ShippingRate, + await self._request_async( + "post", + "/v1/shipping_rates", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, shipping_rate_token: str, @@ -281,6 +321,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + shipping_rate_token: str, + params: "ShippingRateService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ShippingRate: + """ + Returns the shipping rate object with the given ID. + """ + return cast( + ShippingRate, + await self._request_async( + "get", + "/v1/shipping_rates/{shipping_rate_token}".format( + shipping_rate_token=sanitize_id(shipping_rate_token), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, shipping_rate_token: str, @@ -303,3 +366,26 @@ def update( options=options, ), ) + + async def update_async( + self, + shipping_rate_token: str, + params: "ShippingRateService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> ShippingRate: + """ + Updates an existing shipping rate object. + """ + return cast( + ShippingRate, + await self._request_async( + "post", + "/v1/shipping_rates/{shipping_rate_token}".format( + shipping_rate_token=sanitize_id(shipping_rate_token), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_source.py b/stripe/_source.py index 49c8faf57..74e8c25b1 100644 --- a/stripe/_source.py +++ b/stripe/_source.py @@ -1127,6 +1127,22 @@ def create(cls, **params: Unpack["Source.CreateParams"]) -> "Source": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Source.CreateParams"] + ) -> "Source": + """ + Creates a new source object. + """ + return cast( + "Source", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_list_source_transactions( cls, @@ -1184,6 +1200,63 @@ def list_source_transactions( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_list_source_transactions_async( + cls, + source: str, + **params: Unpack["Source.ListSourceTransactionsParams"] + ) -> ListObject["SourceTransaction"]: + """ + List source transactions for a given source. + """ + return cast( + ListObject["SourceTransaction"], + await cls._static_request_async( + "get", + "/v1/sources/{source}/source_transactions".format( + source=sanitize_id(source) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def list_source_transactions_async( + source: str, **params: Unpack["Source.ListSourceTransactionsParams"] + ) -> ListObject["SourceTransaction"]: + """ + List source transactions for a given source. + """ + ... + + @overload + async def list_source_transactions_async( + self, **params: Unpack["Source.ListSourceTransactionsParams"] + ) -> ListObject["SourceTransaction"]: + """ + List source transactions for a given source. + """ + ... + + @class_method_variant("_cls_list_source_transactions_async") + async def list_source_transactions_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Source.ListSourceTransactionsParams"] + ) -> ListObject["SourceTransaction"]: + """ + List source transactions for a given source. + """ + return cast( + ListObject["SourceTransaction"], + await self._request_async( + "get", + "/v1/sources/{source}/source_transactions".format( + source=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def modify( cls, id: str, **params: Unpack["Source.ModifyParams"] @@ -1203,6 +1276,25 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Source.ModifyParams"] + ) -> "Source": + """ + Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + + This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Source", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Source.RetrieveParams"] @@ -1214,6 +1306,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Source.RetrieveParams"] + ) -> "Source": + """ + Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def _cls_verify( cls, source: str, **params: Unpack["Source.VerifyParams"] @@ -1267,6 +1370,61 @@ def verify( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_verify_async( + cls, source: str, **params: Unpack["Source.VerifyParams"] + ) -> "Source": + """ + Verify a given source. + """ + return cast( + "Source", + await cls._static_request_async( + "post", + "/v1/sources/{source}/verify".format( + source=sanitize_id(source) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def verify_async( + source: str, **params: Unpack["Source.VerifyParams"] + ) -> "Source": + """ + Verify a given source. + """ + ... + + @overload + async def verify_async( + self, **params: Unpack["Source.VerifyParams"] + ) -> "Source": + """ + Verify a given source. + """ + ... + + @class_method_variant("_cls_verify_async") + async def verify_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Source.VerifyParams"] + ) -> "Source": + """ + Verify a given source. + """ + return cast( + "Source", + await self._request_async( + "post", + "/v1/sources/{source}/verify".format( + source=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + def detach(self, **params) -> "Source": token = self.id diff --git a/stripe/_source_service.py b/stripe/_source_service.py index 506136f39..d5444be03 100644 --- a/stripe/_source_service.py +++ b/stripe/_source_service.py @@ -562,6 +562,31 @@ def detach( ), ) + async def detach_async( + self, + customer: str, + id: str, + params: "SourceService.DetachParams" = {}, + options: RequestOptions = {}, + ) -> Union[Account, BankAccount, Card, Source]: + """ + Delete a specified source for a given customer. + """ + return cast( + Union[Account, BankAccount, Card, Source], + await self._request_async( + "delete", + "/v1/customers/{customer}/sources/{id}".format( + customer=sanitize_id(customer), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, source: str, @@ -583,6 +608,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + source: str, + params: "SourceService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Source: + """ + Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. + """ + return cast( + Source, + await self._request_async( + "get", + "/v1/sources/{source}".format(source=sanitize_id(source)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, source: str, @@ -606,6 +652,29 @@ def update( ), ) + async def update_async( + self, + source: str, + params: "SourceService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Source: + """ + Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + + This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. + """ + return cast( + Source, + await self._request_async( + "post", + "/v1/sources/{source}".format(source=sanitize_id(source)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "SourceService.CreateParams" = {}, @@ -626,6 +695,26 @@ def create( ), ) + async def create_async( + self, + params: "SourceService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Source: + """ + Creates a new source object. + """ + return cast( + Source, + await self._request_async( + "post", + "/v1/sources", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def verify( self, source: str, @@ -648,3 +737,26 @@ def verify( options=options, ), ) + + async def verify_async( + self, + source: str, + params: "SourceService.VerifyParams", + options: RequestOptions = {}, + ) -> Source: + """ + Verify a given source. + """ + return cast( + Source, + await self._request_async( + "post", + "/v1/sources/{source}/verify".format( + source=sanitize_id(source), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_source_transaction_service.py b/stripe/_source_transaction_service.py index e8ea44222..022868032 100644 --- a/stripe/_source_transaction_service.py +++ b/stripe/_source_transaction_service.py @@ -50,3 +50,26 @@ def list( options=options, ), ) + + async def list_async( + self, + source: str, + params: "SourceTransactionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[SourceTransaction]: + """ + List source transactions for a given source. + """ + return cast( + ListObject[SourceTransaction], + await self._request_async( + "get", + "/v1/sources/{source}/source_transactions".format( + source=sanitize_id(source), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index ea5d6bdfe..93e1cf943 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -13,7 +13,11 @@ from stripe._api_requestor import _APIRequestor from stripe._requestor_options import RequestorOptions, BaseAddresses from stripe._client_options import _ClientOptions -from stripe._http_client import HTTPClient, new_default_http_client +from stripe._http_client import ( + HTTPClient, + new_default_http_client, + new_http_client_async_fallback, +) from stripe._api_version import _ApiVersion from stripe._webhook import Webhook, WebhookSignature from stripe._event import Event @@ -146,7 +150,11 @@ def __init__( if http_client is None: http_client = new_default_http_client( - proxy=proxy, verify_ssl_certs=verify_ssl_certs + async_fallback_client=new_http_client_async_fallback( + proxy=proxy, verify_ssl_certs=verify_ssl_certs + ), + proxy=proxy, + verify_ssl_certs=verify_ssl_certs, ) self._requestor = _APIRequestor( diff --git a/stripe/_stripe_object.py b/stripe/_stripe_object.py index 74b07a3cf..4a036e9b7 100644 --- a/stripe/_stripe_object.py +++ b/stripe/_stripe_object.py @@ -21,7 +21,11 @@ import stripe # noqa: IMP101 from stripe import _util -from stripe._stripe_response import StripeResponse, StripeStreamResponse +from stripe._stripe_response import ( + StripeResponse, + StripeStreamResponse, + StripeStreamResponseAsync, +) from stripe._encode import _encode_datetime # pyright: ignore from stripe._request_options import extract_options_from_dict from stripe._api_mode import ApiMode @@ -391,14 +395,12 @@ def request( api_mode=api_mode, ) - # The `method_` and `url_` arguments are suffixed with an underscore to - # avoid conflicting with actual request parameters in `params`. def _request( self, - method_: Literal["get", "post", "delete"], - url_: str, + method: Literal["get", "post", "delete"], + url: str, params: Optional[Mapping[str, Any]] = None, - _usage: Optional[List[str]] = None, + usage: Optional[List[str]] = None, *, base_address: BaseAddress, api_mode: ApiMode, @@ -409,13 +411,38 @@ def _request( request_options, request_params = extract_options_from_dict(params) return self._requestor.request( - method_, - url_, + method, + url, params=request_params, options=request_options, base_address=base_address, api_mode=api_mode, - _usage=_usage, + usage=usage, + ) + + async def _request_async( + self, + method: Literal["get", "post", "delete"], + url: str, + params: Optional[Mapping[str, Any]] = None, + usage: Optional[List[str]] = None, + *, + base_address: BaseAddress, + api_mode: ApiMode, + ) -> "StripeObject": + if params is None: + params = self._retrieve_params + + request_options, request_params = extract_options_from_dict(params) + + return await self._requestor.request_async( + method, + url, + params=request_params, + options=request_options, + base_address=base_address, + api_mode=api_mode, + usage=usage, ) def _request_stream( @@ -440,6 +467,28 @@ def _request_stream( api_mode=api_mode, ) + async def _request_stream_async( + self, + method: str, + url: str, + params: Optional[Mapping[str, Any]] = None, + *, + base_address: BaseAddress = "api", + api_mode: ApiMode = "V1", + ) -> StripeStreamResponseAsync: + if params is None: + params = self._retrieve_params + + request_options, request_params = extract_options_from_dict(params) + return await self._requestor.request_stream_async( + method, + url, + params=request_params, + options=request_options, + base_address=base_address, + api_mode=api_mode, + ) + def __repr__(self) -> str: ident_parts = [type(self).__name__] diff --git a/stripe/_stripe_response.py b/stripe/_stripe_response.py index 28e50af78..b50121546 100644 --- a/stripe/_stripe_response.py +++ b/stripe/_stripe_response.py @@ -2,7 +2,7 @@ from io import IOBase import json from collections import OrderedDict -from typing import Mapping, Optional +from typing import Mapping, Optional, AsyncIterable class StripeResponseBase(object): @@ -44,3 +44,22 @@ class StripeStreamResponse(StripeResponseBase): def __init__(self, io: IOBase, code: int, headers: Mapping[str, str]): StripeResponseBase.__init__(self, code, headers) self.io = io + + +class StripeStreamResponseAsync(StripeResponseBase): + _stream: AsyncIterable[bytes] + + def __init__( + self, + stream: AsyncIterable[bytes], + code: int, + headers: Mapping[str, str], + ): + StripeResponseBase.__init__(self, code, headers) + self._stream = stream + + def stream(self) -> AsyncIterable[bytes]: + return self._stream + + async def read(self) -> bytes: + return b"".join([chunk async for chunk in self._stream]) diff --git a/stripe/_stripe_service.py b/stripe/_stripe_service.py index 7fec47990..218d8b39e 100644 --- a/stripe/_stripe_service.py +++ b/stripe/_stripe_service.py @@ -1,4 +1,10 @@ -from stripe._api_requestor import _APIRequestor, StripeStreamResponse +from stripe._api_requestor import ( + _APIRequestor, +) +from stripe._stripe_response import ( + StripeStreamResponse, + StripeStreamResponseAsync, +) from stripe._stripe_object import StripeObject from stripe._request_options import RequestOptions from stripe._base_address import BaseAddress @@ -30,7 +36,27 @@ def _request( options, base_address=base_address, api_mode=api_mode, - _usage=["stripe_client"], + usage=["stripe_client"], + ) + + async def _request_async( + self, + method: str, + url: str, + params: Optional[Mapping[str, Any]] = None, + options: Optional[RequestOptions] = None, + *, + base_address: BaseAddress, + api_mode: ApiMode, + ) -> StripeObject: + return await self._requestor.request_async( + method, + url, + params, + options, + base_address=base_address, + api_mode=api_mode, + usage=["stripe_client"], ) def _request_stream( @@ -50,5 +76,25 @@ def _request_stream( options, base_address=base_address, api_mode=api_mode, - _usage=["stripe_client"], + usage=["stripe_client"], + ) + + async def _request_stream_async( + self, + method: str, + url: str, + params: Optional[Mapping[str, Any]] = None, + options: Optional[RequestOptions] = None, + *, + base_address: BaseAddress, + api_mode: ApiMode, + ) -> StripeStreamResponseAsync: + return await self._requestor.request_stream_async( + method, + url, + params, + options, + base_address=base_address, + api_mode=api_mode, + usage=["stripe_client"], ) diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 3b29c2b3b..eb4f5801e 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -12,6 +12,7 @@ from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ( + AsyncIterator, ClassVar, Dict, Iterator, @@ -2132,6 +2133,82 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, + subscription_exposed_id: str, + **params: Unpack["Subscription.CancelParams"] + ) -> "Subscription": + """ + Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + + Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + + By default, upon subscription cancellation, Stripe will stop 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. + """ + return cast( + "Subscription", + await cls._static_request_async( + "delete", + "/v1/subscriptions/{subscription_exposed_id}".format( + subscription_exposed_id=sanitize_id( + subscription_exposed_id + ) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + subscription_exposed_id: str, + **params: Unpack["Subscription.CancelParams"] + ) -> "Subscription": + """ + Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + + Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + + By default, upon subscription cancellation, Stripe will stop 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. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["Subscription.CancelParams"] + ) -> "Subscription": + """ + Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + + Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + + By default, upon subscription cancellation, Stripe will stop 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. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Subscription.CancelParams"] + ) -> "Subscription": + """ + Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + + Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + + By default, upon subscription cancellation, Stripe will stop 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. + """ + return cast( + "Subscription", + await self._request_async( + "delete", + "/v1/subscriptions/{subscription_exposed_id}".format( + subscription_exposed_id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create( cls, **params: Unpack["Subscription.CreateParams"] @@ -2154,6 +2231,28 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Subscription.CreateParams"] + ) -> "Subscription": + """ + Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. + + When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request. + The payment_behavior parameter determines the exact behavior of the initial payment. + + To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. + Schedules provide the flexibility to model more complex billing configurations that change over time. + """ + return cast( + "Subscription", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete_discount( cls, @@ -2214,6 +2313,66 @@ def delete_discount( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_delete_discount_async( + cls, + subscription_exposed_id: str, + **params: Unpack["Subscription.DeleteDiscountParams"] + ) -> "Discount": + """ + Removes the currently applied discount on a subscription. + """ + return cast( + "Discount", + await cls._static_request_async( + "delete", + "/v1/subscriptions/{subscription_exposed_id}/discount".format( + subscription_exposed_id=sanitize_id( + subscription_exposed_id + ) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def delete_discount_async( + subscription_exposed_id: str, + **params: Unpack["Subscription.DeleteDiscountParams"] + ) -> "Discount": + """ + Removes the currently applied discount on a subscription. + """ + ... + + @overload + async def delete_discount_async( + self, **params: Unpack["Subscription.DeleteDiscountParams"] + ) -> "Discount": + """ + Removes the currently applied discount on a subscription. + """ + ... + + @class_method_variant("_cls_delete_discount_async") + async def delete_discount_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Subscription.DeleteDiscountParams"] + ) -> "Discount": + """ + Removes the currently applied discount on a subscription. + """ + return cast( + "Discount", + await self._request_async( + "delete", + "/v1/subscriptions/{subscription_exposed_id}/discount".format( + subscription_exposed_id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Subscription.ListParams"] @@ -2235,6 +2394,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Subscription.ListParams"] + ) -> ListObject["Subscription"]: + """ + By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Subscription.ModifyParams"] @@ -2272,6 +2452,43 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Subscription.ModifyParams"] + ) -> "Subscription": + """ + Updates an existing subscription to match the specified parameters. + When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. + To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. + + By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. + + Switching prices does not normally change the billing date or generate an immediate charge unless: + + + The billing interval is changed (for example, from monthly to yearly). + The subscription moves from free to paid, or paid to free. + A trial starts or ends. + + + In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. + + If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). + + If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription. + + Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing](https://stripe.com/docs/rate-limits) instead. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Subscription", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def _cls_resume( cls, subscription: str, **params: Unpack["Subscription.ResumeParams"] @@ -2327,6 +2544,61 @@ def resume( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_resume_async( + cls, subscription: str, **params: Unpack["Subscription.ResumeParams"] + ) -> "Subscription": + """ + Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. + """ + return cast( + "Subscription", + await cls._static_request_async( + "post", + "/v1/subscriptions/{subscription}/resume".format( + subscription=sanitize_id(subscription) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def resume_async( + subscription: str, **params: Unpack["Subscription.ResumeParams"] + ) -> "Subscription": + """ + Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. + """ + ... + + @overload + async def resume_async( + self, **params: Unpack["Subscription.ResumeParams"] + ) -> "Subscription": + """ + Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. + """ + ... + + @class_method_variant("_cls_resume_async") + async def resume_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Subscription.ResumeParams"] + ) -> "Subscription": + """ + Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. + """ + return cast( + "Subscription", + await self._request_async( + "post", + "/v1/subscriptions/{subscription}/resume".format( + subscription=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Subscription.RetrieveParams"] @@ -2338,6 +2610,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Subscription.RetrieveParams"] + ) -> "Subscription": + """ + Retrieves the subscription with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def search( cls, *args, **kwargs: Unpack["Subscription.SearchParams"] @@ -2352,12 +2635,32 @@ def search( search_url="/v1/subscriptions/search", *args, **kwargs ) + @classmethod + async def search_async( + cls, *args, **kwargs: Unpack["Subscription.SearchParams"] + ) -> SearchResultObject["Subscription"]: + """ + Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return await cls._search_async( + search_url="/v1/subscriptions/search", *args, **kwargs + ) + @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["Subscription.SearchParams"] ) -> Iterator["Subscription"]: return cls.search(*args, **kwargs).auto_paging_iter() + @classmethod + async def search_auto_paging_iter_async( + cls, *args, **kwargs: Unpack["Subscription.SearchParams"] + ) -> AsyncIterator["Subscription"]: + return (await cls.search_async(*args, **kwargs)).auto_paging_iter() + _inner_class_types = { "automatic_tax": AutomaticTax, "billing_cycle_anchor_config": BillingCycleAnchorConfig, diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index 780753378..81c246aea 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -422,6 +422,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["SubscriptionItem.CreateParams"] + ) -> "SubscriptionItem": + """ + Adds a new item to an existing subscription. No existing items will be changed or replaced. + """ + return cast( + "SubscriptionItem", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["SubscriptionItem.DeleteParams"] @@ -471,6 +487,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["SubscriptionItem.DeleteParams"] + ) -> "SubscriptionItem": + """ + Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "SubscriptionItem", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["SubscriptionItem.DeleteParams"] + ) -> "SubscriptionItem": + """ + Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["SubscriptionItem.DeleteParams"] + ) -> "SubscriptionItem": + """ + Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["SubscriptionItem.DeleteParams"] + ) -> "SubscriptionItem": + """ + Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["SubscriptionItem.ListParams"] @@ -492,6 +557,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["SubscriptionItem.ListParams"] + ) -> ListObject["SubscriptionItem"]: + """ + Returns a list of your subscription items for a given subscription. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["SubscriptionItem.ModifyParams"] @@ -509,6 +595,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["SubscriptionItem.ModifyParams"] + ) -> "SubscriptionItem": + """ + Updates the plan or quantity of an item on a current subscription. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "SubscriptionItem", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["SubscriptionItem.RetrieveParams"] @@ -520,6 +623,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["SubscriptionItem.RetrieveParams"] + ) -> "SubscriptionItem": + """ + Retrieves the subscription item with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def create_usage_record( cls, @@ -546,6 +660,32 @@ def create_usage_record( ), ) + @classmethod + async def create_usage_record_async( + cls, + subscription_item: str, + **params: Unpack["SubscriptionItem.CreateUsageRecordParams"] + ) -> "UsageRecord": + """ + Creates a usage record for a specified subscription item and date, and fills it with a quantity. + + Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. + + The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. + + The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. + """ + return cast( + "UsageRecord", + await cls._static_request_async( + "post", + "/v1/subscription_items/{subscription_item}/usage_records".format( + subscription_item=sanitize_id(subscription_item) + ), + params=params, + ), + ) + @classmethod def list_usage_record_summaries( cls, @@ -568,4 +708,26 @@ def list_usage_record_summaries( ), ) + @classmethod + async def list_usage_record_summaries_async( + cls, + subscription_item: str, + **params: Unpack["SubscriptionItem.ListUsageRecordSummariesParams"] + ) -> ListObject["UsageRecordSummary"]: + """ + For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). + + The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. + """ + return cast( + ListObject["UsageRecordSummary"], + await cls._static_request_async( + "get", + "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( + subscription_item=sanitize_id(subscription_item) + ), + params=params, + ), + ) + _inner_class_types = {"billing_thresholds": BillingThresholds} diff --git a/stripe/_subscription_item_service.py b/stripe/_subscription_item_service.py index 568342e4a..7371dd70a 100644 --- a/stripe/_subscription_item_service.py +++ b/stripe/_subscription_item_service.py @@ -318,6 +318,27 @@ def delete( ), ) + async def delete_async( + self, + item: str, + params: "SubscriptionItemService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> SubscriptionItem: + """ + Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. + """ + return cast( + SubscriptionItem, + await self._request_async( + "delete", + "/v1/subscription_items/{item}".format(item=sanitize_id(item)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, item: str, @@ -339,6 +360,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + item: str, + params: "SubscriptionItemService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> SubscriptionItem: + """ + Retrieves the subscription item with the given ID. + """ + return cast( + SubscriptionItem, + await self._request_async( + "get", + "/v1/subscription_items/{item}".format(item=sanitize_id(item)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, item: str, @@ -360,6 +402,27 @@ def update( ), ) + async def update_async( + self, + item: str, + params: "SubscriptionItemService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> SubscriptionItem: + """ + Updates the plan or quantity of an item on a current subscription. + """ + return cast( + SubscriptionItem, + await self._request_async( + "post", + "/v1/subscription_items/{item}".format(item=sanitize_id(item)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "SubscriptionItemService.ListParams", @@ -380,6 +443,26 @@ def list( ), ) + async def list_async( + self, + params: "SubscriptionItemService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[SubscriptionItem]: + """ + Returns a list of your subscription items for a given subscription. + """ + return cast( + ListObject[SubscriptionItem], + await self._request_async( + "get", + "/v1/subscription_items", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "SubscriptionItemService.CreateParams", @@ -399,3 +482,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "SubscriptionItemService.CreateParams", + options: RequestOptions = {}, + ) -> SubscriptionItem: + """ + Adds a new item to an existing subscription. No existing items will be changed or replaced. + """ + return cast( + SubscriptionItem, + await self._request_async( + "post", + "/v1/subscription_items", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_subscription_item_usage_record_service.py b/stripe/_subscription_item_usage_record_service.py index ecd1101cb..85c41210d 100644 --- a/stripe/_subscription_item_usage_record_service.py +++ b/stripe/_subscription_item_usage_record_service.py @@ -55,3 +55,32 @@ def create( options=options, ), ) + + async def create_async( + self, + subscription_item: str, + params: "SubscriptionItemUsageRecordService.CreateParams", + options: RequestOptions = {}, + ) -> UsageRecord: + """ + Creates a usage record for a specified subscription item and date, and fills it with a quantity. + + Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. + + The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. + + The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. + """ + return cast( + UsageRecord, + await self._request_async( + "post", + "/v1/subscription_items/{subscription_item}/usage_records".format( + subscription_item=sanitize_id(subscription_item), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_subscription_item_usage_record_summary_service.py b/stripe/_subscription_item_usage_record_summary_service.py index 5ef28d8c8..4eb3cfd31 100644 --- a/stripe/_subscription_item_usage_record_summary_service.py +++ b/stripe/_subscription_item_usage_record_summary_service.py @@ -52,3 +52,28 @@ def list( options=options, ), ) + + async def list_async( + self, + subscription_item: str, + params: "SubscriptionItemUsageRecordSummaryService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[UsageRecordSummary]: + """ + For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). + + The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. + """ + return cast( + ListObject[UsageRecordSummary], + await self._request_async( + "get", + "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( + subscription_item=sanitize_id(subscription_item), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index 9d1216472..19f34a873 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -1540,6 +1540,63 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, + schedule: str, + **params: Unpack["SubscriptionSchedule.CancelParams"] + ) -> "SubscriptionSchedule": + """ + Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. + """ + return cast( + "SubscriptionSchedule", + await cls._static_request_async( + "post", + "/v1/subscription_schedules/{schedule}/cancel".format( + schedule=sanitize_id(schedule) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + schedule: str, **params: Unpack["SubscriptionSchedule.CancelParams"] + ) -> "SubscriptionSchedule": + """ + Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["SubscriptionSchedule.CancelParams"] + ) -> "SubscriptionSchedule": + """ + Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["SubscriptionSchedule.CancelParams"] + ) -> "SubscriptionSchedule": + """ + Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. + """ + return cast( + "SubscriptionSchedule", + await self._request_async( + "post", + "/v1/subscription_schedules/{schedule}/cancel".format( + schedule=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create( cls, **params: Unpack["SubscriptionSchedule.CreateParams"] @@ -1556,6 +1613,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["SubscriptionSchedule.CreateParams"] + ) -> "SubscriptionSchedule": + """ + Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. + """ + return cast( + "SubscriptionSchedule", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["SubscriptionSchedule.ListParams"] @@ -1577,6 +1650,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["SubscriptionSchedule.ListParams"] + ) -> ListObject["SubscriptionSchedule"]: + """ + Retrieves the list of your subscription schedules. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["SubscriptionSchedule.ModifyParams"] @@ -1594,6 +1688,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["SubscriptionSchedule.ModifyParams"] + ) -> "SubscriptionSchedule": + """ + Updates an existing subscription schedule. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "SubscriptionSchedule", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def _cls_release( cls, @@ -1651,6 +1762,63 @@ def release( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_release_async( + cls, + schedule: str, + **params: Unpack["SubscriptionSchedule.ReleaseParams"] + ) -> "SubscriptionSchedule": + """ + Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. + """ + return cast( + "SubscriptionSchedule", + await cls._static_request_async( + "post", + "/v1/subscription_schedules/{schedule}/release".format( + schedule=sanitize_id(schedule) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def release_async( + schedule: str, **params: Unpack["SubscriptionSchedule.ReleaseParams"] + ) -> "SubscriptionSchedule": + """ + Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. + """ + ... + + @overload + async def release_async( + self, **params: Unpack["SubscriptionSchedule.ReleaseParams"] + ) -> "SubscriptionSchedule": + """ + Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. + """ + ... + + @class_method_variant("_cls_release_async") + async def release_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["SubscriptionSchedule.ReleaseParams"] + ) -> "SubscriptionSchedule": + """ + Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. + """ + return cast( + "SubscriptionSchedule", + await self._request_async( + "post", + "/v1/subscription_schedules/{schedule}/release".format( + schedule=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["SubscriptionSchedule.RetrieveParams"] @@ -1662,6 +1830,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["SubscriptionSchedule.RetrieveParams"] + ) -> "SubscriptionSchedule": + """ + Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "current_phase": CurrentPhase, "default_settings": DefaultSettings, diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index 260f36d88..5921d68a3 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -1080,6 +1080,26 @@ def list( ), ) + async def list_async( + self, + params: "SubscriptionScheduleService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[SubscriptionSchedule]: + """ + Retrieves the list of your subscription schedules. + """ + return cast( + ListObject[SubscriptionSchedule], + await self._request_async( + "get", + "/v1/subscription_schedules", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "SubscriptionScheduleService.CreateParams" = {}, @@ -1100,6 +1120,26 @@ def create( ), ) + async def create_async( + self, + params: "SubscriptionScheduleService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> SubscriptionSchedule: + """ + Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. + """ + return cast( + SubscriptionSchedule, + await self._request_async( + "post", + "/v1/subscription_schedules", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, schedule: str, @@ -1123,6 +1163,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + schedule: str, + params: "SubscriptionScheduleService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> SubscriptionSchedule: + """ + Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. + """ + return cast( + SubscriptionSchedule, + await self._request_async( + "get", + "/v1/subscription_schedules/{schedule}".format( + schedule=sanitize_id(schedule), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, schedule: str, @@ -1146,6 +1209,29 @@ def update( ), ) + async def update_async( + self, + schedule: str, + params: "SubscriptionScheduleService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> SubscriptionSchedule: + """ + Updates an existing subscription schedule. + """ + return cast( + SubscriptionSchedule, + await self._request_async( + "post", + "/v1/subscription_schedules/{schedule}".format( + schedule=sanitize_id(schedule), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, schedule: str, @@ -1169,6 +1255,29 @@ def cancel( ), ) + async def cancel_async( + self, + schedule: str, + params: "SubscriptionScheduleService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> SubscriptionSchedule: + """ + Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. + """ + return cast( + SubscriptionSchedule, + await self._request_async( + "post", + "/v1/subscription_schedules/{schedule}/cancel".format( + schedule=sanitize_id(schedule), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def release( self, schedule: str, @@ -1191,3 +1300,26 @@ def release( options=options, ), ) + + async def release_async( + self, + schedule: str, + params: "SubscriptionScheduleService.ReleaseParams" = {}, + options: RequestOptions = {}, + ) -> SubscriptionSchedule: + """ + Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. + """ + return cast( + SubscriptionSchedule, + await self._request_async( + "post", + "/v1/subscription_schedules/{schedule}/release".format( + schedule=sanitize_id(schedule), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index b42a10f3c..4bb559fab 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -1501,6 +1501,35 @@ def cancel( ), ) + async def cancel_async( + self, + subscription_exposed_id: str, + params: "SubscriptionService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> Subscription: + """ + Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + + Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + + By default, upon subscription cancellation, Stripe will stop 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. + """ + return cast( + Subscription, + await self._request_async( + "delete", + "/v1/subscriptions/{subscription_exposed_id}".format( + subscription_exposed_id=sanitize_id( + subscription_exposed_id + ), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, subscription_exposed_id: str, @@ -1526,6 +1555,31 @@ def retrieve( ), ) + async def retrieve_async( + self, + subscription_exposed_id: str, + params: "SubscriptionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Subscription: + """ + Retrieves the subscription with the given ID. + """ + return cast( + Subscription, + await self._request_async( + "get", + "/v1/subscriptions/{subscription_exposed_id}".format( + subscription_exposed_id=sanitize_id( + subscription_exposed_id + ), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, subscription_exposed_id: str, @@ -1571,6 +1625,51 @@ def update( ), ) + async def update_async( + self, + subscription_exposed_id: str, + params: "SubscriptionService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Subscription: + """ + Updates an existing subscription to match the specified parameters. + When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. + To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. + + By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. + + Switching prices does not normally change the billing date or generate an immediate charge unless: + + + The billing interval is changed (for example, from monthly to yearly). + The subscription moves from free to paid, or paid to free. + A trial starts or ends. + + + In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. + + If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). + + If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription. + + Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing](https://stripe.com/docs/rate-limits) instead. + """ + return cast( + Subscription, + await self._request_async( + "post", + "/v1/subscriptions/{subscription_exposed_id}".format( + subscription_exposed_id=sanitize_id( + subscription_exposed_id + ), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def delete_discount( self, subscription_exposed_id: str, @@ -1596,6 +1695,31 @@ def delete_discount( ), ) + async def delete_discount_async( + self, + subscription_exposed_id: str, + params: "SubscriptionService.DeleteDiscountParams" = {}, + options: RequestOptions = {}, + ) -> Discount: + """ + Removes the currently applied discount on a subscription. + """ + return cast( + Discount, + await self._request_async( + "delete", + "/v1/subscriptions/{subscription_exposed_id}/discount".format( + subscription_exposed_id=sanitize_id( + subscription_exposed_id + ), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "SubscriptionService.ListParams" = {}, @@ -1616,6 +1740,26 @@ def list( ), ) + async def list_async( + self, + params: "SubscriptionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Subscription]: + """ + By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. + """ + return cast( + ListObject[Subscription], + await self._request_async( + "get", + "/v1/subscriptions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "SubscriptionService.CreateParams", @@ -1642,6 +1786,32 @@ def create( ), ) + async def create_async( + self, + params: "SubscriptionService.CreateParams", + options: RequestOptions = {}, + ) -> Subscription: + """ + Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. + + When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request. + The payment_behavior parameter determines the exact behavior of the initial payment. + + To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. + Schedules provide the flexibility to model more complex billing configurations that change over time. + """ + return cast( + Subscription, + await self._request_async( + "post", + "/v1/subscriptions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def search( self, params: "SubscriptionService.SearchParams", @@ -1665,6 +1835,29 @@ def search( ), ) + async def search_async( + self, + params: "SubscriptionService.SearchParams", + options: RequestOptions = {}, + ) -> SearchResultObject[Subscription]: + """ + Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + to an hour behind during outages. Search functionality is not available to merchants in India. + """ + return cast( + SearchResultObject[Subscription], + await self._request_async( + "get", + "/v1/subscriptions/search", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def resume( self, subscription: str, @@ -1687,3 +1880,26 @@ def resume( options=options, ), ) + + async def resume_async( + self, + subscription: str, + params: "SubscriptionService.ResumeParams" = {}, + options: RequestOptions = {}, + ) -> Subscription: + """ + Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. + """ + return cast( + Subscription, + await self._request_async( + "post", + "/v1/subscriptions/{subscription}/resume".format( + subscription=sanitize_id(subscription), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_tax_code.py b/stripe/_tax_code.py index 5a1279e78..a20795230 100644 --- a/stripe/_tax_code.py +++ b/stripe/_tax_code.py @@ -76,6 +76,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["TaxCode.ListParams"] + ) -> ListObject["TaxCode"]: + """ + A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. + """ + 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["TaxCode.RetrieveParams"] @@ -86,3 +107,14 @@ def retrieve( instance = cls(id, **params) instance.refresh() return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["TaxCode.RetrieveParams"] + ) -> "TaxCode": + """ + Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/_tax_code_service.py b/stripe/_tax_code_service.py index 27f9ede8d..4ed661d52 100644 --- a/stripe/_tax_code_service.py +++ b/stripe/_tax_code_service.py @@ -54,6 +54,26 @@ def list( ), ) + async def list_async( + self, + params: "TaxCodeService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[TaxCode]: + """ + A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. + """ + return cast( + ListObject[TaxCode], + await self._request_async( + "get", + "/v1/tax_codes", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -74,3 +94,24 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + id: str, + params: "TaxCodeService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> TaxCode: + """ + Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. + """ + return cast( + TaxCode, + await self._request_async( + "get", + "/v1/tax_codes/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index 8619a7a8e..a220f3d7a 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -342,6 +342,22 @@ def create(cls, **params: Unpack["TaxId.CreateParams"]) -> "TaxId": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["TaxId.CreateParams"] + ) -> "TaxId": + """ + Creates a new account or customer tax_id object. + """ + return cast( + "TaxId", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["TaxId.DeleteParams"] @@ -387,6 +403,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["TaxId.DeleteParams"] + ) -> "TaxId": + """ + Deletes an existing account or customer tax_id object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "TaxId", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["TaxId.DeleteParams"] + ) -> "TaxId": + """ + Deletes an existing account or customer tax_id object. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["TaxId.DeleteParams"] + ) -> "TaxId": + """ + Deletes an existing account or customer tax_id object. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["TaxId.DeleteParams"] + ) -> "TaxId": + """ + Deletes an existing account or customer tax_id object. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list(cls, **params: Unpack["TaxId.ListParams"]) -> ListObject["TaxId"]: """ @@ -406,6 +471,27 @@ def list(cls, **params: Unpack["TaxId.ListParams"]) -> ListObject["TaxId"]: return result + @classmethod + async def list_async( + cls, **params: Unpack["TaxId.ListParams"] + ) -> ListObject["TaxId"]: + """ + Returns a list of tax IDs. + """ + 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["TaxId.RetrieveParams"] @@ -417,4 +503,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["TaxId.RetrieveParams"] + ) -> "TaxId": + """ + Retrieves an account or customer tax_id object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"owner": Owner, "verification": Verification} diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py index 7d4ab2014..237ff8554 100644 --- a/stripe/_tax_id_service.py +++ b/stripe/_tax_id_service.py @@ -176,6 +176,27 @@ def delete( ), ) + async def delete_async( + self, + id: str, + params: "TaxIdService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> TaxId: + """ + Deletes an existing account or customer tax_id object. + """ + return cast( + TaxId, + await self._request_async( + "delete", + "/v1/tax_ids/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -197,6 +218,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + id: str, + params: "TaxIdService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> TaxId: + """ + Retrieves an account or customer tax_id object. + """ + return cast( + TaxId, + await self._request_async( + "get", + "/v1/tax_ids/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "TaxIdService.ListParams" = {}, @@ -217,6 +259,26 @@ def list( ), ) + async def list_async( + self, + params: "TaxIdService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[TaxId]: + """ + Returns a list of tax IDs. + """ + return cast( + ListObject[TaxId], + await self._request_async( + "get", + "/v1/tax_ids", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "TaxIdService.CreateParams", options: RequestOptions = {} ) -> TaxId: @@ -234,3 +296,21 @@ def create( options=options, ), ) + + async def create_async( + self, params: "TaxIdService.CreateParams", options: RequestOptions = {} + ) -> TaxId: + """ + Creates a new account or customer tax_id object. + """ + return cast( + TaxId, + await self._request_async( + "post", + "/v1/tax_ids", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index 1d6389f46..3c7bd7bb3 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -292,6 +292,22 @@ def create(cls, **params: Unpack["TaxRate.CreateParams"]) -> "TaxRate": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["TaxRate.CreateParams"] + ) -> "TaxRate": + """ + Creates a new tax rate. + """ + return cast( + "TaxRate", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["TaxRate.ListParams"] @@ -313,6 +329,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["TaxRate.ListParams"] + ) -> ListObject["TaxRate"]: + """ + Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["TaxRate.ModifyParams"] @@ -330,6 +367,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["TaxRate.ModifyParams"] + ) -> "TaxRate": + """ + Updates an existing tax rate. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "TaxRate", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["TaxRate.RetrieveParams"] @@ -340,3 +394,14 @@ def retrieve( instance = cls(id, **params) instance.refresh() return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["TaxRate.RetrieveParams"] + ) -> "TaxRate": + """ + Retrieves a tax rate with the given ID + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/_tax_rate_service.py b/stripe/_tax_rate_service.py index e676afd05..b8d0b0d8d 100644 --- a/stripe/_tax_rate_service.py +++ b/stripe/_tax_rate_service.py @@ -200,6 +200,26 @@ def list( ), ) + async def list_async( + self, + params: "TaxRateService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[TaxRate]: + """ + Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. + """ + return cast( + ListObject[TaxRate], + await self._request_async( + "get", + "/v1/tax_rates", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "TaxRateService.CreateParams", @@ -220,6 +240,26 @@ def create( ), ) + async def create_async( + self, + params: "TaxRateService.CreateParams", + options: RequestOptions = {}, + ) -> TaxRate: + """ + Creates a new tax rate. + """ + return cast( + TaxRate, + await self._request_async( + "post", + "/v1/tax_rates", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, tax_rate: str, @@ -243,6 +283,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + tax_rate: str, + params: "TaxRateService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> TaxRate: + """ + Retrieves a tax rate with the given ID + """ + return cast( + TaxRate, + await self._request_async( + "get", + "/v1/tax_rates/{tax_rate}".format( + tax_rate=sanitize_id(tax_rate), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, tax_rate: str, @@ -265,3 +328,26 @@ def update( options=options, ), ) + + async def update_async( + self, + tax_rate: str, + params: "TaxRateService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> TaxRate: + """ + Updates an existing tax rate. + """ + return cast( + TaxRate, + await self._request_async( + "post", + "/v1/tax_rates/{tax_rate}".format( + tax_rate=sanitize_id(tax_rate), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_test_helpers.py b/stripe/_test_helpers.py index 7f61b7e7f..5b398f850 100644 --- a/stripe/_test_helpers.py +++ b/stripe/_test_helpers.py @@ -29,6 +29,10 @@ def __init__(self, resource): def _static_request(cls, *args, **kwargs): return cls._resource_cls._static_request(*args, **kwargs) + @classmethod + async def _static_request_async(cls, *args, **kwargs): + return await cls._resource_cls._static_request_async(*args, **kwargs) + @classmethod def _static_request_stream(cls, *args, **kwargs): return cls._resource_cls._static_request_stream(*args, **kwargs) diff --git a/stripe/_token.py b/stripe/_token.py index 3f9957202..13c9c1244 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -1126,6 +1126,23 @@ def create(cls, **params: Unpack["Token.CreateParams"]) -> "Token": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Token.CreateParams"] + ) -> "Token": + """ + Creates a single-use token that represents a bank account's details. + You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [Custom account](https://stripe.com/docs/api#accounts). + """ + return cast( + "Token", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Token.RetrieveParams"] @@ -1136,3 +1153,14 @@ def retrieve( instance = cls(id, **params) instance.refresh() return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Token.RetrieveParams"] + ) -> "Token": + """ + Retrieves the token with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/_token_service.py b/stripe/_token_service.py index b1a247755..455ab070b 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -1066,6 +1066,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + token: str, + params: "TokenService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Token: + """ + Retrieves the token with the given ID. + """ + return cast( + Token, + await self._request_async( + "get", + "/v1/tokens/{token}".format(token=sanitize_id(token)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "TokenService.CreateParams" = {}, @@ -1086,3 +1107,24 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "TokenService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Token: + """ + Creates a single-use token that represents a bank account's details. + You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [Custom account](https://stripe.com/docs/api#accounts). + """ + return cast( + Token, + await self._request_async( + "post", + "/v1/tokens", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_topup.py b/stripe/_topup.py index bcbf96e5f..c6404973e 100644 --- a/stripe/_topup.py +++ b/stripe/_topup.py @@ -278,6 +278,59 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, topup: str, **params: Unpack["Topup.CancelParams"] + ) -> "Topup": + """ + Cancels a top-up. Only pending top-ups can be canceled. + """ + return cast( + "Topup", + await cls._static_request_async( + "post", + "/v1/topups/{topup}/cancel".format(topup=sanitize_id(topup)), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + topup: str, **params: Unpack["Topup.CancelParams"] + ) -> "Topup": + """ + Cancels a top-up. Only pending top-ups can be canceled. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["Topup.CancelParams"] + ) -> "Topup": + """ + Cancels a top-up. Only pending top-ups can be canceled. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Topup.CancelParams"] + ) -> "Topup": + """ + Cancels a top-up. Only pending top-ups can be canceled. + """ + return cast( + "Topup", + await self._request_async( + "post", + "/v1/topups/{topup}/cancel".format( + topup=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create(cls, **params: Unpack["Topup.CreateParams"]) -> "Topup": """ @@ -292,6 +345,22 @@ def create(cls, **params: Unpack["Topup.CreateParams"]) -> "Topup": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Topup.CreateParams"] + ) -> "Topup": + """ + Top up the balance of an account + """ + return cast( + "Topup", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list(cls, **params: Unpack["Topup.ListParams"]) -> ListObject["Topup"]: """ @@ -311,6 +380,27 @@ def list(cls, **params: Unpack["Topup.ListParams"]) -> ListObject["Topup"]: return result + @classmethod + async def list_async( + cls, **params: Unpack["Topup.ListParams"] + ) -> ListObject["Topup"]: + """ + Returns a list of top-ups. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Topup.ModifyParams"] @@ -328,6 +418,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Topup.ModifyParams"] + ) -> "Topup": + """ + Updates the metadata of a top-up. Other top-up details are not editable by design. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Topup", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Topup.RetrieveParams"] @@ -338,3 +445,14 @@ def retrieve( instance = cls(id, **params) instance.refresh() return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Topup.RetrieveParams"] + ) -> "Topup": + """ + Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/_topup_service.py b/stripe/_topup_service.py index c89aa4753..eeeeae7d9 100644 --- a/stripe/_topup_service.py +++ b/stripe/_topup_service.py @@ -158,6 +158,26 @@ def list( ), ) + async def list_async( + self, + params: "TopupService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Topup]: + """ + Returns a list of top-ups. + """ + return cast( + ListObject[Topup], + await self._request_async( + "get", + "/v1/topups", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "TopupService.CreateParams", options: RequestOptions = {} ) -> Topup: @@ -176,6 +196,24 @@ def create( ), ) + async def create_async( + self, params: "TopupService.CreateParams", options: RequestOptions = {} + ) -> Topup: + """ + Top up the balance of an account + """ + return cast( + Topup, + await self._request_async( + "post", + "/v1/topups", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, topup: str, @@ -197,6 +235,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + topup: str, + params: "TopupService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Topup: + """ + Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. + """ + return cast( + Topup, + await self._request_async( + "get", + "/v1/topups/{topup}".format(topup=sanitize_id(topup)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, topup: str, @@ -218,6 +277,27 @@ def update( ), ) + async def update_async( + self, + topup: str, + params: "TopupService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Topup: + """ + Updates the metadata of a top-up. Other top-up details are not editable by design. + """ + return cast( + Topup, + await self._request_async( + "post", + "/v1/topups/{topup}".format(topup=sanitize_id(topup)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, topup: str, @@ -238,3 +318,24 @@ def cancel( options=options, ), ) + + async def cancel_async( + self, + topup: str, + params: "TopupService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> Topup: + """ + Cancels a top-up. Only pending top-ups can be canceled. + """ + return cast( + Topup, + await self._request_async( + "post", + "/v1/topups/{topup}/cancel".format(topup=sanitize_id(topup)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_transfer.py b/stripe/_transfer.py index 50fd7bdc9..222d59d72 100644 --- a/stripe/_transfer.py +++ b/stripe/_transfer.py @@ -290,6 +290,22 @@ def create(cls, **params: Unpack["Transfer.CreateParams"]) -> "Transfer": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Transfer.CreateParams"] + ) -> "Transfer": + """ + To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. + """ + return cast( + "Transfer", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Transfer.ListParams"] @@ -311,6 +327,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Transfer.ListParams"] + ) -> ListObject["Transfer"]: + """ + Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Transfer.ModifyParams"] @@ -330,6 +367,25 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Transfer.ModifyParams"] + ) -> "Transfer": + """ + Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + + This request accepts only metadata as an argument. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Transfer", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Transfer.RetrieveParams"] @@ -341,6 +397,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Transfer.RetrieveParams"] + ) -> "Transfer": + """ + Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def create_reversal( cls, id: str, **params: Unpack["Transfer.CreateReversalParams"] @@ -361,6 +428,26 @@ def create_reversal( ), ) + @classmethod + async def create_reversal_async( + cls, id: str, **params: Unpack["Transfer.CreateReversalParams"] + ) -> "Reversal": + """ + When you create a new reversal, you must specify a transfer to create it on. + + When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. + + Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. + """ + return cast( + "Reversal", + await cls._static_request_async( + "post", + "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), + params=params, + ), + ) + @classmethod def retrieve_reversal( cls, @@ -382,6 +469,27 @@ def retrieve_reversal( ), ) + @classmethod + async def retrieve_reversal_async( + cls, + transfer: str, + id: str, + **params: Unpack["Transfer.RetrieveReversalParams"] + ) -> "Reversal": + """ + By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. + """ + return cast( + "Reversal", + await cls._static_request_async( + "get", + "/v1/transfers/{transfer}/reversals/{id}".format( + transfer=sanitize_id(transfer), id=sanitize_id(id) + ), + params=params, + ), + ) + @classmethod def modify_reversal( cls, @@ -405,6 +513,29 @@ def modify_reversal( ), ) + @classmethod + async def modify_reversal_async( + cls, + transfer: str, + id: str, + **params: Unpack["Transfer.ModifyReversalParams"] + ) -> "Reversal": + """ + Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + + This request only accepts metadata and description as arguments. + """ + return cast( + "Reversal", + await cls._static_request_async( + "post", + "/v1/transfers/{transfer}/reversals/{id}".format( + transfer=sanitize_id(transfer), id=sanitize_id(id) + ), + params=params, + ), + ) + @classmethod def list_reversals( cls, id: str, **params: Unpack["Transfer.ListReversalsParams"] @@ -420,3 +551,19 @@ def list_reversals( params=params, ), ) + + @classmethod + async def list_reversals_async( + cls, id: str, **params: Unpack["Transfer.ListReversalsParams"] + ) -> ListObject["Reversal"]: + """ + You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. + """ + return cast( + ListObject["Reversal"], + await cls._static_request_async( + "get", + "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), + params=params, + ), + ) diff --git a/stripe/_transfer_reversal_service.py b/stripe/_transfer_reversal_service.py index 919481021..2159726ef 100644 --- a/stripe/_transfer_reversal_service.py +++ b/stripe/_transfer_reversal_service.py @@ -87,6 +87,27 @@ def list( ), ) + async def list_async( + self, + id: str, + params: "TransferReversalService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Reversal]: + """ + You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. + """ + return cast( + ListObject[Reversal], + await self._request_async( + "get", + "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, id: str, @@ -112,6 +133,31 @@ def create( ), ) + async def create_async( + self, + id: str, + params: "TransferReversalService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Reversal: + """ + When you create a new reversal, you must specify a transfer to create it on. + + When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. + + Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. + """ + return cast( + Reversal, + await self._request_async( + "post", + "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, transfer: str, @@ -137,6 +183,31 @@ def retrieve( ), ) + async def retrieve_async( + self, + transfer: str, + id: str, + params: "TransferReversalService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Reversal: + """ + By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. + """ + return cast( + Reversal, + await self._request_async( + "get", + "/v1/transfers/{transfer}/reversals/{id}".format( + transfer=sanitize_id(transfer), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, transfer: str, @@ -163,3 +234,30 @@ def update( options=options, ), ) + + async def update_async( + self, + transfer: str, + id: str, + params: "TransferReversalService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Reversal: + """ + Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + + This request only accepts metadata and description as arguments. + """ + return cast( + Reversal, + await self._request_async( + "post", + "/v1/transfers/{transfer}/reversals/{id}".format( + transfer=sanitize_id(transfer), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_transfer_service.py b/stripe/_transfer_service.py index 9dfdc07d4..a78d77486 100644 --- a/stripe/_transfer_service.py +++ b/stripe/_transfer_service.py @@ -141,6 +141,26 @@ def list( ), ) + async def list_async( + self, + params: "TransferService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Transfer]: + """ + Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. + """ + return cast( + ListObject[Transfer], + await self._request_async( + "get", + "/v1/transfers", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "TransferService.CreateParams", @@ -161,6 +181,26 @@ def create( ), ) + async def create_async( + self, + params: "TransferService.CreateParams", + options: RequestOptions = {}, + ) -> Transfer: + """ + To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. + """ + return cast( + Transfer, + await self._request_async( + "post", + "/v1/transfers", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, transfer: str, @@ -184,6 +224,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + transfer: str, + params: "TransferService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Transfer: + """ + Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. + """ + return cast( + Transfer, + await self._request_async( + "get", + "/v1/transfers/{transfer}".format( + transfer=sanitize_id(transfer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, transfer: str, @@ -208,3 +271,28 @@ def update( options=options, ), ) + + async def update_async( + self, + transfer: str, + params: "TransferService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Transfer: + """ + Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + + This request accepts only metadata as an argument. + """ + return cast( + Transfer, + await self._request_async( + "post", + "/v1/transfers/{transfer}".format( + transfer=sanitize_id(transfer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_updateable_api_resource.py b/stripe/_updateable_api_resource.py index e24860bbb..4088dc510 100644 --- a/stripe/_updateable_api_resource.py +++ b/stripe/_updateable_api_resource.py @@ -24,7 +24,7 @@ def save(self, idempotency_key=None): "post", self.instance_url(), params=updated_params, - _usage=["save"], + usage=["save"], ) else: _util.logger.debug("Trying to save already saved object %r", self) diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index f7deee920..a27263a70 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -762,6 +762,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["WebhookEndpoint.CreateParams"] + ) -> "WebhookEndpoint": + """ + A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. + """ + return cast( + "WebhookEndpoint", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["WebhookEndpoint.DeleteParams"] @@ -811,6 +827,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["WebhookEndpoint.DeleteParams"] + ) -> "WebhookEndpoint": + """ + You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "WebhookEndpoint", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["WebhookEndpoint.DeleteParams"] + ) -> "WebhookEndpoint": + """ + You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["WebhookEndpoint.DeleteParams"] + ) -> "WebhookEndpoint": + """ + You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["WebhookEndpoint.DeleteParams"] + ) -> "WebhookEndpoint": + """ + You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["WebhookEndpoint.ListParams"] @@ -832,6 +897,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["WebhookEndpoint.ListParams"] + ) -> ListObject["WebhookEndpoint"]: + """ + Returns a list of your webhook endpoints. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["WebhookEndpoint.ModifyParams"] @@ -849,6 +935,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["WebhookEndpoint.ModifyParams"] + ) -> "WebhookEndpoint": + """ + Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "WebhookEndpoint", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["WebhookEndpoint.RetrieveParams"] @@ -859,3 +962,14 @@ def retrieve( instance = cls(id, **params) instance.refresh() return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["WebhookEndpoint.RetrieveParams"] + ) -> "WebhookEndpoint": + """ + Retrieves the webhook endpoint with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index a015b0c9f..d4ea213ee 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -697,6 +697,29 @@ def delete( ), ) + async def delete_async( + self, + webhook_endpoint: str, + params: "WebhookEndpointService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> WebhookEndpoint: + """ + You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. + """ + return cast( + WebhookEndpoint, + await self._request_async( + "delete", + "/v1/webhook_endpoints/{webhook_endpoint}".format( + webhook_endpoint=sanitize_id(webhook_endpoint), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, webhook_endpoint: str, @@ -720,6 +743,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + webhook_endpoint: str, + params: "WebhookEndpointService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> WebhookEndpoint: + """ + Retrieves the webhook endpoint with the given ID. + """ + return cast( + WebhookEndpoint, + await self._request_async( + "get", + "/v1/webhook_endpoints/{webhook_endpoint}".format( + webhook_endpoint=sanitize_id(webhook_endpoint), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, webhook_endpoint: str, @@ -743,6 +789,29 @@ def update( ), ) + async def update_async( + self, + webhook_endpoint: str, + params: "WebhookEndpointService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> WebhookEndpoint: + """ + Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. + """ + return cast( + WebhookEndpoint, + await self._request_async( + "post", + "/v1/webhook_endpoints/{webhook_endpoint}".format( + webhook_endpoint=sanitize_id(webhook_endpoint), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "WebhookEndpointService.ListParams" = {}, @@ -763,6 +832,26 @@ def list( ), ) + async def list_async( + self, + params: "WebhookEndpointService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[WebhookEndpoint]: + """ + Returns a list of your webhook endpoints. + """ + return cast( + ListObject[WebhookEndpoint], + await self._request_async( + "get", + "/v1/webhook_endpoints", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "WebhookEndpointService.CreateParams", @@ -782,3 +871,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "WebhookEndpointService.CreateParams", + options: RequestOptions = {}, + ) -> WebhookEndpoint: + """ + A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. + """ + return cast( + WebhookEndpoint, + await self._request_async( + "post", + "/v1/webhook_endpoints", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/apps/_secret.py b/stripe/apps/_secret.py index 59b84c323..39f7ef8e2 100644 --- a/stripe/apps/_secret.py +++ b/stripe/apps/_secret.py @@ -194,6 +194,22 @@ def create(cls, **params: Unpack["Secret.CreateParams"]) -> "Secret": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Secret.CreateParams"] + ) -> "Secret": + """ + Create or replace a secret in the secret store. + """ + return cast( + "Secret", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def delete_where( cls, **params: Unpack["Secret.DeleteWhereParams"] @@ -210,6 +226,22 @@ def delete_where( ), ) + @classmethod + async def delete_where_async( + cls, **params: Unpack["Secret.DeleteWhereParams"] + ) -> "Secret": + """ + Deletes a secret from the secret store by name and scope. + """ + return cast( + "Secret", + await cls._static_request_async( + "post", + "/v1/apps/secrets/delete", + params=params, + ), + ) + @classmethod def find(cls, **params: Unpack["Secret.FindParams"]) -> "Secret": """ @@ -224,6 +256,22 @@ def find(cls, **params: Unpack["Secret.FindParams"]) -> "Secret": ), ) + @classmethod + async def find_async( + cls, **params: Unpack["Secret.FindParams"] + ) -> "Secret": + """ + Finds a secret in the secret store by name and scope. + """ + return cast( + "Secret", + await cls._static_request_async( + "get", + "/v1/apps/secrets/find", + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Secret.ListParams"] @@ -245,4 +293,25 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Secret.ListParams"] + ) -> ListObject["Secret"]: + """ + List all secrets stored on the given scope. + """ + 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 + _inner_class_types = {"scope": Scope} diff --git a/stripe/apps/_secret_service.py b/stripe/apps/_secret_service.py index 1806cb381..cdc3b0648 100644 --- a/stripe/apps/_secret_service.py +++ b/stripe/apps/_secret_service.py @@ -139,6 +139,24 @@ def list( ), ) + async def list_async( + self, params: "SecretService.ListParams", options: RequestOptions = {} + ) -> ListObject[Secret]: + """ + List all secrets stored on the given scope. + """ + return cast( + ListObject[Secret], + await self._request_async( + "get", + "/v1/apps/secrets", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "SecretService.CreateParams", @@ -159,6 +177,26 @@ def create( ), ) + async def create_async( + self, + params: "SecretService.CreateParams", + options: RequestOptions = {}, + ) -> Secret: + """ + Create or replace a secret in the secret store. + """ + return cast( + Secret, + await self._request_async( + "post", + "/v1/apps/secrets", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def find( self, params: "SecretService.FindParams", options: RequestOptions = {} ) -> Secret: @@ -177,6 +215,24 @@ def find( ), ) + async def find_async( + self, params: "SecretService.FindParams", options: RequestOptions = {} + ) -> Secret: + """ + Finds a secret in the secret store by name and scope. + """ + return cast( + Secret, + await self._request_async( + "get", + "/v1/apps/secrets/find", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def delete_where( self, params: "SecretService.DeleteWhereParams", @@ -196,3 +252,23 @@ def delete_where( options=options, ), ) + + async def delete_where_async( + self, + params: "SecretService.DeleteWhereParams", + options: RequestOptions = {}, + ) -> Secret: + """ + Deletes a secret from the secret store by name and scope. + """ + return cast( + Secret, + await self._request_async( + "post", + "/v1/apps/secrets/delete", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index 3b858f2b2..198797d8e 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -252,6 +252,22 @@ def create(cls, **params: Unpack["Meter.CreateParams"]) -> "Meter": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Meter.CreateParams"] + ) -> "Meter": + """ + Creates a billing meter + """ + return cast( + "Meter", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_deactivate( cls, id: str, **params: Unpack["Meter.DeactivateParams"] @@ -307,6 +323,61 @@ def deactivate( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_deactivate_async( + cls, id: str, **params: Unpack["Meter.DeactivateParams"] + ) -> "Meter": + """ + Deactivates a billing meter + """ + return cast( + "Meter", + await cls._static_request_async( + "post", + "/v1/billing/meters/{id}/deactivate".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def deactivate_async( + id: str, **params: Unpack["Meter.DeactivateParams"] + ) -> "Meter": + """ + Deactivates a billing meter + """ + ... + + @overload + async def deactivate_async( + self, **params: Unpack["Meter.DeactivateParams"] + ) -> "Meter": + """ + Deactivates a billing meter + """ + ... + + @class_method_variant("_cls_deactivate_async") + async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Meter.DeactivateParams"] + ) -> "Meter": + """ + Deactivates a billing meter + """ + return cast( + "Meter", + await self._request_async( + "post", + "/v1/billing/meters/{id}/deactivate".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def list(cls, **params: Unpack["Meter.ListParams"]) -> ListObject["Meter"]: """ @@ -326,6 +397,27 @@ def list(cls, **params: Unpack["Meter.ListParams"]) -> ListObject["Meter"]: return result + @classmethod + async def list_async( + cls, **params: Unpack["Meter.ListParams"] + ) -> ListObject["Meter"]: + """ + Retrieve a list of billing meters. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Meter.ModifyParams"] @@ -343,6 +435,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Meter.ModifyParams"] + ) -> "Meter": + """ + Updates a billing meter + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Meter", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def _cls_reactivate( cls, id: str, **params: Unpack["Meter.ReactivateParams"] @@ -398,6 +507,61 @@ def reactivate( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_reactivate_async( + cls, id: str, **params: Unpack["Meter.ReactivateParams"] + ) -> "Meter": + """ + Reactivates a billing meter + """ + return cast( + "Meter", + await cls._static_request_async( + "post", + "/v1/billing/meters/{id}/reactivate".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def reactivate_async( + id: str, **params: Unpack["Meter.ReactivateParams"] + ) -> "Meter": + """ + Reactivates a billing meter + """ + ... + + @overload + async def reactivate_async( + self, **params: Unpack["Meter.ReactivateParams"] + ) -> "Meter": + """ + Reactivates a billing meter + """ + ... + + @class_method_variant("_cls_reactivate_async") + async def reactivate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Meter.ReactivateParams"] + ) -> "Meter": + """ + Reactivates a billing meter + """ + return cast( + "Meter", + await self._request_async( + "post", + "/v1/billing/meters/{id}/reactivate".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Meter.RetrieveParams"] @@ -409,6 +573,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Meter.RetrieveParams"] + ) -> "Meter": + """ + Retrieves a billing meter given an ID + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def list_event_summaries( cls, id: str, **params: Unpack["Meter.ListEventSummariesParams"] @@ -427,6 +602,24 @@ def list_event_summaries( ), ) + @classmethod + async def list_event_summaries_async( + cls, id: str, **params: Unpack["Meter.ListEventSummariesParams"] + ) -> ListObject["MeterEventSummary"]: + """ + Retrieve a list of billing meter event summaries. + """ + return cast( + ListObject["MeterEventSummary"], + await cls._static_request_async( + "get", + "/v1/billing/meters/{id}/event_summaries".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + _inner_class_types = { "customer_mapping": CustomerMapping, "default_aggregation": DefaultAggregation, diff --git a/stripe/billing/_meter_event.py b/stripe/billing/_meter_event.py index 33890ea6d..cba844046 100644 --- a/stripe/billing/_meter_event.py +++ b/stripe/billing/_meter_event.py @@ -82,3 +82,19 @@ def create( params=params, ), ) + + @classmethod + async def create_async( + cls, **params: Unpack["MeterEvent.CreateParams"] + ) -> "MeterEvent": + """ + Creates a billing meter event + """ + return cast( + "MeterEvent", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) diff --git a/stripe/billing/_meter_event_adjustment.py b/stripe/billing/_meter_event_adjustment.py index 6ce5fbb55..b4c0d41e5 100644 --- a/stripe/billing/_meter_event_adjustment.py +++ b/stripe/billing/_meter_event_adjustment.py @@ -63,3 +63,19 @@ def create( params=params, ), ) + + @classmethod + async def create_async( + cls, **params: Unpack["MeterEventAdjustment.CreateParams"] + ) -> "MeterEventAdjustment": + """ + Creates a billing meter event adjustment + """ + return cast( + "MeterEventAdjustment", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) diff --git a/stripe/billing/_meter_event_adjustment_service.py b/stripe/billing/_meter_event_adjustment_service.py index 083c0f9ab..04eeea52e 100644 --- a/stripe/billing/_meter_event_adjustment_service.py +++ b/stripe/billing/_meter_event_adjustment_service.py @@ -47,3 +47,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "MeterEventAdjustmentService.CreateParams", + options: RequestOptions = {}, + ) -> MeterEventAdjustment: + """ + Creates a billing meter event adjustment + """ + return cast( + MeterEventAdjustment, + await self._request_async( + "post", + "/v1/billing/meter_event_adjustments", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing/_meter_event_service.py b/stripe/billing/_meter_event_service.py index 50ff09567..ab1161a73 100644 --- a/stripe/billing/_meter_event_service.py +++ b/stripe/billing/_meter_event_service.py @@ -49,3 +49,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "MeterEventService.CreateParams", + options: RequestOptions = {}, + ) -> MeterEvent: + """ + Creates a billing meter event + """ + return cast( + MeterEvent, + await self._request_async( + "post", + "/v1/billing/meter_events", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing/_meter_event_summary_service.py b/stripe/billing/_meter_event_summary_service.py index 422fc574b..df51cd62f 100644 --- a/stripe/billing/_meter_event_summary_service.py +++ b/stripe/billing/_meter_event_summary_service.py @@ -66,3 +66,26 @@ def list( options=options, ), ) + + async def list_async( + self, + id: str, + params: "MeterEventSummaryService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[MeterEventSummary]: + """ + Retrieve a list of billing meter event summaries. + """ + return cast( + ListObject[MeterEventSummary], + await self._request_async( + "get", + "/v1/billing/meters/{id}/event_summaries".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing/_meter_service.py b/stripe/billing/_meter_service.py index a7e7597cd..ca27d84d6 100644 --- a/stripe/billing/_meter_service.py +++ b/stripe/billing/_meter_service.py @@ -141,6 +141,26 @@ def list( ), ) + async def list_async( + self, + params: "MeterService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Meter]: + """ + Retrieve a list of billing meters. + """ + return cast( + ListObject[Meter], + await self._request_async( + "get", + "/v1/billing/meters", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "MeterService.CreateParams", options: RequestOptions = {} ) -> Meter: @@ -159,6 +179,24 @@ def create( ), ) + async def create_async( + self, params: "MeterService.CreateParams", options: RequestOptions = {} + ) -> Meter: + """ + Creates a billing meter + """ + return cast( + Meter, + await self._request_async( + "post", + "/v1/billing/meters", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -180,6 +218,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + id: str, + params: "MeterService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Meter: + """ + Retrieves a billing meter given an ID + """ + return cast( + Meter, + await self._request_async( + "get", + "/v1/billing/meters/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, id: str, @@ -201,6 +260,27 @@ def update( ), ) + async def update_async( + self, + id: str, + params: "MeterService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Meter: + """ + Updates a billing meter + """ + return cast( + Meter, + await self._request_async( + "post", + "/v1/billing/meters/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def deactivate( self, id: str, @@ -224,6 +304,29 @@ def deactivate( ), ) + async def deactivate_async( + self, + id: str, + params: "MeterService.DeactivateParams" = {}, + options: RequestOptions = {}, + ) -> Meter: + """ + Deactivates a billing meter + """ + return cast( + Meter, + await self._request_async( + "post", + "/v1/billing/meters/{id}/deactivate".format( + id=sanitize_id(id) + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def reactivate( self, id: str, @@ -246,3 +349,26 @@ def reactivate( options=options, ), ) + + async def reactivate_async( + self, + id: str, + params: "MeterService.ReactivateParams" = {}, + options: RequestOptions = {}, + ) -> Meter: + """ + Reactivates a billing meter + """ + return cast( + Meter, + await self._request_async( + "post", + "/v1/billing/meters/{id}/reactivate".format( + id=sanitize_id(id) + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index 293f384dd..32f695c8c 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -659,6 +659,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Configuration.CreateParams"] + ) -> "Configuration": + """ + Creates a configuration that describes the functionality and behavior of a PortalSession + """ + return cast( + "Configuration", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Configuration.ListParams"] @@ -680,6 +696,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Configuration.ListParams"] + ) -> ListObject["Configuration"]: + """ + Returns a list of configurations that describe the functionality of the customer portal. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Configuration.ModifyParams"] @@ -697,6 +734,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Configuration.ModifyParams"] + ) -> "Configuration": + """ + Updates a configuration that describes the functionality of the customer portal. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Configuration", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Configuration.RetrieveParams"] @@ -708,6 +762,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Configuration.RetrieveParams"] + ) -> "Configuration": + """ + Retrieves a configuration that describes the functionality of the customer portal. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "business_profile": BusinessProfile, "features": Features, diff --git a/stripe/billing_portal/_configuration_service.py b/stripe/billing_portal/_configuration_service.py index 40d79de28..61ba49b22 100644 --- a/stripe/billing_portal/_configuration_service.py +++ b/stripe/billing_portal/_configuration_service.py @@ -449,6 +449,26 @@ def list( ), ) + async def list_async( + self, + params: "ConfigurationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Configuration]: + """ + Returns a list of configurations that describe the functionality of the customer portal. + """ + return cast( + ListObject[Configuration], + await self._request_async( + "get", + "/v1/billing_portal/configurations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "ConfigurationService.CreateParams", @@ -469,6 +489,26 @@ def create( ), ) + async def create_async( + self, + params: "ConfigurationService.CreateParams", + options: RequestOptions = {}, + ) -> Configuration: + """ + Creates a configuration that describes the functionality and behavior of a PortalSession + """ + return cast( + Configuration, + await self._request_async( + "post", + "/v1/billing_portal/configurations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, configuration: str, @@ -492,6 +532,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + configuration: str, + params: "ConfigurationService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Configuration: + """ + Retrieves a configuration that describes the functionality of the customer portal. + """ + return cast( + Configuration, + await self._request_async( + "get", + "/v1/billing_portal/configurations/{configuration}".format( + configuration=sanitize_id(configuration), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, configuration: str, @@ -514,3 +577,26 @@ def update( options=options, ), ) + + async def update_async( + self, + configuration: str, + params: "ConfigurationService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Configuration: + """ + Updates a configuration that describes the functionality of the customer portal. + """ + return cast( + Configuration, + await self._request_async( + "post", + "/v1/billing_portal/configurations/{configuration}".format( + configuration=sanitize_id(configuration), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index 479797a13..201ac449c 100644 --- a/stripe/billing_portal/_session.py +++ b/stripe/billing_portal/_session.py @@ -506,4 +506,20 @@ def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Session.CreateParams"] + ) -> "Session": + """ + Creates a session of the customer portal. + """ + return cast( + "Session", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + _inner_class_types = {"flow": Flow} diff --git a/stripe/billing_portal/_session_service.py b/stripe/billing_portal/_session_service.py index 0a173db8d..ef745d0a7 100644 --- a/stripe/billing_portal/_session_service.py +++ b/stripe/billing_portal/_session_service.py @@ -252,3 +252,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "SessionService.CreateParams", + options: RequestOptions = {}, + ) -> Session: + """ + Creates a session of the customer portal. + """ + return cast( + Session, + await self._request_async( + "post", + "/v1/billing_portal/sessions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 86bf8eaaa..eedc2add3 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -3859,6 +3859,22 @@ def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Session.CreateParams"] + ) -> "Session": + """ + Creates a Session object. + """ + return cast( + "Session", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_expire( cls, session: str, **params: Unpack["Session.ExpireParams"] @@ -3920,6 +3936,69 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_expire_async( + cls, session: str, **params: Unpack["Session.ExpireParams"] + ) -> "Session": + """ + A Session can be expired when it is in one of these statuses: open + + After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + """ + return cast( + "Session", + await cls._static_request_async( + "post", + "/v1/checkout/sessions/{session}/expire".format( + session=sanitize_id(session) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def expire_async( + session: str, **params: Unpack["Session.ExpireParams"] + ) -> "Session": + """ + A Session can be expired when it is in one of these statuses: open + + After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + """ + ... + + @overload + async def expire_async( + self, **params: Unpack["Session.ExpireParams"] + ) -> "Session": + """ + A Session can be expired when it is in one of these statuses: open + + After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + """ + ... + + @class_method_variant("_cls_expire_async") + async def expire_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Session.ExpireParams"] + ) -> "Session": + """ + A Session can be expired when it is in one of these statuses: open + + After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + """ + return cast( + "Session", + await self._request_async( + "post", + "/v1/checkout/sessions/{session}/expire".format( + session=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Session.ListParams"] @@ -3941,6 +4020,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Session.ListParams"] + ) -> ListObject["Session"]: + """ + Returns a list of Checkout Sessions. + """ + 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 _cls_list_line_items( cls, session: str, **params: Unpack["Session.ListLineItemsParams"] @@ -3996,6 +4096,61 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_list_line_items_async( + cls, session: str, **params: Unpack["Session.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["LineItem"], + await cls._static_request_async( + "get", + "/v1/checkout/sessions/{session}/line_items".format( + session=sanitize_id(session) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def list_line_items_async( + session: str, **params: Unpack["Session.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + ... + + @overload + async def list_line_items_async( + self, **params: Unpack["Session.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + ... + + @class_method_variant("_cls_list_line_items_async") + async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Session.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["LineItem"], + await self._request_async( + "get", + "/v1/checkout/sessions/{session}/line_items".format( + session=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Session.RetrieveParams"] @@ -4007,6 +4162,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Session.RetrieveParams"] + ) -> "Session": + """ + Retrieves a Session object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "after_expiration": AfterExpiration, "automatic_tax": AutomaticTax, diff --git a/stripe/checkout/_session_line_item_service.py b/stripe/checkout/_session_line_item_service.py index cc1dc8317..dc7317d12 100644 --- a/stripe/checkout/_session_line_item_service.py +++ b/stripe/checkout/_session_line_item_service.py @@ -50,3 +50,26 @@ def list( options=options, ), ) + + async def list_async( + self, + session: str, + params: "SessionLineItemService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[LineItem]: + """ + When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject[LineItem], + await self._request_async( + "get", + "/v1/checkout/sessions/{session}/line_items".format( + session=sanitize_id(session), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 70498abbf..d264045a5 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -2183,6 +2183,26 @@ def list( ), ) + async def list_async( + self, + params: "SessionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Session]: + """ + Returns a list of Checkout Sessions. + """ + return cast( + ListObject[Session], + await self._request_async( + "get", + "/v1/checkout/sessions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "SessionService.CreateParams" = {}, @@ -2203,6 +2223,26 @@ def create( ), ) + async def create_async( + self, + params: "SessionService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Session: + """ + Creates a Session object. + """ + return cast( + Session, + await self._request_async( + "post", + "/v1/checkout/sessions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, session: str, @@ -2226,6 +2266,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + session: str, + params: "SessionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Session: + """ + Retrieves a Session object. + """ + return cast( + Session, + await self._request_async( + "get", + "/v1/checkout/sessions/{session}".format( + session=sanitize_id(session), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def expire( self, session: str, @@ -2250,3 +2313,28 @@ def expire( options=options, ), ) + + async def expire_async( + self, + session: str, + params: "SessionService.ExpireParams" = {}, + options: RequestOptions = {}, + ) -> Session: + """ + A Session can be expired when it is in one of these statuses: open + + After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + """ + return cast( + Session, + await self._request_async( + "post", + "/v1/checkout/sessions/{session}/expire".format( + session=sanitize_id(session), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/climate/_order.py b/stripe/climate/_order.py index 649ccf2da..1fdf62de0 100644 --- a/stripe/climate/_order.py +++ b/stripe/climate/_order.py @@ -324,6 +324,73 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, order: str, **params: Unpack["Order.CancelParams"] + ) -> "Order": + """ + Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier + might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe + provides 90 days advance notice and refunds the amount_total. + """ + return cast( + "Order", + await cls._static_request_async( + "post", + "/v1/climate/orders/{order}/cancel".format( + order=sanitize_id(order) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + order: str, **params: Unpack["Order.CancelParams"] + ) -> "Order": + """ + Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier + might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe + provides 90 days advance notice and refunds the amount_total. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["Order.CancelParams"] + ) -> "Order": + """ + Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier + might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe + provides 90 days advance notice and refunds the amount_total. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Order.CancelParams"] + ) -> "Order": + """ + Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier + might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe + provides 90 days advance notice and refunds the amount_total. + """ + return cast( + "Order", + await self._request_async( + "post", + "/v1/climate/orders/{order}/cancel".format( + order=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create(cls, **params: Unpack["Order.CreateParams"]) -> "Order": """ @@ -339,6 +406,23 @@ def create(cls, **params: Unpack["Order.CreateParams"]) -> "Order": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Order.CreateParams"] + ) -> "Order": + """ + Creates a Climate order object for a given Climate product. The order will be processed immediately + after creation and payment will be deducted your Stripe balance. + """ + return cast( + "Order", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list(cls, **params: Unpack["Order.ListParams"]) -> ListObject["Order"]: """ @@ -359,6 +443,28 @@ def list(cls, **params: Unpack["Order.ListParams"]) -> ListObject["Order"]: return result + @classmethod + async def list_async( + cls, **params: Unpack["Order.ListParams"] + ) -> ListObject["Order"]: + """ + Lists all Climate order objects. The orders are returned sorted by creation date, with the + most recently created orders appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Order.ModifyParams"] @@ -376,6 +482,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Order.ModifyParams"] + ) -> "Order": + """ + Updates the specified order by setting the values of the parameters passed. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Order", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Order.RetrieveParams"] @@ -387,6 +510,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Order.RetrieveParams"] + ) -> "Order": + """ + Retrieves the details of a Climate order object with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "beneficiary": Beneficiary, "delivery_details": DeliveryDetail, diff --git a/stripe/climate/_order_service.py b/stripe/climate/_order_service.py index ab75fa1ac..6ee55084a 100644 --- a/stripe/climate/_order_service.py +++ b/stripe/climate/_order_service.py @@ -119,6 +119,27 @@ def list( ), ) + async def list_async( + self, + params: "OrderService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Order]: + """ + Lists all Climate order objects. The orders are returned sorted by creation date, with the + most recently created orders appearing first. + """ + return cast( + ListObject[Order], + await self._request_async( + "get", + "/v1/climate/orders", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "OrderService.CreateParams", options: RequestOptions = {} ) -> Order: @@ -138,6 +159,25 @@ def create( ), ) + async def create_async( + self, params: "OrderService.CreateParams", options: RequestOptions = {} + ) -> Order: + """ + Creates a Climate order object for a given Climate product. The order will be processed immediately + after creation and payment will be deducted your Stripe balance. + """ + return cast( + Order, + await self._request_async( + "post", + "/v1/climate/orders", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, order: str, @@ -159,6 +199,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + order: str, + params: "OrderService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Order: + """ + Retrieves the details of a Climate order object with the given ID. + """ + return cast( + Order, + await self._request_async( + "get", + "/v1/climate/orders/{order}".format(order=sanitize_id(order)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, order: str, @@ -180,6 +241,27 @@ def update( ), ) + async def update_async( + self, + order: str, + params: "OrderService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Order: + """ + Updates the specified order by setting the values of the parameters passed. + """ + return cast( + Order, + await self._request_async( + "post", + "/v1/climate/orders/{order}".format(order=sanitize_id(order)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, order: str, @@ -205,3 +287,29 @@ def cancel( options=options, ), ) + + async def cancel_async( + self, + order: str, + params: "OrderService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> Order: + """ + Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier + might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe + provides 90 days advance notice and refunds the amount_total. + """ + return cast( + Order, + await self._request_async( + "post", + "/v1/climate/orders/{order}/cancel".format( + order=sanitize_id(order), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/climate/_product.py b/stripe/climate/_product.py index f290b237a..8117c7aa5 100644 --- a/stripe/climate/_product.py +++ b/stripe/climate/_product.py @@ -117,6 +117,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Product.ListParams"] + ) -> ListObject["Product"]: + """ + Lists all available Climate product objects. + """ + 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["Product.RetrieveParams"] @@ -128,6 +149,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Product.RetrieveParams"] + ) -> "Product": + """ + Retrieves the details of a Climate product with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "current_prices_per_metric_ton": CurrentPricesPerMetricTon, } diff --git a/stripe/climate/_product_service.py b/stripe/climate/_product_service.py index 847f8c1ec..b0c4d230d 100644 --- a/stripe/climate/_product_service.py +++ b/stripe/climate/_product_service.py @@ -54,6 +54,26 @@ def list( ), ) + async def list_async( + self, + params: "ProductService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Product]: + """ + Lists all available Climate product objects. + """ + return cast( + ListObject[Product], + await self._request_async( + "get", + "/v1/climate/products", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, product: str, @@ -76,3 +96,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + product: str, + params: "ProductService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Product: + """ + Retrieves the details of a Climate product with the given ID. + """ + return cast( + Product, + await self._request_async( + "get", + "/v1/climate/products/{product}".format( + product=sanitize_id(product), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/climate/_supplier.py b/stripe/climate/_supplier.py index b64c569e0..74927e9ce 100644 --- a/stripe/climate/_supplier.py +++ b/stripe/climate/_supplier.py @@ -116,6 +116,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Supplier.ListParams"] + ) -> ListObject["Supplier"]: + """ + Lists all available Climate supplier objects. + """ + 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["Supplier.RetrieveParams"] @@ -127,4 +148,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Supplier.RetrieveParams"] + ) -> "Supplier": + """ + Retrieves a Climate supplier object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"locations": Location} diff --git a/stripe/climate/_supplier_service.py b/stripe/climate/_supplier_service.py index 2dd297e7c..6f4bf0b17 100644 --- a/stripe/climate/_supplier_service.py +++ b/stripe/climate/_supplier_service.py @@ -54,6 +54,26 @@ def list( ), ) + async def list_async( + self, + params: "SupplierService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Supplier]: + """ + Lists all available Climate supplier objects. + """ + return cast( + ListObject[Supplier], + await self._request_async( + "get", + "/v1/climate/suppliers", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, supplier: str, @@ -76,3 +96,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + supplier: str, + params: "SupplierService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Supplier: + """ + Retrieves a Climate supplier object. + """ + return cast( + Supplier, + await self._request_async( + "get", + "/v1/climate/suppliers/{supplier}".format( + supplier=sanitize_id(supplier), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/financial_connections/_account.py b/stripe/financial_connections/_account.py index f96db7667..ecca2fe22 100644 --- a/stripe/financial_connections/_account.py +++ b/stripe/financial_connections/_account.py @@ -386,6 +386,61 @@ def disconnect( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_disconnect_async( + cls, account: str, **params: Unpack["Account.DisconnectParams"] + ) -> "Account": + """ + Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). + """ + return cast( + "Account", + await cls._static_request_async( + "post", + "/v1/financial_connections/accounts/{account}/disconnect".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def disconnect_async( + account: str, **params: Unpack["Account.DisconnectParams"] + ) -> "Account": + """ + Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). + """ + ... + + @overload + async def disconnect_async( + self, **params: Unpack["Account.DisconnectParams"] + ) -> "Account": + """ + Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). + """ + ... + + @class_method_variant("_cls_disconnect_async") + async def disconnect_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Account.DisconnectParams"] + ) -> "Account": + """ + Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). + """ + return cast( + "Account", + await self._request_async( + "post", + "/v1/financial_connections/accounts/{account}/disconnect".format( + account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Account.ListParams"] @@ -407,6 +462,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Account.ListParams"] + ) -> ListObject["Account"]: + """ + Returns a list of Financial Connections Account objects. + """ + 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 _cls_list_owners( cls, account: str, **params: Unpack["Account.ListOwnersParams"] @@ -462,6 +538,61 @@ def list_owners( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_list_owners_async( + cls, account: str, **params: Unpack["Account.ListOwnersParams"] + ) -> ListObject["AccountOwner"]: + """ + Lists all owners for a given Account + """ + return cast( + ListObject["AccountOwner"], + await cls._static_request_async( + "get", + "/v1/financial_connections/accounts/{account}/owners".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def list_owners_async( + account: str, **params: Unpack["Account.ListOwnersParams"] + ) -> ListObject["AccountOwner"]: + """ + Lists all owners for a given Account + """ + ... + + @overload + async def list_owners_async( + self, **params: Unpack["Account.ListOwnersParams"] + ) -> ListObject["AccountOwner"]: + """ + Lists all owners for a given Account + """ + ... + + @class_method_variant("_cls_list_owners_async") + async def list_owners_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Account.ListOwnersParams"] + ) -> ListObject["AccountOwner"]: + """ + Lists all owners for a given Account + """ + return cast( + ListObject["AccountOwner"], + await self._request_async( + "get", + "/v1/financial_connections/accounts/{account}/owners".format( + account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_refresh_account( cls, account: str, **params: Unpack["Account.RefreshAccountParams"] @@ -517,6 +648,61 @@ def refresh_account( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_refresh_account_async( + cls, account: str, **params: Unpack["Account.RefreshAccountParams"] + ) -> "Account": + """ + Refreshes the data associated with a Financial Connections Account. + """ + return cast( + "Account", + await cls._static_request_async( + "post", + "/v1/financial_connections/accounts/{account}/refresh".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def refresh_account_async( + account: str, **params: Unpack["Account.RefreshAccountParams"] + ) -> "Account": + """ + Refreshes the data associated with a Financial Connections Account. + """ + ... + + @overload + async def refresh_account_async( + self, **params: Unpack["Account.RefreshAccountParams"] + ) -> "Account": + """ + Refreshes the data associated with a Financial Connections Account. + """ + ... + + @class_method_variant("_cls_refresh_account_async") + async def refresh_account_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Account.RefreshAccountParams"] + ) -> "Account": + """ + Refreshes the data associated with a Financial Connections Account. + """ + return cast( + "Account", + await self._request_async( + "post", + "/v1/financial_connections/accounts/{account}/refresh".format( + account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Account.RetrieveParams"] @@ -528,6 +714,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Account.RetrieveParams"] + ) -> "Account": + """ + Retrieves the details of an Financial Connections Account. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def _cls_subscribe( cls, account: str, **params: Unpack["Account.SubscribeParams"] @@ -583,6 +780,61 @@ def subscribe( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_subscribe_async( + cls, account: str, **params: Unpack["Account.SubscribeParams"] + ) -> "Account": + """ + Subscribes to periodic refreshes of data associated with a Financial Connections Account. + """ + return cast( + "Account", + await cls._static_request_async( + "post", + "/v1/financial_connections/accounts/{account}/subscribe".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def subscribe_async( + account: str, **params: Unpack["Account.SubscribeParams"] + ) -> "Account": + """ + Subscribes to periodic refreshes of data associated with a Financial Connections Account. + """ + ... + + @overload + async def subscribe_async( + self, **params: Unpack["Account.SubscribeParams"] + ) -> "Account": + """ + Subscribes to periodic refreshes of data associated with a Financial Connections Account. + """ + ... + + @class_method_variant("_cls_subscribe_async") + async def subscribe_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Account.SubscribeParams"] + ) -> "Account": + """ + Subscribes to periodic refreshes of data associated with a Financial Connections Account. + """ + return cast( + "Account", + await self._request_async( + "post", + "/v1/financial_connections/accounts/{account}/subscribe".format( + account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_unsubscribe( cls, account: str, **params: Unpack["Account.UnsubscribeParams"] @@ -638,6 +890,61 @@ def unsubscribe( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_unsubscribe_async( + cls, account: str, **params: Unpack["Account.UnsubscribeParams"] + ) -> "Account": + """ + Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. + """ + return cast( + "Account", + await cls._static_request_async( + "post", + "/v1/financial_connections/accounts/{account}/unsubscribe".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def unsubscribe_async( + account: str, **params: Unpack["Account.UnsubscribeParams"] + ) -> "Account": + """ + Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. + """ + ... + + @overload + async def unsubscribe_async( + self, **params: Unpack["Account.UnsubscribeParams"] + ) -> "Account": + """ + Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. + """ + ... + + @class_method_variant("_cls_unsubscribe_async") + async def unsubscribe_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Account.UnsubscribeParams"] + ) -> "Account": + """ + Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. + """ + return cast( + "Account", + await self._request_async( + "post", + "/v1/financial_connections/accounts/{account}/unsubscribe".format( + account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + _inner_class_types = { "account_holder": AccountHolder, "balance": Balance, diff --git a/stripe/financial_connections/_account_owner_service.py b/stripe/financial_connections/_account_owner_service.py index 767367fdb..43422e8c8 100644 --- a/stripe/financial_connections/_account_owner_service.py +++ b/stripe/financial_connections/_account_owner_service.py @@ -54,3 +54,26 @@ def list( options=options, ), ) + + async def list_async( + self, + account: str, + params: "AccountOwnerService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[AccountOwner]: + """ + Lists all owners for a given Account + """ + return cast( + ListObject[AccountOwner], + await self._request_async( + "get", + "/v1/financial_connections/accounts/{account}/owners".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/financial_connections/_account_service.py b/stripe/financial_connections/_account_service.py index 1a6c878b7..6ab7ac485 100644 --- a/stripe/financial_connections/_account_service.py +++ b/stripe/financial_connections/_account_service.py @@ -115,6 +115,26 @@ def list( ), ) + async def list_async( + self, + params: "AccountService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Account]: + """ + Returns a list of Financial Connections Account objects. + """ + return cast( + ListObject[Account], + await self._request_async( + "get", + "/v1/financial_connections/accounts", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, account: str, @@ -138,6 +158,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + account: str, + params: "AccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + Retrieves the details of an Financial Connections Account. + """ + return cast( + Account, + await self._request_async( + "get", + "/v1/financial_connections/accounts/{account}".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def disconnect( self, account: str, @@ -161,6 +204,29 @@ def disconnect( ), ) + async def disconnect_async( + self, + account: str, + params: "AccountService.DisconnectParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). + """ + return cast( + Account, + await self._request_async( + "post", + "/v1/financial_connections/accounts/{account}/disconnect".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def refresh( self, account: str, @@ -184,6 +250,29 @@ def refresh( ), ) + async def refresh_async( + self, + account: str, + params: "AccountService.RefreshParams", + options: RequestOptions = {}, + ) -> Account: + """ + Refreshes the data associated with a Financial Connections Account. + """ + return cast( + Account, + await self._request_async( + "post", + "/v1/financial_connections/accounts/{account}/refresh".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def subscribe( self, account: str, @@ -207,6 +296,29 @@ def subscribe( ), ) + async def subscribe_async( + self, + account: str, + params: "AccountService.SubscribeParams", + options: RequestOptions = {}, + ) -> Account: + """ + Subscribes to periodic refreshes of data associated with a Financial Connections Account. + """ + return cast( + Account, + await self._request_async( + "post", + "/v1/financial_connections/accounts/{account}/subscribe".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def unsubscribe( self, account: str, @@ -229,3 +341,26 @@ def unsubscribe( options=options, ), ) + + async def unsubscribe_async( + self, + account: str, + params: "AccountService.UnsubscribeParams", + options: RequestOptions = {}, + ) -> Account: + """ + Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. + """ + return cast( + Account, + await self._request_async( + "post", + "/v1/financial_connections/accounts/{account}/unsubscribe".format( + account=sanitize_id(account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/financial_connections/_session.py b/stripe/financial_connections/_session.py index 897e42934..54e50ebcf 100644 --- a/stripe/financial_connections/_session.py +++ b/stripe/financial_connections/_session.py @@ -163,6 +163,22 @@ def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Session.CreateParams"] + ) -> "Session": + """ + To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. + """ + return cast( + "Session", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Session.RetrieveParams"] @@ -174,4 +190,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Session.RetrieveParams"] + ) -> "Session": + """ + Retrieves the details of a Financial Connections Session + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"account_holder": AccountHolder, "filters": Filters} diff --git a/stripe/financial_connections/_session_service.py b/stripe/financial_connections/_session_service.py index 127626741..d15529e5e 100644 --- a/stripe/financial_connections/_session_service.py +++ b/stripe/financial_connections/_session_service.py @@ -90,6 +90,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + session: str, + params: "SessionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Session: + """ + Retrieves the details of a Financial Connections Session + """ + return cast( + Session, + await self._request_async( + "get", + "/v1/financial_connections/sessions/{session}".format( + session=sanitize_id(session), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "SessionService.CreateParams", @@ -109,3 +132,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "SessionService.CreateParams", + options: RequestOptions = {}, + ) -> Session: + """ + To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. + """ + return cast( + Session, + await self._request_async( + "post", + "/v1/financial_connections/sessions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/financial_connections/_transaction.py b/stripe/financial_connections/_transaction.py index 601378e94..70b6ce9bb 100644 --- a/stripe/financial_connections/_transaction.py +++ b/stripe/financial_connections/_transaction.py @@ -156,6 +156,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Transaction.ListParams"] + ) -> ListObject["Transaction"]: + """ + Returns a list of Financial Connections Transaction objects. + """ + 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["Transaction.RetrieveParams"] @@ -167,4 +188,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Transaction.RetrieveParams"] + ) -> "Transaction": + """ + Retrieves the details of a Financial Connections Transaction + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"status_transitions": StatusTransitions} diff --git a/stripe/financial_connections/_transaction_service.py b/stripe/financial_connections/_transaction_service.py index e5df770c4..362ea579a 100644 --- a/stripe/financial_connections/_transaction_service.py +++ b/stripe/financial_connections/_transaction_service.py @@ -94,6 +94,26 @@ def list( ), ) + async def list_async( + self, + params: "TransactionService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[Transaction]: + """ + Returns a list of Financial Connections Transaction objects. + """ + return cast( + ListObject[Transaction], + await self._request_async( + "get", + "/v1/financial_connections/transactions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, transaction: str, @@ -116,3 +136,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + transaction: str, + params: "TransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Transaction: + """ + Retrieves the details of a Financial Connections Transaction + """ + return cast( + Transaction, + await self._request_async( + "get", + "/v1/financial_connections/transactions/{transaction}".format( + transaction=sanitize_id(transaction), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/forwarding/_request.py b/stripe/forwarding/_request.py index 5f77b4f99..b8ac3d350 100644 --- a/stripe/forwarding/_request.py +++ b/stripe/forwarding/_request.py @@ -250,6 +250,22 @@ def create(cls, **params: Unpack["Request.CreateParams"]) -> "Request": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Request.CreateParams"] + ) -> "Request": + """ + Creates a ForwardingRequest object. + """ + return cast( + "Request", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Request.ListParams"] @@ -271,6 +287,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Request.ListParams"] + ) -> ListObject["Request"]: + """ + Lists all ForwardingRequest objects. + """ + 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["Request.RetrieveParams"] @@ -282,6 +319,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Request.RetrieveParams"] + ) -> "Request": + """ + Retrieves a ForwardingRequest object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "request_context": RequestContext, "request_details": RequestDetails, diff --git a/stripe/forwarding/_request_service.py b/stripe/forwarding/_request_service.py index e5734ab68..d3e37ff6e 100644 --- a/stripe/forwarding/_request_service.py +++ b/stripe/forwarding/_request_service.py @@ -126,6 +126,26 @@ def list( ), ) + async def list_async( + self, + params: "RequestService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Request]: + """ + Lists all ForwardingRequest objects. + """ + return cast( + ListObject[Request], + await self._request_async( + "get", + "/v1/forwarding/requests", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "RequestService.CreateParams", @@ -146,6 +166,26 @@ def create( ), ) + async def create_async( + self, + params: "RequestService.CreateParams", + options: RequestOptions = {}, + ) -> Request: + """ + Creates a ForwardingRequest object. + """ + return cast( + Request, + await self._request_async( + "post", + "/v1/forwarding/requests", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -166,3 +206,24 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + id: str, + params: "RequestService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Request: + """ + Retrieves a ForwardingRequest object. + """ + return cast( + Request, + await self._request_async( + "get", + "/v1/forwarding/requests/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index 5a711e9ae..acec47b98 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -414,6 +414,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["VerificationReport.ListParams"] + ) -> ListObject["VerificationReport"]: + """ + List all verification reports. + """ + 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["VerificationReport.RetrieveParams"] @@ -425,6 +446,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["VerificationReport.RetrieveParams"] + ) -> "VerificationReport": + """ + Retrieves an existing VerificationReport + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "document": Document, "id_number": IdNumber, diff --git a/stripe/identity/_verification_report_service.py b/stripe/identity/_verification_report_service.py index b37675adf..7554c54e0 100644 --- a/stripe/identity/_verification_report_service.py +++ b/stripe/identity/_verification_report_service.py @@ -88,6 +88,26 @@ def list( ), ) + async def list_async( + self, + params: "VerificationReportService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[VerificationReport]: + """ + List all verification reports. + """ + return cast( + ListObject[VerificationReport], + await self._request_async( + "get", + "/v1/identity/verification_reports", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, report: str, @@ -110,3 +130,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + report: str, + params: "VerificationReportService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> VerificationReport: + """ + Retrieves an existing VerificationReport + """ + return cast( + VerificationReport, + await self._request_async( + "get", + "/v1/identity/verification_reports/{report}".format( + report=sanitize_id(report), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index fa4667a27..03d409ac1 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -465,6 +465,69 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, session: str, **params: Unpack["VerificationSession.CancelParams"] + ) -> "VerificationSession": + """ + A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). + + Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). + """ + return cast( + "VerificationSession", + await cls._static_request_async( + "post", + "/v1/identity/verification_sessions/{session}/cancel".format( + session=sanitize_id(session) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + session: str, **params: Unpack["VerificationSession.CancelParams"] + ) -> "VerificationSession": + """ + A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). + + Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["VerificationSession.CancelParams"] + ) -> "VerificationSession": + """ + A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). + + Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["VerificationSession.CancelParams"] + ) -> "VerificationSession": + """ + A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). + + Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). + """ + return cast( + "VerificationSession", + await self._request_async( + "post", + "/v1/identity/verification_sessions/{session}/cancel".format( + session=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create( cls, **params: Unpack["VerificationSession.CreateParams"] @@ -487,6 +550,28 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["VerificationSession.CreateParams"] + ) -> "VerificationSession": + """ + Creates a VerificationSession object. + + After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url. + + If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode. + + Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents) + """ + return cast( + "VerificationSession", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["VerificationSession.ListParams"] @@ -508,6 +593,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["VerificationSession.ListParams"] + ) -> ListObject["VerificationSession"]: + """ + Returns a list of VerificationSessions + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["VerificationSession.ModifyParams"] @@ -528,6 +634,26 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["VerificationSession.ModifyParams"] + ) -> "VerificationSession": + """ + Updates a VerificationSession object. + + When the session status is requires_input, you can use this method to update the + verification check and options. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "VerificationSession", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def _cls_redact( cls, session: str, **params: Unpack["VerificationSession.RedactParams"] @@ -655,6 +781,133 @@ def redact( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_redact_async( + cls, session: str, **params: Unpack["VerificationSession.RedactParams"] + ) -> "VerificationSession": + """ + Redact a VerificationSession to remove all collected information from Stripe. This will redact + the VerificationSession and all objects related to it, including VerificationReports, Events, + request logs, etc. + + A VerificationSession object can be redacted when it is in requires_input or verified + [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action + state will automatically cancel it. + + The redaction process may take up to four days. When the redaction process is in progress, the + VerificationSession's redaction.status field will be set to processing; when the process is + finished, it will change to redacted and an identity.verification_session.redacted event + will be emitted. + + Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the + fields that contain personal data will be replaced by the string [redacted] or a similar + placeholder. The metadata field will also be erased. Redacted objects cannot be updated or + used for any purpose. + + [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). + """ + return cast( + "VerificationSession", + await cls._static_request_async( + "post", + "/v1/identity/verification_sessions/{session}/redact".format( + session=sanitize_id(session) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def redact_async( + session: str, **params: Unpack["VerificationSession.RedactParams"] + ) -> "VerificationSession": + """ + Redact a VerificationSession to remove all collected information from Stripe. This will redact + the VerificationSession and all objects related to it, including VerificationReports, Events, + request logs, etc. + + A VerificationSession object can be redacted when it is in requires_input or verified + [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action + state will automatically cancel it. + + The redaction process may take up to four days. When the redaction process is in progress, the + VerificationSession's redaction.status field will be set to processing; when the process is + finished, it will change to redacted and an identity.verification_session.redacted event + will be emitted. + + Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the + fields that contain personal data will be replaced by the string [redacted] or a similar + placeholder. The metadata field will also be erased. Redacted objects cannot be updated or + used for any purpose. + + [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). + """ + ... + + @overload + async def redact_async( + self, **params: Unpack["VerificationSession.RedactParams"] + ) -> "VerificationSession": + """ + Redact a VerificationSession to remove all collected information from Stripe. This will redact + the VerificationSession and all objects related to it, including VerificationReports, Events, + request logs, etc. + + A VerificationSession object can be redacted when it is in requires_input or verified + [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action + state will automatically cancel it. + + The redaction process may take up to four days. When the redaction process is in progress, the + VerificationSession's redaction.status field will be set to processing; when the process is + finished, it will change to redacted and an identity.verification_session.redacted event + will be emitted. + + Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the + fields that contain personal data will be replaced by the string [redacted] or a similar + placeholder. The metadata field will also be erased. Redacted objects cannot be updated or + used for any purpose. + + [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). + """ + ... + + @class_method_variant("_cls_redact_async") + async def redact_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["VerificationSession.RedactParams"] + ) -> "VerificationSession": + """ + Redact a VerificationSession to remove all collected information from Stripe. This will redact + the VerificationSession and all objects related to it, including VerificationReports, Events, + request logs, etc. + + A VerificationSession object can be redacted when it is in requires_input or verified + [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action + state will automatically cancel it. + + The redaction process may take up to four days. When the redaction process is in progress, the + VerificationSession's redaction.status field will be set to processing; when the process is + finished, it will change to redacted and an identity.verification_session.redacted event + will be emitted. + + Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the + fields that contain personal data will be replaced by the string [redacted] or a similar + placeholder. The metadata field will also be erased. Redacted objects cannot be updated or + used for any purpose. + + [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). + """ + return cast( + "VerificationSession", + await self._request_async( + "post", + "/v1/identity/verification_sessions/{session}/redact".format( + session=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["VerificationSession.RetrieveParams"] @@ -669,6 +922,20 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["VerificationSession.RetrieveParams"] + ) -> "VerificationSession": + """ + Retrieves the details of a VerificationSession that was previously created. + + When the session status is requires_input, you can use this method to retrieve a valid + client_secret or url to allow re-submission. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "last_error": LastError, "options": Options, diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index 6bafb5f9b..052d38343 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -200,6 +200,26 @@ def list( ), ) + async def list_async( + self, + params: "VerificationSessionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[VerificationSession]: + """ + Returns a list of VerificationSessions + """ + return cast( + ListObject[VerificationSession], + await self._request_async( + "get", + "/v1/identity/verification_sessions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "VerificationSessionService.CreateParams", @@ -226,6 +246,32 @@ def create( ), ) + async def create_async( + self, + params: "VerificationSessionService.CreateParams", + options: RequestOptions = {}, + ) -> VerificationSession: + """ + Creates a VerificationSession object. + + After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url. + + If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode. + + Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents) + """ + return cast( + VerificationSession, + await self._request_async( + "post", + "/v1/identity/verification_sessions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, session: str, @@ -252,6 +298,32 @@ def retrieve( ), ) + async def retrieve_async( + self, + session: str, + params: "VerificationSessionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> VerificationSession: + """ + Retrieves the details of a VerificationSession that was previously created. + + When the session status is requires_input, you can use this method to retrieve a valid + client_secret or url to allow re-submission. + """ + return cast( + VerificationSession, + await self._request_async( + "get", + "/v1/identity/verification_sessions/{session}".format( + session=sanitize_id(session), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, session: str, @@ -278,6 +350,32 @@ def update( ), ) + async def update_async( + self, + session: str, + params: "VerificationSessionService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> VerificationSession: + """ + Updates a VerificationSession object. + + When the session status is requires_input, you can use this method to update the + verification check and options. + """ + return cast( + VerificationSession, + await self._request_async( + "post", + "/v1/identity/verification_sessions/{session}".format( + session=sanitize_id(session), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, session: str, @@ -303,6 +401,31 @@ def cancel( ), ) + async def cancel_async( + self, + session: str, + params: "VerificationSessionService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> VerificationSession: + """ + A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). + + Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). + """ + return cast( + VerificationSession, + await self._request_async( + "post", + "/v1/identity/verification_sessions/{session}/cancel".format( + session=sanitize_id(session), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def redact( self, session: str, @@ -343,3 +466,44 @@ def redact( options=options, ), ) + + async def redact_async( + self, + session: str, + params: "VerificationSessionService.RedactParams" = {}, + options: RequestOptions = {}, + ) -> VerificationSession: + """ + Redact a VerificationSession to remove all collected information from Stripe. This will redact + the VerificationSession and all objects related to it, including VerificationReports, Events, + request logs, etc. + + A VerificationSession object can be redacted when it is in requires_input or verified + [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action + state will automatically cancel it. + + The redaction process may take up to four days. When the redaction process is in progress, the + VerificationSession's redaction.status field will be set to processing; when the process is + finished, it will change to redacted and an identity.verification_session.redacted event + will be emitted. + + Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the + fields that contain personal data will be replaced by the string [redacted] or a similar + placeholder. The metadata field will also be erased. Redacted objects cannot be updated or + used for any purpose. + + [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). + """ + return cast( + VerificationSession, + await self._request_async( + "post", + "/v1/identity/verification_sessions/{session}/redact".format( + session=sanitize_id(session), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index fdf4c8685..491baa895 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -1166,6 +1166,67 @@ def approve( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_approve_async( + cls, + authorization: str, + **params: Unpack["Authorization.ApproveParams"] + ) -> "Authorization": + """ + [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + """ + return cast( + "Authorization", + await cls._static_request_async( + "post", + "/v1/issuing/authorizations/{authorization}/approve".format( + authorization=sanitize_id(authorization) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def approve_async( + authorization: str, **params: Unpack["Authorization.ApproveParams"] + ) -> "Authorization": + """ + [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + """ + ... + + @overload + async def approve_async( + self, **params: Unpack["Authorization.ApproveParams"] + ) -> "Authorization": + """ + [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + """ + ... + + @class_method_variant("_cls_approve_async") + async def approve_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Authorization.ApproveParams"] + ) -> "Authorization": + """ + [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + """ + return cast( + "Authorization", + await self._request_async( + "post", + "/v1/issuing/authorizations/{authorization}/approve".format( + authorization=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_decline( cls, @@ -1227,6 +1288,67 @@ def decline( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_decline_async( + cls, + authorization: str, + **params: Unpack["Authorization.DeclineParams"] + ) -> "Authorization": + """ + [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + """ + return cast( + "Authorization", + await cls._static_request_async( + "post", + "/v1/issuing/authorizations/{authorization}/decline".format( + authorization=sanitize_id(authorization) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def decline_async( + authorization: str, **params: Unpack["Authorization.DeclineParams"] + ) -> "Authorization": + """ + [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + """ + ... + + @overload + async def decline_async( + self, **params: Unpack["Authorization.DeclineParams"] + ) -> "Authorization": + """ + [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + """ + ... + + @class_method_variant("_cls_decline_async") + async def decline_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Authorization.DeclineParams"] + ) -> "Authorization": + """ + [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + """ + return cast( + "Authorization", + await self._request_async( + "post", + "/v1/issuing/authorizations/{authorization}/decline".format( + authorization=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Authorization.ListParams"] @@ -1248,6 +1370,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Authorization.ListParams"] + ) -> ListObject["Authorization"]: + """ + Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Authorization.ModifyParams"] @@ -1265,6 +1408,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Authorization.ModifyParams"] + ) -> "Authorization": + """ + Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Authorization", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Authorization.RetrieveParams"] @@ -1276,6 +1436,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Authorization.RetrieveParams"] + ) -> "Authorization": + """ + Retrieves an Issuing Authorization object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + class TestHelpers(APIResourceTestHelpers["Authorization"]): _resource_cls: Type["Authorization"] @@ -1336,6 +1507,63 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_capture_async( + cls, + authorization: str, + **params: Unpack["Authorization.CaptureParams"] + ) -> "Authorization": + """ + Capture a test-mode authorization. + """ + return cast( + "Authorization", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( + authorization=sanitize_id(authorization) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def capture_async( + authorization: str, **params: Unpack["Authorization.CaptureParams"] + ) -> "Authorization": + """ + Capture a test-mode authorization. + """ + ... + + @overload + async def capture_async( + self, **params: Unpack["Authorization.CaptureParams"] + ) -> "Authorization": + """ + Capture a test-mode authorization. + """ + ... + + @class_method_variant("_cls_capture_async") + async def capture_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Authorization.CaptureParams"] + ) -> "Authorization": + """ + Capture a test-mode authorization. + """ + return cast( + "Authorization", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( + authorization=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def create( cls, **params: Unpack["Authorization.CreateParams"] @@ -1352,6 +1580,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Authorization.CreateParams"] + ) -> "Authorization": + """ + Create a test-mode authorization. + """ + return cast( + "Authorization", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/authorizations", + params=params, + ), + ) + @classmethod def _cls_expire( cls, @@ -1409,6 +1653,63 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_expire_async( + cls, + authorization: str, + **params: Unpack["Authorization.ExpireParams"] + ) -> "Authorization": + """ + Expire a test-mode Authorization. + """ + return cast( + "Authorization", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( + authorization=sanitize_id(authorization) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def expire_async( + authorization: str, **params: Unpack["Authorization.ExpireParams"] + ) -> "Authorization": + """ + Expire a test-mode Authorization. + """ + ... + + @overload + async def expire_async( + self, **params: Unpack["Authorization.ExpireParams"] + ) -> "Authorization": + """ + Expire a test-mode Authorization. + """ + ... + + @class_method_variant("_cls_expire_async") + async def expire_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Authorization.ExpireParams"] + ) -> "Authorization": + """ + Expire a test-mode Authorization. + """ + return cast( + "Authorization", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( + authorization=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_increment( cls, @@ -1467,6 +1768,64 @@ def increment( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_increment_async( + cls, + authorization: str, + **params: Unpack["Authorization.IncrementParams"] + ) -> "Authorization": + """ + Increment a test-mode Authorization. + """ + return cast( + "Authorization", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( + authorization=sanitize_id(authorization) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def increment_async( + authorization: str, + **params: Unpack["Authorization.IncrementParams"] + ) -> "Authorization": + """ + Increment a test-mode Authorization. + """ + ... + + @overload + async def increment_async( + self, **params: Unpack["Authorization.IncrementParams"] + ) -> "Authorization": + """ + Increment a test-mode Authorization. + """ + ... + + @class_method_variant("_cls_increment_async") + async def increment_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Authorization.IncrementParams"] + ) -> "Authorization": + """ + Increment a test-mode Authorization. + """ + return cast( + "Authorization", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( + authorization=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_reverse( cls, @@ -1524,6 +1883,63 @@ def reverse( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_reverse_async( + cls, + authorization: str, + **params: Unpack["Authorization.ReverseParams"] + ) -> "Authorization": + """ + Reverse a test-mode Authorization. + """ + return cast( + "Authorization", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( + authorization=sanitize_id(authorization) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def reverse_async( + authorization: str, **params: Unpack["Authorization.ReverseParams"] + ) -> "Authorization": + """ + Reverse a test-mode Authorization. + """ + ... + + @overload + async def reverse_async( + self, **params: Unpack["Authorization.ReverseParams"] + ) -> "Authorization": + """ + Reverse a test-mode Authorization. + """ + ... + + @class_method_variant("_cls_reverse_async") + async def reverse_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Authorization.ReverseParams"] + ) -> "Authorization": + """ + Reverse a test-mode Authorization. + """ + return cast( + "Authorization", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( + authorization=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/issuing/_authorization_service.py b/stripe/issuing/_authorization_service.py index 7ea57564f..20118487b 100644 --- a/stripe/issuing/_authorization_service.py +++ b/stripe/issuing/_authorization_service.py @@ -122,6 +122,26 @@ def list( ), ) + async def list_async( + self, + params: "AuthorizationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Authorization]: + """ + Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[Authorization], + await self._request_async( + "get", + "/v1/issuing/authorizations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, authorization: str, @@ -145,6 +165,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + authorization: str, + params: "AuthorizationService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Authorization: + """ + Retrieves an Issuing Authorization object. + """ + return cast( + Authorization, + await self._request_async( + "get", + "/v1/issuing/authorizations/{authorization}".format( + authorization=sanitize_id(authorization), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, authorization: str, @@ -168,6 +211,29 @@ def update( ), ) + async def update_async( + self, + authorization: str, + params: "AuthorizationService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Authorization: + """ + Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + return cast( + Authorization, + await self._request_async( + "post", + "/v1/issuing/authorizations/{authorization}".format( + authorization=sanitize_id(authorization), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def approve( self, authorization: str, @@ -192,6 +258,30 @@ def approve( ), ) + async def approve_async( + self, + authorization: str, + params: "AuthorizationService.ApproveParams" = {}, + options: RequestOptions = {}, + ) -> Authorization: + """ + [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + """ + return cast( + Authorization, + await self._request_async( + "post", + "/v1/issuing/authorizations/{authorization}/approve".format( + authorization=sanitize_id(authorization), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def decline( self, authorization: str, @@ -215,3 +305,27 @@ def decline( options=options, ), ) + + async def decline_async( + self, + authorization: str, + params: "AuthorizationService.DeclineParams" = {}, + options: RequestOptions = {}, + ) -> Authorization: + """ + [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + """ + return cast( + Authorization, + await self._request_async( + "post", + "/v1/issuing/authorizations/{authorization}/decline".format( + authorization=sanitize_id(authorization), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index 5f82cedc5..5ce50a858 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -3344,6 +3344,22 @@ def create(cls, **params: Unpack["Card.CreateParams"]) -> "Card": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Card.CreateParams"] + ) -> "Card": + """ + Creates an Issuing Card object. + """ + return cast( + "Card", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list(cls, **params: Unpack["Card.ListParams"]) -> ListObject["Card"]: """ @@ -3363,6 +3379,27 @@ def list(cls, **params: Unpack["Card.ListParams"]) -> ListObject["Card"]: return result + @classmethod + async def list_async( + cls, **params: Unpack["Card.ListParams"] + ) -> ListObject["Card"]: + """ + Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify(cls, id: str, **params: Unpack["Card.ModifyParams"]) -> "Card": """ @@ -3378,6 +3415,23 @@ def modify(cls, id: str, **params: Unpack["Card.ModifyParams"]) -> "Card": ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Card.ModifyParams"] + ) -> "Card": + """ + Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Card", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Card.RetrieveParams"] @@ -3389,6 +3443,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Card.RetrieveParams"] + ) -> "Card": + """ + Retrieves an Issuing Card object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + class TestHelpers(APIResourceTestHelpers["Card"]): _resource_cls: Type["Card"] @@ -3447,6 +3512,61 @@ def deliver_card( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_deliver_card_async( + cls, card: str, **params: Unpack["Card.DeliverCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to delivered. + """ + return cast( + "Card", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( + card=sanitize_id(card) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def deliver_card_async( + card: str, **params: Unpack["Card.DeliverCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to delivered. + """ + ... + + @overload + async def deliver_card_async( + self, **params: Unpack["Card.DeliverCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to delivered. + """ + ... + + @class_method_variant("_cls_deliver_card_async") + async def deliver_card_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Card.DeliverCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to delivered. + """ + return cast( + "Card", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( + card=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_fail_card( cls, card: str, **params: Unpack["Card.FailCardParams"] @@ -3500,6 +3620,61 @@ def fail_card( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_fail_card_async( + cls, card: str, **params: Unpack["Card.FailCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to failure. + """ + return cast( + "Card", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( + card=sanitize_id(card) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def fail_card_async( + card: str, **params: Unpack["Card.FailCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to failure. + """ + ... + + @overload + async def fail_card_async( + self, **params: Unpack["Card.FailCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to failure. + """ + ... + + @class_method_variant("_cls_fail_card_async") + async def fail_card_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Card.FailCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to failure. + """ + return cast( + "Card", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( + card=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_return_card( cls, card: str, **params: Unpack["Card.ReturnCardParams"] @@ -3555,6 +3730,61 @@ def return_card( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_return_card_async( + cls, card: str, **params: Unpack["Card.ReturnCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to returned. + """ + return cast( + "Card", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( + card=sanitize_id(card) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def return_card_async( + card: str, **params: Unpack["Card.ReturnCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to returned. + """ + ... + + @overload + async def return_card_async( + self, **params: Unpack["Card.ReturnCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to returned. + """ + ... + + @class_method_variant("_cls_return_card_async") + async def return_card_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Card.ReturnCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to returned. + """ + return cast( + "Card", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( + card=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_ship_card( cls, card: str, **params: Unpack["Card.ShipCardParams"] @@ -3608,6 +3838,61 @@ def ship_card( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_ship_card_async( + cls, card: str, **params: Unpack["Card.ShipCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to shipped. + """ + return cast( + "Card", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( + card=sanitize_id(card) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def ship_card_async( + card: str, **params: Unpack["Card.ShipCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to shipped. + """ + ... + + @overload + async def ship_card_async( + self, **params: Unpack["Card.ShipCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to shipped. + """ + ... + + @class_method_variant("_cls_ship_card_async") + async def ship_card_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Card.ShipCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to shipped. + """ + return cast( + "Card", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( + card=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/issuing/_card_service.py b/stripe/issuing/_card_service.py index 9e9e04ddb..1aa977c30 100644 --- a/stripe/issuing/_card_service.py +++ b/stripe/issuing/_card_service.py @@ -2137,6 +2137,26 @@ def list( ), ) + async def list_async( + self, + params: "CardService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Card]: + """ + Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[Card], + await self._request_async( + "get", + "/v1/issuing/cards", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "CardService.CreateParams", options: RequestOptions = {} ) -> Card: @@ -2155,6 +2175,24 @@ def create( ), ) + async def create_async( + self, params: "CardService.CreateParams", options: RequestOptions = {} + ) -> Card: + """ + Creates an Issuing Card object. + """ + return cast( + Card, + await self._request_async( + "post", + "/v1/issuing/cards", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, card: str, @@ -2176,6 +2214,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + card: str, + params: "CardService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Card: + """ + Retrieves an Issuing Card object. + """ + return cast( + Card, + await self._request_async( + "get", + "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, card: str, @@ -2196,3 +2255,24 @@ def update( options=options, ), ) + + async def update_async( + self, + card: str, + params: "CardService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Card: + """ + Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + return cast( + Card, + await self._request_async( + "post", + "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/issuing/_cardholder.py b/stripe/issuing/_cardholder.py index 6f9287d5d..9bebe54dc 100644 --- a/stripe/issuing/_cardholder.py +++ b/stripe/issuing/_cardholder.py @@ -3478,6 +3478,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Cardholder.CreateParams"] + ) -> "Cardholder": + """ + Creates a new Issuing Cardholder object that can be issued cards. + """ + return cast( + "Cardholder", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Cardholder.ListParams"] @@ -3499,6 +3515,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Cardholder.ListParams"] + ) -> ListObject["Cardholder"]: + """ + Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Cardholder.ModifyParams"] @@ -3516,6 +3553,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Cardholder.ModifyParams"] + ) -> "Cardholder": + """ + Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Cardholder", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Cardholder.RetrieveParams"] @@ -3527,6 +3581,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Cardholder.RetrieveParams"] + ) -> "Cardholder": + """ + Retrieves an Issuing Cardholder object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "billing": Billing, "company": Company, diff --git a/stripe/issuing/_cardholder_service.py b/stripe/issuing/_cardholder_service.py index 7a730fb51..590e33578 100644 --- a/stripe/issuing/_cardholder_service.py +++ b/stripe/issuing/_cardholder_service.py @@ -2312,6 +2312,26 @@ def list( ), ) + async def list_async( + self, + params: "CardholderService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Cardholder]: + """ + Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[Cardholder], + await self._request_async( + "get", + "/v1/issuing/cardholders", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "CardholderService.CreateParams", @@ -2332,6 +2352,26 @@ def create( ), ) + async def create_async( + self, + params: "CardholderService.CreateParams", + options: RequestOptions = {}, + ) -> Cardholder: + """ + Creates a new Issuing Cardholder object that can be issued cards. + """ + return cast( + Cardholder, + await self._request_async( + "post", + "/v1/issuing/cardholders", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, cardholder: str, @@ -2355,6 +2395,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + cardholder: str, + params: "CardholderService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Cardholder: + """ + Retrieves an Issuing Cardholder object. + """ + return cast( + Cardholder, + await self._request_async( + "get", + "/v1/issuing/cardholders/{cardholder}".format( + cardholder=sanitize_id(cardholder), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, cardholder: str, @@ -2377,3 +2440,26 @@ def update( options=options, ), ) + + async def update_async( + self, + cardholder: str, + params: "CardholderService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Cardholder: + """ + Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + return cast( + Cardholder, + await self._request_async( + "post", + "/v1/issuing/cardholders/{cardholder}".format( + cardholder=sanitize_id(cardholder), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/issuing/_dispute.py b/stripe/issuing/_dispute.py index 20b714afa..32c735376 100644 --- a/stripe/issuing/_dispute.py +++ b/stripe/issuing/_dispute.py @@ -882,6 +882,22 @@ def create(cls, **params: Unpack["Dispute.CreateParams"]) -> "Dispute": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Dispute.CreateParams"] + ) -> "Dispute": + """ + Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. + """ + return cast( + "Dispute", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Dispute.ListParams"] @@ -903,6 +919,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Dispute.ListParams"] + ) -> ListObject["Dispute"]: + """ + Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Dispute.ModifyParams"] @@ -920,6 +957,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Dispute.ModifyParams"] + ) -> "Dispute": + """ + Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Dispute", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Dispute.RetrieveParams"] @@ -931,6 +985,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Dispute.RetrieveParams"] + ) -> "Dispute": + """ + Retrieves an Issuing Dispute object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def _cls_submit( cls, dispute: str, **params: Unpack["Dispute.SubmitParams"] @@ -984,4 +1049,59 @@ def submit( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_submit_async( + cls, dispute: str, **params: Unpack["Dispute.SubmitParams"] + ) -> "Dispute": + """ + Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). + """ + return cast( + "Dispute", + await cls._static_request_async( + "post", + "/v1/issuing/disputes/{dispute}/submit".format( + dispute=sanitize_id(dispute) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def submit_async( + dispute: str, **params: Unpack["Dispute.SubmitParams"] + ) -> "Dispute": + """ + Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). + """ + ... + + @overload + async def submit_async( + self, **params: Unpack["Dispute.SubmitParams"] + ) -> "Dispute": + """ + Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). + """ + ... + + @class_method_variant("_cls_submit_async") + async def submit_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Dispute.SubmitParams"] + ) -> "Dispute": + """ + Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). + """ + return cast( + "Dispute", + await self._request_async( + "post", + "/v1/issuing/disputes/{dispute}/submit".format( + dispute=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + _inner_class_types = {"evidence": Evidence, "treasury": Treasury} diff --git a/stripe/issuing/_dispute_service.py b/stripe/issuing/_dispute_service.py index 7ed43fe19..4b567e3ce 100644 --- a/stripe/issuing/_dispute_service.py +++ b/stripe/issuing/_dispute_service.py @@ -614,6 +614,26 @@ def list( ), ) + async def list_async( + self, + params: "DisputeService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Dispute]: + """ + Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[Dispute], + await self._request_async( + "get", + "/v1/issuing/disputes", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "DisputeService.CreateParams" = {}, @@ -634,6 +654,26 @@ def create( ), ) + async def create_async( + self, + params: "DisputeService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Dispute: + """ + Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. + """ + return cast( + Dispute, + await self._request_async( + "post", + "/v1/issuing/disputes", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, dispute: str, @@ -657,6 +697,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + dispute: str, + params: "DisputeService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Dispute: + """ + Retrieves an Issuing Dispute object. + """ + return cast( + Dispute, + await self._request_async( + "get", + "/v1/issuing/disputes/{dispute}".format( + dispute=sanitize_id(dispute), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, dispute: str, @@ -680,6 +743,29 @@ def update( ), ) + async def update_async( + self, + dispute: str, + params: "DisputeService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Dispute: + """ + Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. + """ + return cast( + Dispute, + await self._request_async( + "post", + "/v1/issuing/disputes/{dispute}".format( + dispute=sanitize_id(dispute), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def submit( self, dispute: str, @@ -702,3 +788,26 @@ def submit( options=options, ), ) + + async def submit_async( + self, + dispute: str, + params: "DisputeService.SubmitParams" = {}, + options: RequestOptions = {}, + ) -> Dispute: + """ + Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). + """ + return cast( + Dispute, + await self._request_async( + "post", + "/v1/issuing/disputes/{dispute}/submit".format( + dispute=sanitize_id(dispute), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/issuing/_personalization_design.py b/stripe/issuing/_personalization_design.py index 6ef27050c..16b2aaa9d 100644 --- a/stripe/issuing/_personalization_design.py +++ b/stripe/issuing/_personalization_design.py @@ -400,6 +400,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["PersonalizationDesign.CreateParams"] + ) -> "PersonalizationDesign": + """ + Creates a personalization design object. + """ + return cast( + "PersonalizationDesign", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["PersonalizationDesign.ListParams"] @@ -421,6 +437,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["PersonalizationDesign.ListParams"] + ) -> ListObject["PersonalizationDesign"]: + """ + Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["PersonalizationDesign.ModifyParams"] @@ -438,6 +475,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["PersonalizationDesign.ModifyParams"] + ) -> "PersonalizationDesign": + """ + Updates a card personalization object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "PersonalizationDesign", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["PersonalizationDesign.RetrieveParams"] @@ -449,6 +503,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["PersonalizationDesign.RetrieveParams"] + ) -> "PersonalizationDesign": + """ + Retrieves a personalization design object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + class TestHelpers(APIResourceTestHelpers["PersonalizationDesign"]): _resource_cls: Type["PersonalizationDesign"] @@ -514,6 +579,68 @@ def activate( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_activate_async( + cls, + personalization_design: str, + **params: Unpack["PersonalizationDesign.ActivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to active. + """ + return cast( + "PersonalizationDesign", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( + personalization_design=sanitize_id( + personalization_design + ) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def activate_async( + personalization_design: str, + **params: Unpack["PersonalizationDesign.ActivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to active. + """ + ... + + @overload + async def activate_async( + self, **params: Unpack["PersonalizationDesign.ActivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to active. + """ + ... + + @class_method_variant("_cls_activate_async") + async def activate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PersonalizationDesign.ActivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to active. + """ + return cast( + "PersonalizationDesign", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( + personalization_design=sanitize_id( + self.resource.get("id") + ) + ), + params=params, + ), + ) + @classmethod def _cls_deactivate( cls, @@ -576,6 +703,68 @@ def deactivate( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_deactivate_async( + cls, + personalization_design: str, + **params: Unpack["PersonalizationDesign.DeactivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to inactive. + """ + return cast( + "PersonalizationDesign", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( + personalization_design=sanitize_id( + personalization_design + ) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def deactivate_async( + personalization_design: str, + **params: Unpack["PersonalizationDesign.DeactivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to inactive. + """ + ... + + @overload + async def deactivate_async( + self, **params: Unpack["PersonalizationDesign.DeactivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to inactive. + """ + ... + + @class_method_variant("_cls_deactivate_async") + async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PersonalizationDesign.DeactivateParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to inactive. + """ + return cast( + "PersonalizationDesign", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( + personalization_design=sanitize_id( + self.resource.get("id") + ) + ), + params=params, + ), + ) + @classmethod def _cls_reject( cls, @@ -638,6 +827,68 @@ def reject( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_reject_async( + cls, + personalization_design: str, + **params: Unpack["PersonalizationDesign.RejectParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to rejected. + """ + return cast( + "PersonalizationDesign", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( + personalization_design=sanitize_id( + personalization_design + ) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def reject_async( + personalization_design: str, + **params: Unpack["PersonalizationDesign.RejectParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to rejected. + """ + ... + + @overload + async def reject_async( + self, **params: Unpack["PersonalizationDesign.RejectParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to rejected. + """ + ... + + @class_method_variant("_cls_reject_async") + async def reject_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PersonalizationDesign.RejectParams"] + ) -> "PersonalizationDesign": + """ + Updates the status of the specified testmode personalization design object to rejected. + """ + return cast( + "PersonalizationDesign", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( + personalization_design=sanitize_id( + self.resource.get("id") + ) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/issuing/_personalization_design_service.py b/stripe/issuing/_personalization_design_service.py index 90d2808fb..259746c88 100644 --- a/stripe/issuing/_personalization_design_service.py +++ b/stripe/issuing/_personalization_design_service.py @@ -212,6 +212,26 @@ def list( ), ) + async def list_async( + self, + params: "PersonalizationDesignService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PersonalizationDesign]: + """ + Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[PersonalizationDesign], + await self._request_async( + "get", + "/v1/issuing/personalization_designs", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "PersonalizationDesignService.CreateParams", @@ -232,6 +252,26 @@ def create( ), ) + async def create_async( + self, + params: "PersonalizationDesignService.CreateParams", + options: RequestOptions = {}, + ) -> PersonalizationDesign: + """ + Creates a personalization design object. + """ + return cast( + PersonalizationDesign, + await self._request_async( + "post", + "/v1/issuing/personalization_designs", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, personalization_design: str, @@ -255,6 +295,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + personalization_design: str, + params: "PersonalizationDesignService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PersonalizationDesign: + """ + Retrieves a personalization design object. + """ + return cast( + PersonalizationDesign, + await self._request_async( + "get", + "/v1/issuing/personalization_designs/{personalization_design}".format( + personalization_design=sanitize_id(personalization_design), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, personalization_design: str, @@ -277,3 +340,26 @@ def update( options=options, ), ) + + async def update_async( + self, + personalization_design: str, + params: "PersonalizationDesignService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> PersonalizationDesign: + """ + Updates a card personalization object. + """ + return cast( + PersonalizationDesign, + await self._request_async( + "post", + "/v1/issuing/personalization_designs/{personalization_design}".format( + personalization_design=sanitize_id(personalization_design), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/issuing/_physical_bundle.py b/stripe/issuing/_physical_bundle.py index 4868a7da1..c5c5d0c82 100644 --- a/stripe/issuing/_physical_bundle.py +++ b/stripe/issuing/_physical_bundle.py @@ -110,6 +110,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["PhysicalBundle.ListParams"] + ) -> ListObject["PhysicalBundle"]: + """ + Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + 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["PhysicalBundle.RetrieveParams"] @@ -121,4 +142,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["PhysicalBundle.RetrieveParams"] + ) -> "PhysicalBundle": + """ + Retrieves a physical bundle object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"features": Features} diff --git a/stripe/issuing/_physical_bundle_service.py b/stripe/issuing/_physical_bundle_service.py index 55fa268b6..39722924d 100644 --- a/stripe/issuing/_physical_bundle_service.py +++ b/stripe/issuing/_physical_bundle_service.py @@ -62,6 +62,26 @@ def list( ), ) + async def list_async( + self, + params: "PhysicalBundleService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PhysicalBundle]: + """ + Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[PhysicalBundle], + await self._request_async( + "get", + "/v1/issuing/physical_bundles", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, physical_bundle: str, @@ -84,3 +104,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + physical_bundle: str, + params: "PhysicalBundleService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PhysicalBundle: + """ + Retrieves a physical bundle object. + """ + return cast( + PhysicalBundle, + await self._request_async( + "get", + "/v1/issuing/physical_bundles/{physical_bundle}".format( + physical_bundle=sanitize_id(physical_bundle), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/issuing/_token.py b/stripe/issuing/_token.py index 1d3407e26..cd22e21f6 100644 --- a/stripe/issuing/_token.py +++ b/stripe/issuing/_token.py @@ -325,6 +325,27 @@ def list(cls, **params: Unpack["Token.ListParams"]) -> ListObject["Token"]: return result + @classmethod + async def list_async( + cls, **params: Unpack["Token.ListParams"] + ) -> ListObject["Token"]: + """ + Lists all Issuing Token objects for a given card. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Token.ModifyParams"] @@ -342,6 +363,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Token.ModifyParams"] + ) -> "Token": + """ + Attempts to update the specified Issuing Token object to the status specified. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Token", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Token.RetrieveParams"] @@ -353,4 +391,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Token.RetrieveParams"] + ) -> "Token": + """ + Retrieves an Issuing Token object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"network_data": NetworkData} diff --git a/stripe/issuing/_token_service.py b/stripe/issuing/_token_service.py index 521636b68..6a6b99d20 100644 --- a/stripe/issuing/_token_service.py +++ b/stripe/issuing/_token_service.py @@ -94,6 +94,24 @@ def list( ), ) + async def list_async( + self, params: "TokenService.ListParams", options: RequestOptions = {} + ) -> ListObject[Token]: + """ + Lists all Issuing Token objects for a given card. + """ + return cast( + ListObject[Token], + await self._request_async( + "get", + "/v1/issuing/tokens", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, token: str, @@ -115,6 +133,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + token: str, + params: "TokenService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Token: + """ + Retrieves an Issuing Token object. + """ + return cast( + Token, + await self._request_async( + "get", + "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, token: str, @@ -135,3 +174,24 @@ def update( options=options, ), ) + + async def update_async( + self, + token: str, + params: "TokenService.UpdateParams", + options: RequestOptions = {}, + ) -> Token: + """ + Attempts to update the specified Issuing Token object to the status specified. + """ + return cast( + Token, + await self._request_async( + "post", + "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index 4c6184ce0..7746593dc 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -1407,6 +1407,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Transaction.ListParams"] + ) -> ListObject["Transaction"]: + """ + Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Transaction.ModifyParams"] @@ -1424,6 +1445,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Transaction.ModifyParams"] + ) -> "Transaction": + """ + Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Transaction", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Transaction.RetrieveParams"] @@ -1435,6 +1473,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Transaction.RetrieveParams"] + ) -> "Transaction": + """ + Retrieves an Issuing Transaction object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + class TestHelpers(APIResourceTestHelpers["Transaction"]): _resource_cls: Type["Transaction"] @@ -1454,6 +1503,22 @@ def create_force_capture( ), ) + @classmethod + async def create_force_capture_async( + cls, **params: Unpack["Transaction.CreateForceCaptureParams"] + ) -> "Transaction": + """ + Allows the user to capture an arbitrary amount, also known as a forced capture. + """ + return cast( + "Transaction", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/transactions/create_force_capture", + params=params, + ), + ) + @classmethod def create_unlinked_refund( cls, **params: Unpack["Transaction.CreateUnlinkedRefundParams"] @@ -1470,6 +1535,22 @@ def create_unlinked_refund( ), ) + @classmethod + async def create_unlinked_refund_async( + cls, **params: Unpack["Transaction.CreateUnlinkedRefundParams"] + ) -> "Transaction": + """ + Allows the user to refund an arbitrary amount, also known as a unlinked refund. + """ + return cast( + "Transaction", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/transactions/create_unlinked_refund", + params=params, + ), + ) + @classmethod def _cls_refund( cls, transaction: str, **params: Unpack["Transaction.RefundParams"] @@ -1525,6 +1606,61 @@ def refund( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_refund_async( + cls, transaction: str, **params: Unpack["Transaction.RefundParams"] + ) -> "Transaction": + """ + Refund a test-mode Transaction. + """ + return cast( + "Transaction", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( + transaction=sanitize_id(transaction) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def refund_async( + transaction: str, **params: Unpack["Transaction.RefundParams"] + ) -> "Transaction": + """ + Refund a test-mode Transaction. + """ + ... + + @overload + async def refund_async( + self, **params: Unpack["Transaction.RefundParams"] + ) -> "Transaction": + """ + Refund a test-mode Transaction. + """ + ... + + @class_method_variant("_cls_refund_async") + async def refund_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Transaction.RefundParams"] + ) -> "Transaction": + """ + Refund a test-mode Transaction. + """ + return cast( + "Transaction", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( + transaction=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/issuing/_transaction_service.py b/stripe/issuing/_transaction_service.py index 6910fa538..178c73832 100644 --- a/stripe/issuing/_transaction_service.py +++ b/stripe/issuing/_transaction_service.py @@ -98,6 +98,26 @@ def list( ), ) + async def list_async( + self, + params: "TransactionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Transaction]: + """ + Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[Transaction], + await self._request_async( + "get", + "/v1/issuing/transactions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, transaction: str, @@ -121,6 +141,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + transaction: str, + params: "TransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Transaction: + """ + Retrieves an Issuing Transaction object. + """ + return cast( + Transaction, + await self._request_async( + "get", + "/v1/issuing/transactions/{transaction}".format( + transaction=sanitize_id(transaction), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, transaction: str, @@ -143,3 +186,26 @@ def update( options=options, ), ) + + async def update_async( + self, + transaction: str, + params: "TransactionService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Transaction: + """ + Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + return cast( + Transaction, + await self._request_async( + "post", + "/v1/issuing/transactions/{transaction}".format( + transaction=sanitize_id(transaction), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/radar/_early_fraud_warning.py b/stripe/radar/_early_fraud_warning.py index 81899d553..5a6c54658 100644 --- a/stripe/radar/_early_fraud_warning.py +++ b/stripe/radar/_early_fraud_warning.py @@ -138,6 +138,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["EarlyFraudWarning.ListParams"] + ) -> ListObject["EarlyFraudWarning"]: + """ + Returns a list of early fraud warnings. + """ + 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["EarlyFraudWarning.RetrieveParams"] @@ -150,3 +171,16 @@ def retrieve( instance = cls(id, **params) instance.refresh() return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["EarlyFraudWarning.RetrieveParams"] + ) -> "EarlyFraudWarning": + """ + Retrieves the details of an early fraud warning that has previously been created. + + Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/radar/_early_fraud_warning_service.py b/stripe/radar/_early_fraud_warning_service.py index 31940e009..2118f15cb 100644 --- a/stripe/radar/_early_fraud_warning_service.py +++ b/stripe/radar/_early_fraud_warning_service.py @@ -84,6 +84,26 @@ def list( ), ) + async def list_async( + self, + params: "EarlyFraudWarningService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[EarlyFraudWarning]: + """ + Returns a list of early fraud warnings. + """ + return cast( + ListObject[EarlyFraudWarning], + await self._request_async( + "get", + "/v1/radar/early_fraud_warnings", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, early_fraud_warning: str, @@ -108,3 +128,28 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + early_fraud_warning: str, + params: "EarlyFraudWarningService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> EarlyFraudWarning: + """ + Retrieves the details of an early fraud warning that has previously been created. + + Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. + """ + return cast( + EarlyFraudWarning, + await self._request_async( + "get", + "/v1/radar/early_fraud_warnings/{early_fraud_warning}".format( + early_fraud_warning=sanitize_id(early_fraud_warning), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/radar/_value_list.py b/stripe/radar/_value_list.py index ed0fa44c7..158494dac 100644 --- a/stripe/radar/_value_list.py +++ b/stripe/radar/_value_list.py @@ -214,6 +214,22 @@ def create(cls, **params: Unpack["ValueList.CreateParams"]) -> "ValueList": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["ValueList.CreateParams"] + ) -> "ValueList": + """ + Creates a new ValueList object, which can then be referenced in rules. + """ + return cast( + "ValueList", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["ValueList.DeleteParams"] @@ -263,6 +279,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["ValueList.DeleteParams"] + ) -> "ValueList": + """ + Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "ValueList", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["ValueList.DeleteParams"] + ) -> "ValueList": + """ + Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["ValueList.DeleteParams"] + ) -> "ValueList": + """ + Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["ValueList.DeleteParams"] + ) -> "ValueList": + """ + Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["ValueList.ListParams"] @@ -284,6 +349,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["ValueList.ListParams"] + ) -> ListObject["ValueList"]: + """ + Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["ValueList.ModifyParams"] @@ -301,6 +387,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["ValueList.ModifyParams"] + ) -> "ValueList": + """ + Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "ValueList", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["ValueList.RetrieveParams"] @@ -311,3 +414,14 @@ def retrieve( instance = cls(id, **params) instance.refresh() return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ValueList.RetrieveParams"] + ) -> "ValueList": + """ + Retrieves a ValueList object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/radar/_value_list_item.py b/stripe/radar/_value_list_item.py index b90795c6c..b48d9d542 100644 --- a/stripe/radar/_value_list_item.py +++ b/stripe/radar/_value_list_item.py @@ -145,6 +145,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["ValueListItem.CreateParams"] + ) -> "ValueListItem": + """ + Creates a new ValueListItem object, which is added to the specified parent value list. + """ + return cast( + "ValueListItem", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["ValueListItem.DeleteParams"] @@ -194,6 +210,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["ValueListItem.DeleteParams"] + ) -> "ValueListItem": + """ + Deletes a ValueListItem object, removing it from its parent value list. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "ValueListItem", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["ValueListItem.DeleteParams"] + ) -> "ValueListItem": + """ + Deletes a ValueListItem object, removing it from its parent value list. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["ValueListItem.DeleteParams"] + ) -> "ValueListItem": + """ + Deletes a ValueListItem object, removing it from its parent value list. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["ValueListItem.DeleteParams"] + ) -> "ValueListItem": + """ + Deletes a ValueListItem object, removing it from its parent value list. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["ValueListItem.ListParams"] @@ -215,6 +280,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["ValueListItem.ListParams"] + ) -> ListObject["ValueListItem"]: + """ + Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + 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["ValueListItem.RetrieveParams"] @@ -225,3 +311,14 @@ def retrieve( instance = cls(id, **params) instance.refresh() return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ValueListItem.RetrieveParams"] + ) -> "ValueListItem": + """ + Retrieves a ValueListItem object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/radar/_value_list_item_service.py b/stripe/radar/_value_list_item_service.py index 477715442..60c54fec2 100644 --- a/stripe/radar/_value_list_item_service.py +++ b/stripe/radar/_value_list_item_service.py @@ -104,6 +104,29 @@ def delete( ), ) + async def delete_async( + self, + item: str, + params: "ValueListItemService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> ValueListItem: + """ + Deletes a ValueListItem object, removing it from its parent value list. + """ + return cast( + ValueListItem, + await self._request_async( + "delete", + "/v1/radar/value_list_items/{item}".format( + item=sanitize_id(item), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, item: str, @@ -127,6 +150,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + item: str, + params: "ValueListItemService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ValueListItem: + """ + Retrieves a ValueListItem object. + """ + return cast( + ValueListItem, + await self._request_async( + "get", + "/v1/radar/value_list_items/{item}".format( + item=sanitize_id(item), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "ValueListItemService.ListParams", @@ -147,6 +193,26 @@ def list( ), ) + async def list_async( + self, + params: "ValueListItemService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[ValueListItem]: + """ + Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[ValueListItem], + await self._request_async( + "get", + "/v1/radar/value_list_items", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "ValueListItemService.CreateParams", @@ -166,3 +232,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "ValueListItemService.CreateParams", + options: RequestOptions = {}, + ) -> ValueListItem: + """ + Creates a new ValueListItem object, which is added to the specified parent value list. + """ + return cast( + ValueListItem, + await self._request_async( + "post", + "/v1/radar/value_list_items", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/radar/_value_list_service.py b/stripe/radar/_value_list_service.py index a63d09724..f0e9e330d 100644 --- a/stripe/radar/_value_list_service.py +++ b/stripe/radar/_value_list_service.py @@ -143,6 +143,29 @@ def delete( ), ) + async def delete_async( + self, + value_list: str, + params: "ValueListService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> ValueList: + """ + Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. + """ + return cast( + ValueList, + await self._request_async( + "delete", + "/v1/radar/value_lists/{value_list}".format( + value_list=sanitize_id(value_list), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, value_list: str, @@ -166,6 +189,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + value_list: str, + params: "ValueListService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ValueList: + """ + Retrieves a ValueList object. + """ + return cast( + ValueList, + await self._request_async( + "get", + "/v1/radar/value_lists/{value_list}".format( + value_list=sanitize_id(value_list), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, value_list: str, @@ -189,6 +235,29 @@ def update( ), ) + async def update_async( + self, + value_list: str, + params: "ValueListService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> ValueList: + """ + Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. + """ + return cast( + ValueList, + await self._request_async( + "post", + "/v1/radar/value_lists/{value_list}".format( + value_list=sanitize_id(value_list), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "ValueListService.ListParams" = {}, @@ -209,6 +278,26 @@ def list( ), ) + async def list_async( + self, + params: "ValueListService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ValueList]: + """ + Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[ValueList], + await self._request_async( + "get", + "/v1/radar/value_lists", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "ValueListService.CreateParams", @@ -228,3 +317,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "ValueListService.CreateParams", + options: RequestOptions = {}, + ) -> ValueList: + """ + Creates a new ValueList object, which can then be referenced in rules. + """ + return cast( + ValueList, + await self._request_async( + "post", + "/v1/radar/value_lists", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/reporting/_report_run.py b/stripe/reporting/_report_run.py index b97af6367..9cdbb1754 100644 --- a/stripe/reporting/_report_run.py +++ b/stripe/reporting/_report_run.py @@ -864,6 +864,22 @@ def create(cls, **params: Unpack["ReportRun.CreateParams"]) -> "ReportRun": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["ReportRun.CreateParams"] + ) -> "ReportRun": + """ + Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) + """ + return cast( + "ReportRun", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["ReportRun.ListParams"] @@ -885,6 +901,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["ReportRun.ListParams"] + ) -> ListObject["ReportRun"]: + """ + Returns a list of Report Runs, with the most recent appearing first. + """ + 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["ReportRun.RetrieveParams"] @@ -896,4 +933,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ReportRun.RetrieveParams"] + ) -> "ReportRun": + """ + Retrieves the details of an existing Report Run. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"parameters": Parameters} diff --git a/stripe/reporting/_report_run_service.py b/stripe/reporting/_report_run_service.py index d1c47f95c..dfdc1a0c7 100644 --- a/stripe/reporting/_report_run_service.py +++ b/stripe/reporting/_report_run_service.py @@ -766,6 +766,26 @@ def list( ), ) + async def list_async( + self, + params: "ReportRunService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ReportRun]: + """ + Returns a list of Report Runs, with the most recent appearing first. + """ + return cast( + ListObject[ReportRun], + await self._request_async( + "get", + "/v1/reporting/report_runs", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "ReportRunService.CreateParams", @@ -786,6 +806,26 @@ def create( ), ) + async def create_async( + self, + params: "ReportRunService.CreateParams", + options: RequestOptions = {}, + ) -> ReportRun: + """ + Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) + """ + return cast( + ReportRun, + await self._request_async( + "post", + "/v1/reporting/report_runs", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, report_run: str, @@ -808,3 +848,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + report_run: str, + params: "ReportRunService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ReportRun: + """ + Retrieves the details of an existing Report Run. + """ + return cast( + ReportRun, + await self._request_async( + "get", + "/v1/reporting/report_runs/{report_run}".format( + report_run=sanitize_id(report_run), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/reporting/_report_type.py b/stripe/reporting/_report_type.py index 7e0eeff2b..b6e476595 100644 --- a/stripe/reporting/_report_type.py +++ b/stripe/reporting/_report_type.py @@ -93,6 +93,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["ReportType.ListParams"] + ) -> ListObject["ReportType"]: + """ + Returns a full list of Report Types. + """ + 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["ReportType.RetrieveParams"] @@ -103,3 +124,14 @@ def retrieve( instance = cls(id, **params) instance.refresh() return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ReportType.RetrieveParams"] + ) -> "ReportType": + """ + Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/reporting/_report_type_service.py b/stripe/reporting/_report_type_service.py index b8075889f..e50f78037 100644 --- a/stripe/reporting/_report_type_service.py +++ b/stripe/reporting/_report_type_service.py @@ -42,6 +42,26 @@ def list( ), ) + async def list_async( + self, + params: "ReportTypeService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ReportType]: + """ + Returns a full list of Report Types. + """ + return cast( + ListObject[ReportType], + await self._request_async( + "get", + "/v1/reporting/report_types", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, report_type: str, @@ -64,3 +84,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + report_type: str, + params: "ReportTypeService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ReportType: + """ + Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) + """ + return cast( + ReportType, + await self._request_async( + "get", + "/v1/reporting/report_types/{report_type}".format( + report_type=sanitize_id(report_type), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/sigma/_scheduled_query_run.py b/stripe/sigma/_scheduled_query_run.py index 1f8be909b..aef65a5d0 100644 --- a/stripe/sigma/_scheduled_query_run.py +++ b/stripe/sigma/_scheduled_query_run.py @@ -116,6 +116,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["ScheduledQueryRun.ListParams"] + ) -> ListObject["ScheduledQueryRun"]: + """ + Returns a list of scheduled query runs. + """ + 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["ScheduledQueryRun.RetrieveParams"] @@ -127,6 +148,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ScheduledQueryRun.RetrieveParams"] + ) -> "ScheduledQueryRun": + """ + Retrieves the details of an scheduled query run. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def class_url(cls): return "/v1/sigma/scheduled_query_runs" diff --git a/stripe/sigma/_scheduled_query_run_service.py b/stripe/sigma/_scheduled_query_run_service.py index 3648820a1..55bec997f 100644 --- a/stripe/sigma/_scheduled_query_run_service.py +++ b/stripe/sigma/_scheduled_query_run_service.py @@ -54,6 +54,26 @@ def list( ), ) + async def list_async( + self, + params: "ScheduledQueryRunService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ScheduledQueryRun]: + """ + Returns a list of scheduled query runs. + """ + return cast( + ListObject[ScheduledQueryRun], + await self._request_async( + "get", + "/v1/sigma/scheduled_query_runs", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, scheduled_query_run: str, @@ -76,3 +96,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + scheduled_query_run: str, + params: "ScheduledQueryRunService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ScheduledQueryRun: + """ + Retrieves the details of an scheduled query run. + """ + return cast( + ScheduledQueryRun, + await self._request_async( + "get", + "/v1/sigma/scheduled_query_runs/{scheduled_query_run}".format( + scheduled_query_run=sanitize_id(scheduled_query_run), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 1af54da48..f15f43fd8 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -637,6 +637,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Calculation.CreateParams"] + ) -> "Calculation": + """ + Calculates tax based on input and returns a Tax Calculation object. + """ + return cast( + "Calculation", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_list_line_items( cls, @@ -694,6 +710,63 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_list_line_items_async( + cls, + calculation: str, + **params: Unpack["Calculation.ListLineItemsParams"] + ) -> ListObject["CalculationLineItem"]: + """ + Retrieves the line items of a persisted tax calculation as a collection. + """ + return cast( + ListObject["CalculationLineItem"], + await cls._static_request_async( + "get", + "/v1/tax/calculations/{calculation}/line_items".format( + calculation=sanitize_id(calculation) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def list_line_items_async( + calculation: str, **params: Unpack["Calculation.ListLineItemsParams"] + ) -> ListObject["CalculationLineItem"]: + """ + Retrieves the line items of a persisted tax calculation as a collection. + """ + ... + + @overload + async def list_line_items_async( + self, **params: Unpack["Calculation.ListLineItemsParams"] + ) -> ListObject["CalculationLineItem"]: + """ + Retrieves the line items of a persisted tax calculation as a collection. + """ + ... + + @class_method_variant("_cls_list_line_items_async") + async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Calculation.ListLineItemsParams"] + ) -> ListObject["CalculationLineItem"]: + """ + Retrieves the line items of a persisted tax calculation as a collection. + """ + return cast( + ListObject["CalculationLineItem"], + await self._request_async( + "get", + "/v1/tax/calculations/{calculation}/line_items".format( + calculation=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + _inner_class_types = { "customer_details": CustomerDetails, "shipping_cost": ShippingCost, diff --git a/stripe/tax/_calculation_line_item_service.py b/stripe/tax/_calculation_line_item_service.py index 7107782b9..1061d0ed2 100644 --- a/stripe/tax/_calculation_line_item_service.py +++ b/stripe/tax/_calculation_line_item_service.py @@ -50,3 +50,26 @@ def list( options=options, ), ) + + async def list_async( + self, + calculation: str, + params: "CalculationLineItemService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[CalculationLineItem]: + """ + Retrieves the line items of a persisted tax calculation as a collection. + """ + return cast( + ListObject[CalculationLineItem], + await self._request_async( + "get", + "/v1/tax/calculations/{calculation}/line_items".format( + calculation=sanitize_id(calculation), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index 77c8d7096..5f649cb9e 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -244,3 +244,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "CalculationService.CreateParams", + options: RequestOptions = {}, + ) -> Calculation: + """ + Calculates tax based on input and returns a Tax Calculation object. + """ + return cast( + Calculation, + await self._request_async( + "post", + "/v1/tax/calculations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index 623063d09..b6c707f05 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -1650,6 +1650,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Registration.CreateParams"] + ) -> "Registration": + """ + Creates a new Tax Registration object. + """ + return cast( + "Registration", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["Registration.ListParams"] @@ -1671,6 +1687,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Registration.ListParams"] + ) -> ListObject["Registration"]: + """ + Returns a list of Tax Registration objects. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Registration.ModifyParams"] @@ -1690,6 +1727,25 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Registration.ModifyParams"] + ) -> "Registration": + """ + Updates an existing Tax Registration object. + + A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Registration", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Registration.RetrieveParams"] @@ -1701,4 +1757,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Registration.RetrieveParams"] + ) -> "Registration": + """ + Returns a Tax Registration object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"country_options": CountryOptions} diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index bcaa78d14..f9429be5f 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -960,6 +960,26 @@ def list( ), ) + async def list_async( + self, + params: "RegistrationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Registration]: + """ + Returns a list of Tax Registration objects. + """ + return cast( + ListObject[Registration], + await self._request_async( + "get", + "/v1/tax/registrations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "RegistrationService.CreateParams", @@ -980,6 +1000,26 @@ def create( ), ) + async def create_async( + self, + params: "RegistrationService.CreateParams", + options: RequestOptions = {}, + ) -> Registration: + """ + Creates a new Tax Registration object. + """ + return cast( + Registration, + await self._request_async( + "post", + "/v1/tax/registrations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -1001,6 +1041,27 @@ def retrieve( ), ) + async def retrieve_async( + self, + id: str, + params: "RegistrationService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Registration: + """ + Returns a Tax Registration object. + """ + return cast( + Registration, + await self._request_async( + "get", + "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, id: str, @@ -1023,3 +1084,26 @@ def update( options=options, ), ) + + async def update_async( + self, + id: str, + params: "RegistrationService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Registration: + """ + Updates an existing Tax Registration object. + + A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at. + """ + return cast( + Registration, + await self._request_async( + "post", + "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/tax/_settings.py b/stripe/tax/_settings.py index cf8615d50..c8454342a 100644 --- a/stripe/tax/_settings.py +++ b/stripe/tax/_settings.py @@ -173,6 +173,22 @@ def modify(cls, **params: Unpack["Settings.ModifyParams"]) -> "Settings": ), ) + @classmethod + async def modify_async( + cls, **params: Unpack["Settings.ModifyParams"] + ) -> "Settings": + """ + Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. + """ + return cast( + "Settings", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def retrieve( cls, **params: Unpack["Settings.RetrieveParams"] @@ -184,6 +200,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, **params: Unpack["Settings.RetrieveParams"] + ) -> "Settings": + """ + Retrieves Tax Settings for a merchant. + """ + instance = cls(None, **params) + await instance.refresh_async() + return instance + @classmethod def class_url(cls): return "/v1/tax/settings" diff --git a/stripe/tax/_settings_service.py b/stripe/tax/_settings_service.py index 542a4675f..63903ccff 100644 --- a/stripe/tax/_settings_service.py +++ b/stripe/tax/_settings_service.py @@ -92,6 +92,26 @@ def retrieve( ), ) + async def retrieve_async( + self, + params: "SettingsService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Settings: + """ + Retrieves Tax Settings for a merchant. + """ + return cast( + Settings, + await self._request_async( + "get", + "/v1/tax/settings", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, params: "SettingsService.UpdateParams" = {}, @@ -111,3 +131,23 @@ def update( options=options, ), ) + + async def update_async( + self, + params: "SettingsService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Settings: + """ + Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. + """ + return cast( + Settings, + await self._request_async( + "post", + "/v1/tax/settings", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index 6c9323bda..c2aea6e9f 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -466,6 +466,22 @@ def create_from_calculation( ), ) + @classmethod + async def create_from_calculation_async( + cls, **params: Unpack["Transaction.CreateFromCalculationParams"] + ) -> "Transaction": + """ + Creates a Tax Transaction from a calculation. + """ + return cast( + "Transaction", + await cls._static_request_async( + "post", + "/v1/tax/transactions/create_from_calculation", + params=params, + ), + ) + @classmethod def create_reversal( cls, **params: Unpack["Transaction.CreateReversalParams"] @@ -482,6 +498,22 @@ def create_reversal( ), ) + @classmethod + async def create_reversal_async( + cls, **params: Unpack["Transaction.CreateReversalParams"] + ) -> "Transaction": + """ + Partially or fully reverses a previously created Transaction. + """ + return cast( + "Transaction", + await cls._static_request_async( + "post", + "/v1/tax/transactions/create_reversal", + params=params, + ), + ) + @classmethod def _cls_list_line_items( cls, @@ -539,6 +571,63 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_list_line_items_async( + cls, + transaction: str, + **params: Unpack["Transaction.ListLineItemsParams"] + ) -> ListObject["TransactionLineItem"]: + """ + Retrieves the line items of a committed standalone transaction as a collection. + """ + return cast( + ListObject["TransactionLineItem"], + await cls._static_request_async( + "get", + "/v1/tax/transactions/{transaction}/line_items".format( + transaction=sanitize_id(transaction) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def list_line_items_async( + transaction: str, **params: Unpack["Transaction.ListLineItemsParams"] + ) -> ListObject["TransactionLineItem"]: + """ + Retrieves the line items of a committed standalone transaction as a collection. + """ + ... + + @overload + async def list_line_items_async( + self, **params: Unpack["Transaction.ListLineItemsParams"] + ) -> ListObject["TransactionLineItem"]: + """ + Retrieves the line items of a committed standalone transaction as a collection. + """ + ... + + @class_method_variant("_cls_list_line_items_async") + async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Transaction.ListLineItemsParams"] + ) -> ListObject["TransactionLineItem"]: + """ + Retrieves the line items of a committed standalone transaction as a collection. + """ + return cast( + ListObject["TransactionLineItem"], + await self._request_async( + "get", + "/v1/tax/transactions/{transaction}/line_items".format( + transaction=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Transaction.RetrieveParams"] @@ -550,6 +639,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Transaction.RetrieveParams"] + ) -> "Transaction": + """ + Retrieves a Tax Transaction object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "customer_details": CustomerDetails, "reversal": Reversal, diff --git a/stripe/tax/_transaction_line_item_service.py b/stripe/tax/_transaction_line_item_service.py index be470515c..2a50b2fd5 100644 --- a/stripe/tax/_transaction_line_item_service.py +++ b/stripe/tax/_transaction_line_item_service.py @@ -50,3 +50,26 @@ def list( options=options, ), ) + + async def list_async( + self, + transaction: str, + params: "TransactionLineItemService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[TransactionLineItem]: + """ + Retrieves the line items of a committed standalone transaction as a collection. + """ + return cast( + ListObject[TransactionLineItem], + await self._request_async( + "get", + "/v1/tax/transactions/{transaction}/line_items".format( + transaction=sanitize_id(transaction), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/tax/_transaction_service.py b/stripe/tax/_transaction_service.py index 170184291..d4d488996 100644 --- a/stripe/tax/_transaction_service.py +++ b/stripe/tax/_transaction_service.py @@ -137,6 +137,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + transaction: str, + params: "TransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Transaction: + """ + Retrieves a Tax Transaction object. + """ + return cast( + Transaction, + await self._request_async( + "get", + "/v1/tax/transactions/{transaction}".format( + transaction=sanitize_id(transaction), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create_from_calculation( self, params: "TransactionService.CreateFromCalculationParams", @@ -157,6 +180,26 @@ def create_from_calculation( ), ) + async def create_from_calculation_async( + self, + params: "TransactionService.CreateFromCalculationParams", + options: RequestOptions = {}, + ) -> Transaction: + """ + Creates a Tax Transaction from a calculation. + """ + return cast( + Transaction, + await self._request_async( + "post", + "/v1/tax/transactions/create_from_calculation", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create_reversal( self, params: "TransactionService.CreateReversalParams", @@ -176,3 +219,23 @@ def create_reversal( options=options, ), ) + + async def create_reversal_async( + self, + params: "TransactionService.CreateReversalParams", + options: RequestOptions = {}, + ) -> Transaction: + """ + Partially or fully reverses a previously created Transaction. + """ + return cast( + Transaction, + await self._request_async( + "post", + "/v1/tax/transactions/create_reversal", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index e9c8c4135..786a5f0ba 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -958,6 +958,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Configuration.CreateParams"] + ) -> "Configuration": + """ + Creates a new Configuration object. + """ + return cast( + "Configuration", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Configuration.DeleteParams"] @@ -1007,6 +1023,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["Configuration.DeleteParams"] + ) -> "Configuration": + """ + Deletes a Configuration object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "Configuration", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["Configuration.DeleteParams"] + ) -> "Configuration": + """ + Deletes a Configuration object. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["Configuration.DeleteParams"] + ) -> "Configuration": + """ + Deletes a Configuration object. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Configuration.DeleteParams"] + ) -> "Configuration": + """ + Deletes a Configuration object. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["Configuration.ListParams"] @@ -1028,6 +1093,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Configuration.ListParams"] + ) -> ListObject["Configuration"]: + """ + Returns a list of Configuration objects. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Configuration.ModifyParams"] @@ -1045,6 +1131,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Configuration.ModifyParams"] + ) -> "Configuration": + """ + Updates a new Configuration object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Configuration", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Configuration.RetrieveParams"] @@ -1056,6 +1159,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Configuration.RetrieveParams"] + ) -> "Configuration": + """ + Retrieves a Configuration object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "bbpos_wisepos_e": BbposWiseposE, "offline": Offline, diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index b7544544f..76740d703 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -676,6 +676,29 @@ def delete( ), ) + async def delete_async( + self, + configuration: str, + params: "ConfigurationService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Configuration: + """ + Deletes a Configuration object. + """ + return cast( + Configuration, + await self._request_async( + "delete", + "/v1/terminal/configurations/{configuration}".format( + configuration=sanitize_id(configuration), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, configuration: str, @@ -699,6 +722,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + configuration: str, + params: "ConfigurationService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Configuration: + """ + Retrieves a Configuration object. + """ + return cast( + Configuration, + await self._request_async( + "get", + "/v1/terminal/configurations/{configuration}".format( + configuration=sanitize_id(configuration), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, configuration: str, @@ -722,6 +768,29 @@ def update( ), ) + async def update_async( + self, + configuration: str, + params: "ConfigurationService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Configuration: + """ + Updates a new Configuration object. + """ + return cast( + Configuration, + await self._request_async( + "post", + "/v1/terminal/configurations/{configuration}".format( + configuration=sanitize_id(configuration), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "ConfigurationService.ListParams" = {}, @@ -742,6 +811,26 @@ def list( ), ) + async def list_async( + self, + params: "ConfigurationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Configuration]: + """ + Returns a list of Configuration objects. + """ + return cast( + ListObject[Configuration], + await self._request_async( + "get", + "/v1/terminal/configurations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "ConfigurationService.CreateParams" = {}, @@ -761,3 +850,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "ConfigurationService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Configuration: + """ + Creates a new Configuration object. + """ + return cast( + Configuration, + await self._request_async( + "post", + "/v1/terminal/configurations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/terminal/_connection_token.py b/stripe/terminal/_connection_token.py index df2e31c5b..294eb02b7 100644 --- a/stripe/terminal/_connection_token.py +++ b/stripe/terminal/_connection_token.py @@ -55,3 +55,19 @@ def create( params=params, ), ) + + @classmethod + async def create_async( + cls, **params: Unpack["ConnectionToken.CreateParams"] + ) -> "ConnectionToken": + """ + To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. + """ + return cast( + "ConnectionToken", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) diff --git a/stripe/terminal/_connection_token_service.py b/stripe/terminal/_connection_token_service.py index 20a7b937a..12861c259 100644 --- a/stripe/terminal/_connection_token_service.py +++ b/stripe/terminal/_connection_token_service.py @@ -37,3 +37,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "ConnectionTokenService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> ConnectionToken: + """ + To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. + """ + return cast( + ConnectionToken, + await self._request_async( + "post", + "/v1/terminal/connection_tokens", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/terminal/_location.py b/stripe/terminal/_location.py index b27f80a78..fe38a4c11 100644 --- a/stripe/terminal/_location.py +++ b/stripe/terminal/_location.py @@ -220,6 +220,23 @@ def create(cls, **params: Unpack["Location.CreateParams"]) -> "Location": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Location.CreateParams"] + ) -> "Location": + """ + Creates a new Location object. + For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. + """ + return cast( + "Location", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Location.DeleteParams"] @@ -267,6 +284,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["Location.DeleteParams"] + ) -> "Location": + """ + Deletes a Location object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "Location", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["Location.DeleteParams"] + ) -> "Location": + """ + Deletes a Location object. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["Location.DeleteParams"] + ) -> "Location": + """ + Deletes a Location object. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Location.DeleteParams"] + ) -> "Location": + """ + Deletes a Location object. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["Location.ListParams"] @@ -288,6 +354,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Location.ListParams"] + ) -> ListObject["Location"]: + """ + Returns a list of Location objects. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Location.ModifyParams"] @@ -305,6 +392,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Location.ModifyParams"] + ) -> "Location": + """ + Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Location", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Location.RetrieveParams"] @@ -316,4 +420,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Location.RetrieveParams"] + ) -> "Location": + """ + Retrieves a Location object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"address": Address} diff --git a/stripe/terminal/_location_service.py b/stripe/terminal/_location_service.py index 7ef8789a0..18a8458cb 100644 --- a/stripe/terminal/_location_service.py +++ b/stripe/terminal/_location_service.py @@ -156,6 +156,29 @@ def delete( ), ) + async def delete_async( + self, + location: str, + params: "LocationService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Location: + """ + Deletes a Location object. + """ + return cast( + Location, + await self._request_async( + "delete", + "/v1/terminal/locations/{location}".format( + location=sanitize_id(location), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, location: str, @@ -179,6 +202,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + location: str, + params: "LocationService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Location: + """ + Retrieves a Location object. + """ + return cast( + Location, + await self._request_async( + "get", + "/v1/terminal/locations/{location}".format( + location=sanitize_id(location), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, location: str, @@ -202,6 +248,29 @@ def update( ), ) + async def update_async( + self, + location: str, + params: "LocationService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Location: + """ + Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + return cast( + Location, + await self._request_async( + "post", + "/v1/terminal/locations/{location}".format( + location=sanitize_id(location), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "LocationService.ListParams" = {}, @@ -222,6 +291,26 @@ def list( ), ) + async def list_async( + self, + params: "LocationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Location]: + """ + Returns a list of Location objects. + """ + return cast( + ListObject[Location], + await self._request_async( + "get", + "/v1/terminal/locations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "LocationService.CreateParams", @@ -242,3 +331,24 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "LocationService.CreateParams", + options: RequestOptions = {}, + ) -> Location: + """ + Creates a new Location object. + For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. + """ + return cast( + Location, + await self._request_async( + "post", + "/v1/terminal/locations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index 2bd82d40b..2003834bb 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -630,6 +630,61 @@ def cancel_action( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_action_async( + cls, reader: str, **params: Unpack["Reader.CancelActionParams"] + ) -> "Reader": + """ + Cancels the current reader action. + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + "/v1/terminal/readers/{reader}/cancel_action".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_action_async( + reader: str, **params: Unpack["Reader.CancelActionParams"] + ) -> "Reader": + """ + Cancels the current reader action. + """ + ... + + @overload + async def cancel_action_async( + self, **params: Unpack["Reader.CancelActionParams"] + ) -> "Reader": + """ + Cancels the current reader action. + """ + ... + + @class_method_variant("_cls_cancel_action_async") + async def cancel_action_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.CancelActionParams"] + ) -> "Reader": + """ + Cancels the current reader action. + """ + return cast( + "Reader", + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/cancel_action".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create(cls, **params: Unpack["Reader.CreateParams"]) -> "Reader": """ @@ -644,6 +699,22 @@ def create(cls, **params: Unpack["Reader.CreateParams"]) -> "Reader": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["Reader.CreateParams"] + ) -> "Reader": + """ + Creates a new Reader object. + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Reader.DeleteParams"] @@ -689,6 +760,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["Reader.DeleteParams"] + ) -> "Reader": + """ + Deletes a Reader object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "Reader", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["Reader.DeleteParams"] + ) -> "Reader": + """ + Deletes a Reader object. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["Reader.DeleteParams"] + ) -> "Reader": + """ + Deletes a Reader object. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.DeleteParams"] + ) -> "Reader": + """ + Deletes a Reader object. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["Reader.ListParams"] @@ -710,6 +830,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Reader.ListParams"] + ) -> ListObject["Reader"]: + """ + Returns a list of Reader objects. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["Reader.ModifyParams"] @@ -727,6 +868,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Reader.ModifyParams"] + ) -> "Reader": + """ + Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Reader", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def _cls_process_payment_intent( cls, reader: str, **params: Unpack["Reader.ProcessPaymentIntentParams"] @@ -782,6 +940,61 @@ def process_payment_intent( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_process_payment_intent_async( + cls, reader: str, **params: Unpack["Reader.ProcessPaymentIntentParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader. + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + "/v1/terminal/readers/{reader}/process_payment_intent".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def process_payment_intent_async( + reader: str, **params: Unpack["Reader.ProcessPaymentIntentParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader. + """ + ... + + @overload + async def process_payment_intent_async( + self, **params: Unpack["Reader.ProcessPaymentIntentParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader. + """ + ... + + @class_method_variant("_cls_process_payment_intent_async") + async def process_payment_intent_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.ProcessPaymentIntentParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader. + """ + return cast( + "Reader", + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/process_payment_intent".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_process_setup_intent( cls, reader: str, **params: Unpack["Reader.ProcessSetupIntentParams"] @@ -837,6 +1050,61 @@ def process_setup_intent( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_process_setup_intent_async( + cls, reader: str, **params: Unpack["Reader.ProcessSetupIntentParams"] + ) -> "Reader": + """ + Initiates a setup intent flow on a Reader. + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + "/v1/terminal/readers/{reader}/process_setup_intent".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def process_setup_intent_async( + reader: str, **params: Unpack["Reader.ProcessSetupIntentParams"] + ) -> "Reader": + """ + Initiates a setup intent flow on a Reader. + """ + ... + + @overload + async def process_setup_intent_async( + self, **params: Unpack["Reader.ProcessSetupIntentParams"] + ) -> "Reader": + """ + Initiates a setup intent flow on a Reader. + """ + ... + + @class_method_variant("_cls_process_setup_intent_async") + async def process_setup_intent_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.ProcessSetupIntentParams"] + ) -> "Reader": + """ + Initiates a setup intent flow on a Reader. + """ + return cast( + "Reader", + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/process_setup_intent".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_refund_payment( cls, reader: str, **params: Unpack["Reader.RefundPaymentParams"] @@ -892,6 +1160,61 @@ def refund_payment( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_refund_payment_async( + cls, reader: str, **params: Unpack["Reader.RefundPaymentParams"] + ) -> "Reader": + """ + Initiates a refund on a Reader + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + "/v1/terminal/readers/{reader}/refund_payment".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def refund_payment_async( + reader: str, **params: Unpack["Reader.RefundPaymentParams"] + ) -> "Reader": + """ + Initiates a refund on a Reader + """ + ... + + @overload + async def refund_payment_async( + self, **params: Unpack["Reader.RefundPaymentParams"] + ) -> "Reader": + """ + Initiates a refund on a Reader + """ + ... + + @class_method_variant("_cls_refund_payment_async") + async def refund_payment_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.RefundPaymentParams"] + ) -> "Reader": + """ + Initiates a refund on a Reader + """ + return cast( + "Reader", + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/refund_payment".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Reader.RetrieveParams"] @@ -903,6 +1226,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Reader.RetrieveParams"] + ) -> "Reader": + """ + Retrieves a Reader object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def _cls_set_reader_display( cls, reader: str, **params: Unpack["Reader.SetReaderDisplayParams"] @@ -958,6 +1292,61 @@ def set_reader_display( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_set_reader_display_async( + cls, reader: str, **params: Unpack["Reader.SetReaderDisplayParams"] + ) -> "Reader": + """ + Sets reader display to show cart details. + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + "/v1/terminal/readers/{reader}/set_reader_display".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def set_reader_display_async( + reader: str, **params: Unpack["Reader.SetReaderDisplayParams"] + ) -> "Reader": + """ + Sets reader display to show cart details. + """ + ... + + @overload + async def set_reader_display_async( + self, **params: Unpack["Reader.SetReaderDisplayParams"] + ) -> "Reader": + """ + Sets reader display to show cart details. + """ + ... + + @class_method_variant("_cls_set_reader_display_async") + async def set_reader_display_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.SetReaderDisplayParams"] + ) -> "Reader": + """ + Sets reader display to show cart details. + """ + return cast( + "Reader", + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/set_reader_display".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + class TestHelpers(APIResourceTestHelpers["Reader"]): _resource_cls: Type["Reader"] @@ -1018,6 +1407,63 @@ def present_payment_method( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_present_payment_method_async( + cls, + reader: str, + **params: Unpack["Reader.PresentPaymentMethodParams"] + ) -> "Reader": + """ + Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def present_payment_method_async( + reader: str, **params: Unpack["Reader.PresentPaymentMethodParams"] + ) -> "Reader": + """ + Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. + """ + ... + + @overload + async def present_payment_method_async( + self, **params: Unpack["Reader.PresentPaymentMethodParams"] + ) -> "Reader": + """ + Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. + """ + ... + + @class_method_variant("_cls_present_payment_method_async") + async def present_payment_method_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.PresentPaymentMethodParams"] + ) -> "Reader": + """ + Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. + """ + return cast( + "Reader", + await self.resource._request_async( + "post", + "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( + reader=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 7aa19439e..8efeb865e 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -279,6 +279,29 @@ def delete( ), ) + async def delete_async( + self, + reader: str, + params: "ReaderService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Reader: + """ + Deletes a Reader object. + """ + return cast( + Reader, + await self._request_async( + "delete", + "/v1/terminal/readers/{reader}".format( + reader=sanitize_id(reader), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, reader: str, @@ -302,6 +325,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + reader: str, + params: "ReaderService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Reader: + """ + Retrieves a Reader object. + """ + return cast( + Reader, + await self._request_async( + "get", + "/v1/terminal/readers/{reader}".format( + reader=sanitize_id(reader), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, reader: str, @@ -325,6 +371,29 @@ def update( ), ) + async def update_async( + self, + reader: str, + params: "ReaderService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Reader: + """ + Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers/{reader}".format( + reader=sanitize_id(reader), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "ReaderService.ListParams" = {}, @@ -345,6 +414,26 @@ def list( ), ) + async def list_async( + self, + params: "ReaderService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Reader]: + """ + Returns a list of Reader objects. + """ + return cast( + ListObject[Reader], + await self._request_async( + "get", + "/v1/terminal/readers", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "ReaderService.CreateParams", @@ -365,6 +454,26 @@ def create( ), ) + async def create_async( + self, + params: "ReaderService.CreateParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Creates a new Reader object. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel_action( self, reader: str, @@ -388,6 +497,29 @@ def cancel_action( ), ) + async def cancel_action_async( + self, + reader: str, + params: "ReaderService.CancelActionParams" = {}, + options: RequestOptions = {}, + ) -> Reader: + """ + Cancels the current reader action. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/cancel_action".format( + reader=sanitize_id(reader), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def process_payment_intent( self, reader: str, @@ -411,6 +543,29 @@ def process_payment_intent( ), ) + async def process_payment_intent_async( + self, + reader: str, + params: "ReaderService.ProcessPaymentIntentParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Initiates a payment flow on a Reader. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/process_payment_intent".format( + reader=sanitize_id(reader), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def process_setup_intent( self, reader: str, @@ -434,6 +589,29 @@ def process_setup_intent( ), ) + async def process_setup_intent_async( + self, + reader: str, + params: "ReaderService.ProcessSetupIntentParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Initiates a setup intent flow on a Reader. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/process_setup_intent".format( + reader=sanitize_id(reader), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def refund_payment( self, reader: str, @@ -457,6 +635,29 @@ def refund_payment( ), ) + async def refund_payment_async( + self, + reader: str, + params: "ReaderService.RefundPaymentParams" = {}, + options: RequestOptions = {}, + ) -> Reader: + """ + Initiates a refund on a Reader + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/refund_payment".format( + reader=sanitize_id(reader), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def set_reader_display( self, reader: str, @@ -479,3 +680,26 @@ def set_reader_display( options=options, ), ) + + async def set_reader_display_async( + self, + reader: str, + params: "ReaderService.SetReaderDisplayParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Sets reader display to show cart details. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/set_reader_display".format( + reader=sanitize_id(reader), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index 78ccaa7f4..947094701 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -701,3 +701,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "ConfirmationTokenService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> ConfirmationToken: + """ + Creates a test mode Confirmation Token server side for your integration tests. + """ + return cast( + ConfirmationToken, + await self._request_async( + "post", + "/v1/test_helpers/confirmation_tokens", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/_customer_service.py b/stripe/test_helpers/_customer_service.py index 104171afa..f9870538b 100644 --- a/stripe/test_helpers/_customer_service.py +++ b/stripe/test_helpers/_customer_service.py @@ -51,3 +51,26 @@ def fund_cash_balance( options=options, ), ) + + async def fund_cash_balance_async( + self, + customer: str, + params: "CustomerService.FundCashBalanceParams", + options: RequestOptions = {}, + ) -> CustomerCashBalanceTransaction: + """ + Create an incoming testmode bank transfer + """ + return cast( + CustomerCashBalanceTransaction, + await self._request_async( + "post", + "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( + customer=sanitize_id(customer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/_refund_service.py b/stripe/test_helpers/_refund_service.py index 1db5c17ed..27d0a885f 100644 --- a/stripe/test_helpers/_refund_service.py +++ b/stripe/test_helpers/_refund_service.py @@ -37,3 +37,26 @@ def expire( options=options, ), ) + + async def expire_async( + self, + refund: str, + params: "RefundService.ExpireParams" = {}, + options: RequestOptions = {}, + ) -> Refund: + """ + Expire a refund with a status of requires_action. + """ + return cast( + Refund, + await self._request_async( + "post", + "/v1/test_helpers/refunds/{refund}/expire".format( + refund=sanitize_id(refund), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/_test_clock.py b/stripe/test_helpers/_test_clock.py index 41fd31487..97996fe29 100644 --- a/stripe/test_helpers/_test_clock.py +++ b/stripe/test_helpers/_test_clock.py @@ -168,6 +168,61 @@ def advance( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_advance_async( + cls, test_clock: str, **params: Unpack["TestClock.AdvanceParams"] + ) -> "TestClock": + """ + Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. + """ + return cast( + "TestClock", + await cls._static_request_async( + "post", + "/v1/test_helpers/test_clocks/{test_clock}/advance".format( + test_clock=sanitize_id(test_clock) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def advance_async( + test_clock: str, **params: Unpack["TestClock.AdvanceParams"] + ) -> "TestClock": + """ + Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. + """ + ... + + @overload + async def advance_async( + self, **params: Unpack["TestClock.AdvanceParams"] + ) -> "TestClock": + """ + Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. + """ + ... + + @class_method_variant("_cls_advance_async") + async def advance_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["TestClock.AdvanceParams"] + ) -> "TestClock": + """ + Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. + """ + return cast( + "TestClock", + await self._request_async( + "post", + "/v1/test_helpers/test_clocks/{test_clock}/advance".format( + test_clock=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create(cls, **params: Unpack["TestClock.CreateParams"]) -> "TestClock": """ @@ -182,6 +237,22 @@ def create(cls, **params: Unpack["TestClock.CreateParams"]) -> "TestClock": ), ) + @classmethod + async def create_async( + cls, **params: Unpack["TestClock.CreateParams"] + ) -> "TestClock": + """ + Creates a new test clock that can be attached to new customers and quotes. + """ + return cast( + "TestClock", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["TestClock.DeleteParams"] @@ -231,6 +302,55 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] params=params, ) + @classmethod + async def _cls_delete_async( + cls, sid: str, **params: Unpack["TestClock.DeleteParams"] + ) -> "TestClock": + """ + Deletes a test clock. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) + return cast( + "TestClock", + await cls._static_request_async( + "delete", + url, + params=params, + ), + ) + + @overload + @staticmethod + async def delete_async( + sid: str, **params: Unpack["TestClock.DeleteParams"] + ) -> "TestClock": + """ + Deletes a test clock. + """ + ... + + @overload + async def delete_async( + self, **params: Unpack["TestClock.DeleteParams"] + ) -> "TestClock": + """ + Deletes a test clock. + """ + ... + + @class_method_variant("_cls_delete_async") + async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["TestClock.DeleteParams"] + ) -> "TestClock": + """ + Deletes a test clock. + """ + return await self._request_and_refresh_async( + "delete", + self.instance_url(), + params=params, + ) + @classmethod def list( cls, **params: Unpack["TestClock.ListParams"] @@ -252,6 +372,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["TestClock.ListParams"] + ) -> ListObject["TestClock"]: + """ + Returns a list of your test clocks. + """ + 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["TestClock.RetrieveParams"] @@ -262,3 +403,14 @@ def retrieve( instance = cls(id, **params) instance.refresh() return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["TestClock.RetrieveParams"] + ) -> "TestClock": + """ + Retrieves a test clock. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/test_helpers/_test_clock_service.py b/stripe/test_helpers/_test_clock_service.py index 1bfeb0588..72e98b2dd 100644 --- a/stripe/test_helpers/_test_clock_service.py +++ b/stripe/test_helpers/_test_clock_service.py @@ -84,6 +84,29 @@ def delete( ), ) + async def delete_async( + self, + test_clock: str, + params: "TestClockService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> TestClock: + """ + Deletes a test clock. + """ + return cast( + TestClock, + await self._request_async( + "delete", + "/v1/test_helpers/test_clocks/{test_clock}".format( + test_clock=sanitize_id(test_clock), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, test_clock: str, @@ -107,6 +130,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + test_clock: str, + params: "TestClockService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> TestClock: + """ + Retrieves a test clock. + """ + return cast( + TestClock, + await self._request_async( + "get", + "/v1/test_helpers/test_clocks/{test_clock}".format( + test_clock=sanitize_id(test_clock), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, params: "TestClockService.ListParams" = {}, @@ -127,6 +173,26 @@ def list( ), ) + async def list_async( + self, + params: "TestClockService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[TestClock]: + """ + Returns a list of your test clocks. + """ + return cast( + ListObject[TestClock], + await self._request_async( + "get", + "/v1/test_helpers/test_clocks", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "TestClockService.CreateParams", @@ -147,6 +213,26 @@ def create( ), ) + async def create_async( + self, + params: "TestClockService.CreateParams", + options: RequestOptions = {}, + ) -> TestClock: + """ + Creates a new test clock that can be attached to new customers and quotes. + """ + return cast( + TestClock, + await self._request_async( + "post", + "/v1/test_helpers/test_clocks", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def advance( self, test_clock: str, @@ -169,3 +255,26 @@ def advance( options=options, ), ) + + async def advance_async( + self, + test_clock: str, + params: "TestClockService.AdvanceParams", + options: RequestOptions = {}, + ) -> TestClock: + """ + Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. + """ + return cast( + TestClock, + await self._request_async( + "post", + "/v1/test_helpers/test_clocks/{test_clock}/advance".format( + test_clock=sanitize_id(test_clock), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/issuing/_authorization_service.py b/stripe/test_helpers/issuing/_authorization_service.py index 954f43b33..438942ee4 100644 --- a/stripe/test_helpers/issuing/_authorization_service.py +++ b/stripe/test_helpers/issuing/_authorization_service.py @@ -664,6 +664,26 @@ def create( ), ) + async def create_async( + self, + params: "AuthorizationService.CreateParams", + options: RequestOptions = {}, + ) -> Authorization: + """ + Create a test-mode authorization. + """ + return cast( + Authorization, + await self._request_async( + "post", + "/v1/test_helpers/issuing/authorizations", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def capture( self, authorization: str, @@ -687,6 +707,29 @@ def capture( ), ) + async def capture_async( + self, + authorization: str, + params: "AuthorizationService.CaptureParams" = {}, + options: RequestOptions = {}, + ) -> Authorization: + """ + Capture a test-mode authorization. + """ + return cast( + Authorization, + await self._request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( + authorization=sanitize_id(authorization), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def expire( self, authorization: str, @@ -710,6 +753,29 @@ def expire( ), ) + async def expire_async( + self, + authorization: str, + params: "AuthorizationService.ExpireParams" = {}, + options: RequestOptions = {}, + ) -> Authorization: + """ + Expire a test-mode Authorization. + """ + return cast( + Authorization, + await self._request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( + authorization=sanitize_id(authorization), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def increment( self, authorization: str, @@ -733,6 +799,29 @@ def increment( ), ) + async def increment_async( + self, + authorization: str, + params: "AuthorizationService.IncrementParams", + options: RequestOptions = {}, + ) -> Authorization: + """ + Increment a test-mode Authorization. + """ + return cast( + Authorization, + await self._request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( + authorization=sanitize_id(authorization), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def reverse( self, authorization: str, @@ -755,3 +844,26 @@ def reverse( options=options, ), ) + + async def reverse_async( + self, + authorization: str, + params: "AuthorizationService.ReverseParams" = {}, + options: RequestOptions = {}, + ) -> Authorization: + """ + Reverse a test-mode Authorization. + """ + return cast( + Authorization, + await self._request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( + authorization=sanitize_id(authorization), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/issuing/_card_service.py b/stripe/test_helpers/issuing/_card_service.py index faa032617..51b742f65 100644 --- a/stripe/test_helpers/issuing/_card_service.py +++ b/stripe/test_helpers/issuing/_card_service.py @@ -56,6 +56,29 @@ def deliver_card( ), ) + async def deliver_card_async( + self, + card: str, + params: "CardService.DeliverCardParams" = {}, + options: RequestOptions = {}, + ) -> Card: + """ + Updates the shipping status of the specified Issuing Card object to delivered. + """ + return cast( + Card, + await self._request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( + card=sanitize_id(card), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def fail_card( self, card: str, @@ -79,6 +102,29 @@ def fail_card( ), ) + async def fail_card_async( + self, + card: str, + params: "CardService.FailCardParams" = {}, + options: RequestOptions = {}, + ) -> Card: + """ + Updates the shipping status of the specified Issuing Card object to failure. + """ + return cast( + Card, + await self._request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( + card=sanitize_id(card), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def return_card( self, card: str, @@ -102,6 +148,29 @@ def return_card( ), ) + async def return_card_async( + self, + card: str, + params: "CardService.ReturnCardParams" = {}, + options: RequestOptions = {}, + ) -> Card: + """ + Updates the shipping status of the specified Issuing Card object to returned. + """ + return cast( + Card, + await self._request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( + card=sanitize_id(card), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def ship_card( self, card: str, @@ -124,3 +193,26 @@ def ship_card( options=options, ), ) + + async def ship_card_async( + self, + card: str, + params: "CardService.ShipCardParams" = {}, + options: RequestOptions = {}, + ) -> Card: + """ + Updates the shipping status of the specified Issuing Card object to shipped. + """ + return cast( + Card, + await self._request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( + card=sanitize_id(card), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/issuing/_personalization_design_service.py b/stripe/test_helpers/issuing/_personalization_design_service.py index 0f3b7faf2..18823b094 100644 --- a/stripe/test_helpers/issuing/_personalization_design_service.py +++ b/stripe/test_helpers/issuing/_personalization_design_service.py @@ -89,6 +89,29 @@ def activate( ), ) + async def activate_async( + self, + personalization_design: str, + params: "PersonalizationDesignService.ActivateParams" = {}, + options: RequestOptions = {}, + ) -> PersonalizationDesign: + """ + Updates the status of the specified testmode personalization design object to active. + """ + return cast( + PersonalizationDesign, + await self._request_async( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( + personalization_design=sanitize_id(personalization_design), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def deactivate( self, personalization_design: str, @@ -112,6 +135,29 @@ def deactivate( ), ) + async def deactivate_async( + self, + personalization_design: str, + params: "PersonalizationDesignService.DeactivateParams" = {}, + options: RequestOptions = {}, + ) -> PersonalizationDesign: + """ + Updates the status of the specified testmode personalization design object to inactive. + """ + return cast( + PersonalizationDesign, + await self._request_async( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( + personalization_design=sanitize_id(personalization_design), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def reject( self, personalization_design: str, @@ -134,3 +180,26 @@ def reject( options=options, ), ) + + async def reject_async( + self, + personalization_design: str, + params: "PersonalizationDesignService.RejectParams", + options: RequestOptions = {}, + ) -> PersonalizationDesign: + """ + Updates the status of the specified testmode personalization design object to rejected. + """ + return cast( + PersonalizationDesign, + await self._request_async( + "post", + "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( + personalization_design=sanitize_id(personalization_design), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/issuing/_transaction_service.py b/stripe/test_helpers/issuing/_transaction_service.py index bde260ed2..218470270 100644 --- a/stripe/test_helpers/issuing/_transaction_service.py +++ b/stripe/test_helpers/issuing/_transaction_service.py @@ -1024,6 +1024,29 @@ def refund( ), ) + async def refund_async( + self, + transaction: str, + params: "TransactionService.RefundParams" = {}, + options: RequestOptions = {}, + ) -> Transaction: + """ + Refund a test-mode Transaction. + """ + return cast( + Transaction, + await self._request_async( + "post", + "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( + transaction=sanitize_id(transaction), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create_force_capture( self, params: "TransactionService.CreateForceCaptureParams", @@ -1044,6 +1067,26 @@ def create_force_capture( ), ) + async def create_force_capture_async( + self, + params: "TransactionService.CreateForceCaptureParams", + options: RequestOptions = {}, + ) -> Transaction: + """ + Allows the user to capture an arbitrary amount, also known as a forced capture. + """ + return cast( + Transaction, + await self._request_async( + "post", + "/v1/test_helpers/issuing/transactions/create_force_capture", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create_unlinked_refund( self, params: "TransactionService.CreateUnlinkedRefundParams", @@ -1063,3 +1106,23 @@ def create_unlinked_refund( options=options, ), ) + + async def create_unlinked_refund_async( + self, + params: "TransactionService.CreateUnlinkedRefundParams", + options: RequestOptions = {}, + ) -> Transaction: + """ + Allows the user to refund an arbitrary amount, also known as a unlinked refund. + """ + return cast( + Transaction, + await self._request_async( + "post", + "/v1/test_helpers/issuing/transactions/create_unlinked_refund", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/terminal/_reader_service.py b/stripe/test_helpers/terminal/_reader_service.py index 545fc13eb..04c64468a 100644 --- a/stripe/test_helpers/terminal/_reader_service.py +++ b/stripe/test_helpers/terminal/_reader_service.py @@ -69,3 +69,26 @@ def present_payment_method( options=options, ), ) + + async def present_payment_method_async( + self, + reader: str, + params: "ReaderService.PresentPaymentMethodParams" = {}, + options: RequestOptions = {}, + ) -> Reader: + """ + Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( + reader=sanitize_id(reader), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/treasury/_inbound_transfer_service.py b/stripe/test_helpers/treasury/_inbound_transfer_service.py index cebd14247..16b16359d 100644 --- a/stripe/test_helpers/treasury/_inbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_inbound_transfer_service.py @@ -78,6 +78,29 @@ def fail( ), ) + async def fail_async( + self, + id: str, + params: "InboundTransferService.FailParams" = {}, + options: RequestOptions = {}, + ) -> InboundTransfer: + """ + Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. + """ + return cast( + InboundTransfer, + await self._request_async( + "post", + "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def return_inbound_transfer( self, id: str, @@ -101,6 +124,29 @@ def return_inbound_transfer( ), ) + async def return_inbound_transfer_async( + self, + id: str, + params: "InboundTransferService.ReturnInboundTransferParams" = {}, + options: RequestOptions = {}, + ) -> InboundTransfer: + """ + Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. + """ + return cast( + InboundTransfer, + await self._request_async( + "post", + "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def succeed( self, id: str, @@ -123,3 +169,26 @@ def succeed( options=options, ), ) + + async def succeed_async( + self, + id: str, + params: "InboundTransferService.SucceedParams" = {}, + options: RequestOptions = {}, + ) -> InboundTransfer: + """ + Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. + """ + return cast( + InboundTransfer, + await self._request_async( + "post", + "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/treasury/_outbound_payment_service.py b/stripe/test_helpers/treasury/_outbound_payment_service.py index ffad5afb9..2506837af 100644 --- a/stripe/test_helpers/treasury/_outbound_payment_service.py +++ b/stripe/test_helpers/treasury/_outbound_payment_service.py @@ -75,6 +75,29 @@ def fail( ), ) + async def fail_async( + self, + id: str, + params: "OutboundPaymentService.FailParams" = {}, + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. + """ + return cast( + OutboundPayment, + await self._request_async( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def post( self, id: str, @@ -98,6 +121,29 @@ def post( ), ) + async def post_async( + self, + id: str, + params: "OutboundPaymentService.PostParams" = {}, + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. + """ + return cast( + OutboundPayment, + await self._request_async( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def return_outbound_payment( self, id: str, @@ -120,3 +166,26 @@ def return_outbound_payment( options=options, ), ) + + async def return_outbound_payment_async( + self, + id: str, + params: "OutboundPaymentService.ReturnOutboundPaymentParams" = {}, + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. + """ + return cast( + OutboundPayment, + await self._request_async( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/treasury/_outbound_transfer_service.py b/stripe/test_helpers/treasury/_outbound_transfer_service.py index 46396fdce..a16ae3792 100644 --- a/stripe/test_helpers/treasury/_outbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_outbound_transfer_service.py @@ -75,6 +75,29 @@ def fail( ), ) + async def fail_async( + self, + outbound_transfer: str, + params: "OutboundTransferService.FailParams" = {}, + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. + """ + return cast( + OutboundTransfer, + await self._request_async( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( + outbound_transfer=sanitize_id(outbound_transfer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def post( self, outbound_transfer: str, @@ -98,6 +121,29 @@ def post( ), ) + async def post_async( + self, + outbound_transfer: str, + params: "OutboundTransferService.PostParams" = {}, + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. + """ + return cast( + OutboundTransfer, + await self._request_async( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( + outbound_transfer=sanitize_id(outbound_transfer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def return_outbound_transfer( self, outbound_transfer: str, @@ -120,3 +166,26 @@ def return_outbound_transfer( options=options, ), ) + + async def return_outbound_transfer_async( + self, + outbound_transfer: str, + params: "OutboundTransferService.ReturnOutboundTransferParams" = {}, + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. + """ + return cast( + OutboundTransfer, + await self._request_async( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( + outbound_transfer=sanitize_id(outbound_transfer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/treasury/_received_credit_service.py b/stripe/test_helpers/treasury/_received_credit_service.py index dd71b4074..14ca527c8 100644 --- a/stripe/test_helpers/treasury/_received_credit_service.py +++ b/stripe/test_helpers/treasury/_received_credit_service.py @@ -85,3 +85,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "ReceivedCreditService.CreateParams", + options: RequestOptions = {}, + ) -> ReceivedCredit: + """ + Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. + """ + return cast( + ReceivedCredit, + await self._request_async( + "post", + "/v1/test_helpers/treasury/received_credits", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/test_helpers/treasury/_received_debit_service.py b/stripe/test_helpers/treasury/_received_debit_service.py index dd2b0882c..2b0f761cc 100644 --- a/stripe/test_helpers/treasury/_received_debit_service.py +++ b/stripe/test_helpers/treasury/_received_debit_service.py @@ -85,3 +85,23 @@ def create( options=options, ), ) + + async def create_async( + self, + params: "ReceivedDebitService.CreateParams", + options: RequestOptions = {}, + ) -> ReceivedDebit: + """ + Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. + """ + return cast( + ReceivedDebit, + await self._request_async( + "post", + "/v1/test_helpers/treasury/received_debits", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_credit_reversal.py b/stripe/treasury/_credit_reversal.py index 64bdba4be..1318c3d53 100644 --- a/stripe/treasury/_credit_reversal.py +++ b/stripe/treasury/_credit_reversal.py @@ -151,6 +151,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["CreditReversal.CreateParams"] + ) -> "CreditReversal": + """ + Reverses a ReceivedCredit and creates a CreditReversal object. + """ + return cast( + "CreditReversal", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["CreditReversal.ListParams"] @@ -172,6 +188,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["CreditReversal.ListParams"] + ) -> ListObject["CreditReversal"]: + """ + Returns a list of CreditReversals. + """ + 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["CreditReversal.RetrieveParams"] @@ -183,4 +220,15 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["CreditReversal.RetrieveParams"] + ) -> "CreditReversal": + """ + Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"status_transitions": StatusTransitions} diff --git a/stripe/treasury/_credit_reversal_service.py b/stripe/treasury/_credit_reversal_service.py index 5f3c21854..3ae920b0f 100644 --- a/stripe/treasury/_credit_reversal_service.py +++ b/stripe/treasury/_credit_reversal_service.py @@ -80,6 +80,26 @@ def list( ), ) + async def list_async( + self, + params: "CreditReversalService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[CreditReversal]: + """ + Returns a list of CreditReversals. + """ + return cast( + ListObject[CreditReversal], + await self._request_async( + "get", + "/v1/treasury/credit_reversals", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "CreditReversalService.CreateParams", @@ -100,6 +120,26 @@ def create( ), ) + async def create_async( + self, + params: "CreditReversalService.CreateParams", + options: RequestOptions = {}, + ) -> CreditReversal: + """ + Reverses a ReceivedCredit and creates a CreditReversal object. + """ + return cast( + CreditReversal, + await self._request_async( + "post", + "/v1/treasury/credit_reversals", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, credit_reversal: str, @@ -122,3 +162,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + credit_reversal: str, + params: "CreditReversalService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> CreditReversal: + """ + Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list + """ + return cast( + CreditReversal, + await self._request_async( + "get", + "/v1/treasury/credit_reversals/{credit_reversal}".format( + credit_reversal=sanitize_id(credit_reversal), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_debit_reversal.py b/stripe/treasury/_debit_reversal.py index 980f16645..6c1ec1c0c 100644 --- a/stripe/treasury/_debit_reversal.py +++ b/stripe/treasury/_debit_reversal.py @@ -165,6 +165,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["DebitReversal.CreateParams"] + ) -> "DebitReversal": + """ + Reverses a ReceivedDebit and creates a DebitReversal object. + """ + return cast( + "DebitReversal", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["DebitReversal.ListParams"] @@ -186,6 +202,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["DebitReversal.ListParams"] + ) -> ListObject["DebitReversal"]: + """ + Returns a list of DebitReversals. + """ + 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["DebitReversal.RetrieveParams"] @@ -197,6 +234,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["DebitReversal.RetrieveParams"] + ) -> "DebitReversal": + """ + Retrieves a DebitReversal object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "linked_flows": LinkedFlows, "status_transitions": StatusTransitions, diff --git a/stripe/treasury/_debit_reversal_service.py b/stripe/treasury/_debit_reversal_service.py index ed207e9e9..b8f54471b 100644 --- a/stripe/treasury/_debit_reversal_service.py +++ b/stripe/treasury/_debit_reversal_service.py @@ -84,6 +84,26 @@ def list( ), ) + async def list_async( + self, + params: "DebitReversalService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[DebitReversal]: + """ + Returns a list of DebitReversals. + """ + return cast( + ListObject[DebitReversal], + await self._request_async( + "get", + "/v1/treasury/debit_reversals", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "DebitReversalService.CreateParams", @@ -104,6 +124,26 @@ def create( ), ) + async def create_async( + self, + params: "DebitReversalService.CreateParams", + options: RequestOptions = {}, + ) -> DebitReversal: + """ + Reverses a ReceivedDebit and creates a DebitReversal object. + """ + return cast( + DebitReversal, + await self._request_async( + "post", + "/v1/treasury/debit_reversals", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, debit_reversal: str, @@ -126,3 +166,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + debit_reversal: str, + params: "DebitReversalService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> DebitReversal: + """ + Retrieves a DebitReversal object. + """ + return cast( + DebitReversal, + await self._request_async( + "get", + "/v1/treasury/debit_reversals/{debit_reversal}".format( + debit_reversal=sanitize_id(debit_reversal), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index 76ea8eae6..3cbd88346 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -782,6 +782,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["FinancialAccount.CreateParams"] + ) -> "FinancialAccount": + """ + Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. + """ + return cast( + "FinancialAccount", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["FinancialAccount.ListParams"] @@ -803,6 +819,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["FinancialAccount.ListParams"] + ) -> ListObject["FinancialAccount"]: + """ + Returns a list of FinancialAccounts. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def modify( cls, id: str, **params: Unpack["FinancialAccount.ModifyParams"] @@ -820,6 +857,23 @@ def modify( ), ) + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["FinancialAccount.ModifyParams"] + ) -> "FinancialAccount": + """ + Updates the details of a FinancialAccount. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "FinancialAccount", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["FinancialAccount.RetrieveParams"] @@ -831,6 +885,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["FinancialAccount.RetrieveParams"] + ) -> "FinancialAccount": + """ + Retrieves the details of a FinancialAccount. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def _cls_retrieve_features( cls, @@ -889,6 +954,64 @@ def retrieve_features( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_retrieve_features_async( + cls, + financial_account: str, + **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] + ) -> "FinancialAccountFeatures": + """ + Retrieves Features information associated with the FinancialAccount. + """ + return cast( + "FinancialAccountFeatures", + await cls._static_request_async( + "get", + "/v1/treasury/financial_accounts/{financial_account}/features".format( + financial_account=sanitize_id(financial_account) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def retrieve_features_async( + financial_account: str, + **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] + ) -> "FinancialAccountFeatures": + """ + Retrieves Features information associated with the FinancialAccount. + """ + ... + + @overload + async def retrieve_features_async( + self, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] + ) -> "FinancialAccountFeatures": + """ + Retrieves Features information associated with the FinancialAccount. + """ + ... + + @class_method_variant("_cls_retrieve_features_async") + async def retrieve_features_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] + ) -> "FinancialAccountFeatures": + """ + Retrieves Features information associated with the FinancialAccount. + """ + return cast( + "FinancialAccountFeatures", + await self._request_async( + "get", + "/v1/treasury/financial_accounts/{financial_account}/features".format( + financial_account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_update_features( cls, @@ -947,6 +1070,64 @@ def update_features( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_update_features_async( + cls, + financial_account: str, + **params: Unpack["FinancialAccount.UpdateFeaturesParams"] + ) -> "FinancialAccountFeatures": + """ + Updates the Features associated with a FinancialAccount. + """ + return cast( + "FinancialAccountFeatures", + await cls._static_request_async( + "post", + "/v1/treasury/financial_accounts/{financial_account}/features".format( + financial_account=sanitize_id(financial_account) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def update_features_async( + financial_account: str, + **params: Unpack["FinancialAccount.UpdateFeaturesParams"] + ) -> "FinancialAccountFeatures": + """ + Updates the Features associated with a FinancialAccount. + """ + ... + + @overload + async def update_features_async( + self, **params: Unpack["FinancialAccount.UpdateFeaturesParams"] + ) -> "FinancialAccountFeatures": + """ + Updates the Features associated with a FinancialAccount. + """ + ... + + @class_method_variant("_cls_update_features_async") + async def update_features_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["FinancialAccount.UpdateFeaturesParams"] + ) -> "FinancialAccountFeatures": + """ + Updates the Features associated with a FinancialAccount. + """ + return cast( + "FinancialAccountFeatures", + await self._request_async( + "post", + "/v1/treasury/financial_accounts/{financial_account}/features".format( + financial_account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + _inner_class_types = { "balance": Balance, "financial_addresses": FinancialAddress, diff --git a/stripe/treasury/_financial_account_features_service.py b/stripe/treasury/_financial_account_features_service.py index 726df2448..85f555ac3 100644 --- a/stripe/treasury/_financial_account_features_service.py +++ b/stripe/treasury/_financial_account_features_service.py @@ -338,6 +338,29 @@ def update( ), ) + async def update_async( + self, + financial_account: str, + params: "FinancialAccountFeaturesService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccountFeatures: + """ + Updates the Features associated with a FinancialAccount. + """ + return cast( + FinancialAccountFeatures, + await self._request_async( + "post", + "/v1/treasury/financial_accounts/{financial_account}/features".format( + financial_account=sanitize_id(financial_account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, financial_account: str, @@ -361,6 +384,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + financial_account: str, + params: "FinancialAccountFeaturesService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccountFeatures: + """ + Retrieves Features information associated with the FinancialAccount. + """ + return cast( + FinancialAccountFeatures, + await self._request_async( + "get", + "/v1/treasury/financial_accounts/{financial_account}/features".format( + financial_account=sanitize_id(financial_account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def list( self, financial_account: str, @@ -384,6 +430,29 @@ def list( ), ) + async def list_async( + self, + financial_account: str, + params: "FinancialAccountFeaturesService.ListParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccountFeatures: + """ + Retrieves Features information associated with the FinancialAccount. + """ + return cast( + FinancialAccountFeatures, + await self._request_async( + "get", + "/v1/treasury/financial_accounts/{financial_account}/features".format( + financial_account=sanitize_id(financial_account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, financial_account: str, @@ -406,3 +475,26 @@ def create( options=options, ), ) + + async def create_async( + self, + financial_account: str, + params: "FinancialAccountFeaturesService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccountFeatures: + """ + Updates the Features associated with a FinancialAccount. + """ + return cast( + FinancialAccountFeatures, + await self._request_async( + "post", + "/v1/treasury/financial_accounts/{financial_account}/features".format( + financial_account=sanitize_id(financial_account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index cd907c9f5..c61f2e46e 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -431,6 +431,26 @@ def list( ), ) + async def list_async( + self, + params: "FinancialAccountService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[FinancialAccount]: + """ + Returns a list of FinancialAccounts. + """ + return cast( + ListObject[FinancialAccount], + await self._request_async( + "get", + "/v1/treasury/financial_accounts", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "FinancialAccountService.CreateParams", @@ -451,6 +471,26 @@ def create( ), ) + async def create_async( + self, + params: "FinancialAccountService.CreateParams", + options: RequestOptions = {}, + ) -> FinancialAccount: + """ + Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. + """ + return cast( + FinancialAccount, + await self._request_async( + "post", + "/v1/treasury/financial_accounts", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, financial_account: str, @@ -474,6 +514,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + financial_account: str, + params: "FinancialAccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccount: + """ + Retrieves the details of a FinancialAccount. + """ + return cast( + FinancialAccount, + await self._request_async( + "get", + "/v1/treasury/financial_accounts/{financial_account}".format( + financial_account=sanitize_id(financial_account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def update( self, financial_account: str, @@ -496,3 +559,26 @@ def update( options=options, ), ) + + async def update_async( + self, + financial_account: str, + params: "FinancialAccountService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccount: + """ + Updates the details of a FinancialAccount. + """ + return cast( + FinancialAccount, + await self._request_async( + "post", + "/v1/treasury/financial_accounts/{financial_account}".format( + financial_account=sanitize_id(financial_account), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_inbound_transfer.py b/stripe/treasury/_inbound_transfer.py index d34368541..ec921ddac 100644 --- a/stripe/treasury/_inbound_transfer.py +++ b/stripe/treasury/_inbound_transfer.py @@ -411,6 +411,63 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, + inbound_transfer: str, + **params: Unpack["InboundTransfer.CancelParams"] + ) -> "InboundTransfer": + """ + Cancels an InboundTransfer. + """ + return cast( + "InboundTransfer", + await cls._static_request_async( + "post", + "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( + inbound_transfer=sanitize_id(inbound_transfer) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + inbound_transfer: str, **params: Unpack["InboundTransfer.CancelParams"] + ) -> "InboundTransfer": + """ + Cancels an InboundTransfer. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["InboundTransfer.CancelParams"] + ) -> "InboundTransfer": + """ + Cancels an InboundTransfer. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["InboundTransfer.CancelParams"] + ) -> "InboundTransfer": + """ + Cancels an InboundTransfer. + """ + return cast( + "InboundTransfer", + await self._request_async( + "post", + "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( + inbound_transfer=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create( cls, **params: Unpack["InboundTransfer.CreateParams"] @@ -427,6 +484,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["InboundTransfer.CreateParams"] + ) -> "InboundTransfer": + """ + Creates an InboundTransfer. + """ + return cast( + "InboundTransfer", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["InboundTransfer.ListParams"] @@ -448,6 +521,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["InboundTransfer.ListParams"] + ) -> ListObject["InboundTransfer"]: + """ + Returns a list of InboundTransfers sent from the specified FinancialAccount. + """ + 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["InboundTransfer.RetrieveParams"] @@ -459,6 +553,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["InboundTransfer.RetrieveParams"] + ) -> "InboundTransfer": + """ + Retrieves the details of an existing InboundTransfer. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + class TestHelpers(APIResourceTestHelpers["InboundTransfer"]): _resource_cls: Type["InboundTransfer"] @@ -517,6 +622,61 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_fail_async( + cls, id: str, **params: Unpack["InboundTransfer.FailParams"] + ) -> "InboundTransfer": + """ + Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. + """ + return cast( + "InboundTransfer", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def fail_async( + id: str, **params: Unpack["InboundTransfer.FailParams"] + ) -> "InboundTransfer": + """ + Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. + """ + ... + + @overload + async def fail_async( + self, **params: Unpack["InboundTransfer.FailParams"] + ) -> "InboundTransfer": + """ + Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. + """ + ... + + @class_method_variant("_cls_fail_async") + async def fail_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["InboundTransfer.FailParams"] + ) -> "InboundTransfer": + """ + Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. + """ + return cast( + "InboundTransfer", + await self.resource._request_async( + "post", + "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( + id=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_return_inbound_transfer( cls, @@ -577,6 +737,66 @@ def return_inbound_transfer( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_return_inbound_transfer_async( + cls, + id: str, + **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] + ) -> "InboundTransfer": + """ + Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. + """ + return cast( + "InboundTransfer", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def return_inbound_transfer_async( + id: str, + **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] + ) -> "InboundTransfer": + """ + Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. + """ + ... + + @overload + async def return_inbound_transfer_async( + self, + **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] + ) -> "InboundTransfer": + """ + Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. + """ + ... + + @class_method_variant("_cls_return_inbound_transfer_async") + async def return_inbound_transfer_async( # pyright: ignore[reportGeneralTypeIssues] + self, + **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] + ) -> "InboundTransfer": + """ + Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. + """ + return cast( + "InboundTransfer", + await self.resource._request_async( + "post", + "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( + id=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_succeed( cls, id: str, **params: Unpack["InboundTransfer.SucceedParams"] @@ -632,6 +852,61 @@ def succeed( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_succeed_async( + cls, id: str, **params: Unpack["InboundTransfer.SucceedParams"] + ) -> "InboundTransfer": + """ + Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. + """ + return cast( + "InboundTransfer", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def succeed_async( + id: str, **params: Unpack["InboundTransfer.SucceedParams"] + ) -> "InboundTransfer": + """ + Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. + """ + ... + + @overload + async def succeed_async( + self, **params: Unpack["InboundTransfer.SucceedParams"] + ) -> "InboundTransfer": + """ + Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. + """ + ... + + @class_method_variant("_cls_succeed_async") + async def succeed_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["InboundTransfer.SucceedParams"] + ) -> "InboundTransfer": + """ + Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. + """ + return cast( + "InboundTransfer", + await self.resource._request_async( + "post", + "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( + id=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/treasury/_inbound_transfer_service.py b/stripe/treasury/_inbound_transfer_service.py index 3cb72d874..40c7114b3 100644 --- a/stripe/treasury/_inbound_transfer_service.py +++ b/stripe/treasury/_inbound_transfer_service.py @@ -104,6 +104,26 @@ def list( ), ) + async def list_async( + self, + params: "InboundTransferService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[InboundTransfer]: + """ + Returns a list of InboundTransfers sent from the specified FinancialAccount. + """ + return cast( + ListObject[InboundTransfer], + await self._request_async( + "get", + "/v1/treasury/inbound_transfers", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "InboundTransferService.CreateParams", @@ -124,6 +144,26 @@ def create( ), ) + async def create_async( + self, + params: "InboundTransferService.CreateParams", + options: RequestOptions = {}, + ) -> InboundTransfer: + """ + Creates an InboundTransfer. + """ + return cast( + InboundTransfer, + await self._request_async( + "post", + "/v1/treasury/inbound_transfers", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -147,6 +187,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + id: str, + params: "InboundTransferService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> InboundTransfer: + """ + Retrieves the details of an existing InboundTransfer. + """ + return cast( + InboundTransfer, + await self._request_async( + "get", + "/v1/treasury/inbound_transfers/{id}".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, inbound_transfer: str, @@ -169,3 +232,26 @@ def cancel( options=options, ), ) + + async def cancel_async( + self, + inbound_transfer: str, + params: "InboundTransferService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> InboundTransfer: + """ + Cancels an InboundTransfer. + """ + return cast( + InboundTransfer, + await self._request_async( + "post", + "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( + inbound_transfer=sanitize_id(inbound_transfer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index af42babd1..c843c9866 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -606,6 +606,61 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, id: str, **params: Unpack["OutboundPayment.CancelParams"] + ) -> "OutboundPayment": + """ + Cancel an OutboundPayment. + """ + return cast( + "OutboundPayment", + await cls._static_request_async( + "post", + "/v1/treasury/outbound_payments/{id}/cancel".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + id: str, **params: Unpack["OutboundPayment.CancelParams"] + ) -> "OutboundPayment": + """ + Cancel an OutboundPayment. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["OutboundPayment.CancelParams"] + ) -> "OutboundPayment": + """ + Cancel an OutboundPayment. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OutboundPayment.CancelParams"] + ) -> "OutboundPayment": + """ + Cancel an OutboundPayment. + """ + return cast( + "OutboundPayment", + await self._request_async( + "post", + "/v1/treasury/outbound_payments/{id}/cancel".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create( cls, **params: Unpack["OutboundPayment.CreateParams"] @@ -622,6 +677,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["OutboundPayment.CreateParams"] + ) -> "OutboundPayment": + """ + Creates an OutboundPayment. + """ + return cast( + "OutboundPayment", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["OutboundPayment.ListParams"] @@ -643,6 +714,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["OutboundPayment.ListParams"] + ) -> ListObject["OutboundPayment"]: + """ + Returns a list of OutboundPayments sent from the specified FinancialAccount. + """ + 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["OutboundPayment.RetrieveParams"] @@ -654,6 +746,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["OutboundPayment.RetrieveParams"] + ) -> "OutboundPayment": + """ + Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + class TestHelpers(APIResourceTestHelpers["OutboundPayment"]): _resource_cls: Type["OutboundPayment"] @@ -712,6 +815,61 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_fail_async( + cls, id: str, **params: Unpack["OutboundPayment.FailParams"] + ) -> "OutboundPayment": + """ + Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. + """ + return cast( + "OutboundPayment", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def fail_async( + id: str, **params: Unpack["OutboundPayment.FailParams"] + ) -> "OutboundPayment": + """ + Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. + """ + ... + + @overload + async def fail_async( + self, **params: Unpack["OutboundPayment.FailParams"] + ) -> "OutboundPayment": + """ + Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. + """ + ... + + @class_method_variant("_cls_fail_async") + async def fail_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OutboundPayment.FailParams"] + ) -> "OutboundPayment": + """ + Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. + """ + return cast( + "OutboundPayment", + await self.resource._request_async( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( + id=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_post( cls, id: str, **params: Unpack["OutboundPayment.PostParams"] @@ -767,6 +925,61 @@ def post( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_post_async( + cls, id: str, **params: Unpack["OutboundPayment.PostParams"] + ) -> "OutboundPayment": + """ + Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. + """ + return cast( + "OutboundPayment", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def post_async( + id: str, **params: Unpack["OutboundPayment.PostParams"] + ) -> "OutboundPayment": + """ + Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. + """ + ... + + @overload + async def post_async( + self, **params: Unpack["OutboundPayment.PostParams"] + ) -> "OutboundPayment": + """ + Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. + """ + ... + + @class_method_variant("_cls_post_async") + async def post_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OutboundPayment.PostParams"] + ) -> "OutboundPayment": + """ + Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. + """ + return cast( + "OutboundPayment", + await self.resource._request_async( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( + id=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_return_outbound_payment( cls, @@ -827,6 +1040,66 @@ def return_outbound_payment( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_return_outbound_payment_async( + cls, + id: str, + **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] + ) -> "OutboundPayment": + """ + Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. + """ + return cast( + "OutboundPayment", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def return_outbound_payment_async( + id: str, + **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] + ) -> "OutboundPayment": + """ + Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. + """ + ... + + @overload + async def return_outbound_payment_async( + self, + **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] + ) -> "OutboundPayment": + """ + Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. + """ + ... + + @class_method_variant("_cls_return_outbound_payment_async") + async def return_outbound_payment_async( # pyright: ignore[reportGeneralTypeIssues] + self, + **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] + ) -> "OutboundPayment": + """ + Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. + """ + return cast( + "OutboundPayment", + await self.resource._request_async( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( + id=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/treasury/_outbound_payment_service.py b/stripe/treasury/_outbound_payment_service.py index 0cc5615e6..2a22eb7e2 100644 --- a/stripe/treasury/_outbound_payment_service.py +++ b/stripe/treasury/_outbound_payment_service.py @@ -272,6 +272,26 @@ def list( ), ) + async def list_async( + self, + params: "OutboundPaymentService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[OutboundPayment]: + """ + Returns a list of OutboundPayments sent from the specified FinancialAccount. + """ + return cast( + ListObject[OutboundPayment], + await self._request_async( + "get", + "/v1/treasury/outbound_payments", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "OutboundPaymentService.CreateParams", @@ -292,6 +312,26 @@ def create( ), ) + async def create_async( + self, + params: "OutboundPaymentService.CreateParams", + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Creates an OutboundPayment. + """ + return cast( + OutboundPayment, + await self._request_async( + "post", + "/v1/treasury/outbound_payments", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -315,6 +355,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + id: str, + params: "OutboundPaymentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. + """ + return cast( + OutboundPayment, + await self._request_async( + "get", + "/v1/treasury/outbound_payments/{id}".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, id: str, @@ -337,3 +400,26 @@ def cancel( options=options, ), ) + + async def cancel_async( + self, + id: str, + params: "OutboundPaymentService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Cancel an OutboundPayment. + """ + return cast( + OutboundPayment, + await self._request_async( + "post", + "/v1/treasury/outbound_payments/{id}/cancel".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index 7ff842f43..b78f668eb 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -426,6 +426,64 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_cancel_async( + cls, + outbound_transfer: str, + **params: Unpack["OutboundTransfer.CancelParams"] + ) -> "OutboundTransfer": + """ + An OutboundTransfer can be canceled if the funds have not yet been paid out. + """ + return cast( + "OutboundTransfer", + await cls._static_request_async( + "post", + "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( + outbound_transfer=sanitize_id(outbound_transfer) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + outbound_transfer: str, + **params: Unpack["OutboundTransfer.CancelParams"] + ) -> "OutboundTransfer": + """ + An OutboundTransfer can be canceled if the funds have not yet been paid out. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["OutboundTransfer.CancelParams"] + ) -> "OutboundTransfer": + """ + An OutboundTransfer can be canceled if the funds have not yet been paid out. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OutboundTransfer.CancelParams"] + ) -> "OutboundTransfer": + """ + An OutboundTransfer can be canceled if the funds have not yet been paid out. + """ + return cast( + "OutboundTransfer", + await self._request_async( + "post", + "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( + outbound_transfer=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create( cls, **params: Unpack["OutboundTransfer.CreateParams"] @@ -442,6 +500,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["OutboundTransfer.CreateParams"] + ) -> "OutboundTransfer": + """ + Creates an OutboundTransfer. + """ + return cast( + "OutboundTransfer", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + @classmethod def list( cls, **params: Unpack["OutboundTransfer.ListParams"] @@ -463,6 +537,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["OutboundTransfer.ListParams"] + ) -> ListObject["OutboundTransfer"]: + """ + Returns a list of OutboundTransfers sent from the specified FinancialAccount. + """ + 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["OutboundTransfer.RetrieveParams"] @@ -474,6 +569,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["OutboundTransfer.RetrieveParams"] + ) -> "OutboundTransfer": + """ + Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + class TestHelpers(APIResourceTestHelpers["OutboundTransfer"]): _resource_cls: Type["OutboundTransfer"] @@ -535,6 +641,64 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_fail_async( + cls, + outbound_transfer: str, + **params: Unpack["OutboundTransfer.FailParams"] + ) -> "OutboundTransfer": + """ + Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. + """ + return cast( + "OutboundTransfer", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( + outbound_transfer=sanitize_id(outbound_transfer) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def fail_async( + outbound_transfer: str, + **params: Unpack["OutboundTransfer.FailParams"] + ) -> "OutboundTransfer": + """ + Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. + """ + ... + + @overload + async def fail_async( + self, **params: Unpack["OutboundTransfer.FailParams"] + ) -> "OutboundTransfer": + """ + Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. + """ + ... + + @class_method_variant("_cls_fail_async") + async def fail_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OutboundTransfer.FailParams"] + ) -> "OutboundTransfer": + """ + Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. + """ + return cast( + "OutboundTransfer", + await self.resource._request_async( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( + outbound_transfer=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_post( cls, @@ -593,6 +757,64 @@ def post( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_post_async( + cls, + outbound_transfer: str, + **params: Unpack["OutboundTransfer.PostParams"] + ) -> "OutboundTransfer": + """ + Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. + """ + return cast( + "OutboundTransfer", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( + outbound_transfer=sanitize_id(outbound_transfer) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def post_async( + outbound_transfer: str, + **params: Unpack["OutboundTransfer.PostParams"] + ) -> "OutboundTransfer": + """ + Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. + """ + ... + + @overload + async def post_async( + self, **params: Unpack["OutboundTransfer.PostParams"] + ) -> "OutboundTransfer": + """ + Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. + """ + ... + + @class_method_variant("_cls_post_async") + async def post_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OutboundTransfer.PostParams"] + ) -> "OutboundTransfer": + """ + Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. + """ + return cast( + "OutboundTransfer", + await self.resource._request_async( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( + outbound_transfer=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_return_outbound_transfer( cls, @@ -653,6 +875,66 @@ def return_outbound_transfer( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + async def _cls_return_outbound_transfer_async( + cls, + outbound_transfer: str, + **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] + ) -> "OutboundTransfer": + """ + Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. + """ + return cast( + "OutboundTransfer", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( + outbound_transfer=sanitize_id(outbound_transfer) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def return_outbound_transfer_async( + outbound_transfer: str, + **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] + ) -> "OutboundTransfer": + """ + Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. + """ + ... + + @overload + async def return_outbound_transfer_async( + self, + **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] + ) -> "OutboundTransfer": + """ + Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. + """ + ... + + @class_method_variant("_cls_return_outbound_transfer_async") + async def return_outbound_transfer_async( # pyright: ignore[reportGeneralTypeIssues] + self, + **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] + ) -> "OutboundTransfer": + """ + Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. + """ + return cast( + "OutboundTransfer", + await self.resource._request_async( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( + outbound_transfer=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/treasury/_outbound_transfer_service.py b/stripe/treasury/_outbound_transfer_service.py index 40f6ea469..c87bdde15 100644 --- a/stripe/treasury/_outbound_transfer_service.py +++ b/stripe/treasury/_outbound_transfer_service.py @@ -124,6 +124,26 @@ def list( ), ) + async def list_async( + self, + params: "OutboundTransferService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[OutboundTransfer]: + """ + Returns a list of OutboundTransfers sent from the specified FinancialAccount. + """ + return cast( + ListObject[OutboundTransfer], + await self._request_async( + "get", + "/v1/treasury/outbound_transfers", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "OutboundTransferService.CreateParams", @@ -144,6 +164,26 @@ def create( ), ) + async def create_async( + self, + params: "OutboundTransferService.CreateParams", + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Creates an OutboundTransfer. + """ + return cast( + OutboundTransfer, + await self._request_async( + "post", + "/v1/treasury/outbound_transfers", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, outbound_transfer: str, @@ -167,6 +207,29 @@ def retrieve( ), ) + async def retrieve_async( + self, + outbound_transfer: str, + params: "OutboundTransferService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. + """ + return cast( + OutboundTransfer, + await self._request_async( + "get", + "/v1/treasury/outbound_transfers/{outbound_transfer}".format( + outbound_transfer=sanitize_id(outbound_transfer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, outbound_transfer: str, @@ -189,3 +252,26 @@ def cancel( options=options, ), ) + + async def cancel_async( + self, + outbound_transfer: str, + params: "OutboundTransferService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + An OutboundTransfer can be canceled if the funds have not yet been paid out. + """ + return cast( + OutboundTransfer, + await self._request_async( + "post", + "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( + outbound_transfer=sanitize_id(outbound_transfer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 5911ffba0..077ce9509 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -380,6 +380,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["ReceivedCredit.ListParams"] + ) -> ListObject["ReceivedCredit"]: + """ + Returns a list of ReceivedCredits. + """ + 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["ReceivedCredit.RetrieveParams"] @@ -391,6 +412,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ReceivedCredit.RetrieveParams"] + ) -> "ReceivedCredit": + """ + Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + class TestHelpers(APIResourceTestHelpers["ReceivedCredit"]): _resource_cls: Type["ReceivedCredit"] @@ -410,6 +442,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["ReceivedCredit.CreateParams"] + ) -> "ReceivedCredit": + """ + Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. + """ + return cast( + "ReceivedCredit", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/received_credits", + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/treasury/_received_credit_service.py b/stripe/treasury/_received_credit_service.py index 53012d627..250b663e4 100644 --- a/stripe/treasury/_received_credit_service.py +++ b/stripe/treasury/_received_credit_service.py @@ -76,6 +76,26 @@ def list( ), ) + async def list_async( + self, + params: "ReceivedCreditService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[ReceivedCredit]: + """ + Returns a list of ReceivedCredits. + """ + return cast( + ListObject[ReceivedCredit], + await self._request_async( + "get", + "/v1/treasury/received_credits", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -98,3 +118,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + id: str, + params: "ReceivedCreditService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ReceivedCredit: + """ + Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. + """ + return cast( + ReceivedCredit, + await self._request_async( + "get", + "/v1/treasury/received_credits/{id}".format( + id=sanitize_id(id) + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_received_debit.py b/stripe/treasury/_received_debit.py index fc6a05814..49e3f127d 100644 --- a/stripe/treasury/_received_debit.py +++ b/stripe/treasury/_received_debit.py @@ -333,6 +333,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["ReceivedDebit.ListParams"] + ) -> ListObject["ReceivedDebit"]: + """ + Returns a list of ReceivedDebits. + """ + 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["ReceivedDebit.RetrieveParams"] @@ -344,6 +365,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ReceivedDebit.RetrieveParams"] + ) -> "ReceivedDebit": + """ + Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + class TestHelpers(APIResourceTestHelpers["ReceivedDebit"]): _resource_cls: Type["ReceivedDebit"] @@ -363,6 +395,22 @@ def create( ), ) + @classmethod + async def create_async( + cls, **params: Unpack["ReceivedDebit.CreateParams"] + ) -> "ReceivedDebit": + """ + Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. + """ + return cast( + "ReceivedDebit", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/received_debits", + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/treasury/_received_debit_service.py b/stripe/treasury/_received_debit_service.py index d21649d86..e1ef7306d 100644 --- a/stripe/treasury/_received_debit_service.py +++ b/stripe/treasury/_received_debit_service.py @@ -62,6 +62,26 @@ def list( ), ) + async def list_async( + self, + params: "ReceivedDebitService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[ReceivedDebit]: + """ + Returns a list of ReceivedDebits. + """ + return cast( + ListObject[ReceivedDebit], + await self._request_async( + "get", + "/v1/treasury/received_debits", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -82,3 +102,24 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + id: str, + params: "ReceivedDebitService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ReceivedDebit: + """ + Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list + """ + return cast( + ReceivedDebit, + await self._request_async( + "get", + "/v1/treasury/received_debits/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_transaction.py b/stripe/treasury/_transaction.py index e3921cd3d..146739365 100644 --- a/stripe/treasury/_transaction.py +++ b/stripe/treasury/_transaction.py @@ -293,6 +293,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["Transaction.ListParams"] + ) -> ListObject["Transaction"]: + """ + Retrieves a list of Transaction objects. + """ + 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["Transaction.RetrieveParams"] @@ -304,6 +325,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Transaction.RetrieveParams"] + ) -> "Transaction": + """ + Retrieves the details of an existing Transaction. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "balance_impact": BalanceImpact, "flow_details": FlowDetails, diff --git a/stripe/treasury/_transaction_entry.py b/stripe/treasury/_transaction_entry.py index fe2ea9bee..18ebfe248 100644 --- a/stripe/treasury/_transaction_entry.py +++ b/stripe/treasury/_transaction_entry.py @@ -287,6 +287,27 @@ def list( return result + @classmethod + async def list_async( + cls, **params: Unpack["TransactionEntry.ListParams"] + ) -> ListObject["TransactionEntry"]: + """ + Retrieves a list of TransactionEntry objects. + """ + 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["TransactionEntry.RetrieveParams"] @@ -298,6 +319,17 @@ def retrieve( instance.refresh() return instance + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["TransactionEntry.RetrieveParams"] + ) -> "TransactionEntry": + """ + Retrieves a TransactionEntry object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + @classmethod def class_url(cls): return "/v1/treasury/transaction_entries" diff --git a/stripe/treasury/_transaction_entry_service.py b/stripe/treasury/_transaction_entry_service.py index 9064309f7..8d720fd40 100644 --- a/stripe/treasury/_transaction_entry_service.py +++ b/stripe/treasury/_transaction_entry_service.py @@ -109,6 +109,26 @@ def list( ), ) + async def list_async( + self, + params: "TransactionEntryService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[TransactionEntry]: + """ + Retrieves a list of TransactionEntry objects. + """ + return cast( + ListObject[TransactionEntry], + await self._request_async( + "get", + "/v1/treasury/transaction_entries", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -131,3 +151,26 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + id: str, + params: "TransactionEntryService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> TransactionEntry: + """ + Retrieves a TransactionEntry object. + """ + return cast( + TransactionEntry, + await self._request_async( + "get", + "/v1/treasury/transaction_entries/{id}".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_transaction_service.py b/stripe/treasury/_transaction_service.py index 41d301480..ac91f7fd8 100644 --- a/stripe/treasury/_transaction_service.py +++ b/stripe/treasury/_transaction_service.py @@ -120,6 +120,26 @@ def list( ), ) + async def list_async( + self, + params: "TransactionService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[Transaction]: + """ + Retrieves a list of Transaction objects. + """ + return cast( + ListObject[Transaction], + await self._request_async( + "get", + "/v1/treasury/transactions", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, @@ -140,3 +160,24 @@ def retrieve( options=options, ), ) + + async def retrieve_async( + self, + id: str, + params: "TransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Transaction: + """ + Retrieves the details of an existing Transaction. + """ + return cast( + Transaction, + await self._request_async( + "get", + "/v1/treasury/transactions/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/test-requirements.txt b/test-requirements.txt index a06d9840d..626cbbb80 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,16 @@ # These requirements must be installable on all our supported versions + +# This is the last version of httpx compatible with Python 3.6 +httpx == 0.22.0; python_version == "3.6" +httpx >= 0.24.1; python_version == "3.7" +httpx >= 0.27.0; python_version >= "3.8" +aiohttp == 3.8.6; python_version <= "3.7" +aiohttp == 3.9.0; python_version > "3.7" +anyio[trio] == 3.6.2 + pytest-cov >= 2.8.1, < 2.11.0 pytest-mock >= 2.0.0 +asyncmock >= 0.4.2 pytest-xdist >= 1.31.0 pytest >= 6.0.0 coverage >= 4.5.3, < 5 diff --git a/tests/api_resources/abstract/test_api_resource.py b/tests/api_resources/abstract/test_api_resource.py index 4c3a0c96b..ebb533c9f 100644 --- a/tests/api_resources/abstract/test_api_resource.py +++ b/tests/api_resources/abstract/test_api_resource.py @@ -18,6 +18,17 @@ def my_method(cls, **params): params=params, ) + @classmethod + async def my_method_async(cls, **params): + return cls.construct_from( + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + stripe.api_key, + ) + def test_retrieve_and_refresh(self, http_client_mock): path = "/v1/myresources/foo%2A" query_string = "myparam=5" @@ -315,3 +326,27 @@ class MyDeletableResource(stripe.DeletableAPIResource): stripe_version="2023-01-01", stripe_account="acct_bar", ) + + @pytest.mark.anyio + async def test_async_methods_succeed(self, http_client_mock): + http_client_mock.stub_request( + "post", + "/v1/myresources", + rbody='{"id": "foo", "object": "myresource"}', + ) + resource = await self.MyDeletableResource.my_method_async() + http_client_mock.assert_requested( + "post", + path="/v1/myresources", + ) + + http_client_mock.stub_request( + "get", + "/v1/myresources/foo", + rbody='{"id": "foo", "object": "myresource"}', + ) + await resource.refresh_async() + http_client_mock.assert_requested( + "get", + path="/v1/myresources/foo", + ) diff --git a/tests/api_resources/test_list_object.py b/tests/api_resources/test_list_object.py index 72aa8dc11..98a4e72ce 100644 --- a/tests/api_resources/test_list_object.py +++ b/tests/api_resources/test_list_object.py @@ -436,3 +436,78 @@ def test_forwards_api_key_to_nested_resources(self, http_client_mock): api_key="sk_test_iter_forwards_options", ) assert lo.data[0].api_key == "sk_test_iter_forwards_options" + + +class TestAutoPagingAsync: + @staticmethod + def pageable_model_response(ids, has_more): + return { + "object": "list", + "url": "/v1/pageablemodels", + "data": [{"id": id, "object": "pageablemodel"} for id in ids], + "has_more": has_more, + } + + @pytest.mark.anyio + async def test_iter_one_page(self, http_client_mock): + lo = stripe.ListObject.construct_from( + self.pageable_model_response(["pm_123", "pm_124"], False), "mykey" + ) + + http_client_mock.assert_no_request() + + seen = [item["id"] async for item in lo.auto_paging_iter()] + + assert seen == ["pm_123", "pm_124"] + + @pytest.mark.anyio + async def test_iter_two_pages(self, http_client_mock): + lo = stripe.ListObject.construct_from( + self.pageable_model_response(["pm_123", "pm_124"], True), "mykey" + ) + lo._retrieve_params = {"foo": "bar"} + + http_client_mock.stub_request( + "get", + path="/v1/pageablemodels", + query_string="starting_after=pm_124&foo=bar", + rbody=json.dumps( + self.pageable_model_response(["pm_125", "pm_126"], False) + ), + ) + + seen = [item["id"] async for item in lo.auto_paging_iter()] + + http_client_mock.assert_requested( + "get", + path="/v1/pageablemodels", + query_string="starting_after=pm_124&foo=bar", + ) + + assert seen == ["pm_123", "pm_124", "pm_125", "pm_126"] + + @pytest.mark.anyio + async def test_iter_reverse(self, http_client_mock): + lo = stripe.ListObject.construct_from( + self.pageable_model_response(["pm_125", "pm_126"], True), "mykey" + ) + lo._retrieve_params = {"foo": "bar", "ending_before": "pm_127"} + + http_client_mock.stub_request( + "get", + path="/v1/pageablemodels", + query_string="ending_before=pm_125&foo=bar", + rbody=json.dumps( + self.pageable_model_response(["pm_123", "pm_124"], False) + ), + ) + + seen = [item["id"] async for item in lo.auto_paging_iter()] + + http_client_mock.assert_requested( + "get", + path="/v1/pageablemodels", + query_string="ending_before=pm_125&foo=bar", + ) + + assert seen == ["pm_126", "pm_125", "pm_124", "pm_123"] diff --git a/tests/api_resources/test_search_result_object.py b/tests/api_resources/test_search_result_object.py index c77abf467..6e4d3f535 100644 --- a/tests/api_resources/test_search_result_object.py +++ b/tests/api_resources/test_search_result_object.py @@ -42,6 +42,36 @@ def test_search(self, http_client_mock, search_result_object): assert isinstance(res.data[0], stripe.Charge) assert res.data[0].foo == "bar" + @pytest.mark.anyio + async def test_search_async(self, http_client_mock, search_result_object): + http_client_mock.stub_request( + "get", + path="/my/path", + query_string="myparam=you", + rbody=json.dumps( + { + "object": "search_result", + "data": [{"object": "charge", "foo": "bar"}], + } + ), + ) + + res = await search_result_object._search_async( + myparam="you", stripe_account="acct_123" + ) + + http_client_mock.assert_requested( + "get", + path="/my/path", + query_string="myparam=you", + stripe_account="acct_123", + ) + assert isinstance(res, stripe.SearchResultObject) + assert res.stripe_account == "acct_123" + assert isinstance(res.data, list) + assert isinstance(res.data[0], stripe.Charge) + assert res.data[0].foo == "bar" + def test_is_empty(self): sro = stripe.SearchResultObject.construct_from({"data": []}, None) assert sro.is_empty is True @@ -225,3 +255,57 @@ def test_iter_two_pages(self, http_client_mock): ) assert seen == ["pm_123", "pm_124", "pm_125", "pm_126"] + + +class TestAutoPagingAsync: + @staticmethod + def pageable_model_response(ids, has_more, next_page_token): + model = { + "object": "search_result", + "url": "/v1/pageablemodels", + "data": [{"id": id, "object": "pageablemodel"} for id in ids], + "has_more": has_more, + "next_page": next_page_token, + } + + return model + + @pytest.mark.anyio + async def test_iter_one_page(self, http_client_mock): + sro = stripe.SearchResultObject.construct_from( + self.pageable_model_response(["pm_123", "pm_124"], False, None), + "mykey", + ) + + http_client_mock.assert_no_request() + + seen = [item["id"] async for item in sro.auto_paging_iter()] + + assert seen == ["pm_123", "pm_124"] + + @pytest.mark.anyio + async def test_iter_two_pages(self, http_client_mock): + sro = stripe.SearchResultObject.construct_from( + self.pageable_model_response(["pm_123", "pm_124"], True, "token"), + "mykey", + ) + sro._retrieve_params = {"foo": "bar"} + + http_client_mock.stub_request( + "get", + path="/v1/pageablemodels", + query_string="page=token&foo=bar", + rbody=json.dumps( + self.pageable_model_response(["pm_125", "pm_126"], False, None) + ), + ) + + seen = [item["id"] async for item in sro.auto_paging_iter()] + + http_client_mock.assert_requested( + "get", + path="/v1/pageablemodels", + query_string="page=token&foo=bar", + ) + + assert seen == ["pm_123", "pm_124", "pm_125", "pm_126"] diff --git a/tests/conftest.py b/tests/conftest.py index d8f30969e..df2af0e17 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,6 +10,10 @@ from tests.stripe_mock import StripeMock from tests.http_client_mock import HTTPClientMock + +pytest_plugins = ("anyio",) + + MOCK_MINIMUM_VERSION = "0.109.0" # Starts stripe-mock if an OpenAPI spec override is found in `openapi/`, and diff --git a/tests/http_client_mock.py b/tests/http_client_mock.py index 5f3211b33..0e2ea588a 100644 --- a/tests/http_client_mock.py +++ b/tests/http_client_mock.py @@ -72,6 +72,7 @@ def check( api_key=None, stripe_version=None, stripe_account=None, + stripe_context=None, content_type=None, idempotency_key=None, user_agent=None, @@ -102,6 +103,8 @@ def check( self.assert_header("Stripe-Version", stripe_version) if stripe_account is not None: self.assert_header("Stripe-Account", stripe_account) + if stripe_context is not None: + self.assert_header("Stripe-Context", stripe_context) if content_type is not None: self.assert_header("Content-Type", content_type) if idempotency_key is not None: @@ -214,7 +217,9 @@ def assert_post_data(self, expected, is_json=False): class HTTPClientMock(object): def __init__(self, mocker): self.mock_client = mocker.Mock( - wraps=stripe.http_client.new_default_http_client() + wraps=stripe.http_client.new_default_http_client( + async_fallback_client=stripe.http_client.new_http_client_async_fallback() + ) ) self.mock_client._verify_ssl_certs = True @@ -223,6 +228,8 @@ def __init__(self, mocker): self.funcs = [ self.mock_client.request_with_retries, self.mock_client.request_stream_with_retries, + self.mock_client.request_with_retries_async, + self.mock_client.request_stream_with_retries_async, ] self.func_call_order = [] @@ -261,10 +268,15 @@ def custom_side_effect( ret = self.registered_responses[ (called_method, called_path, called_query) ] + if func._mock_name.endswith("async"): + return awaitable(ret) return ret return custom_side_effect + async def awaitable(x): + return x + self.registered_responses[ (method, path, urlencode(parse_and_sort(query_string))) ] = (rbody, rcode, rheaders) diff --git a/tests/request_mock.py b/tests/request_mock.py new file mode 100644 index 000000000..c6675261e --- /dev/null +++ b/tests/request_mock.py @@ -0,0 +1,256 @@ +import json + +import stripe +from stripe import util +from stripe._stripe_response import StripeResponse, StripeStreamResponse + + +class RequestMock(object): + def __init__(self, mocker): + self._mocker = mocker + + self._real_request = stripe.api_requestor.APIRequestor.request + self._real_request_async = ( + stripe.api_requestor.APIRequestor.request_async + ) + self._real_request_stream = ( + stripe.api_requestor.APIRequestor.request_stream + ) + self._stub_request_handler = StubRequestHandler() + + self.constructor_patcher = self._mocker.patch( + "stripe.api_requestor.APIRequestor.__init__", + side_effect=stripe.api_requestor.APIRequestor.__init__, + autospec=True, + ) + + self.request_patcher = self._mocker.patch( + "stripe.api_requestor.APIRequestor.request", + side_effect=self._patched_request, + autospec=True, + ) + + self.request_async_patcher = self._mocker.patch( + "stripe.api_requestor.APIRequestor.request_async", + side_effect=self._patched_request_async, + autospec=True, + ) + + self.request_stream_patcher = self._mocker.patch( + "stripe.api_requestor.APIRequestor.request_stream", + side_effect=self._patched_request_stream, + autospec=True, + ) + + def _patched_request(self, requestor, method, url, *args, **kwargs): + response = self._stub_request_handler.get_response( + method, url, expect_stream=False + ) + if response is not None: + return response, stripe.api_key + + return self._real_request(requestor, method, url, *args, **kwargs) + + async def _patched_request_async( + self, requestor, method, url, *args, **kwargs + ): + response = self._stub_request_handler.get_response( + method, url, expect_stream=False + ) + if response is not None: + return response, stripe.api_key + + return self._real_request_async( + requestor, method, url, *args, **kwargs + ) + + def _patched_request_stream(self, requestor, method, url, *args, **kwargs): + response = self._stub_request_handler.get_response( + method, url, expect_stream=True + ) + if response is not None: + return response, stripe.api_key + + return self._real_request_stream( + requestor, method, url, *args, **kwargs + ) + + def stub_request(self, method, url, rbody={}, rcode=200, rheaders={}): + self._stub_request_handler.register( + method, url, rbody, rcode, rheaders, is_streaming=False + ) + + def stub_request_stream( + self, method, url, rbody={}, rcode=200, rheaders={} + ): + self._stub_request_handler.register( + method, url, rbody, rcode, rheaders, is_streaming=True + ) + + def assert_api_base(self, expected_api_base): + # Note that this method only checks that an API base was provided + # as a keyword argument in APIRequestor's constructor, not as a + # positional argument. + + if "api_base" not in self.constructor_patcher.call_args[1]: + msg = ( + "Expected APIRequestor to have been constructed with " + "api_base='%s'. No API base was provided." % expected_api_base + ) + raise AssertionError(msg) + + actual_api_base = self.constructor_patcher.call_args[1]["api_base"] + if actual_api_base != expected_api_base: + msg = ( + "Expected APIRequestor to have been constructed with " + "api_base='%s'. Constructed with api_base='%s' " + "instead." % (expected_api_base, actual_api_base) + ) + raise AssertionError(msg) + + def assert_api_version(self, expected_api_version): + # Note that this method only checks that an API version was provided + # as a keyword argument in APIRequestor's constructor, not as a + # positional argument. + + if "api_version" not in self.constructor_patcher.call_args[1]: + msg = ( + "Expected APIRequestor to have been constructed with " + "api_version='%s'. No API version was provided." + % expected_api_version + ) + raise AssertionError(msg) + + actual_api_version = self.constructor_patcher.call_args[1][ + "api_version" + ] + if actual_api_version != expected_api_version: + msg = ( + "Expected APIRequestor to have been constructed with " + "api_version='%s'. Constructed with api_version='%s' " + "instead." % (expected_api_version, actual_api_version) + ) + raise AssertionError(msg) + + def assert_requested( + self, + method, + url, + params=None, + headers=None, + api_mode=None, + _usage=None, + ): + self.assert_requested_internal( + self.request_patcher, + method, + url, + params, + headers, + api_mode, + _usage, + ) + + def assert_requested_stream( + self, + method, + url, + params=None, + headers=None, + api_mode=None, + _usage=None, + ): + self.assert_requested_internal( + self.request_stream_patcher, + method, + url, + params, + headers, + api_mode, + _usage, + ) + + def assert_requested_internal( + self, patcher, method, url, params, headers, api_mode, usage + ): + params = params or self._mocker.ANY + headers = headers or self._mocker.ANY + api_mode = api_mode or self._mocker.ANY + usage = usage or self._mocker.ANY + called = False + exception = None + + # Sadly, ANY does not match a missing optional argument, so we + # check all the possible signatures of the request method + possible_called_args = [ + (self._mocker.ANY, method, url), + (self._mocker.ANY, method, url, params), + (self._mocker.ANY, method, url, params, headers), + (self._mocker.ANY, method, url, params, headers, api_mode), + ] + + possible_called_kwargs = [{}, {"_usage": usage}] + + for args in possible_called_args: + for kwargs in possible_called_kwargs: + try: + patcher.assert_called_with(*args, **kwargs) + except AssertionError as e: + exception = e + else: + called = True + break + + if not called: + raise exception + + def assert_no_request(self): + if self.request_patcher.call_count != 0: + msg = ( + "Expected 'request' to not have been called. " + "Called %s times." % (self.request_patcher.call_count) + ) + raise AssertionError(msg) + + def assert_no_request_stream(self): + if self.request_stream_patcher.call_count != 0: + msg = ( + "Expected 'request_stream' to not have been called. " + "Called %s times." % (self.request_stream_patcher.call_count) + ) + raise AssertionError(msg) + + def reset_mock(self): + self.request_patcher.reset_mock() + self.request_stream_patcher.reset_mock() + + +class StubRequestHandler(object): + def __init__(self): + self._entries = {} + + def register( + self, method, url, rbody={}, rcode=200, rheaders={}, is_streaming=False + ): + self._entries[(method, url)] = (rbody, rcode, rheaders, is_streaming) + + def get_response(self, method, url, expect_stream=False): + if (method, url) in self._entries: + rbody, rcode, rheaders, is_streaming = self._entries.pop( + (method, url) + ) + + if expect_stream != is_streaming: + return None + + if not isinstance(rbody, str): + rbody = json.dumps(rbody) + if is_streaming: + stripe_response = StripeStreamResponse( + util.io.BytesIO(str.encode(rbody)), rcode, rheaders + ) + else: + stripe_response = StripeResponse(rbody, rcode, rheaders) + return stripe_response + + return None diff --git a/tests/test_api_requestor.py b/tests/test_api_requestor.py index a04b27435..98daecda3 100644 --- a/tests/test_api_requestor.py +++ b/tests/test_api_requestor.py @@ -8,9 +8,12 @@ import stripe from stripe import util +from stripe._stripe_response import ( + StripeStreamResponse, + StripeStreamResponseAsync, +) from stripe._api_requestor import _APIRequestor, _api_encode from stripe._stripe_object import StripeObject -from stripe._stripe_response import StripeStreamResponse from stripe._requestor_options import ( _GlobalRequestorOptions, ) @@ -242,6 +245,65 @@ def test_empty_methods(self, requestor, http_client_mock): assert resp == {} + @pytest.mark.anyio + async def test_empty_methods_async(self, requestor, http_client_mock): + for meth in VALID_API_METHODS: + http_client_mock.stub_request( + meth, + path=self.valid_path, + rbody="{}", + rcode=200, + ) + + resp = await requestor.request_async( + meth, self.valid_path, {}, base_address="api", api_mode="V1" + ) + + if meth == "post": + post_data = "" + else: + post_data = None + + http_client_mock.assert_requested(meth, post_data=post_data) + assert isinstance(resp, StripeObject) + + assert resp == {} + + @pytest.mark.anyio + async def test_empty_methods_streaming_response_async( + self, requestor, http_client_mock + ): + async def async_iter(): + yield b"this" + yield b"is" + yield b"data" + + for meth in VALID_API_METHODS: + http_client_mock.stub_request( + meth, + path=self.valid_path, + rbody=async_iter(), + rcode=200, + ) + + resp = await requestor.request_stream_async( + meth, + self.valid_path, + {}, + base_address="api", + api_mode="V1", + ) + + if meth == "post": + post_data = "" + else: + post_data = None + + http_client_mock.assert_requested(meth, post_data=post_data) + assert isinstance(resp, StripeStreamResponseAsync) + + assert b"".join([x async for x in resp.stream()]) == b"thisisdata" + def test_empty_methods_streaming_response( self, requestor, http_client_mock ): diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 5c80d2b7f..2f3c97a17 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -6,6 +6,7 @@ from tests.http_client_mock import HTTPClientMock import io from stripe import StripeClient +import pytest class TestGeneratedExamples(object): @@ -53,6 +54,52 @@ def test_account_links_post_service( post_data="account=acct_xxxxxxxxxxxxx&refresh_url=https%3A%2F%2Fexample.com%2Freauth&return_url=https%3A%2F%2Fexample.com%2Freturn&type=account_onboarding", ) + @pytest.mark.anyio + async def test_account_links_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.AccountLink.create_async( + account="acct_xxxxxxxxxxxxx", + refresh_url="https://example.com/reauth", + return_url="https://example.com/return", + type="account_onboarding", + ) + http_client_mock.assert_requested( + "post", + path="/v1/account_links", + query_string="", + post_data="account=acct_xxxxxxxxxxxxx&refresh_url=https%3A%2F%2Fexample.com%2Freauth&return_url=https%3A%2F%2Fexample.com%2Freturn&type=account_onboarding", + ) + + @pytest.mark.anyio + async def test_account_links_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/account_links", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.account_links.create_async( + { + "account": "acct_xxxxxxxxxxxxx", + "refresh_url": "https://example.com/reauth", + "return_url": "https://example.com/return", + "type": "account_onboarding", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/account_links", + query_string="", + api_base="https://api.stripe.com", + post_data="account=acct_xxxxxxxxxxxxx&refresh_url=https%3A%2F%2Fexample.com%2Freauth&return_url=https%3A%2F%2Fexample.com%2Freturn&type=account_onboarding", + ) + def test_accounts_capabilities_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -83,6 +130,38 @@ def test_accounts_capabilities_get_service( api_base="https://api.stripe.com", ) + @pytest.mark.anyio + async def test_accounts_capabilities_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Account.list_capabilities_async("acct_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", + query_string="", + ) + + @pytest.mark.anyio + async def test_accounts_capabilities_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.accounts.capabilities.list_async("acct_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", + query_string="", + api_base="https://api.stripe.com", + ) + def test_accounts_capabilities_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -119,6 +198,44 @@ def test_accounts_capabilities_get_2_service( api_base="https://api.stripe.com", ) + @pytest.mark.anyio + async def test_accounts_capabilities_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Account.retrieve_capability_async( + "acct_xxxxxxxxxxxxx", + "card_payments", + ) + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", + query_string="", + ) + + @pytest.mark.anyio + async def test_accounts_capabilities_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.accounts.capabilities.retrieve_async( + "acct_xxxxxxxxxxxxx", + "card_payments", + ) + http_client_mock.assert_requested( + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", + query_string="", + api_base="https://api.stripe.com", + ) + def test_accounts_capabilities_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -159,6 +276,48 @@ def test_accounts_capabilities_post_service( post_data="requested=True", ) + @pytest.mark.anyio + async def test_accounts_capabilities_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Account.modify_capability_async( + "acct_xxxxxxxxxxxxx", + "card_payments", + requested=True, + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", + query_string="", + post_data="requested=True", + ) + + @pytest.mark.anyio + async def test_accounts_capabilities_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.accounts.capabilities.update_async( + "acct_xxxxxxxxxxxxx", + "card_payments", + {"requested": True}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", + query_string="", + api_base="https://api.stripe.com", + post_data="requested=True", + ) + def test_accounts_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.delete("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -187,6 +346,38 @@ def test_accounts_delete_service( api_base="https://api.stripe.com", ) + @pytest.mark.anyio + async def test_accounts_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Account.delete_async("acct_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_accounts_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/accounts/acct_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.accounts.delete_async("acct_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + def test_accounts_external_accounts_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -223,6 +414,44 @@ def test_accounts_external_accounts_delete_service( api_base="https://api.stripe.com", ) + @pytest.mark.anyio + async def test_accounts_external_accounts_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Account.delete_external_account_async( + "acct_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_accounts_external_accounts_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.accounts.external_accounts.delete_async( + "acct_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + def test_accounts_external_accounts_delete_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -259,6 +488,44 @@ def test_accounts_external_accounts_delete_2_service( api_base="https://api.stripe.com", ) + @pytest.mark.anyio + async def test_accounts_external_accounts_delete_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Account.delete_external_account_async( + "acct_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_accounts_external_accounts_delete_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.accounts.external_accounts.delete_async( + "acct_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + def test_accounts_external_accounts_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -296,65 +563,66 @@ def test_accounts_external_accounts_get_service( api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_get_2( + @pytest.mark.anyio + async def test_accounts_external_accounts_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.list_external_accounts( + await stripe.Account.list_external_accounts_async( "acct_xxxxxxxxxxxxx", - object="bank_account", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - query_string="object=bank_account&limit=3", + query_string="limit=3", ) - def test_accounts_external_accounts_get_2_service( + @pytest.mark.anyio + async def test_accounts_external_accounts_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - "object=bank_account&limit=3", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.list( + await client.accounts.external_accounts.list_async( "acct_xxxxxxxxxxxxx", - {"object": "bank_account", "limit": 3}, + {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - query_string="object=bank_account&limit=3", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_get_3( + def test_accounts_external_accounts_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.list_external_accounts( "acct_xxxxxxxxxxxxx", - object="card", + object="bank_account", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - query_string="object=card&limit=3", + query_string="object=bank_account&limit=3", ) - def test_accounts_external_accounts_get_3_service( + def test_accounts_external_accounts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - "object=card&limit=3", + "object=bank_account&limit=3", ) client = StripeClient( "sk_test_123", @@ -363,183 +631,189 @@ def test_accounts_external_accounts_get_3_service( client.accounts.external_accounts.list( "acct_xxxxxxxxxxxxx", - {"object": "card", "limit": 3}, + {"object": "bank_account", "limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - query_string="object=card&limit=3", + query_string="object=bank_account&limit=3", api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_get_4( + @pytest.mark.anyio + async def test_accounts_external_accounts_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.retrieve_external_account( + await stripe.Account.list_external_accounts_async( "acct_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", + object="bank_account", + limit=3, ) http_client_mock.assert_requested( "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", - query_string="", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + query_string="object=bank_account&limit=3", ) - def test_accounts_external_accounts_get_4_service( + @pytest.mark.anyio + async def test_accounts_external_accounts_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + "object=bank_account&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.retrieve( + await client.accounts.external_accounts.list_async( "acct_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", + {"object": "bank_account", "limit": 3}, ) http_client_mock.assert_requested( "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", - query_string="", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + query_string="object=bank_account&limit=3", api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_get_5( + def test_accounts_external_accounts_get_3( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.retrieve_external_account( + stripe.Account.list_external_accounts( "acct_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", + object="card", + limit=3, ) http_client_mock.assert_requested( "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", - query_string="", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + query_string="object=card&limit=3", ) - def test_accounts_external_accounts_get_5_service( + def test_accounts_external_accounts_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + "object=card&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.retrieve( + client.accounts.external_accounts.list( "acct_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", + {"object": "card", "limit": 3}, ) http_client_mock.assert_requested( "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", - query_string="", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + query_string="object=card&limit=3", api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_post( + @pytest.mark.anyio + async def test_accounts_external_accounts_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.create_external_account( + await stripe.Account.list_external_accounts_async( "acct_xxxxxxxxxxxxx", - external_account="btok_xxxxxxxxxxxxx", + object="card", + limit=3, ) http_client_mock.assert_requested( - "post", + "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - query_string="", - post_data="external_account=btok_xxxxxxxxxxxxx", + query_string="object=card&limit=3", ) - def test_accounts_external_accounts_post_service( + @pytest.mark.anyio + async def test_accounts_external_accounts_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", + "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + "object=card&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.create( + await client.accounts.external_accounts.list_async( "acct_xxxxxxxxxxxxx", - {"external_account": "btok_xxxxxxxxxxxxx"}, + {"object": "card", "limit": 3}, ) http_client_mock.assert_requested( - "post", + "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", - query_string="", + query_string="object=card&limit=3", api_base="https://api.stripe.com", - post_data="external_account=btok_xxxxxxxxxxxxx", ) - def test_accounts_external_accounts_post_2( + def test_accounts_external_accounts_get_4( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.create_external_account( + stripe.Account.retrieve_external_account( "acct_xxxxxxxxxxxxx", - external_account="tok_xxxx_debit", + "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", - post_data="external_account=tok_xxxx_debit", ) - def test_accounts_external_accounts_post_2_service( + def test_accounts_external_accounts_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + "get", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.create( + client.accounts.external_accounts.retrieve( "acct_xxxxxxxxxxxxx", - {"external_account": "tok_xxxx_debit"}, + "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="external_account=tok_xxxx_debit", ) - def test_accounts_external_accounts_post_3( + @pytest.mark.anyio + async def test_accounts_external_accounts_get_4_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.modify_external_account( + await stripe.Account.retrieve_external_account_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( - "post", + "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", - post_data="metadata[order_id]=6735", ) - def test_accounts_external_accounts_post_3_service( + @pytest.mark.anyio + async def test_accounts_external_accounts_get_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", + "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", ) client = StripeClient( @@ -547,39 +821,35 @@ def test_accounts_external_accounts_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.update( + await client.accounts.external_accounts.retrieve_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( - "post", + "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_accounts_external_accounts_post_4( + def test_accounts_external_accounts_get_5( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.modify_external_account( + stripe.Account.retrieve_external_account( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( - "post", + "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", - post_data="metadata[order_id]=6735", ) - def test_accounts_external_accounts_post_4_service( + def test_accounts_external_accounts_get_5_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", + "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", ) client = StripeClient( @@ -587,432 +857,389 @@ def test_accounts_external_accounts_post_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.update( + client.accounts.external_accounts.retrieve( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( - "post", + "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", - ) - - def test_accounts_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Account.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/accounts", - query_string="limit=3", ) - def test_accounts_get_service( + @pytest.mark.anyio + async def test_accounts_external_accounts_get_5_async( self, http_client_mock: HTTPClientMock ) -> None: - http_client_mock.stub_request( - "get", - "/v1/accounts", - "limit=3", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.accounts.list({"limit": 3}) - http_client_mock.assert_requested( - "get", - path="/v1/accounts", - query_string="limit=3", - api_base="https://api.stripe.com", + await stripe.Account.retrieve_external_account_async( + "acct_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", ) - - def test_accounts_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Account.retrieve("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", ) - def test_accounts_get_2_service( + @pytest.mark.anyio + async def test_accounts_external_accounts_get_5_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/accounts/acct_xxxxxxxxxxxxx", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.retrieve("acct_xxxxxxxxxxxxx") + await client.accounts.external_accounts.retrieve_async( + "acct_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_accounts_login_links_post( + def test_accounts_external_accounts_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.create_login_link("acct_xxxxxxxxxxxxx") + stripe.Account.create_external_account( + "acct_xxxxxxxxxxxxx", + external_account="btok_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", + post_data="external_account=btok_xxxxxxxxxxxxx", ) - def test_accounts_login_links_post_service( + def test_accounts_external_accounts_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/accounts/acct_xxxxxxxxxxxxx/login_links", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.login_links.create("acct_xxxxxxxxxxxxx") + client.accounts.external_accounts.create( + "acct_xxxxxxxxxxxxx", + {"external_account": "btok_xxxxxxxxxxxxx"}, + ) http_client_mock.assert_requested( "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", api_base="https://api.stripe.com", + post_data="external_account=btok_xxxxxxxxxxxxx", ) - def test_accounts_persons_delete( + @pytest.mark.anyio + async def test_accounts_external_accounts_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.delete_person( + await stripe.Account.create_external_account_async( "acct_xxxxxxxxxxxxx", - "person_xxxxxxxxxxxxx", + external_account="btok_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "delete", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", + post_data="external_account=btok_xxxxxxxxxxxxx", ) - def test_accounts_persons_delete_service( + @pytest.mark.anyio + async def test_accounts_external_accounts_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + "post", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.persons.delete( + await client.accounts.external_accounts.create_async( "acct_xxxxxxxxxxxxx", - "person_xxxxxxxxxxxxx", + {"external_account": "btok_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( - "delete", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", api_base="https://api.stripe.com", + post_data="external_account=btok_xxxxxxxxxxxxx", ) - def test_accounts_persons_get( + def test_accounts_external_accounts_post_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.persons( + stripe.Account.create_external_account( "acct_xxxxxxxxxxxxx", - limit=3, + external_account="tok_xxxx_debit", ) http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", - query_string="limit=3", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + query_string="", + post_data="external_account=tok_xxxx_debit", ) - def test_accounts_persons_get_service( + def test_accounts_external_accounts_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/accounts/acct_xxxxxxxxxxxxx/persons", - "limit=3", + "post", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.persons.list( + client.accounts.external_accounts.create( "acct_xxxxxxxxxxxxx", - {"limit": 3}, + {"external_account": "tok_xxxx_debit"}, ) http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", - query_string="limit=3", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", + query_string="", api_base="https://api.stripe.com", + post_data="external_account=tok_xxxx_debit", ) - def test_accounts_persons_get_2( + @pytest.mark.anyio + async def test_accounts_external_accounts_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.retrieve_person( + await stripe.Account.create_external_account_async( "acct_xxxxxxxxxxxxx", - "person_xxxxxxxxxxxxx", + external_account="tok_xxxx_debit", ) http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", + post_data="external_account=tok_xxxx_debit", ) - def test_accounts_persons_get_2_service( + @pytest.mark.anyio + async def test_accounts_external_accounts_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + "post", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.persons.retrieve( + await client.accounts.external_accounts.create_async( "acct_xxxxxxxxxxxxx", - "person_xxxxxxxxxxxxx", + {"external_account": "tok_xxxx_debit"}, ) http_client_mock.assert_requested( - "get", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", api_base="https://api.stripe.com", + post_data="external_account=tok_xxxx_debit", ) - def test_accounts_persons_post( + def test_accounts_external_accounts_post_3( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.create_person( + stripe.Account.modify_external_account( "acct_xxxxxxxxxxxxx", - first_name="Jane", - last_name="Diaz", + "ba_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", - post_data="first_name=Jane&last_name=Diaz", + post_data="metadata[order_id]=6735", ) - def test_accounts_persons_post_service( + def test_accounts_external_accounts_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/accounts/acct_xxxxxxxxxxxxx/persons", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.persons.create( + client.accounts.external_accounts.update( "acct_xxxxxxxxxxxxx", - {"first_name": "Jane", "last_name": "Diaz"}, + "ba_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="first_name=Jane&last_name=Diaz", + post_data="metadata[order_id]=6735", ) - def test_accounts_persons_post_2( + @pytest.mark.anyio + async def test_accounts_external_accounts_post_3_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.modify_person( + await stripe.Account.modify_external_account_async( "acct_xxxxxxxxxxxxx", - "person_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) - def test_accounts_persons_post_2_service( + @pytest.mark.anyio + async def test_accounts_external_accounts_post_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.persons.update( + await client.accounts.external_accounts.update_async( "acct_xxxxxxxxxxxxx", - "person_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) - def test_accounts_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Account.create( - type="custom", - country="US", - email="jenny.rosen@example.com", - capabilities={ - "card_payments": {"requested": True}, - "transfers": {"requested": True}, - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/accounts", - query_string="", - post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", - ) - - def test_accounts_post_service( + def test_accounts_external_accounts_post_4( self, http_client_mock: HTTPClientMock ) -> None: - http_client_mock.stub_request( - "post", - "/v1/accounts", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.accounts.create( - { - "type": "custom", - "country": "US", - "email": "jenny.rosen@example.com", - "capabilities": { - "card_payments": {"requested": True}, - "transfers": {"requested": True}, - }, - } - ) - http_client_mock.assert_requested( - "post", - path="/v1/accounts", - query_string="", - api_base="https://api.stripe.com", - post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", - ) - - def test_accounts_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Account.modify( + stripe.Account.modify_external_account( "acct_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) - def test_accounts_post_2_service( + def test_accounts_external_accounts_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/accounts/acct_xxxxxxxxxxxxx", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.update( + client.accounts.external_accounts.update( "acct_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) - def test_accounts_reject_post( + @pytest.mark.anyio + async def test_accounts_external_accounts_post_4_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Account.reject( + await stripe.Account.modify_external_account_async( "acct_xxxxxxxxxxxxx", - reason="fraud", + "card_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/reject", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", - post_data="reason=fraud", + post_data="metadata[order_id]=6735", ) - def test_accounts_reject_post_service( + @pytest.mark.anyio + async def test_accounts_external_accounts_post_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/accounts/acct_xxxxxxxxxxxxx/reject", + "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.reject( + await client.accounts.external_accounts.update_async( "acct_xxxxxxxxxxxxx", - {"reason": "fraud"}, + "card_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/accounts/acct_xxxxxxxxxxxxx/reject", + path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="reason=fraud", + post_data="metadata[order_id]=6735", ) - def test_application_fees_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ApplicationFee.list(limit=3) + def test_accounts_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Account.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/application_fees", + path="/v1/accounts", query_string="limit=3", ) - def test_application_fees_get_service( + def test_accounts_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/application_fees", + "/v1/accounts", "limit=3", ) client = StripeClient( @@ -1020,958 +1247,993 @@ def test_application_fees_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.application_fees.list({"limit": 3}) + client.accounts.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/application_fees", + path="/v1/accounts", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_application_fees_get_2( + @pytest.mark.anyio + async def test_accounts_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.ApplicationFee.retrieve("fee_xxxxxxxxxxxxx") + await stripe.Account.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/application_fees/fee_xxxxxxxxxxxxx", - query_string="", + path="/v1/accounts", + query_string="limit=3", ) - def test_application_fees_get_2_service( + @pytest.mark.anyio + async def test_accounts_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/application_fees/fee_xxxxxxxxxxxxx", + "/v1/accounts", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.application_fees.retrieve("fee_xxxxxxxxxxxxx") + await client.accounts.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/application_fees/fee_xxxxxxxxxxxxx", - query_string="", + path="/v1/accounts", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_application_fees_refunds_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ApplicationFee.list_refunds( - "fee_xxxxxxxxxxxxx", - limit=3, - ) + def test_accounts_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Account.retrieve("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", - query_string="limit=3", + path="/v1/accounts/acct_xxxxxxxxxxxxx", + query_string="", ) - def test_application_fees_refunds_get_service( + def test_accounts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", - "limit=3", + "/v1/accounts/acct_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.application_fees.refunds.list( - "fee_xxxxxxxxxxxxx", - {"limit": 3}, - ) + client.accounts.retrieve("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", - query_string="limit=3", + path="/v1/accounts/acct_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_application_fees_refunds_get_2( + @pytest.mark.anyio + async def test_accounts_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.ApplicationFee.retrieve_refund( - "fee_xxxxxxxxxxxxx", - "fr_xxxxxxxxxxxxx", - ) + await stripe.Account.retrieve_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", + path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", ) - def test_application_fees_refunds_get_2_service( + @pytest.mark.anyio + async def test_accounts_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", + "/v1/accounts/acct_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.application_fees.refunds.retrieve( - "fee_xxxxxxxxxxxxx", - "fr_xxxxxxxxxxxxx", - ) + await client.accounts.retrieve_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", + path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_application_fees_refunds_post( + def test_accounts_login_links_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.ApplicationFee.create_refund("fee_xxxxxxxxxxxxx") + stripe.Account.create_login_link("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", + path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", query_string="", ) - def test_application_fees_refunds_post_service( + def test_accounts_login_links_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", + "/v1/accounts/acct_xxxxxxxxxxxxx/login_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.application_fees.refunds.create("fee_xxxxxxxxxxxxx") + client.accounts.login_links.create("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", + path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", query_string="", api_base="https://api.stripe.com", ) - def test_application_fees_refunds_post_2( + @pytest.mark.anyio + async def test_accounts_login_links_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.ApplicationFee.modify_refund( - "fee_xxxxxxxxxxxxx", - "fr_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + await stripe.Account.create_login_link_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", + path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", query_string="", - post_data="metadata[order_id]=6735", ) - def test_application_fees_refunds_post_2_service( + @pytest.mark.anyio + async def test_accounts_login_links_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", + "/v1/accounts/acct_xxxxxxxxxxxxx/login_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.application_fees.refunds.update( - "fee_xxxxxxxxxxxxx", - "fr_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + await client.accounts.login_links.create_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", + path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_apps_secrets_delete_post( + def test_accounts_persons_delete( self, http_client_mock: HTTPClientMock ) -> None: - stripe.apps.Secret.delete_where( - name="my-api-key", - scope={"type": "account"}, + stripe.Account.delete_person( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/apps/secrets/delete", + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", - post_data="name=my-api-key&scope[type]=account", ) - def test_apps_secrets_delete_post_service( + def test_accounts_persons_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/apps/secrets/delete", + "delete", + "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.apps.secrets.delete_where( - { - "name": "my-api-key", - "scope": {"type": "account"}, - } - ) - http_client_mock.assert_requested( - "post", - path="/v1/apps/secrets/delete", + client.accounts.persons.delete( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="name=my-api-key&scope[type]=account", ) - def test_apps_secrets_find_get( + @pytest.mark.anyio + async def test_accounts_persons_delete_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.apps.Secret.find( - name="sec_123", - scope={"type": "account"}, + await stripe.Account.delete_person_async( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "get", - path="/v1/apps/secrets/find", - query_string="name=sec_123&scope[type]=account", + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + query_string="", ) - def test_apps_secrets_find_get_service( + @pytest.mark.anyio + async def test_accounts_persons_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/apps/secrets/find", - "name=sec_123&scope[type]=account", + "delete", + "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.apps.secrets.find( - { - "name": "sec_123", - "scope": {"type": "account"}, - } + await client.accounts.persons.delete_async( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "get", - path="/v1/apps/secrets/find", - query_string="name=sec_123&scope[type]=account", + "delete", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_apps_secrets_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.apps.Secret.list( - scope={"type": "account"}, - limit=2, + def test_accounts_persons_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.persons( + "acct_xxxxxxxxxxxxx", + limit=3, ) http_client_mock.assert_requested( "get", - path="/v1/apps/secrets", - query_string="scope[type]=account&limit=2", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", + query_string="limit=3", ) - def test_apps_secrets_get_service( + def test_accounts_persons_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/apps/secrets", - "scope[type]=account&limit=2", + "/v1/accounts/acct_xxxxxxxxxxxxx/persons", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) + client.accounts.persons.list( + "acct_xxxxxxxxxxxxx", + {"limit": 3}, + ) http_client_mock.assert_requested( "get", - path="/v1/apps/secrets", - query_string="scope[type]=account&limit=2", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_apps_secrets_get_2( + @pytest.mark.anyio + async def test_accounts_persons_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.apps.Secret.list( - scope={"type": "account"}, - limit=2, + await stripe.Account.persons_async( + "acct_xxxxxxxxxxxxx", + limit=3, ) http_client_mock.assert_requested( "get", - path="/v1/apps/secrets", - query_string="scope[type]=account&limit=2", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", + query_string="limit=3", ) - def test_apps_secrets_get_2_service( + @pytest.mark.anyio + async def test_accounts_persons_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/apps/secrets", - "scope[type]=account&limit=2", + "/v1/accounts/acct_xxxxxxxxxxxxx/persons", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) + await client.accounts.persons.list_async( + "acct_xxxxxxxxxxxxx", + {"limit": 3}, + ) http_client_mock.assert_requested( "get", - path="/v1/apps/secrets", - query_string="scope[type]=account&limit=2", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_apps_secrets_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.apps.Secret.create( - name="sec_123", - payload="very secret string", - scope={"type": "account"}, + def test_accounts_persons_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.retrieve_person( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/apps/secrets", + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", - post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) - def test_apps_secrets_post_service( + def test_accounts_persons_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/apps/secrets", + "get", + "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.apps.secrets.create( - { - "name": "sec_123", - "payload": "very secret string", - "scope": {"type": "account"}, - } + client.accounts.persons.retrieve( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/apps/secrets", + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) - def test_apps_secrets_post_2( + @pytest.mark.anyio + async def test_accounts_persons_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.apps.Secret.create( - name="my-api-key", - payload="secret_key_xxxxxx", - scope={"type": "account"}, + await stripe.Account.retrieve_person_async( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/apps/secrets", + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", - post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) - def test_apps_secrets_post_2_service( + @pytest.mark.anyio + async def test_accounts_persons_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/apps/secrets", + "get", + "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.apps.secrets.create( - { - "name": "my-api-key", - "payload": "secret_key_xxxxxx", - "scope": {"type": "account"}, - } + await client.accounts.persons.retrieve_async( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/apps/secrets", + "get", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) - def test_balance_transactions_get( + def test_accounts_persons_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.BalanceTransaction.list(limit=3) + stripe.Account.create_person( + "acct_xxxxxxxxxxxxx", + first_name="Jane", + last_name="Diaz", + ) http_client_mock.assert_requested( - "get", - path="/v1/balance_transactions", - query_string="limit=3", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", + query_string="", + post_data="first_name=Jane&last_name=Diaz", ) - def test_balance_transactions_get_service( + def test_accounts_persons_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/balance_transactions", - "limit=3", + "post", + "/v1/accounts/acct_xxxxxxxxxxxxx/persons", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.balance_transactions.list({"limit": 3}) + client.accounts.persons.create( + "acct_xxxxxxxxxxxxx", + {"first_name": "Jane", "last_name": "Diaz"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/balance_transactions", - query_string="limit=3", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", + query_string="", api_base="https://api.stripe.com", + post_data="first_name=Jane&last_name=Diaz", ) - def test_balance_transactions_get_2( + @pytest.mark.anyio + async def test_accounts_persons_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.BalanceTransaction.retrieve("txn_xxxxxxxxxxxxx") + await stripe.Account.create_person_async( + "acct_xxxxxxxxxxxxx", + first_name="Jane", + last_name="Diaz", + ) http_client_mock.assert_requested( - "get", - path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", query_string="", + post_data="first_name=Jane&last_name=Diaz", ) - def test_balance_transactions_get_2_service( + @pytest.mark.anyio + async def test_accounts_persons_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/balance_transactions/txn_xxxxxxxxxxxxx", + "post", + "/v1/accounts/acct_xxxxxxxxxxxxx/persons", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.balance_transactions.retrieve("txn_xxxxxxxxxxxxx") + await client.accounts.persons.create_async( + "acct_xxxxxxxxxxxxx", + {"first_name": "Jane", "last_name": "Diaz"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", query_string="", api_base="https://api.stripe.com", + post_data="first_name=Jane&last_name=Diaz", ) - def test_billing_portal_configurations_get( + def test_accounts_persons_post_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.billing_portal.Configuration.list(limit=3) + stripe.Account.modify_person( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/billing_portal/configurations", - query_string="limit=3", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", ) - def test_billing_portal_configurations_get_service( + def test_accounts_persons_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/billing_portal/configurations", - "limit=3", + "post", + "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.billing_portal.configurations.list({"limit": 3}) + client.accounts.persons.update( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "get", - path="/v1/billing_portal/configurations", - query_string="limit=3", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_billing_portal_configurations_get_2( + @pytest.mark.anyio + async def test_accounts_persons_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.billing_portal.Configuration.retrieve("bpc_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", + await stripe.Account.modify_person_async( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_billing_portal_configurations_get_2_service( + @pytest.mark.anyio + async def test_accounts_persons_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", + "post", + "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.billing_portal.configurations.retrieve("bpc_xxxxxxxxxxxxx") + await client.accounts.persons.update_async( + "acct_xxxxxxxxxxxxx", + "person_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "get", - path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_billing_portal_configurations_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.billing_portal.Configuration.create( - features={ - "customer_update": { - "allowed_updates": ["email", "tax_id"], - "enabled": True, - }, - "invoice_history": {"enabled": True}, - }, - business_profile={ - "privacy_policy_url": "https://example.com/privacy", - "terms_of_service_url": "https://example.com/terms", + def test_accounts_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Account.create( + type="custom", + country="US", + email="jenny.rosen@example.com", + capabilities={ + "card_payments": {"requested": True}, + "transfers": {"requested": True}, }, ) http_client_mock.assert_requested( "post", - path="/v1/billing_portal/configurations", + path="/v1/accounts", query_string="", - post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", + post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", ) - def test_billing_portal_configurations_post_service( + def test_accounts_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/billing_portal/configurations", + "/v1/accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.billing_portal.configurations.create( + client.accounts.create( { - "features": { - "customer_update": { - "allowed_updates": ["email", "tax_id"], - "enabled": True, - }, - "invoice_history": {"enabled": True}, - }, - "business_profile": { - "privacy_policy_url": "https://example.com/privacy", - "terms_of_service_url": "https://example.com/terms", + "type": "custom", + "country": "US", + "email": "jenny.rosen@example.com", + "capabilities": { + "card_payments": {"requested": True}, + "transfers": {"requested": True}, }, } ) http_client_mock.assert_requested( "post", - path="/v1/billing_portal/configurations", + path="/v1/accounts", query_string="", api_base="https://api.stripe.com", - post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", + post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", ) - def test_billing_portal_configurations_post_2( + @pytest.mark.anyio + async def test_accounts_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.billing_portal.Configuration.modify( - "bpc_xxxxxxxxxxxxx", - business_profile={ - "privacy_policy_url": "https://example.com/privacy", - "terms_of_service_url": "https://example.com/terms", + await stripe.Account.create_async( + type="custom", + country="US", + email="jenny.rosen@example.com", + capabilities={ + "card_payments": {"requested": True}, + "transfers": {"requested": True}, }, ) http_client_mock.assert_requested( "post", - path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", + path="/v1/accounts", query_string="", - post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", + post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", ) - def test_billing_portal_configurations_post_2_service( + @pytest.mark.anyio + async def test_accounts_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", + "/v1/accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.billing_portal.configurations.update( - "bpc_xxxxxxxxxxxxx", + await client.accounts.create_async( { - "business_profile": { - "privacy_policy_url": "https://example.com/privacy", - "terms_of_service_url": "https://example.com/terms", + "type": "custom", + "country": "US", + "email": "jenny.rosen@example.com", + "capabilities": { + "card_payments": {"requested": True}, + "transfers": {"requested": True}, }, - }, + } ) http_client_mock.assert_requested( "post", - path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", + path="/v1/accounts", query_string="", api_base="https://api.stripe.com", - post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", + post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", ) - def test_billing_portal_sessions_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.billing_portal.Session.create( - customer="cus_xxxxxxxxxxxxx", - return_url="https://example.com/account", + def test_accounts_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Account.modify( + "acct_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/billing_portal/sessions", + path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", - post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", + post_data="metadata[order_id]=6735", ) - def test_billing_portal_sessions_post_service( + def test_accounts_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/billing_portal/sessions", + "/v1/accounts/acct_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.billing_portal.sessions.create( - { - "customer": "cus_xxxxxxxxxxxxx", - "return_url": "https://example.com/account", - } + client.accounts.update( + "acct_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/billing_portal/sessions", + path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", + post_data="metadata[order_id]=6735", ) - def test_charges_capture_post( + @pytest.mark.anyio + async def test_accounts_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Charge.capture("ch_xxxxxxxxxxxxx") + await stripe.Account.modify_async( + "acct_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( "post", - path="/v1/charges/ch_xxxxxxxxxxxxx/capture", + path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_charges_capture_post_service( + @pytest.mark.anyio + async def test_accounts_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/charges/ch_xxxxxxxxxxxxx/capture", + "/v1/accounts/acct_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.charges.capture("ch_xxxxxxxxxxxxx") + await client.accounts.update_async( + "acct_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( "post", - path="/v1/charges/ch_xxxxxxxxxxxxx/capture", + path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_charges_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Charge.list(limit=3) + def test_accounts_reject_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Account.reject( + "acct_xxxxxxxxxxxxx", + reason="fraud", + ) http_client_mock.assert_requested( - "get", - path="/v1/charges", - query_string="limit=3", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/reject", + query_string="", + post_data="reason=fraud", ) - def test_charges_get_service( + def test_accounts_reject_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/charges", - "limit=3", + "post", + "/v1/accounts/acct_xxxxxxxxxxxxx/reject", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.charges.list({"limit": 3}) + client.accounts.reject( + "acct_xxxxxxxxxxxxx", + {"reason": "fraud"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/charges", - query_string="limit=3", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/reject", + query_string="", api_base="https://api.stripe.com", + post_data="reason=fraud", ) - def test_charges_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Charge.retrieve("ch_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_accounts_reject_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Account.reject_async( + "acct_xxxxxxxxxxxxx", + reason="fraud", + ) http_client_mock.assert_requested( - "get", - path="/v1/charges/ch_xxxxxxxxxxxxx", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/reject", query_string="", + post_data="reason=fraud", ) - def test_charges_get_2_service( + @pytest.mark.anyio + async def test_accounts_reject_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/charges/ch_xxxxxxxxxxxxx", + "post", + "/v1/accounts/acct_xxxxxxxxxxxxx/reject", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.charges.retrieve("ch_xxxxxxxxxxxxx") + await client.accounts.reject_async( + "acct_xxxxxxxxxxxxx", + {"reason": "fraud"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/charges/ch_xxxxxxxxxxxxx", + "post", + path="/v1/accounts/acct_xxxxxxxxxxxxx/reject", query_string="", api_base="https://api.stripe.com", + post_data="reason=fraud", ) - def test_charges_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Charge.create( - amount=2000, - currency="usd", - source="tok_xxxx", - description="My First Test Charge (created for API docs at https://www.stripe.com/docs/api)", - ) + def test_application_fees_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ApplicationFee.list(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/charges", - query_string="", - post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", + "get", + path="/v1/application_fees", + query_string="limit=3", ) - def test_charges_post_service( + def test_application_fees_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/charges", + "get", + "/v1/application_fees", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.charges.create( - { - "amount": 2000, - "currency": "usd", - "source": "tok_xxxx", - "description": "My First Test Charge (created for API docs at https://www.stripe.com/docs/api)", - } - ) + client.application_fees.list({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/charges", - query_string="", + "get", + path="/v1/application_fees", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) - def test_charges_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Charge.modify( - "ch_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + @pytest.mark.anyio + async def test_application_fees_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.ApplicationFee.list_async(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/charges/ch_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", + "get", + path="/v1/application_fees", + query_string="limit=3", ) - def test_charges_post_2_service( + @pytest.mark.anyio + async def test_application_fees_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/charges/ch_xxxxxxxxxxxxx", + "get", + "/v1/application_fees", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.charges.update( - "ch_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + await client.application_fees.list_async({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/charges/ch_xxxxxxxxxxxxx", - query_string="", + "get", + path="/v1/application_fees", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_charges_search_get( + def test_application_fees_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Charge.search( - query="amount>999 AND metadata['order_id']:'6735'" - ) + stripe.ApplicationFee.retrieve("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/charges/search", - query_string="query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + path="/v1/application_fees/fee_xxxxxxxxxxxxx", + query_string="", ) - def test_charges_search_get_service( + def test_application_fees_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/charges/search", - "query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + "/v1/application_fees/fee_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.charges.search( - { - "query": "amount>999 AND metadata['order_id']:'6735'", - } - ) + client.application_fees.retrieve("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/charges/search", - query_string="query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + path="/v1/application_fees/fee_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_checkout_sessions_expire_post( + @pytest.mark.anyio + async def test_application_fees_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.checkout.Session.expire("sess_xyz") + await stripe.ApplicationFee.retrieve_async("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/checkout/sessions/sess_xyz/expire", + "get", + path="/v1/application_fees/fee_xxxxxxxxxxxxx", query_string="", ) - def test_checkout_sessions_expire_post_service( + @pytest.mark.anyio + async def test_application_fees_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/checkout/sessions/sess_xyz/expire", + "get", + "/v1/application_fees/fee_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.expire("sess_xyz") + await client.application_fees.retrieve_async("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/checkout/sessions/sess_xyz/expire", + "get", + path="/v1/application_fees/fee_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_checkout_sessions_expire_post_2( + def test_application_fees_refunds_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.checkout.Session.expire("cs_test_xxxxxxxxxxxxx") + stripe.ApplicationFee.list_refunds( + "fee_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( - "post", - path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", - query_string="", + "get", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", + query_string="limit=3", ) - def test_checkout_sessions_expire_post_2_service( + def test_application_fees_refunds_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", + "get", + "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.expire("cs_test_xxxxxxxxxxxxx") + client.application_fees.refunds.list( + "fee_xxxxxxxxxxxxx", + {"limit": 3}, + ) http_client_mock.assert_requested( - "post", - path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", - query_string="", + "get", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_checkout_sessions_get( + @pytest.mark.anyio + async def test_application_fees_refunds_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.checkout.Session.list(limit=3) + await stripe.ApplicationFee.list_refunds_async( + "fee_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/checkout/sessions", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="limit=3", ) - def test_checkout_sessions_get_service( + @pytest.mark.anyio + async def test_application_fees_refunds_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/checkout/sessions", + "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", "limit=3", ) client = StripeClient( @@ -1979,699 +2241,731 @@ def test_checkout_sessions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.list({"limit": 3}) + await client.application_fees.refunds.list_async( + "fee_xxxxxxxxxxxxx", + {"limit": 3}, + ) http_client_mock.assert_requested( "get", - path="/v1/checkout/sessions", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_checkout_sessions_get_2( + def test_application_fees_refunds_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.checkout.Session.retrieve("cs_test_xxxxxxxxxxxxx") + stripe.ApplicationFee.retrieve_refund( + "fee_xxxxxxxxxxxxx", + "fr_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", ) - def test_checkout_sessions_get_2_service( + def test_application_fees_refunds_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", + "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.retrieve("cs_test_xxxxxxxxxxxxx") + client.application_fees.refunds.retrieve( + "fee_xxxxxxxxxxxxx", + "fr_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_checkout_sessions_line_items_get( + @pytest.mark.anyio + async def test_application_fees_refunds_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.checkout.Session.list_line_items("sess_xyz") + await stripe.ApplicationFee.retrieve_refund_async( + "fee_xxxxxxxxxxxxx", + "fr_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/checkout/sessions/sess_xyz/line_items", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", ) - def test_checkout_sessions_line_items_get_service( + @pytest.mark.anyio + async def test_application_fees_refunds_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/checkout/sessions/sess_xyz/line_items", + "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.line_items.list("sess_xyz") + await client.application_fees.refunds.retrieve_async( + "fee_xxxxxxxxxxxxx", + "fr_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/checkout/sessions/sess_xyz/line_items", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_checkout_sessions_post( + def test_application_fees_refunds_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.checkout.Session.create( - success_url="https://example.com/success", - cancel_url="https://example.com/cancel", - mode="payment", - shipping_options=[ - {"shipping_rate": "shr_standard"}, - { - "shipping_rate_data": { - "display_name": "Standard", - "delivery_estimate": { - "minimum": {"unit": "day", "value": 5}, - "maximum": {"unit": "day", "value": 7}, - }, - }, - }, - ], - ) + stripe.ApplicationFee.create_refund("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/checkout/sessions", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="", - post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", ) - def test_checkout_sessions_post_service( + def test_application_fees_refunds_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/checkout/sessions", + "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.create( - { - "success_url": "https://example.com/success", - "cancel_url": "https://example.com/cancel", - "mode": "payment", - "shipping_options": [ - {"shipping_rate": "shr_standard"}, - { - "shipping_rate_data": { - "display_name": "Standard", - "delivery_estimate": { - "minimum": {"unit": "day", "value": 5}, - "maximum": {"unit": "day", "value": 7}, - }, - }, - }, - ], - } - ) + client.application_fees.refunds.create("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/checkout/sessions", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="", api_base="https://api.stripe.com", - post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", ) - def test_checkout_sessions_post_2( + @pytest.mark.anyio + async def test_application_fees_refunds_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.checkout.Session.create( - success_url="https://example.com/success", - line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], - mode="payment", - ) + await stripe.ApplicationFee.create_refund_async("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/checkout/sessions", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="", - post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", ) - def test_checkout_sessions_post_2_service( + @pytest.mark.anyio + async def test_application_fees_refunds_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/checkout/sessions", + "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.create( - { - "success_url": "https://example.com/success", - "line_items": [ - {"price": "price_xxxxxxxxxxxxx", "quantity": 2} - ], - "mode": "payment", - } - ) + await client.application_fees.refunds.create_async("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/checkout/sessions", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="", api_base="https://api.stripe.com", - post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", ) - def test_country_specs_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.CountrySpec.list(limit=3) + def test_application_fees_refunds_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ApplicationFee.modify_refund( + "fee_xxxxxxxxxxxxx", + "fr_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/country_specs", - query_string="limit=3", + "post", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", ) - def test_country_specs_get_service( + def test_application_fees_refunds_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/country_specs", - "limit=3", + "post", + "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.country_specs.list({"limit": 3}) + client.application_fees.refunds.update( + "fee_xxxxxxxxxxxxx", + "fr_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "get", - path="/v1/country_specs", - query_string="limit=3", + "post", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_country_specs_get_2( + @pytest.mark.anyio + async def test_application_fees_refunds_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.CountrySpec.retrieve("US") + await stripe.ApplicationFee.modify_refund_async( + "fee_xxxxxxxxxxxxx", + "fr_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/country_specs/US", + "post", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_country_specs_get_2_service( + @pytest.mark.anyio + async def test_application_fees_refunds_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/country_specs/US", + "post", + "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.country_specs.retrieve("US") + await client.application_fees.refunds.update_async( + "fee_xxxxxxxxxxxxx", + "fr_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "get", - path="/v1/country_specs/US", + "post", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_coupons_delete(self, http_client_mock: HTTPClientMock) -> None: - stripe.Coupon.delete("Z4OV52SU") + def test_apps_secrets_delete_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.apps.Secret.delete_where( + name="my-api-key", + scope={"type": "account"}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/coupons/Z4OV52SU", + "post", + path="/v1/apps/secrets/delete", query_string="", + post_data="name=my-api-key&scope[type]=account", ) - def test_coupons_delete_service( + def test_apps_secrets_delete_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/coupons/Z4OV52SU", + "post", + "/v1/apps/secrets/delete", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.coupons.delete("Z4OV52SU") + client.apps.secrets.delete_where( + { + "name": "my-api-key", + "scope": {"type": "account"}, + } + ) http_client_mock.assert_requested( - "delete", - path="/v1/coupons/Z4OV52SU", + "post", + path="/v1/apps/secrets/delete", query_string="", api_base="https://api.stripe.com", + post_data="name=my-api-key&scope[type]=account", ) - def test_coupons_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Coupon.list(limit=3) + @pytest.mark.anyio + async def test_apps_secrets_delete_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.apps.Secret.delete_where_async( + name="my-api-key", + scope={"type": "account"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/coupons", - query_string="limit=3", + "post", + path="/v1/apps/secrets/delete", + query_string="", + post_data="name=my-api-key&scope[type]=account", ) - def test_coupons_get_service( + @pytest.mark.anyio + async def test_apps_secrets_delete_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/coupons", - "limit=3", + "post", + "/v1/apps/secrets/delete", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.coupons.list({"limit": 3}) + await client.apps.secrets.delete_where_async( + { + "name": "my-api-key", + "scope": {"type": "account"}, + } + ) http_client_mock.assert_requested( - "get", - path="/v1/coupons", - query_string="limit=3", + "post", + path="/v1/apps/secrets/delete", + query_string="", api_base="https://api.stripe.com", + post_data="name=my-api-key&scope[type]=account", ) - def test_coupons_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Coupon.retrieve("Z4OV52SU") + def test_apps_secrets_find_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.apps.Secret.find( + name="sec_123", + scope={"type": "account"}, + ) http_client_mock.assert_requested( "get", - path="/v1/coupons/Z4OV52SU", - query_string="", + path="/v1/apps/secrets/find", + query_string="name=sec_123&scope[type]=account", ) - def test_coupons_get_2_service( + def test_apps_secrets_find_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/coupons/Z4OV52SU", + "/v1/apps/secrets/find", + "name=sec_123&scope[type]=account", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.coupons.retrieve("Z4OV52SU") + client.apps.secrets.find( + { + "name": "sec_123", + "scope": {"type": "account"}, + } + ) http_client_mock.assert_requested( "get", - path="/v1/coupons/Z4OV52SU", - query_string="", + path="/v1/apps/secrets/find", + query_string="name=sec_123&scope[type]=account", api_base="https://api.stripe.com", ) - def test_coupons_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Coupon.create( - percent_off=25.5, - duration="repeating", - duration_in_months=3, + @pytest.mark.anyio + async def test_apps_secrets_find_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.apps.Secret.find_async( + name="sec_123", + scope={"type": "account"}, ) http_client_mock.assert_requested( - "post", - path="/v1/coupons", - query_string="", - post_data="percent_off=25.5&duration=repeating&duration_in_months=3", + "get", + path="/v1/apps/secrets/find", + query_string="name=sec_123&scope[type]=account", ) - def test_coupons_post_service( + @pytest.mark.anyio + async def test_apps_secrets_find_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/coupons", + "get", + "/v1/apps/secrets/find", + "name=sec_123&scope[type]=account", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.coupons.create( + await client.apps.secrets.find_async( { - "percent_off": 25.5, - "duration": "repeating", - "duration_in_months": 3, + "name": "sec_123", + "scope": {"type": "account"}, } ) http_client_mock.assert_requested( - "post", - path="/v1/coupons", - query_string="", + "get", + path="/v1/apps/secrets/find", + query_string="name=sec_123&scope[type]=account", api_base="https://api.stripe.com", - post_data="percent_off=25.5&duration=repeating&duration_in_months=3", ) - def test_coupons_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Coupon.modify( - "Z4OV52SU", - metadata={"order_id": "6735"}, + def test_apps_secrets_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.apps.Secret.list( + scope={"type": "account"}, + limit=2, ) http_client_mock.assert_requested( - "post", - path="/v1/coupons/Z4OV52SU", - query_string="", - post_data="metadata[order_id]=6735", + "get", + path="/v1/apps/secrets", + query_string="scope[type]=account&limit=2", ) - def test_coupons_post_2_service( + def test_apps_secrets_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/coupons/Z4OV52SU", + "get", + "/v1/apps/secrets", + "scope[type]=account&limit=2", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.coupons.update( - "Z4OV52SU", - {"metadata": {"order_id": "6735"}}, - ) + client.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) http_client_mock.assert_requested( - "post", - path="/v1/coupons/Z4OV52SU", - query_string="", + "get", + path="/v1/apps/secrets", + query_string="scope[type]=account&limit=2", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_credit_notes_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.CreditNote.list(limit=3) + @pytest.mark.anyio + async def test_apps_secrets_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.apps.Secret.list_async( + scope={"type": "account"}, + limit=2, + ) http_client_mock.assert_requested( "get", - path="/v1/credit_notes", - query_string="limit=3", + path="/v1/apps/secrets", + query_string="scope[type]=account&limit=2", ) - def test_credit_notes_get_service( + @pytest.mark.anyio + async def test_apps_secrets_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/credit_notes", - "limit=3", + "/v1/apps/secrets", + "scope[type]=account&limit=2", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.credit_notes.list({"limit": 3}) + await client.apps.secrets.list_async( + { + "scope": {"type": "account"}, + "limit": 2, + } + ) http_client_mock.assert_requested( "get", - path="/v1/credit_notes", - query_string="limit=3", + path="/v1/apps/secrets", + query_string="scope[type]=account&limit=2", api_base="https://api.stripe.com", ) - def test_credit_notes_lines_get( + def test_apps_secrets_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.CreditNote.list_lines( - "cn_xxxxxxxxxxxxx", - limit=3, + stripe.apps.Secret.list( + scope={"type": "account"}, + limit=2, ) http_client_mock.assert_requested( "get", - path="/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", - query_string="limit=3", + path="/v1/apps/secrets", + query_string="scope[type]=account&limit=2", ) - def test_credit_notes_lines_get_service( + def test_apps_secrets_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", - "limit=3", + "/v1/apps/secrets", + "scope[type]=account&limit=2", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.credit_notes.line_items.list( - "cn_xxxxxxxxxxxxx", - {"limit": 3}, - ) + client.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) http_client_mock.assert_requested( "get", - path="/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", - query_string="limit=3", + path="/v1/apps/secrets", + query_string="scope[type]=account&limit=2", api_base="https://api.stripe.com", ) - def test_credit_notes_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.CreditNote.create( - invoice="in_xxxxxxxxxxxxx", - lines=[ - { - "type": "invoice_line_item", - "invoice_line_item": "il_xxxxxxxxxxxxx", - "quantity": 1, - }, - ], + @pytest.mark.anyio + async def test_apps_secrets_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.apps.Secret.list_async( + scope={"type": "account"}, + limit=2, ) http_client_mock.assert_requested( - "post", - path="/v1/credit_notes", - query_string="", - post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", + "get", + path="/v1/apps/secrets", + query_string="scope[type]=account&limit=2", ) - def test_credit_notes_post_service( + @pytest.mark.anyio + async def test_apps_secrets_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/credit_notes", + "get", + "/v1/apps/secrets", + "scope[type]=account&limit=2", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.credit_notes.create( + await client.apps.secrets.list_async( { - "invoice": "in_xxxxxxxxxxxxx", - "lines": [ - { - "type": "invoice_line_item", - "invoice_line_item": "il_xxxxxxxxxxxxx", - "quantity": 1, - }, - ], + "scope": {"type": "account"}, + "limit": 2, } ) http_client_mock.assert_requested( - "post", - path="/v1/credit_notes", - query_string="", + "get", + path="/v1/apps/secrets", + query_string="scope[type]=account&limit=2", api_base="https://api.stripe.com", - post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) - def test_credit_notes_preview_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.CreditNote.preview( - invoice="in_xxxxxxxxxxxxx", - lines=[ - { - "type": "invoice_line_item", - "invoice_line_item": "il_xxxxxxxxxxxxx", - "quantity": 1, - }, - ], + def test_apps_secrets_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.apps.Secret.create( + name="sec_123", + payload="very secret string", + scope={"type": "account"}, ) http_client_mock.assert_requested( - "get", - path="/v1/credit_notes/preview", - query_string="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", + "post", + path="/v1/apps/secrets", + query_string="", + post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) - def test_credit_notes_preview_get_service( + def test_apps_secrets_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/credit_notes/preview", - "invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", + "post", + "/v1/apps/secrets", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.credit_notes.preview( + client.apps.secrets.create( { - "invoice": "in_xxxxxxxxxxxxx", - "lines": [ - { - "type": "invoice_line_item", - "invoice_line_item": "il_xxxxxxxxxxxxx", - "quantity": 1, - }, - ], + "name": "sec_123", + "payload": "very secret string", + "scope": {"type": "account"}, } ) http_client_mock.assert_requested( - "get", - path="/v1/credit_notes/preview", - query_string="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", + "post", + path="/v1/apps/secrets", + query_string="", api_base="https://api.stripe.com", + post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) - def test_credit_notes_preview_lines_get( + @pytest.mark.anyio + async def test_apps_secrets_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.CreditNote.preview_lines( - limit=3, - invoice="in_xxxxxxxxxxxxx", + await stripe.apps.Secret.create_async( + name="sec_123", + payload="very secret string", + scope={"type": "account"}, ) http_client_mock.assert_requested( - "get", - path="/v1/credit_notes/preview/lines", - query_string="limit=3&invoice=in_xxxxxxxxxxxxx", + "post", + path="/v1/apps/secrets", + query_string="", + post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) - def test_credit_notes_preview_lines_get_service( + @pytest.mark.anyio + async def test_apps_secrets_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/credit_notes/preview/lines", - "limit=3&invoice=in_xxxxxxxxxxxxx", + "post", + "/v1/apps/secrets", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.credit_notes.preview_lines.list( + await client.apps.secrets.create_async( { - "limit": 3, - "invoice": "in_xxxxxxxxxxxxx", + "name": "sec_123", + "payload": "very secret string", + "scope": {"type": "account"}, } ) http_client_mock.assert_requested( - "get", - path="/v1/credit_notes/preview/lines", - query_string="limit=3&invoice=in_xxxxxxxxxxxxx", + "post", + path="/v1/apps/secrets", + query_string="", api_base="https://api.stripe.com", + post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) - def test_credit_notes_void_post( + def test_apps_secrets_post_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.CreditNote.void_credit_note("cn_xxxxxxxxxxxxx") + stripe.apps.Secret.create( + name="my-api-key", + payload="secret_key_xxxxxx", + scope={"type": "account"}, + ) http_client_mock.assert_requested( "post", - path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", + path="/v1/apps/secrets", query_string="", + post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) - def test_credit_notes_void_post_service( + def test_apps_secrets_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/credit_notes/cn_xxxxxxxxxxxxx/void", + "/v1/apps/secrets", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.credit_notes.void_credit_note("cn_xxxxxxxxxxxxx") + client.apps.secrets.create( + { + "name": "my-api-key", + "payload": "secret_key_xxxxxx", + "scope": {"type": "account"}, + } + ) http_client_mock.assert_requested( "post", - path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", + path="/v1/apps/secrets", query_string="", api_base="https://api.stripe.com", + post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) - def test_customer_sessions_post( + @pytest.mark.anyio + async def test_apps_secrets_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.CustomerSession.create( - customer="cus_123", - components={"buy_button": {"enabled": True}}, + await stripe.apps.Secret.create_async( + name="my-api-key", + payload="secret_key_xxxxxx", + scope={"type": "account"}, ) http_client_mock.assert_requested( "post", - path="/v1/customer_sessions", + path="/v1/apps/secrets", query_string="", - post_data="customer=cus_123&components[buy_button][enabled]=True", + post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) - def test_customer_sessions_post_service( + @pytest.mark.anyio + async def test_apps_secrets_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/customer_sessions", + "/v1/apps/secrets", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customer_sessions.create( + await client.apps.secrets.create_async( { - "customer": "cus_123", - "components": {"buy_button": {"enabled": True}}, + "name": "my-api-key", + "payload": "secret_key_xxxxxx", + "scope": {"type": "account"}, } ) http_client_mock.assert_requested( "post", - path="/v1/customer_sessions", + path="/v1/apps/secrets", query_string="", api_base="https://api.stripe.com", - post_data="customer=cus_123&components[buy_button][enabled]=True", + post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) - def test_customers_balance_transactions_get( + def test_balance_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.list_balance_transactions( - "cus_xxxxxxxxxxxxx", - limit=3, - ) + stripe.BalanceTransaction.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + path="/v1/balance_transactions", query_string="limit=3", ) - def test_customers_balance_transactions_get_service( + def test_balance_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + "/v1/balance_transactions", "limit=3", ) client = StripeClient( @@ -2679,1092 +2973,1097 @@ def test_customers_balance_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.balance_transactions.list( - "cus_xxxxxxxxxxxxx", - {"limit": 3}, - ) + client.balance_transactions.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + path="/v1/balance_transactions", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_customers_balance_transactions_get_2( + @pytest.mark.anyio + async def test_balance_transactions_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.retrieve_balance_transaction( - "cus_xxxxxxxxxxxxx", - "cbtxn_xxxxxxxxxxxxx", - ) + await stripe.BalanceTransaction.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", - query_string="", + path="/v1/balance_transactions", + query_string="limit=3", ) - def test_customers_balance_transactions_get_2_service( + @pytest.mark.anyio + async def test_balance_transactions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", + "/v1/balance_transactions", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.balance_transactions.retrieve( - "cus_xxxxxxxxxxxxx", - "cbtxn_xxxxxxxxxxxxx", - ) + await client.balance_transactions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", - query_string="", + path="/v1/balance_transactions", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_customers_balance_transactions_post( + def test_balance_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.create_balance_transaction( - "cus_xxxxxxxxxxxxx", - amount=-500, - currency="usd", - ) + stripe.BalanceTransaction.retrieve("txn_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + "get", + path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", query_string="", - post_data="amount=-500¤cy=usd", ) - def test_customers_balance_transactions_post_service( + def test_balance_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + "get", + "/v1/balance_transactions/txn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.balance_transactions.create( - "cus_xxxxxxxxxxxxx", - {"amount": -500, "currency": "usd"}, - ) + client.balance_transactions.retrieve("txn_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + "get", + path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="amount=-500¤cy=usd", ) - def test_customers_balance_transactions_post_2( + @pytest.mark.anyio + async def test_balance_transactions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.modify_balance_transaction( - "cus_xxxxxxxxxxxxx", - "cbtxn_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + await stripe.BalanceTransaction.retrieve_async("txn_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", + "get", + path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", query_string="", - post_data="metadata[order_id]=6735", ) - def test_customers_balance_transactions_post_2_service( + @pytest.mark.anyio + async def test_balance_transactions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", + "get", + "/v1/balance_transactions/txn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.balance_transactions.update( - "cus_xxxxxxxxxxxxx", - "cbtxn_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + await client.balance_transactions.retrieve_async("txn_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", + "get", + path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_customers_cash_balance_get( + def test_billing_portal_configurations_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.retrieve_cash_balance("cus_123") + stripe.billing_portal.Configuration.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/customers/cus_123/cash_balance", - query_string="", + path="/v1/billing_portal/configurations", + query_string="limit=3", ) - def test_customers_cash_balance_get_service( + def test_billing_portal_configurations_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/customers/cus_123/cash_balance", + "/v1/billing_portal/configurations", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.cash_balance.retrieve("cus_123") + client.billing_portal.configurations.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/customers/cus_123/cash_balance", - query_string="", + path="/v1/billing_portal/configurations", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_customers_cash_balance_post( + @pytest.mark.anyio + async def test_billing_portal_configurations_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.modify_cash_balance( - "cus_123", - settings={"reconciliation_mode": "manual"}, - ) + await stripe.billing_portal.Configuration.list_async(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_123/cash_balance", - query_string="", - post_data="settings[reconciliation_mode]=manual", + "get", + path="/v1/billing_portal/configurations", + query_string="limit=3", ) - def test_customers_cash_balance_post_service( + @pytest.mark.anyio + async def test_billing_portal_configurations_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/customers/cus_123/cash_balance", + "get", + "/v1/billing_portal/configurations", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.cash_balance.update( - "cus_123", - {"settings": {"reconciliation_mode": "manual"}}, - ) + await client.billing_portal.configurations.list_async({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_123/cash_balance", - query_string="", + "get", + path="/v1/billing_portal/configurations", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="settings[reconciliation_mode]=manual", ) - def test_customers_cash_balance_transactions_get( + def test_billing_portal_configurations_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.list_cash_balance_transactions( - "cus_123", - limit=3, - ) + stripe.billing_portal.Configuration.retrieve("bpc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/customers/cus_123/cash_balance_transactions", - query_string="limit=3", + path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", + query_string="", ) - def test_customers_cash_balance_transactions_get_service( + def test_billing_portal_configurations_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/customers/cus_123/cash_balance_transactions", - "limit=3", + "/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.cash_balance_transactions.list( - "cus_123", - {"limit": 3}, - ) + client.billing_portal.configurations.retrieve("bpc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/customers/cus_123/cash_balance_transactions", - query_string="limit=3", + path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_customers_delete(self, http_client_mock: HTTPClientMock) -> None: - stripe.Customer.delete("cus_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_billing_portal_configurations_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.billing_portal.Configuration.retrieve_async( + "bpc_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx", + "get", + path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", query_string="", ) - def test_customers_delete_service( + @pytest.mark.anyio + async def test_billing_portal_configurations_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/customers/cus_xxxxxxxxxxxxx", + "get", + "/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.delete("cus_xxxxxxxxxxxxx") + await client.billing_portal.configurations.retrieve_async( + "bpc_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx", + "get", + path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_customers_funding_instructions_post( + def test_billing_portal_configurations_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.create_funding_instructions( - "cus_123", - bank_transfer={ - "requested_address_types": ["zengin"], - "type": "jp_bank_transfer", + stripe.billing_portal.Configuration.create( + features={ + "customer_update": { + "allowed_updates": ["email", "tax_id"], + "enabled": True, + }, + "invoice_history": {"enabled": True}, + }, + business_profile={ + "privacy_policy_url": "https://example.com/privacy", + "terms_of_service_url": "https://example.com/terms", }, - currency="usd", - funding_type="bank_transfer", ) http_client_mock.assert_requested( "post", - path="/v1/customers/cus_123/funding_instructions", + path="/v1/billing_portal/configurations", query_string="", - post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", + post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) - def test_customers_funding_instructions_post_service( + def test_billing_portal_configurations_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/customers/cus_123/funding_instructions", + "/v1/billing_portal/configurations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.funding_instructions.create( - "cus_123", + client.billing_portal.configurations.create( { - "bank_transfer": { - "requested_address_types": ["zengin"], - "type": "jp_bank_transfer", + "features": { + "customer_update": { + "allowed_updates": ["email", "tax_id"], + "enabled": True, + }, + "invoice_history": {"enabled": True}, }, - "currency": "usd", - "funding_type": "bank_transfer", - }, + "business_profile": { + "privacy_policy_url": "https://example.com/privacy", + "terms_of_service_url": "https://example.com/terms", + }, + } ) http_client_mock.assert_requested( "post", - path="/v1/customers/cus_123/funding_instructions", + path="/v1/billing_portal/configurations", query_string="", api_base="https://api.stripe.com", - post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", + post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) - def test_customers_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Customer.list(limit=3) + @pytest.mark.anyio + async def test_billing_portal_configurations_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.billing_portal.Configuration.create_async( + features={ + "customer_update": { + "allowed_updates": ["email", "tax_id"], + "enabled": True, + }, + "invoice_history": {"enabled": True}, + }, + business_profile={ + "privacy_policy_url": "https://example.com/privacy", + "terms_of_service_url": "https://example.com/terms", + }, + ) http_client_mock.assert_requested( - "get", - path="/v1/customers", - query_string="limit=3", + "post", + path="/v1/billing_portal/configurations", + query_string="", + post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) - def test_customers_get_service( + @pytest.mark.anyio + async def test_billing_portal_configurations_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/customers", - "limit=3", + "post", + "/v1/billing_portal/configurations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.list({"limit": 3}) + await client.billing_portal.configurations.create_async( + { + "features": { + "customer_update": { + "allowed_updates": ["email", "tax_id"], + "enabled": True, + }, + "invoice_history": {"enabled": True}, + }, + "business_profile": { + "privacy_policy_url": "https://example.com/privacy", + "terms_of_service_url": "https://example.com/terms", + }, + } + ) http_client_mock.assert_requested( - "get", - path="/v1/customers", - query_string="limit=3", + "post", + path="/v1/billing_portal/configurations", + query_string="", api_base="https://api.stripe.com", + post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) - def test_customers_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Customer.list(limit=3) + def test_billing_portal_configurations_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.billing_portal.Configuration.modify( + "bpc_xxxxxxxxxxxxx", + business_profile={ + "privacy_policy_url": "https://example.com/privacy", + "terms_of_service_url": "https://example.com/terms", + }, + ) http_client_mock.assert_requested( - "get", - path="/v1/customers", - query_string="limit=3", + "post", + path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", + query_string="", + post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) - def test_customers_get_2_service( + def test_billing_portal_configurations_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/customers", - "limit=3", + "post", + "/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.list({"limit": 3}) + client.billing_portal.configurations.update( + "bpc_xxxxxxxxxxxxx", + { + "business_profile": { + "privacy_policy_url": "https://example.com/privacy", + "terms_of_service_url": "https://example.com/terms", + }, + }, + ) http_client_mock.assert_requested( - "get", - path="/v1/customers", - query_string="limit=3", + "post", + path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", + post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) - def test_customers_get_3(self, http_client_mock: HTTPClientMock) -> None: - stripe.Customer.retrieve("cus_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_billing_portal_configurations_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.billing_portal.Configuration.modify_async( + "bpc_xxxxxxxxxxxxx", + business_profile={ + "privacy_policy_url": "https://example.com/privacy", + "terms_of_service_url": "https://example.com/terms", + }, + ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx", + "post", + path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", query_string="", + post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) - def test_customers_get_3_service( + @pytest.mark.anyio + async def test_billing_portal_configurations_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/customers/cus_xxxxxxxxxxxxx", + "post", + "/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.retrieve("cus_xxxxxxxxxxxxx") + await client.billing_portal.configurations.update_async( + "bpc_xxxxxxxxxxxxx", + { + "business_profile": { + "privacy_policy_url": "https://example.com/privacy", + "terms_of_service_url": "https://example.com/terms", + }, + }, + ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx", + "post", + path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) - def test_customers_payment_methods_get( + def test_billing_portal_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.list_payment_methods( - "cus_xyz", - type="card", + stripe.billing_portal.Session.create( + customer="cus_xxxxxxxxxxxxx", + return_url="https://example.com/account", ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xyz/payment_methods", - query_string="type=card", + "post", + path="/v1/billing_portal/sessions", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", ) - def test_customers_payment_methods_get_service( + def test_billing_portal_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/customers/cus_xyz/payment_methods", - "type=card", + "post", + "/v1/billing_portal/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_methods.list( - "cus_xyz", - {"type": "card"}, + client.billing_portal.sessions.create( + { + "customer": "cus_xxxxxxxxxxxxx", + "return_url": "https://example.com/account", + } ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xyz/payment_methods", - query_string="type=card", + "post", + path="/v1/billing_portal/sessions", + query_string="", api_base="https://api.stripe.com", + post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", ) - def test_customers_payment_methods_get_2( + @pytest.mark.anyio + async def test_billing_portal_sessions_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.list_payment_methods( - "cus_xxxxxxxxxxxxx", - type="card", + await stripe.billing_portal.Session.create_async( + customer="cus_xxxxxxxxxxxxx", + return_url="https://example.com/account", ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", - query_string="type=card", + "post", + path="/v1/billing_portal/sessions", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", ) - def test_customers_payment_methods_get_2_service( + @pytest.mark.anyio + async def test_billing_portal_sessions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", - "type=card", + "post", + "/v1/billing_portal/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_methods.list( - "cus_xxxxxxxxxxxxx", - {"type": "card"}, + await client.billing_portal.sessions.create_async( + { + "customer": "cus_xxxxxxxxxxxxx", + "return_url": "https://example.com/account", + } ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", - query_string="type=card", + "post", + path="/v1/billing_portal/sessions", + query_string="", api_base="https://api.stripe.com", + post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", ) - def test_customers_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Customer.create( - description="My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", - ) + def test_charges_capture_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Charge.capture("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/customers", + path="/v1/charges/ch_xxxxxxxxxxxxx/capture", query_string="", - post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) - def test_customers_post_service( + def test_charges_capture_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/customers", + "/v1/charges/ch_xxxxxxxxxxxxx/capture", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.create( - { - "description": "My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", - } - ) + client.charges.capture("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/customers", + path="/v1/charges/ch_xxxxxxxxxxxxx/capture", query_string="", api_base="https://api.stripe.com", - post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) - def test_customers_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Customer.modify( - "cus_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + @pytest.mark.anyio + async def test_charges_capture_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Charge.capture_async("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/customers/cus_xxxxxxxxxxxxx", + path="/v1/charges/ch_xxxxxxxxxxxxx/capture", query_string="", - post_data="metadata[order_id]=6735", ) - def test_customers_post_2_service( + @pytest.mark.anyio + async def test_charges_capture_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/customers/cus_xxxxxxxxxxxxx", + "/v1/charges/ch_xxxxxxxxxxxxx/capture", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.update( - "cus_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + await client.charges.capture_async("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/customers/cus_xxxxxxxxxxxxx", + path="/v1/charges/ch_xxxxxxxxxxxxx/capture", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_customers_search_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.search( - query="name:'fakename' AND metadata['foo']:'bar'", - ) + def test_charges_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Charge.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/customers/search", - query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", + path="/v1/charges", + query_string="limit=3", ) - def test_customers_search_get_service( + def test_charges_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/customers/search", - "query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", + "/v1/charges", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.search( - { - "query": "name:'fakename' AND metadata['foo']:'bar'", - } - ) + client.charges.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/customers/search", - query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", + path="/v1/charges", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_customers_search_get_2( + @pytest.mark.anyio + async def test_charges_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.search( - query="name:'fakename' AND metadata['foo']:'bar'", - ) + await stripe.Charge.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/customers/search", - query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", + path="/v1/charges", + query_string="limit=3", ) - def test_customers_search_get_2_service( + @pytest.mark.anyio + async def test_charges_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/customers/search", - "query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", + "/v1/charges", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.search( - { - "query": "name:'fakename' AND metadata['foo']:'bar'", - } - ) + await client.charges.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/customers/search", - query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", + path="/v1/charges", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_customers_sources_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.delete_source( - "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - ) + def test_charges_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Charge.retrieve("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + "get", + path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", ) - def test_customers_sources_delete_service( + def test_charges_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + "get", + "/v1/charges/ch_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.sources.detach( - "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - ) + client.charges.retrieve("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + "get", + path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_customers_sources_delete_2( + @pytest.mark.anyio + async def test_charges_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.delete_source( - "cus_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", - ) + await stripe.Charge.retrieve_async("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + "get", + path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", ) - def test_customers_sources_delete_2_service( + @pytest.mark.anyio + async def test_charges_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + "get", + "/v1/charges/ch_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.sources.detach( - "cus_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", - ) + await client.charges.retrieve_async("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + "get", + path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_customers_sources_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.list_sources( - "cus_xxxxxxxxxxxxx", - object="bank_account", - limit=3, + def test_charges_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Charge.create( + amount=2000, + currency="usd", + source="tok_xxxx", + description="My First Test Charge (created for API docs at https://www.stripe.com/docs/api)", ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources", - query_string="object=bank_account&limit=3", + "post", + path="/v1/charges", + query_string="", + post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) - def test_customers_sources_get_service( + def test_charges_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/customers/cus_xxxxxxxxxxxxx/sources", - "object=bank_account&limit=3", + "post", + "/v1/charges", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.list( - "cus_xxxxxxxxxxxxx", - {"object": "bank_account", "limit": 3}, + client.charges.create( + { + "amount": 2000, + "currency": "usd", + "source": "tok_xxxx", + "description": "My First Test Charge (created for API docs at https://www.stripe.com/docs/api)", + } ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources", - query_string="object=bank_account&limit=3", + "post", + path="/v1/charges", + query_string="", api_base="https://api.stripe.com", + post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) - def test_customers_sources_get_2( + @pytest.mark.anyio + async def test_charges_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.list_sources( - "cus_xxxxxxxxxxxxx", - object="card", - limit=3, + await stripe.Charge.create_async( + amount=2000, + currency="usd", + source="tok_xxxx", + description="My First Test Charge (created for API docs at https://www.stripe.com/docs/api)", ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources", - query_string="object=card&limit=3", + "post", + path="/v1/charges", + query_string="", + post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) - def test_customers_sources_get_2_service( + @pytest.mark.anyio + async def test_charges_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/customers/cus_xxxxxxxxxxxxx/sources", - "object=card&limit=3", + "post", + "/v1/charges", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.list( - "cus_xxxxxxxxxxxxx", - {"object": "card", "limit": 3}, + await client.charges.create_async( + { + "amount": 2000, + "currency": "usd", + "source": "tok_xxxx", + "description": "My First Test Charge (created for API docs at https://www.stripe.com/docs/api)", + } ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources", - query_string="object=card&limit=3", + "post", + path="/v1/charges", + query_string="", api_base="https://api.stripe.com", + post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) - def test_customers_sources_get_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Customer.retrieve_source( - "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", + def test_charges_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Charge.modify( + "ch_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + "post", + path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_customers_sources_get_3_service( + def test_charges_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + "post", + "/v1/charges/ch_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.retrieve( - "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", + client.charges.update( + "ch_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + "post", + path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_customers_sources_get_4( + @pytest.mark.anyio + async def test_charges_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.retrieve_source( - "cus_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", + await stripe.Charge.modify_async( + "ch_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + "post", + path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_customers_sources_get_4_service( + @pytest.mark.anyio + async def test_charges_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + "post", + "/v1/charges/ch_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.retrieve( - "cus_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", + await client.charges.update_async( + "ch_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( - "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + "post", + path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_customers_sources_post( + def test_charges_search_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.modify_source( - "cus_123", - "card_123", - account_holder_name="Kamil", + stripe.Charge.search( + query="amount>999 AND metadata['order_id']:'6735'" ) http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_123/sources/card_123", - query_string="", - post_data="account_holder_name=Kamil", + "get", + path="/v1/charges/search", + query_string="query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) - def test_customers_sources_post_service( + def test_charges_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/customers/cus_123/sources/card_123", + "get", + "/v1/charges/search", + "query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.update( - "cus_123", - "card_123", - {"account_holder_name": "Kamil"}, + client.charges.search( + { + "query": "amount>999 AND metadata['order_id']:'6735'", + } ) http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_123/sources/card_123", - query_string="", + "get", + path="/v1/charges/search", + query_string="query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", - post_data="account_holder_name=Kamil", ) - def test_customers_sources_post_2( + @pytest.mark.anyio + async def test_charges_search_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.create_source( - "cus_xxxxxxxxxxxxx", - source="btok_xxxxxxxxxxxxx", + await stripe.Charge.search_async( + query="amount>999 AND metadata['order_id']:'6735'", ) http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources", - query_string="", - post_data="source=btok_xxxxxxxxxxxxx", + "get", + path="/v1/charges/search", + query_string="query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) - def test_customers_sources_post_2_service( + @pytest.mark.anyio + async def test_charges_search_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/customers/cus_xxxxxxxxxxxxx/sources", + "get", + "/v1/charges/search", + "query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.create( - "cus_xxxxxxxxxxxxx", - {"source": "btok_xxxxxxxxxxxxx"}, + await client.charges.search_async( + { + "query": "amount>999 AND metadata['order_id']:'6735'", + } ) http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources", - query_string="", + "get", + path="/v1/charges/search", + query_string="query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", - post_data="source=btok_xxxxxxxxxxxxx", ) - def test_customers_sources_post_3( + def test_checkout_sessions_expire_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.create_source( - "cus_xxxxxxxxxxxxx", - source="tok_xxxx", - ) + stripe.checkout.Session.expire("sess_xyz") http_client_mock.assert_requested( "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + path="/v1/checkout/sessions/sess_xyz/expire", query_string="", - post_data="source=tok_xxxx", ) - def test_customers_sources_post_3_service( + def test_checkout_sessions_expire_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/customers/cus_xxxxxxxxxxxxx/sources", + "/v1/checkout/sessions/sess_xyz/expire", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.create( - "cus_xxxxxxxxxxxxx", - {"source": "tok_xxxx"}, - ) + client.checkout.sessions.expire("sess_xyz") http_client_mock.assert_requested( "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + path="/v1/checkout/sessions/sess_xyz/expire", query_string="", api_base="https://api.stripe.com", - post_data="source=tok_xxxx", ) - def test_customers_sources_post_4( + @pytest.mark.anyio + async def test_checkout_sessions_expire_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.modify_source( - "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + await stripe.checkout.Session.expire_async("sess_xyz") http_client_mock.assert_requested( "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + path="/v1/checkout/sessions/sess_xyz/expire", query_string="", - post_data="metadata[order_id]=6735", ) - def test_customers_sources_post_4_service( + @pytest.mark.anyio + async def test_checkout_sessions_expire_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + "/v1/checkout/sessions/sess_xyz/expire", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.update( - "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + await client.checkout.sessions.expire_async("sess_xyz") http_client_mock.assert_requested( "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + path="/v1/checkout/sessions/sess_xyz/expire", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_customers_sources_post_5( + def test_checkout_sessions_expire_post_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.modify_source( - "cus_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", - name="Jenny Rosen", - ) + stripe.checkout.Session.expire("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", query_string="", - post_data="name=Jenny%20Rosen", ) - def test_customers_sources_post_5_service( + def test_checkout_sessions_expire_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + "/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.update( - "cus_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", - {"name": "Jenny Rosen"}, - ) + client.checkout.sessions.expire("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", query_string="", api_base="https://api.stripe.com", - post_data="name=Jenny%20Rosen", ) - def test_customers_tax_ids_delete( + @pytest.mark.anyio + async def test_checkout_sessions_expire_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.delete_tax_id( - "cus_xxxxxxxxxxxxx", - "txi_xxxxxxxxxxxxx", - ) + await stripe.checkout.Session.expire_async("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", + "post", + path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", query_string="", ) - def test_customers_tax_ids_delete_service( + @pytest.mark.anyio + async def test_checkout_sessions_expire_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", + "post", + "/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.tax_ids.delete( - "cus_xxxxxxxxxxxxx", - "txi_xxxxxxxxxxxxx", - ) + await client.checkout.sessions.expire_async("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", + "post", + path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", query_string="", api_base="https://api.stripe.com", ) - def test_customers_tax_ids_get( + def test_checkout_sessions_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.list_tax_ids( - "cus_xxxxxxxxxxxxx", - limit=3, - ) + stripe.checkout.Session.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", + path="/v1/checkout/sessions", query_string="limit=3", ) - def test_customers_tax_ids_get_service( + def test_checkout_sessions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", + "/v1/checkout/sessions", "limit=3", ) client = StripeClient( @@ -3772,407 +4071,442 @@ def test_customers_tax_ids_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.tax_ids.list( - "cus_xxxxxxxxxxxxx", - {"limit": 3}, - ) + client.checkout.sessions.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", + path="/v1/checkout/sessions", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_customers_tax_ids_get_2( + @pytest.mark.anyio + async def test_checkout_sessions_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.retrieve_tax_id( - "cus_xxxxxxxxxxxxx", - "txi_xxxxxxxxxxxxx", - ) + await stripe.checkout.Session.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", - query_string="", + path="/v1/checkout/sessions", + query_string="limit=3", ) - def test_customers_tax_ids_get_2_service( + @pytest.mark.anyio + async def test_checkout_sessions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", + "/v1/checkout/sessions", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.tax_ids.retrieve( - "cus_xxxxxxxxxxxxx", - "txi_xxxxxxxxxxxxx", - ) + await client.checkout.sessions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", - query_string="", + path="/v1/checkout/sessions", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_customers_tax_ids_post( + def test_checkout_sessions_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.create_tax_id( - "cus_xxxxxxxxxxxxx", - type="eu_vat", - value="DE123456789", - ) + stripe.checkout.Session.retrieve("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", + "get", + path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", query_string="", - post_data="type=eu_vat&value=DE123456789", ) - def test_customers_tax_ids_post_service( + def test_checkout_sessions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", + "get", + "/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.customers.tax_ids.create( - "cus_xxxxxxxxxxxxx", - {"type": "eu_vat", "value": "DE123456789"}, - ) + client.checkout.sessions.retrieve("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", + "get", + path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="type=eu_vat&value=DE123456789", ) - def test_disputes_close_post( + @pytest.mark.anyio + async def test_checkout_sessions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Dispute.close("dp_xxxxxxxxxxxxx") + await stripe.checkout.Session.retrieve_async("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/disputes/dp_xxxxxxxxxxxxx/close", + "get", + path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", query_string="", ) - def test_disputes_close_post_service( + @pytest.mark.anyio + async def test_checkout_sessions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/disputes/dp_xxxxxxxxxxxxx/close", + "get", + "/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.disputes.close("dp_xxxxxxxxxxxxx") + await client.checkout.sessions.retrieve_async("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/disputes/dp_xxxxxxxxxxxxx/close", + "get", + path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_disputes_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Dispute.list(limit=3) + def test_checkout_sessions_line_items_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.checkout.Session.list_line_items("sess_xyz") http_client_mock.assert_requested( "get", - path="/v1/disputes", - query_string="limit=3", + path="/v1/checkout/sessions/sess_xyz/line_items", + query_string="", ) - def test_disputes_get_service( + def test_checkout_sessions_line_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/disputes", - "limit=3", + "/v1/checkout/sessions/sess_xyz/line_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.disputes.list({"limit": 3}) + client.checkout.sessions.line_items.list("sess_xyz") http_client_mock.assert_requested( "get", - path="/v1/disputes", - query_string="limit=3", + path="/v1/checkout/sessions/sess_xyz/line_items", + query_string="", api_base="https://api.stripe.com", ) - def test_disputes_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Dispute.retrieve("dp_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_checkout_sessions_line_items_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.checkout.Session.list_line_items_async("sess_xyz") http_client_mock.assert_requested( "get", - path="/v1/disputes/dp_xxxxxxxxxxxxx", + path="/v1/checkout/sessions/sess_xyz/line_items", query_string="", ) - def test_disputes_get_2_service( + @pytest.mark.anyio + async def test_checkout_sessions_line_items_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/disputes/dp_xxxxxxxxxxxxx", + "/v1/checkout/sessions/sess_xyz/line_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.disputes.retrieve("dp_xxxxxxxxxxxxx") + await client.checkout.sessions.line_items.list_async("sess_xyz") http_client_mock.assert_requested( "get", - path="/v1/disputes/dp_xxxxxxxxxxxxx", + path="/v1/checkout/sessions/sess_xyz/line_items", query_string="", api_base="https://api.stripe.com", ) - def test_disputes_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Dispute.modify( - "dp_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, + def test_checkout_sessions_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.checkout.Session.create( + success_url="https://example.com/success", + cancel_url="https://example.com/cancel", + mode="payment", + shipping_options=[ + {"shipping_rate": "shr_standard"}, + { + "shipping_rate_data": { + "display_name": "Standard", + "delivery_estimate": { + "minimum": {"unit": "day", "value": 5}, + "maximum": {"unit": "day", "value": 7}, + }, + }, + }, + ], ) http_client_mock.assert_requested( "post", - path="/v1/disputes/dp_xxxxxxxxxxxxx", + path="/v1/checkout/sessions", query_string="", - post_data="metadata[order_id]=6735", + post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", ) - def test_disputes_post_service( + def test_checkout_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/disputes/dp_xxxxxxxxxxxxx", + "/v1/checkout/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.disputes.update( - "dp_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + client.checkout.sessions.create( + { + "success_url": "https://example.com/success", + "cancel_url": "https://example.com/cancel", + "mode": "payment", + "shipping_options": [ + {"shipping_rate": "shr_standard"}, + { + "shipping_rate_data": { + "display_name": "Standard", + "delivery_estimate": { + "minimum": {"unit": "day", "value": 5}, + "maximum": {"unit": "day", "value": 7}, + }, + }, + }, + ], + } ) http_client_mock.assert_requested( "post", - path="/v1/disputes/dp_xxxxxxxxxxxxx", + path="/v1/checkout/sessions", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", + post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", ) - def test_events_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Event.list(limit=3) + @pytest.mark.anyio + async def test_checkout_sessions_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.checkout.Session.create_async( + success_url="https://example.com/success", + cancel_url="https://example.com/cancel", + mode="payment", + shipping_options=[ + {"shipping_rate": "shr_standard"}, + { + "shipping_rate_data": { + "display_name": "Standard", + "delivery_estimate": { + "minimum": {"unit": "day", "value": 5}, + "maximum": {"unit": "day", "value": 7}, + }, + }, + }, + ], + ) http_client_mock.assert_requested( - "get", - path="/v1/events", - query_string="limit=3", + "post", + path="/v1/checkout/sessions", + query_string="", + post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", ) - def test_events_get_service( + @pytest.mark.anyio + async def test_checkout_sessions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/events", - "limit=3", + "post", + "/v1/checkout/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.events.list({"limit": 3}) - http_client_mock.assert_requested( - "get", - path="/v1/events", - query_string="limit=3", - api_base="https://api.stripe.com", - ) - - def test_events_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Event.retrieve("evt_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/events/evt_xxxxxxxxxxxxx", - query_string="", - ) - - def test_events_get_2_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v1/events/evt_xxxxxxxxxxxxx", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), + await client.checkout.sessions.create_async( + { + "success_url": "https://example.com/success", + "cancel_url": "https://example.com/cancel", + "mode": "payment", + "shipping_options": [ + {"shipping_rate": "shr_standard"}, + { + "shipping_rate_data": { + "display_name": "Standard", + "delivery_estimate": { + "minimum": {"unit": "day", "value": 5}, + "maximum": {"unit": "day", "value": 7}, + }, + }, + }, + ], + } ) - - client.events.retrieve("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/events/evt_xxxxxxxxxxxxx", + "post", + path="/v1/checkout/sessions", query_string="", api_base="https://api.stripe.com", + post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", ) - def test_file_links_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.FileLink.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/file_links", - query_string="limit=3", - ) - - def test_file_links_get_service( + def test_checkout_sessions_post_2( self, http_client_mock: HTTPClientMock ) -> None: - http_client_mock.stub_request( - "get", - "/v1/file_links", - "limit=3", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.file_links.list({"limit": 3}) - http_client_mock.assert_requested( - "get", - path="/v1/file_links", - query_string="limit=3", - api_base="https://api.stripe.com", + stripe.checkout.Session.create( + success_url="https://example.com/success", + line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], + mode="payment", ) - - def test_file_links_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.FileLink.retrieve("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/file_links/link_xxxxxxxxxxxxx", + "post", + path="/v1/checkout/sessions", query_string="", + post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", ) - def test_file_links_get_2_service( + def test_checkout_sessions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/file_links/link_xxxxxxxxxxxxx", + "post", + "/v1/checkout/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.file_links.retrieve("link_xxxxxxxxxxxxx") + client.checkout.sessions.create( + { + "success_url": "https://example.com/success", + "line_items": [ + {"price": "price_xxxxxxxxxxxxx", "quantity": 2} + ], + "mode": "payment", + } + ) http_client_mock.assert_requested( - "get", - path="/v1/file_links/link_xxxxxxxxxxxxx", + "post", + path="/v1/checkout/sessions", query_string="", api_base="https://api.stripe.com", + post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", ) - def test_file_links_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.FileLink.create(file="file_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_checkout_sessions_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.checkout.Session.create_async( + success_url="https://example.com/success", + line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], + mode="payment", + ) http_client_mock.assert_requested( "post", - path="/v1/file_links", + path="/v1/checkout/sessions", query_string="", - post_data="file=file_xxxxxxxxxxxxx", + post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", ) - def test_file_links_post_service( + @pytest.mark.anyio + async def test_checkout_sessions_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/file_links", + "/v1/checkout/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.file_links.create({"file": "file_xxxxxxxxxxxxx"}) + await client.checkout.sessions.create_async( + { + "success_url": "https://example.com/success", + "line_items": [ + {"price": "price_xxxxxxxxxxxxx", "quantity": 2} + ], + "mode": "payment", + } + ) http_client_mock.assert_requested( "post", - path="/v1/file_links", + path="/v1/checkout/sessions", query_string="", api_base="https://api.stripe.com", - post_data="file=file_xxxxxxxxxxxxx", + post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", ) - def test_file_links_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.FileLink.modify( - "link_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + def test_country_specs_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.CountrySpec.list(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/file_links/link_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", + "get", + path="/v1/country_specs", + query_string="limit=3", ) - def test_file_links_post_2_service( + def test_country_specs_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/file_links/link_xxxxxxxxxxxxx", + "get", + "/v1/country_specs", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.file_links.update( - "link_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + client.country_specs.list({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/file_links/link_xxxxxxxxxxxxx", - query_string="", + "get", + path="/v1/country_specs", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_files_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.File.list(limit=3) + @pytest.mark.anyio + async def test_country_specs_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.CountrySpec.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/files", + path="/v1/country_specs", query_string="limit=3", ) - def test_files_get_service(self, http_client_mock: HTTPClientMock) -> None: + @pytest.mark.anyio + async def test_country_specs_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: http_client_mock.stub_request( "get", - "/v1/files", + "/v1/country_specs", "limit=3", ) client = StripeClient( @@ -4180,1558 +4514,1787 @@ def test_files_get_service(self, http_client_mock: HTTPClientMock) -> None: http_client=http_client_mock.get_mock_http_client(), ) - client.files.list({"limit": 3}) + await client.country_specs.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/files", + path="/v1/country_specs", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_files_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.File.retrieve("file_xxxxxxxxxxxxx") + def test_country_specs_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.CountrySpec.retrieve("US") http_client_mock.assert_requested( "get", - path="/v1/files/file_xxxxxxxxxxxxx", + path="/v1/country_specs/US", query_string="", ) - def test_files_get_2_service( + def test_country_specs_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/files/file_xxxxxxxxxxxxx", + "/v1/country_specs/US", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.files.retrieve("file_xxxxxxxxxxxxx") + client.country_specs.retrieve("US") http_client_mock.assert_requested( "get", - path="/v1/files/file_xxxxxxxxxxxxx", + path="/v1/country_specs/US", query_string="", api_base="https://api.stripe.com", ) - def test_files_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.File.create( - purpose="account_requirement", - file=io.StringIO("foo"), - ) + @pytest.mark.anyio + async def test_country_specs_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.CountrySpec.retrieve_async("US") http_client_mock.assert_requested( - "post", - path="/v1/files", + "get", + path="/v1/country_specs/US", query_string="", ) - def test_files_post_service( + @pytest.mark.anyio + async def test_country_specs_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/files", + "get", + "/v1/country_specs/US", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.files.create( - { - "purpose": "account_requirement", - "file": io.StringIO("foo"), - } - ) + await client.country_specs.retrieve_async("US") http_client_mock.assert_requested( - "post", - path="/v1/files", + "get", + path="/v1/country_specs/US", query_string="", - api_base="https://files.stripe.com", + api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_disconnect_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.disconnect("fca_xyz") + def test_coupons_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.Coupon.delete("Z4OV52SU") http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/accounts/fca_xyz/disconnect", + "delete", + path="/v1/coupons/Z4OV52SU", query_string="", ) - def test_financial_connections_accounts_disconnect_post_service( + def test_coupons_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/financial_connections/accounts/fca_xyz/disconnect", + "delete", + "/v1/coupons/Z4OV52SU", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.disconnect("fca_xyz") + client.coupons.delete("Z4OV52SU") http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/accounts/fca_xyz/disconnect", + "delete", + path="/v1/coupons/Z4OV52SU", query_string="", api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_disconnect_post_2( + @pytest.mark.anyio + async def test_coupons_delete_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.financial_connections.Account.disconnect("fca_xxxxxxxxxxxxx") + await stripe.Coupon.delete_async("Z4OV52SU") http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", + "delete", + path="/v1/coupons/Z4OV52SU", query_string="", ) - def test_financial_connections_accounts_disconnect_post_2_service( + @pytest.mark.anyio + async def test_coupons_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", + "delete", + "/v1/coupons/Z4OV52SU", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.disconnect("fca_xxxxxxxxxxxxx") + await client.coupons.delete_async("Z4OV52SU") http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", + "delete", + path="/v1/coupons/Z4OV52SU", query_string="", api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.list() + def test_coupons_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Coupon.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/financial_connections/accounts", - query_string="", + path="/v1/coupons", + query_string="limit=3", ) - def test_financial_connections_accounts_get_service( + def test_coupons_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/financial_connections/accounts", + "/v1/coupons", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.list() + client.coupons.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/financial_connections/accounts", - query_string="", + path="/v1/coupons", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_get_2( + @pytest.mark.anyio + async def test_coupons_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.financial_connections.Account.retrieve("fca_xyz") + await stripe.Coupon.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/financial_connections/accounts/fca_xyz", - query_string="", + path="/v1/coupons", + query_string="limit=3", ) - def test_financial_connections_accounts_get_2_service( + @pytest.mark.anyio + async def test_coupons_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/financial_connections/accounts/fca_xyz", + "/v1/coupons", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.retrieve("fca_xyz") + await client.coupons.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/financial_connections/accounts/fca_xyz", - query_string="", + path="/v1/coupons", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_get_3( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.list( - account_holder={"customer": "cus_xxxxxxxxxxxxx"}, - ) + def test_coupons_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Coupon.retrieve("Z4OV52SU") http_client_mock.assert_requested( "get", - path="/v1/financial_connections/accounts", - query_string="account_holder[customer]=cus_xxxxxxxxxxxxx", + path="/v1/coupons/Z4OV52SU", + query_string="", ) - def test_financial_connections_accounts_get_3_service( + def test_coupons_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/financial_connections/accounts", - "account_holder[customer]=cus_xxxxxxxxxxxxx", + "/v1/coupons/Z4OV52SU", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.list( - { - "account_holder": {"customer": "cus_xxxxxxxxxxxxx"}, - } - ) + client.coupons.retrieve("Z4OV52SU") http_client_mock.assert_requested( "get", - path="/v1/financial_connections/accounts", - query_string="account_holder[customer]=cus_xxxxxxxxxxxxx", + path="/v1/coupons/Z4OV52SU", + query_string="", api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_get_4( + @pytest.mark.anyio + async def test_coupons_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.financial_connections.Account.retrieve("fca_xxxxxxxxxxxxx") + await stripe.Coupon.retrieve_async("Z4OV52SU") http_client_mock.assert_requested( "get", - path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", + path="/v1/coupons/Z4OV52SU", query_string="", ) - def test_financial_connections_accounts_get_4_service( + @pytest.mark.anyio + async def test_coupons_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", + "/v1/coupons/Z4OV52SU", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.retrieve("fca_xxxxxxxxxxxxx") + await client.coupons.retrieve_async("Z4OV52SU") http_client_mock.assert_requested( "get", - path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", + path="/v1/coupons/Z4OV52SU", query_string="", api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_owners_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.list_owners( - "fca_xyz", - ownership="fcaowns_xyz", + def test_coupons_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Coupon.create( + percent_off=25.5, + duration="repeating", + duration_in_months=3, ) http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/accounts/fca_xyz/owners", - query_string="ownership=fcaowns_xyz", + "post", + path="/v1/coupons", + query_string="", + post_data="percent_off=25.5&duration=repeating&duration_in_months=3", ) - def test_financial_connections_accounts_owners_get_service( + def test_coupons_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/financial_connections/accounts/fca_xyz/owners", - "ownership=fcaowns_xyz", + "post", + "/v1/coupons", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.owners.list( - "fca_xyz", - {"ownership": "fcaowns_xyz"}, + client.coupons.create( + { + "percent_off": 25.5, + "duration": "repeating", + "duration_in_months": 3, + } ) http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/accounts/fca_xyz/owners", - query_string="ownership=fcaowns_xyz", + "post", + path="/v1/coupons", + query_string="", api_base="https://api.stripe.com", + post_data="percent_off=25.5&duration=repeating&duration_in_months=3", ) - def test_financial_connections_accounts_owners_get_2( + @pytest.mark.anyio + async def test_coupons_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.financial_connections.Account.list_owners( - "fca_xxxxxxxxxxxxx", - limit=3, - ownership="fcaowns_xxxxxxxxxxxxx", + await stripe.Coupon.create_async( + percent_off=25.5, + duration="repeating", + duration_in_months=3, ) http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", - query_string="limit=3&ownership=fcaowns_xxxxxxxxxxxxx", + "post", + path="/v1/coupons", + query_string="", + post_data="percent_off=25.5&duration=repeating&duration_in_months=3", ) - def test_financial_connections_accounts_owners_get_2_service( + @pytest.mark.anyio + async def test_coupons_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", - "limit=3&ownership=fcaowns_xxxxxxxxxxxxx", + "post", + "/v1/coupons", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.owners.list( - "fca_xxxxxxxxxxxxx", - {"limit": 3, "ownership": "fcaowns_xxxxxxxxxxxxx"}, + await client.coupons.create_async( + { + "percent_off": 25.5, + "duration": "repeating", + "duration_in_months": 3, + } ) http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", - query_string="limit=3&ownership=fcaowns_xxxxxxxxxxxxx", + "post", + path="/v1/coupons", + query_string="", api_base="https://api.stripe.com", + post_data="percent_off=25.5&duration=repeating&duration_in_months=3", ) - def test_financial_connections_accounts_refresh_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.refresh_account( - "fca_xyz", - features=["balance"], + def test_coupons_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Coupon.modify( + "Z4OV52SU", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/financial_connections/accounts/fca_xyz/refresh", + path="/v1/coupons/Z4OV52SU", query_string="", - post_data="features[0]=balance", + post_data="metadata[order_id]=6735", ) - def test_financial_connections_accounts_refresh_post_service( + def test_coupons_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/financial_connections/accounts/fca_xyz/refresh", + "/v1/coupons/Z4OV52SU", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.refresh( - "fca_xyz", - {"features": ["balance"]}, + client.coupons.update( + "Z4OV52SU", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/financial_connections/accounts/fca_xyz/refresh", + path="/v1/coupons/Z4OV52SU", query_string="", api_base="https://api.stripe.com", - post_data="features[0]=balance", + post_data="metadata[order_id]=6735", ) - def test_financial_connections_accounts_subscribe_post( + @pytest.mark.anyio + async def test_coupons_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.financial_connections.Account.subscribe( - "fa_123", - features=["transactions"], + await stripe.Coupon.modify_async( + "Z4OV52SU", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/financial_connections/accounts/fa_123/subscribe", + path="/v1/coupons/Z4OV52SU", query_string="", - post_data="features[0]=transactions", + post_data="metadata[order_id]=6735", ) - def test_financial_connections_accounts_subscribe_post_service( + @pytest.mark.anyio + async def test_coupons_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/financial_connections/accounts/fa_123/subscribe", + "/v1/coupons/Z4OV52SU", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.subscribe( - "fa_123", - {"features": ["transactions"]}, + await client.coupons.update_async( + "Z4OV52SU", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/financial_connections/accounts/fa_123/subscribe", + path="/v1/coupons/Z4OV52SU", query_string="", api_base="https://api.stripe.com", - post_data="features[0]=transactions", + post_data="metadata[order_id]=6735", ) - def test_financial_connections_accounts_unsubscribe_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Account.unsubscribe( - "fa_123", - features=["transactions"], - ) + def test_credit_notes_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.CreditNote.list(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/accounts/fa_123/unsubscribe", - query_string="", - post_data="features[0]=transactions", + "get", + path="/v1/credit_notes", + query_string="limit=3", ) - def test_financial_connections_accounts_unsubscribe_post_service( + def test_credit_notes_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/financial_connections/accounts/fa_123/unsubscribe", + "get", + "/v1/credit_notes", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.unsubscribe( - "fa_123", - {"features": ["transactions"]}, - ) + client.credit_notes.list({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/accounts/fa_123/unsubscribe", - query_string="", + "get", + path="/v1/credit_notes", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="features[0]=transactions", ) - def test_financial_connections_sessions_get( + @pytest.mark.anyio + async def test_credit_notes_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.financial_connections.Session.retrieve("fcsess_xyz") + await stripe.CreditNote.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/financial_connections/sessions/fcsess_xyz", - query_string="", + path="/v1/credit_notes", + query_string="limit=3", ) - def test_financial_connections_sessions_get_service( + @pytest.mark.anyio + async def test_credit_notes_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/financial_connections/sessions/fcsess_xyz", + "/v1/credit_notes", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.sessions.retrieve("fcsess_xyz") + await client.credit_notes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/financial_connections/sessions/fcsess_xyz", - query_string="", + path="/v1/credit_notes", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_financial_connections_sessions_get_2( + def test_credit_notes_lines_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.financial_connections.Session.retrieve("fcsess_xxxxxxxxxxxxx") + stripe.CreditNote.list_lines( + "cn_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", - query_string="", + path="/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", + query_string="limit=3", ) - def test_financial_connections_sessions_get_2_service( + def test_credit_notes_lines_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", + "/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.sessions.retrieve("fcsess_xxxxxxxxxxxxx") + client.credit_notes.line_items.list( + "cn_xxxxxxxxxxxxx", + {"limit": 3}, + ) http_client_mock.assert_requested( "get", - path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", - query_string="", + path="/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_financial_connections_sessions_post( + @pytest.mark.anyio + async def test_credit_notes_lines_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.financial_connections.Session.create( - account_holder={"type": "customer", "customer": "cus_123"}, - permissions=["balances"], + await stripe.CreditNote.list_lines_async( + "cn_xxxxxxxxxxxxx", + limit=3, ) http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/sessions", - query_string="", - post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", + "get", + path="/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", + query_string="limit=3", ) - def test_financial_connections_sessions_post_service( + @pytest.mark.anyio + async def test_credit_notes_lines_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/financial_connections/sessions", + "get", + "/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.sessions.create( - { - "account_holder": {"type": "customer", "customer": "cus_123"}, - "permissions": ["balances"], - } + await client.credit_notes.line_items.list_async( + "cn_xxxxxxxxxxxxx", + {"limit": 3}, ) http_client_mock.assert_requested( - "post", - path="/v1/financial_connections/sessions", - query_string="", + "get", + path="/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", ) - def test_financial_connections_sessions_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.financial_connections.Session.create( - account_holder={ - "type": "customer", - "customer": "cus_xxxxxxxxxxxxx", - }, - permissions=["payment_method", "balances"], - filters={"countries": ["US"]}, + def test_credit_notes_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.CreditNote.create( + invoice="in_xxxxxxxxxxxxx", + lines=[ + { + "type": "invoice_line_item", + "invoice_line_item": "il_xxxxxxxxxxxxx", + "quantity": 1, + }, + ], ) http_client_mock.assert_requested( "post", - path="/v1/financial_connections/sessions", + path="/v1/credit_notes", query_string="", - post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", + post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) - def test_financial_connections_sessions_post_2_service( + def test_credit_notes_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/financial_connections/sessions", + "/v1/credit_notes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.sessions.create( + client.credit_notes.create( { - "account_holder": { - "type": "customer", - "customer": "cus_xxxxxxxxxxxxx", - }, - "permissions": ["payment_method", "balances"], - "filters": {"countries": ["US"]}, + "invoice": "in_xxxxxxxxxxxxx", + "lines": [ + { + "type": "invoice_line_item", + "invoice_line_item": "il_xxxxxxxxxxxxx", + "quantity": 1, + }, + ], } ) http_client_mock.assert_requested( "post", - path="/v1/financial_connections/sessions", + path="/v1/credit_notes", query_string="", api_base="https://api.stripe.com", - post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", + post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) - def test_financial_connections_transactions_get( + @pytest.mark.anyio + async def test_credit_notes_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.financial_connections.Transaction.retrieve("tr_123") + await stripe.CreditNote.create_async( + invoice="in_xxxxxxxxxxxxx", + lines=[ + { + "type": "invoice_line_item", + "invoice_line_item": "il_xxxxxxxxxxxxx", + "quantity": 1, + }, + ], + ) http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/transactions/tr_123", + "post", + path="/v1/credit_notes", query_string="", + post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) - def test_financial_connections_transactions_get_service( + @pytest.mark.anyio + async def test_credit_notes_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/financial_connections/transactions/tr_123", + "post", + "/v1/credit_notes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.transactions.retrieve("tr_123") + await client.credit_notes.create_async( + { + "invoice": "in_xxxxxxxxxxxxx", + "lines": [ + { + "type": "invoice_line_item", + "invoice_line_item": "il_xxxxxxxxxxxxx", + "quantity": 1, + }, + ], + } + ) http_client_mock.assert_requested( - "get", - path="/v1/financial_connections/transactions/tr_123", + "post", + path="/v1/credit_notes", query_string="", api_base="https://api.stripe.com", + post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) - def test_financial_connections_transactions_get_2( + def test_credit_notes_preview_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.financial_connections.Transaction.list(account="fca_xyz") + stripe.CreditNote.preview( + invoice="in_xxxxxxxxxxxxx", + lines=[ + { + "type": "invoice_line_item", + "invoice_line_item": "il_xxxxxxxxxxxxx", + "quantity": 1, + }, + ], + ) http_client_mock.assert_requested( "get", - path="/v1/financial_connections/transactions", - query_string="account=fca_xyz", + path="/v1/credit_notes/preview", + query_string="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) - def test_financial_connections_transactions_get_2_service( + def test_credit_notes_preview_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/financial_connections/transactions", - "account=fca_xyz", + "/v1/credit_notes/preview", + "invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.transactions.list({"account": "fca_xyz"}) + client.credit_notes.preview( + { + "invoice": "in_xxxxxxxxxxxxx", + "lines": [ + { + "type": "invoice_line_item", + "invoice_line_item": "il_xxxxxxxxxxxxx", + "quantity": 1, + }, + ], + } + ) http_client_mock.assert_requested( "get", - path="/v1/financial_connections/transactions", - query_string="account=fca_xyz", + path="/v1/credit_notes/preview", + query_string="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", api_base="https://api.stripe.com", ) - def test_identity_verification_reports_get( + @pytest.mark.anyio + async def test_credit_notes_preview_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.identity.VerificationReport.list(limit=3) + await stripe.CreditNote.preview_async( + invoice="in_xxxxxxxxxxxxx", + lines=[ + { + "type": "invoice_line_item", + "invoice_line_item": "il_xxxxxxxxxxxxx", + "quantity": 1, + }, + ], + ) http_client_mock.assert_requested( "get", - path="/v1/identity/verification_reports", - query_string="limit=3", + path="/v1/credit_notes/preview", + query_string="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) - def test_identity_verification_reports_get_service( + @pytest.mark.anyio + async def test_credit_notes_preview_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/identity/verification_reports", - "limit=3", + "/v1/credit_notes/preview", + "invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_reports.list({"limit": 3}) + await client.credit_notes.preview_async( + { + "invoice": "in_xxxxxxxxxxxxx", + "lines": [ + { + "type": "invoice_line_item", + "invoice_line_item": "il_xxxxxxxxxxxxx", + "quantity": 1, + }, + ], + } + ) http_client_mock.assert_requested( "get", - path="/v1/identity/verification_reports", - query_string="limit=3", + path="/v1/credit_notes/preview", + query_string="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", api_base="https://api.stripe.com", ) - def test_identity_verification_reports_get_2( + def test_credit_notes_preview_lines_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.identity.VerificationReport.retrieve("vr_xxxxxxxxxxxxx") + stripe.CreditNote.preview_lines( + limit=3, + invoice="in_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", - query_string="", + path="/v1/credit_notes/preview/lines", + query_string="limit=3&invoice=in_xxxxxxxxxxxxx", ) - def test_identity_verification_reports_get_2_service( + def test_credit_notes_preview_lines_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", + "/v1/credit_notes/preview/lines", + "limit=3&invoice=in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_reports.retrieve("vr_xxxxxxxxxxxxx") + client.credit_notes.preview_lines.list( + { + "limit": 3, + "invoice": "in_xxxxxxxxxxxxx", + } + ) http_client_mock.assert_requested( "get", - path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", - query_string="", + path="/v1/credit_notes/preview/lines", + query_string="limit=3&invoice=in_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) - def test_identity_verification_sessions_cancel_post( + @pytest.mark.anyio + async def test_credit_notes_preview_lines_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.identity.VerificationSession.cancel("vs_xxxxxxxxxxxxx") + await stripe.CreditNote.preview_lines_async( + limit=3, + invoice="in_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", - query_string="", + "get", + path="/v1/credit_notes/preview/lines", + query_string="limit=3&invoice=in_xxxxxxxxxxxxx", ) - def test_identity_verification_sessions_cancel_post_service( + @pytest.mark.anyio + async def test_credit_notes_preview_lines_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", + "get", + "/v1/credit_notes/preview/lines", + "limit=3&invoice=in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_sessions.cancel("vs_xxxxxxxxxxxxx") + await client.credit_notes.preview_lines.list_async( + { + "limit": 3, + "invoice": "in_xxxxxxxxxxxxx", + } + ) http_client_mock.assert_requested( - "post", - path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", - query_string="", + "get", + path="/v1/credit_notes/preview/lines", + query_string="limit=3&invoice=in_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) - def test_identity_verification_sessions_get( + def test_credit_notes_void_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.identity.VerificationSession.list(limit=3) + stripe.CreditNote.void_credit_note("cn_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/identity/verification_sessions", - query_string="limit=3", + "post", + path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", + query_string="", ) - def test_identity_verification_sessions_get_service( + def test_credit_notes_void_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/identity/verification_sessions", - "limit=3", + "post", + "/v1/credit_notes/cn_xxxxxxxxxxxxx/void", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_sessions.list({"limit": 3}) + client.credit_notes.void_credit_note("cn_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/identity/verification_sessions", - query_string="limit=3", + "post", + path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", + query_string="", api_base="https://api.stripe.com", ) - def test_identity_verification_sessions_get_2( + @pytest.mark.anyio + async def test_credit_notes_void_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.identity.VerificationSession.retrieve("vs_xxxxxxxxxxxxx") + await stripe.CreditNote.void_credit_note_async("cn_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", + "post", + path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", query_string="", ) - def test_identity_verification_sessions_get_2_service( + @pytest.mark.anyio + async def test_credit_notes_void_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", + "post", + "/v1/credit_notes/cn_xxxxxxxxxxxxx/void", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_sessions.retrieve("vs_xxxxxxxxxxxxx") + await client.credit_notes.void_credit_note_async("cn_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", + "post", + path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", query_string="", api_base="https://api.stripe.com", ) - def test_identity_verification_sessions_post( + def test_customer_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.identity.VerificationSession.create(type="document") + stripe.CustomerSession.create( + customer="cus_123", + components={"buy_button": {"enabled": True}}, + ) http_client_mock.assert_requested( "post", - path="/v1/identity/verification_sessions", + path="/v1/customer_sessions", query_string="", - post_data="type=document", + post_data="customer=cus_123&components[buy_button][enabled]=True", ) - def test_identity_verification_sessions_post_service( + def test_customer_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/identity/verification_sessions", + "/v1/customer_sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_sessions.create({"type": "document"}) + client.customer_sessions.create( + { + "customer": "cus_123", + "components": {"buy_button": {"enabled": True}}, + } + ) http_client_mock.assert_requested( "post", - path="/v1/identity/verification_sessions", + path="/v1/customer_sessions", query_string="", api_base="https://api.stripe.com", - post_data="type=document", + post_data="customer=cus_123&components[buy_button][enabled]=True", ) - def test_identity_verification_sessions_post_2( + @pytest.mark.anyio + async def test_customer_sessions_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.identity.VerificationSession.modify( - "vs_xxxxxxxxxxxxx", - type="id_number", + await stripe.CustomerSession.create_async( + customer="cus_123", + components={"buy_button": {"enabled": True}}, ) http_client_mock.assert_requested( "post", - path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", + path="/v1/customer_sessions", query_string="", - post_data="type=id_number", + post_data="customer=cus_123&components[buy_button][enabled]=True", ) - def test_identity_verification_sessions_post_2_service( + @pytest.mark.anyio + async def test_customer_sessions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", + "/v1/customer_sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_sessions.update( - "vs_xxxxxxxxxxxxx", - {"type": "id_number"}, + await client.customer_sessions.create_async( + { + "customer": "cus_123", + "components": {"buy_button": {"enabled": True}}, + } ) http_client_mock.assert_requested( "post", - path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", + path="/v1/customer_sessions", query_string="", api_base="https://api.stripe.com", - post_data="type=id_number", + post_data="customer=cus_123&components[buy_button][enabled]=True", ) - def test_identity_verification_sessions_redact_post( + def test_customers_balance_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.identity.VerificationSession.redact("vs_xxxxxxxxxxxxx") + stripe.Customer.list_balance_transactions( + "cus_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( - "post", - path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", - query_string="", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + query_string="limit=3", ) - def test_identity_verification_sessions_redact_post_service( + def test_customers_balance_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", + "get", + "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_sessions.redact("vs_xxxxxxxxxxxxx") + client.customers.balance_transactions.list( + "cus_xxxxxxxxxxxxx", + {"limit": 3}, + ) http_client_mock.assert_requested( - "post", - path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", - query_string="", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_invoiceitems_delete( + @pytest.mark.anyio + async def test_customers_balance_transactions_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.InvoiceItem.delete("ii_xxxxxxxxxxxxx") + await stripe.Customer.list_balance_transactions_async( + "cus_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( - "delete", - path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", - query_string="", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + query_string="limit=3", ) - def test_invoiceitems_delete_service( + @pytest.mark.anyio + async def test_customers_balance_transactions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/invoiceitems/ii_xxxxxxxxxxxxx", + "get", + "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoice_items.delete("ii_xxxxxxxxxxxxx") + await client.customers.balance_transactions.list_async( + "cus_xxxxxxxxxxxxx", + {"limit": 3}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", - query_string="", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_invoiceitems_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.InvoiceItem.list(limit=3) + def test_customers_balance_transactions_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.retrieve_balance_transaction( + "cus_xxxxxxxxxxxxx", + "cbtxn_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/invoiceitems", - query_string="limit=3", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", + query_string="", ) - def test_invoiceitems_get_service( + def test_customers_balance_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/invoiceitems", - "limit=3", + "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoice_items.list({"limit": 3}) + client.customers.balance_transactions.retrieve( + "cus_xxxxxxxxxxxxx", + "cbtxn_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/invoiceitems", - query_string="limit=3", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_invoiceitems_get_2( + @pytest.mark.anyio + async def test_customers_balance_transactions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.InvoiceItem.retrieve("ii_xxxxxxxxxxxxx") + await stripe.Customer.retrieve_balance_transaction_async( + "cus_xxxxxxxxxxxxx", + "cbtxn_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", ) - def test_invoiceitems_get_2_service( + @pytest.mark.anyio + async def test_customers_balance_transactions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/invoiceitems/ii_xxxxxxxxxxxxx", + "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoice_items.retrieve("ii_xxxxxxxxxxxxx") + await client.customers.balance_transactions.retrieve_async( + "cus_xxxxxxxxxxxxx", + "cbtxn_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_invoiceitems_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.InvoiceItem.create( - customer="cus_xxxxxxxxxxxxx", - price="price_xxxxxxxxxxxxx", + def test_customers_balance_transactions_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.create_balance_transaction( + "cus_xxxxxxxxxxxxx", + amount=-500, + currency="usd", ) http_client_mock.assert_requested( "post", - path="/v1/invoiceitems", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", query_string="", - post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", + post_data="amount=-500¤cy=usd", ) - def test_invoiceitems_post_service( + def test_customers_balance_transactions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/invoiceitems", + "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoice_items.create( - { - "customer": "cus_xxxxxxxxxxxxx", - "price": "price_xxxxxxxxxxxxx", - } + client.customers.balance_transactions.create( + "cus_xxxxxxxxxxxxx", + {"amount": -500, "currency": "usd"}, ) http_client_mock.assert_requested( "post", - path="/v1/invoiceitems", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", query_string="", api_base="https://api.stripe.com", - post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", + post_data="amount=-500¤cy=usd", ) - def test_invoiceitems_post_2( + @pytest.mark.anyio + async def test_customers_balance_transactions_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.InvoiceItem.modify( - "ii_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, + await stripe.Customer.create_balance_transaction_async( + "cus_xxxxxxxxxxxxx", + amount=-500, + currency="usd", ) http_client_mock.assert_requested( "post", - path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", query_string="", - post_data="metadata[order_id]=6735", + post_data="amount=-500¤cy=usd", ) - def test_invoiceitems_post_2_service( + @pytest.mark.anyio + async def test_customers_balance_transactions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/invoiceitems/ii_xxxxxxxxxxxxx", + "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoice_items.update( - "ii_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + await client.customers.balance_transactions.create_async( + "cus_xxxxxxxxxxxxx", + {"amount": -500, "currency": "usd"}, ) http_client_mock.assert_requested( "post", - path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", + post_data="amount=-500¤cy=usd", ) - def test_invoices_delete(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.delete("in_xxxxxxxxxxxxx") + def test_customers_balance_transactions_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.modify_balance_transaction( + "cus_xxxxxxxxxxxxx", + "cbtxn_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/invoices/in_xxxxxxxxxxxxx", + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_invoices_delete_service( + def test_customers_balance_transactions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/invoices/in_xxxxxxxxxxxxx", + "post", + "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.delete("in_xxxxxxxxxxxxx") + client.customers.balance_transactions.update( + "cus_xxxxxxxxxxxxx", + "cbtxn_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/invoices/in_xxxxxxxxxxxxx", + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_invoices_finalize_post( + @pytest.mark.anyio + async def test_customers_balance_transactions_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Invoice.finalize_invoice("in_xxxxxxxxxxxxx") + await stripe.Customer.modify_balance_transaction_async( + "cus_xxxxxxxxxxxxx", + "cbtxn_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_invoices_finalize_post_service( + @pytest.mark.anyio + async def test_customers_balance_transactions_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/invoices/in_xxxxxxxxxxxxx/finalize", + "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.finalize_invoice("in_xxxxxxxxxxxxx") + await client.customers.balance_transactions.update_async( + "cus_xxxxxxxxxxxxx", + "cbtxn_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", + path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_invoices_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.list(limit=3) + def test_customers_cash_balance_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.retrieve_cash_balance("cus_123") http_client_mock.assert_requested( "get", - path="/v1/invoices", - query_string="limit=3", + path="/v1/customers/cus_123/cash_balance", + query_string="", ) - def test_invoices_get_service( + def test_customers_cash_balance_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/invoices", - "limit=3", + "/v1/customers/cus_123/cash_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.list({"limit": 3}) + client.customers.cash_balance.retrieve("cus_123") http_client_mock.assert_requested( "get", - path="/v1/invoices", - query_string="limit=3", + path="/v1/customers/cus_123/cash_balance", + query_string="", api_base="https://api.stripe.com", ) - def test_invoices_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.retrieve("in_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_customers_cash_balance_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Customer.retrieve_cash_balance_async("cus_123") http_client_mock.assert_requested( "get", - path="/v1/invoices/in_xxxxxxxxxxxxx", + path="/v1/customers/cus_123/cash_balance", query_string="", ) - def test_invoices_get_2_service( + @pytest.mark.anyio + async def test_customers_cash_balance_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/invoices/in_xxxxxxxxxxxxx", + "/v1/customers/cus_123/cash_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.retrieve("in_xxxxxxxxxxxxx") + await client.customers.cash_balance.retrieve_async("cus_123") http_client_mock.assert_requested( "get", - path="/v1/invoices/in_xxxxxxxxxxxxx", + path="/v1/customers/cus_123/cash_balance", query_string="", api_base="https://api.stripe.com", ) - def test_invoices_get_3(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.retrieve( - "in_xxxxxxxxxxxxx", - expand=["customer"], + def test_customers_cash_balance_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.modify_cash_balance( + "cus_123", + settings={"reconciliation_mode": "manual"}, ) http_client_mock.assert_requested( - "get", - path="/v1/invoices/in_xxxxxxxxxxxxx", - query_string="expand[0]=customer", + "post", + path="/v1/customers/cus_123/cash_balance", + query_string="", + post_data="settings[reconciliation_mode]=manual", ) - def test_invoices_get_3_service( + def test_customers_cash_balance_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/invoices/in_xxxxxxxxxxxxx", - "expand[0]=customer", + "post", + "/v1/customers/cus_123/cash_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.retrieve( - "in_xxxxxxxxxxxxx", - {"expand": ["customer"]}, + client.customers.cash_balance.update( + "cus_123", + {"settings": {"reconciliation_mode": "manual"}}, ) http_client_mock.assert_requested( - "get", - path="/v1/invoices/in_xxxxxxxxxxxxx", - query_string="expand[0]=customer", + "post", + path="/v1/customers/cus_123/cash_balance", + query_string="", api_base="https://api.stripe.com", + post_data="settings[reconciliation_mode]=manual", ) - def test_invoices_mark_uncollectible_post( + @pytest.mark.anyio + async def test_customers_cash_balance_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Invoice.mark_uncollectible("in_xxxxxxxxxxxxx") + await stripe.Customer.modify_cash_balance_async( + "cus_123", + settings={"reconciliation_mode": "manual"}, + ) http_client_mock.assert_requested( "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", + path="/v1/customers/cus_123/cash_balance", query_string="", + post_data="settings[reconciliation_mode]=manual", ) - def test_invoices_mark_uncollectible_post_service( + @pytest.mark.anyio + async def test_customers_cash_balance_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", + "/v1/customers/cus_123/cash_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.mark_uncollectible("in_xxxxxxxxxxxxx") + await client.customers.cash_balance.update_async( + "cus_123", + {"settings": {"reconciliation_mode": "manual"}}, + ) http_client_mock.assert_requested( "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", + path="/v1/customers/cus_123/cash_balance", query_string="", api_base="https://api.stripe.com", + post_data="settings[reconciliation_mode]=manual", ) - def test_invoices_pay_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.pay("in_xxxxxxxxxxxxx") + def test_customers_cash_balance_transactions_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.list_cash_balance_transactions( + "cus_123", + limit=3, + ) http_client_mock.assert_requested( - "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/pay", - query_string="", + "get", + path="/v1/customers/cus_123/cash_balance_transactions", + query_string="limit=3", ) - def test_invoices_pay_post_service( + def test_customers_cash_balance_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/invoices/in_xxxxxxxxxxxxx/pay", + "get", + "/v1/customers/cus_123/cash_balance_transactions", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.pay("in_xxxxxxxxxxxxx") + client.customers.cash_balance_transactions.list( + "cus_123", + {"limit": 3}, + ) http_client_mock.assert_requested( - "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/pay", - query_string="", + "get", + path="/v1/customers/cus_123/cash_balance_transactions", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_invoices_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.create(customer="cus_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_customers_cash_balance_transactions_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Customer.list_cash_balance_transactions_async( + "cus_123", + limit=3, + ) http_client_mock.assert_requested( - "post", - path="/v1/invoices", - query_string="", - post_data="customer=cus_xxxxxxxxxxxxx", + "get", + path="/v1/customers/cus_123/cash_balance_transactions", + query_string="limit=3", ) - def test_invoices_post_service( + @pytest.mark.anyio + async def test_customers_cash_balance_transactions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/invoices", + "get", + "/v1/customers/cus_123/cash_balance_transactions", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.create({"customer": "cus_xxxxxxxxxxxxx"}) + await client.customers.cash_balance_transactions.list_async( + "cus_123", + {"limit": 3}, + ) http_client_mock.assert_requested( - "post", - path="/v1/invoices", - query_string="", + "get", + path="/v1/customers/cus_123/cash_balance_transactions", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="customer=cus_xxxxxxxxxxxxx", ) - def test_invoices_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Invoice.modify( - "in_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + def test_customers_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.Customer.delete("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/invoices/in_xxxxxxxxxxxxx", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", - post_data="metadata[order_id]=6735", ) - def test_invoices_post_2_service( + def test_customers_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/invoices/in_xxxxxxxxxxxxx", + "delete", + "/v1/customers/cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.update( - "in_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + client.customers.delete("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/invoices/in_xxxxxxxxxxxxx", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_invoices_search_get( + @pytest.mark.anyio + async def test_customers_delete_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Invoice.search( - query="total>999 AND metadata['order_id']:'6735'" - ) + await stripe.Customer.delete_async("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/invoices/search", - query_string="query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx", + query_string="", ) - def test_invoices_search_get_service( + @pytest.mark.anyio + async def test_customers_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/invoices/search", - "query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + "delete", + "/v1/customers/cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.search( - { - "query": "total>999 AND metadata['order_id']:'6735'", - } - ) + await client.customers.delete_async("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/invoices/search", - query_string="query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_invoices_send_post( + def test_customers_funding_instructions_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Invoice.send_invoice("in_xxxxxxxxxxxxx") + stripe.Customer.create_funding_instructions( + "cus_123", + bank_transfer={ + "requested_address_types": ["zengin"], + "type": "jp_bank_transfer", + }, + currency="usd", + funding_type="bank_transfer", + ) http_client_mock.assert_requested( "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/send", + path="/v1/customers/cus_123/funding_instructions", query_string="", + post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", ) - def test_invoices_send_post_service( + def test_customers_funding_instructions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/invoices/in_xxxxxxxxxxxxx/send", + "/v1/customers/cus_123/funding_instructions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.send_invoice("in_xxxxxxxxxxxxx") + client.customers.funding_instructions.create( + "cus_123", + { + "bank_transfer": { + "requested_address_types": ["zengin"], + "type": "jp_bank_transfer", + }, + "currency": "usd", + "funding_type": "bank_transfer", + }, + ) http_client_mock.assert_requested( "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/send", + path="/v1/customers/cus_123/funding_instructions", query_string="", api_base="https://api.stripe.com", + post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", ) - def test_invoices_upcoming_get( + @pytest.mark.anyio + async def test_customers_funding_instructions_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Invoice.upcoming(customer="cus_9utnxg47pWjV1e") + await stripe.Customer.create_funding_instructions_async( + "cus_123", + bank_transfer={ + "requested_address_types": ["zengin"], + "type": "jp_bank_transfer", + }, + currency="usd", + funding_type="bank_transfer", + ) http_client_mock.assert_requested( - "get", - path="/v1/invoices/upcoming", - query_string="customer=cus_9utnxg47pWjV1e", + "post", + path="/v1/customers/cus_123/funding_instructions", + query_string="", + post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", ) - def test_invoices_upcoming_get_service( + @pytest.mark.anyio + async def test_customers_funding_instructions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/invoices/upcoming", - "customer=cus_9utnxg47pWjV1e", + "post", + "/v1/customers/cus_123/funding_instructions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.upcoming({"customer": "cus_9utnxg47pWjV1e"}) + await client.customers.funding_instructions.create_async( + "cus_123", + { + "bank_transfer": { + "requested_address_types": ["zengin"], + "type": "jp_bank_transfer", + }, + "currency": "usd", + "funding_type": "bank_transfer", + }, + ) http_client_mock.assert_requested( - "get", - path="/v1/invoices/upcoming", - query_string="customer=cus_9utnxg47pWjV1e", + "post", + path="/v1/customers/cus_123/funding_instructions", + query_string="", api_base="https://api.stripe.com", + post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", ) - def test_invoices_void_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Invoice.void_invoice("in_xxxxxxxxxxxxx") + def test_customers_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Customer.list(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/void", - query_string="", + "get", + path="/v1/customers", + query_string="limit=3", ) - def test_invoices_void_post_service( + def test_customers_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/invoices/in_xxxxxxxxxxxxx/void", + "get", + "/v1/customers", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.void_invoice("in_xxxxxxxxxxxxx") + client.customers.list({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/invoices/in_xxxxxxxxxxxxx/void", - query_string="", + "get", + path="/v1/customers", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_issuing_authorizations_approve_post( + @pytest.mark.anyio + async def test_customers_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Authorization.approve("iauth_xxxxxxxxxxxxx") + await stripe.Customer.list_async(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", - query_string="", + "get", + path="/v1/customers", + query_string="limit=3", ) - def test_issuing_authorizations_approve_post_service( + @pytest.mark.anyio + async def test_customers_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", + "get", + "/v1/customers", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.authorizations.approve("iauth_xxxxxxxxxxxxx") + await client.customers.list_async({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", - query_string="", + "get", + path="/v1/customers", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_issuing_authorizations_decline_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Authorization.decline("iauth_xxxxxxxxxxxxx") + def test_customers_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Customer.list(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", - query_string="", + "get", + path="/v1/customers", + query_string="limit=3", ) - def test_issuing_authorizations_decline_post_service( + def test_customers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", + "get", + "/v1/customers", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.authorizations.decline("iauth_xxxxxxxxxxxxx") + client.customers.list({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", - query_string="", + "get", + path="/v1/customers", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_issuing_authorizations_get( + @pytest.mark.anyio + async def test_customers_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Authorization.list(limit=3) + await stripe.Customer.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/issuing/authorizations", + path="/v1/customers", query_string="limit=3", ) - def test_issuing_authorizations_get_service( + @pytest.mark.anyio + async def test_customers_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/issuing/authorizations", + "/v1/customers", "limit=3", ) client = StripeClient( @@ -5739,1377 +6302,1516 @@ def test_issuing_authorizations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.authorizations.list({"limit": 3}) + await client.customers.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/issuing/authorizations", + path="/v1/customers", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_issuing_authorizations_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Authorization.retrieve("iauth_xxxxxxxxxxxxx") + def test_customers_get_3(self, http_client_mock: HTTPClientMock) -> None: + stripe.Customer.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", ) - def test_issuing_authorizations_get_2_service( + def test_customers_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", + "/v1/customers/cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.authorizations.retrieve("iauth_xxxxxxxxxxxxx") + client.customers.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_issuing_authorizations_post( + @pytest.mark.anyio + async def test_customers_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Authorization.modify( - "iauth_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + await stripe.Customer.retrieve_async("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", - post_data="metadata[order_id]=6735", ) - def test_issuing_authorizations_post_service( + @pytest.mark.anyio + async def test_customers_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", + "get", + "/v1/customers/cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.authorizations.update( - "iauth_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + await client.customers.retrieve_async("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_issuing_cardholders_get( + def test_customers_payment_methods_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Cardholder.list(limit=3) + stripe.Customer.list_payment_methods( + "cus_xyz", + type="card", + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/cardholders", - query_string="limit=3", + path="/v1/customers/cus_xyz/payment_methods", + query_string="type=card", ) - def test_issuing_cardholders_get_service( + def test_customers_payment_methods_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/issuing/cardholders", - "limit=3", + "/v1/customers/cus_xyz/payment_methods", + "type=card", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cardholders.list({"limit": 3}) + client.customers.payment_methods.list( + "cus_xyz", + {"type": "card"}, + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/cardholders", - query_string="limit=3", + path="/v1/customers/cus_xyz/payment_methods", + query_string="type=card", api_base="https://api.stripe.com", ) - def test_issuing_cardholders_get_2( + @pytest.mark.anyio + async def test_customers_payment_methods_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Cardholder.retrieve("ich_xxxxxxxxxxxxx") + await stripe.Customer.list_payment_methods_async( + "cus_xyz", + type="card", + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", - query_string="", + path="/v1/customers/cus_xyz/payment_methods", + query_string="type=card", ) - def test_issuing_cardholders_get_2_service( + @pytest.mark.anyio + async def test_customers_payment_methods_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", + "/v1/customers/cus_xyz/payment_methods", + "type=card", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cardholders.retrieve("ich_xxxxxxxxxxxxx") + await client.customers.payment_methods.list_async( + "cus_xyz", + {"type": "card"}, + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", - query_string="", + path="/v1/customers/cus_xyz/payment_methods", + query_string="type=card", api_base="https://api.stripe.com", ) - def test_issuing_cardholders_post( + def test_customers_payment_methods_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Cardholder.create( - type="individual", - name="Jenny Rosen", - email="jenny.rosen@example.com", - phone_number="+18888675309", - billing={ - "address": { - "line1": "1234 Main Street", - "city": "San Francisco", - "state": "CA", - "country": "US", - "postal_code": "94111", - }, - }, + stripe.Customer.list_payment_methods( + "cus_xxxxxxxxxxxxx", + type="card", ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/cardholders", - query_string="", - post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", + query_string="type=card", ) - def test_issuing_cardholders_post_service( + def test_customers_payment_methods_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/issuing/cardholders", + "get", + "/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", + "type=card", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cardholders.create( - { - "type": "individual", - "name": "Jenny Rosen", - "email": "jenny.rosen@example.com", - "phone_number": "+18888675309", - "billing": { - "address": { - "line1": "1234 Main Street", - "city": "San Francisco", - "state": "CA", - "country": "US", - "postal_code": "94111", - }, - }, - } + client.customers.payment_methods.list( + "cus_xxxxxxxxxxxxx", + {"type": "card"}, ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/cardholders", - query_string="", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", + query_string="type=card", api_base="https://api.stripe.com", - post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", ) - def test_issuing_cardholders_post_2( + @pytest.mark.anyio + async def test_customers_payment_methods_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Cardholder.modify( - "ich_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, + await stripe.Customer.list_payment_methods_async( + "cus_xxxxxxxxxxxxx", + type="card", ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", + query_string="type=card", ) - def test_issuing_cardholders_post_2_service( + @pytest.mark.anyio + async def test_customers_payment_methods_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", + "get", + "/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", + "type=card", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cardholders.update( - "ich_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + await client.customers.payment_methods.list_async( + "cus_xxxxxxxxxxxxx", + {"type": "card"}, ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", - query_string="", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", + query_string="type=card", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_issuing_cards_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.issuing.Card.list(limit=3) + def test_customers_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Customer.create( + description="My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", + ) http_client_mock.assert_requested( - "get", - path="/v1/issuing/cards", - query_string="limit=3", + "post", + path="/v1/customers", + query_string="", + post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) - def test_issuing_cards_get_service( + def test_customers_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/issuing/cards", - "limit=3", + "post", + "/v1/customers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cards.list({"limit": 3}) + client.customers.create( + { + "description": "My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", + } + ) http_client_mock.assert_requested( - "get", - path="/v1/issuing/cards", - query_string="limit=3", + "post", + path="/v1/customers", + query_string="", api_base="https://api.stripe.com", + post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) - def test_issuing_cards_get_2( + @pytest.mark.anyio + async def test_customers_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Card.retrieve("ic_xxxxxxxxxxxxx") + await stripe.Customer.create_async( + description="My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", + ) http_client_mock.assert_requested( - "get", - path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", + "post", + path="/v1/customers", query_string="", + post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) - def test_issuing_cards_get_2_service( + @pytest.mark.anyio + async def test_customers_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/issuing/cards/ic_xxxxxxxxxxxxx", + "post", + "/v1/customers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cards.retrieve("ic_xxxxxxxxxxxxx") + await client.customers.create_async( + { + "description": "My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", + } + ) http_client_mock.assert_requested( - "get", - path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", + "post", + path="/v1/customers", query_string="", api_base="https://api.stripe.com", + post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) - def test_issuing_cards_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.issuing.Card.create( - cardholder="ich_xxxxxxxxxxxxx", - currency="usd", - type="virtual", + def test_customers_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Customer.modify( + "cus_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/issuing/cards", + path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", - post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", + post_data="metadata[order_id]=6735", ) - def test_issuing_cards_post_service( + def test_customers_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/issuing/cards", + "/v1/customers/cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cards.create( - { - "cardholder": "ich_xxxxxxxxxxxxx", - "currency": "usd", - "type": "virtual", - } + client.customers.update( + "cus_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/issuing/cards", + path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", + post_data="metadata[order_id]=6735", ) - def test_issuing_cards_post_2( + @pytest.mark.anyio + async def test_customers_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Card.modify( - "ic_xxxxxxxxxxxxx", + await stripe.Customer.modify_async( + "cus_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) - def test_issuing_cards_post_2_service( + @pytest.mark.anyio + async def test_customers_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/issuing/cards/ic_xxxxxxxxxxxxx", + "/v1/customers/cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cards.update( - "ic_xxxxxxxxxxxxx", + await client.customers.update_async( + "cus_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) - def test_issuing_disputes_get( + def test_customers_search_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Dispute.list(limit=3) + stripe.Customer.search( + query="name:'fakename' AND metadata['foo']:'bar'", + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/disputes", - query_string="limit=3", + path="/v1/customers/search", + query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) - def test_issuing_disputes_get_service( + def test_customers_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/issuing/disputes", - "limit=3", + "/v1/customers/search", + "query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.disputes.list({"limit": 3}) + client.customers.search( + { + "query": "name:'fakename' AND metadata['foo']:'bar'", + } + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/disputes", - query_string="limit=3", + path="/v1/customers/search", + query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", api_base="https://api.stripe.com", ) - def test_issuing_disputes_get_2( + @pytest.mark.anyio + async def test_customers_search_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Dispute.retrieve("idp_xxxxxxxxxxxxx") + await stripe.Customer.search_async( + query="name:'fakename' AND metadata['foo']:'bar'", + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", - query_string="", + path="/v1/customers/search", + query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) - def test_issuing_disputes_get_2_service( + @pytest.mark.anyio + async def test_customers_search_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/issuing/disputes/idp_xxxxxxxxxxxxx", + "/v1/customers/search", + "query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.disputes.retrieve("idp_xxxxxxxxxxxxx") + await client.customers.search_async( + { + "query": "name:'fakename' AND metadata['foo']:'bar'", + } + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", - query_string="", + path="/v1/customers/search", + query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", api_base="https://api.stripe.com", ) - def test_issuing_disputes_post( + def test_customers_search_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Dispute.create( - transaction="ipi_xxxxxxxxxxxxx", - evidence={ - "reason": "fraudulent", - "fraudulent": {"explanation": "Purchase was unrecognized."}, - }, + stripe.Customer.search( + query="name:'fakename' AND metadata['foo']:'bar'", ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/disputes", - query_string="", - post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", + "get", + path="/v1/customers/search", + query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) - def test_issuing_disputes_post_service( + def test_customers_search_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/issuing/disputes", + "get", + "/v1/customers/search", + "query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.disputes.create( + client.customers.search( { - "transaction": "ipi_xxxxxxxxxxxxx", - "evidence": { - "reason": "fraudulent", - "fraudulent": { - "explanation": "Purchase was unrecognized." - }, - }, + "query": "name:'fakename' AND metadata['foo']:'bar'", } ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/disputes", - query_string="", + "get", + path="/v1/customers/search", + query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", api_base="https://api.stripe.com", - post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", ) - def test_issuing_disputes_submit_post( + @pytest.mark.anyio + async def test_customers_search_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Dispute.submit("idp_xxxxxxxxxxxxx") + await stripe.Customer.search_async( + query="name:'fakename' AND metadata['foo']:'bar'", + ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", - query_string="", + "get", + path="/v1/customers/search", + query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) - def test_issuing_disputes_submit_post_service( + @pytest.mark.anyio + async def test_customers_search_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", + "get", + "/v1/customers/search", + "query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.disputes.submit("idp_xxxxxxxxxxxxx") + await client.customers.search_async( + { + "query": "name:'fakename' AND metadata['foo']:'bar'", + } + ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", - query_string="", + "get", + path="/v1/customers/search", + query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", api_base="https://api.stripe.com", ) - def test_issuing_personalization_designs_get( + def test_customers_sources_delete( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.PersonalizationDesign.list() + stripe.Customer.delete_source( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "get", - path="/v1/issuing/personalization_designs", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", ) - def test_issuing_personalization_designs_get_service( + def test_customers_sources_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/issuing/personalization_designs", + "delete", + "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.personalization_designs.list() + client.sources.detach( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "get", - path="/v1/issuing/personalization_designs", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_issuing_personalization_designs_get_2( + @pytest.mark.anyio + async def test_customers_sources_delete_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.PersonalizationDesign.retrieve("pd_xyz") + await stripe.Customer.delete_source_async( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "get", - path="/v1/issuing/personalization_designs/pd_xyz", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", ) - def test_issuing_personalization_designs_get_2_service( + @pytest.mark.anyio + async def test_customers_sources_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/issuing/personalization_designs/pd_xyz", + "delete", + "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.personalization_designs.retrieve("pd_xyz") + await client.sources.detach_async( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "get", - path="/v1/issuing/personalization_designs/pd_xyz", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_issuing_personalization_designs_post( + def test_customers_sources_delete_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.PersonalizationDesign.create(physical_bundle="pb_xyz") + stripe.Customer.delete_source( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/personalization_designs", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", - post_data="physical_bundle=pb_xyz", ) - def test_issuing_personalization_designs_post_service( + def test_customers_sources_delete_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/issuing/personalization_designs", + "delete", + "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.personalization_designs.create( - { - "physical_bundle": "pb_xyz", - } + client.sources.detach( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/personalization_designs", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="physical_bundle=pb_xyz", ) - def test_issuing_personalization_designs_post_2( + @pytest.mark.anyio + async def test_customers_sources_delete_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.PersonalizationDesign.modify("pd_xyz") + await stripe.Customer.delete_source_async( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/personalization_designs/pd_xyz", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", ) - def test_issuing_personalization_designs_post_2_service( + @pytest.mark.anyio + async def test_customers_sources_delete_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/issuing/personalization_designs/pd_xyz", + "delete", + "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.personalization_designs.update("pd_xyz") + await client.sources.detach_async( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/personalization_designs/pd_xyz", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_issuing_physical_bundles_get( + def test_customers_sources_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.PhysicalBundle.list() + stripe.Customer.list_sources( + "cus_xxxxxxxxxxxxx", + object="bank_account", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/physical_bundles", - query_string="", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="object=bank_account&limit=3", ) - def test_issuing_physical_bundles_get_service( + def test_customers_sources_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/issuing/physical_bundles", + "/v1/customers/cus_xxxxxxxxxxxxx/sources", + "object=bank_account&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.physical_bundles.list() + client.customers.payment_sources.list( + "cus_xxxxxxxxxxxxx", + {"object": "bank_account", "limit": 3}, + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/physical_bundles", - query_string="", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="object=bank_account&limit=3", api_base="https://api.stripe.com", ) - def test_issuing_physical_bundles_get_2( + @pytest.mark.anyio + async def test_customers_sources_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.PhysicalBundle.retrieve("pb_xyz") + await stripe.Customer.list_sources_async( + "cus_xxxxxxxxxxxxx", + object="bank_account", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/physical_bundles/pb_xyz", - query_string="", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="object=bank_account&limit=3", ) - def test_issuing_physical_bundles_get_2_service( + @pytest.mark.anyio + async def test_customers_sources_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/issuing/physical_bundles/pb_xyz", + "/v1/customers/cus_xxxxxxxxxxxxx/sources", + "object=bank_account&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.physical_bundles.retrieve("pb_xyz") + await client.customers.payment_sources.list_async( + "cus_xxxxxxxxxxxxx", + {"object": "bank_account", "limit": 3}, + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/physical_bundles/pb_xyz", - query_string="", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="object=bank_account&limit=3", api_base="https://api.stripe.com", ) - def test_issuing_transactions_get( + def test_customers_sources_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Transaction.list(limit=3) + stripe.Customer.list_sources( + "cus_xxxxxxxxxxxxx", + object="card", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/transactions", - query_string="limit=3", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="object=card&limit=3", ) - def test_issuing_transactions_get_service( + def test_customers_sources_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/issuing/transactions", - "limit=3", + "/v1/customers/cus_xxxxxxxxxxxxx/sources", + "object=card&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.transactions.list({"limit": 3}) + client.customers.payment_sources.list( + "cus_xxxxxxxxxxxxx", + {"object": "card", "limit": 3}, + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/transactions", - query_string="limit=3", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="object=card&limit=3", api_base="https://api.stripe.com", ) - def test_issuing_transactions_get_2( + @pytest.mark.anyio + async def test_customers_sources_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Transaction.retrieve("ipi_xxxxxxxxxxxxx") + await stripe.Customer.list_sources_async( + "cus_xxxxxxxxxxxxx", + object="card", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", - query_string="", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="object=card&limit=3", ) - def test_issuing_transactions_get_2_service( + @pytest.mark.anyio + async def test_customers_sources_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", + "/v1/customers/cus_xxxxxxxxxxxxx/sources", + "object=card&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.transactions.retrieve("ipi_xxxxxxxxxxxxx") + await client.customers.payment_sources.list_async( + "cus_xxxxxxxxxxxxx", + {"object": "card", "limit": 3}, + ) http_client_mock.assert_requested( "get", - path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", - query_string="", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="object=card&limit=3", api_base="https://api.stripe.com", ) - def test_issuing_transactions_post( + def test_customers_sources_get_3( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Transaction.modify( - "ipi_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, + stripe.Customer.retrieve_source( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", + query_string="", ) - def test_issuing_transactions_post_service( + def test_customers_sources_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", + "get", + "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.transactions.update( - "ipi_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + client.customers.payment_sources.retrieve( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_mandates_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Mandate.retrieve("mandate_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_customers_sources_get_3_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Customer.retrieve_source_async( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/mandates/mandate_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", ) - def test_mandates_get_service( + @pytest.mark.anyio + async def test_customers_sources_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/mandates/mandate_xxxxxxxxxxxxx", + "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.mandates.retrieve("mandate_xxxxxxxxxxxxx") + await client.customers.payment_sources.retrieve_async( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/mandates/mandate_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_payment_intents_apply_customer_balance_post( + def test_customers_sources_get_4( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.apply_customer_balance("pi_xxxxxxxxxxxxx") + stripe.Customer.retrieve_source( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", ) - def test_payment_intents_apply_customer_balance_post_service( + def test_customers_sources_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", + "get", + "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.apply_customer_balance("pi_xxxxxxxxxxxxx") + client.customers.payment_sources.retrieve( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_payment_intents_cancel_post( + @pytest.mark.anyio + async def test_customers_sources_get_4_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.cancel("pi_xxxxxxxxxxxxx") + await stripe.Customer.retrieve_source_async( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", ) - def test_payment_intents_cancel_post_service( + @pytest.mark.anyio + async def test_customers_sources_get_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", + "get", + "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.cancel("pi_xxxxxxxxxxxxx") + await client.customers.payment_sources.retrieve_async( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", + "get", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_payment_intents_capture_post( + def test_customers_sources_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.capture("pi_xxxxxxxxxxxxx") + stripe.Customer.modify_source( + "cus_123", + "card_123", + account_holder_name="Kamil", + ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", + path="/v1/customers/cus_123/sources/card_123", query_string="", + post_data="account_holder_name=Kamil", ) - def test_payment_intents_capture_post_service( + def test_customers_sources_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", + "/v1/customers/cus_123/sources/card_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.capture("pi_xxxxxxxxxxxxx") + client.customers.payment_sources.update( + "cus_123", + "card_123", + {"account_holder_name": "Kamil"}, + ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", + path="/v1/customers/cus_123/sources/card_123", query_string="", api_base="https://api.stripe.com", + post_data="account_holder_name=Kamil", ) - def test_payment_intents_confirm_post( + @pytest.mark.anyio + async def test_customers_sources_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.confirm( - "pi_xxxxxxxxxxxxx", - payment_method="pm_card_visa", + await stripe.Customer.modify_source_async( + "cus_123", + "card_123", + account_holder_name="Kamil", ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", + path="/v1/customers/cus_123/sources/card_123", query_string="", - post_data="payment_method=pm_card_visa", + post_data="account_holder_name=Kamil", ) - def test_payment_intents_confirm_post_service( + @pytest.mark.anyio + async def test_customers_sources_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", + "/v1/customers/cus_123/sources/card_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.confirm( - "pi_xxxxxxxxxxxxx", - {"payment_method": "pm_card_visa"}, + await client.customers.payment_sources.update_async( + "cus_123", + "card_123", + {"account_holder_name": "Kamil"}, ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", + path="/v1/customers/cus_123/sources/card_123", query_string="", api_base="https://api.stripe.com", - post_data="payment_method=pm_card_visa", + post_data="account_holder_name=Kamil", ) - def test_payment_intents_get( + def test_customers_sources_post_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.list(limit=3) + stripe.Customer.create_source( + "cus_xxxxxxxxxxxxx", + source="btok_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "get", - path="/v1/payment_intents", - query_string="limit=3", + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="", + post_data="source=btok_xxxxxxxxxxxxx", ) - def test_payment_intents_get_service( + def test_customers_sources_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/payment_intents", - "limit=3", + "post", + "/v1/customers/cus_xxxxxxxxxxxxx/sources", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.list({"limit": 3}) + client.customers.payment_sources.create( + "cus_xxxxxxxxxxxxx", + {"source": "btok_xxxxxxxxxxxxx"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/payment_intents", - query_string="limit=3", + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", + query_string="", api_base="https://api.stripe.com", + post_data="source=btok_xxxxxxxxxxxxx", ) - def test_payment_intents_get_2( + @pytest.mark.anyio + async def test_customers_sources_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.retrieve("pi_xxxxxxxxxxxxx") + await stripe.Customer.create_source_async( + "cus_xxxxxxxxxxxxx", + source="btok_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "get", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", + post_data="source=btok_xxxxxxxxxxxxx", ) - def test_payment_intents_get_2_service( + @pytest.mark.anyio + async def test_customers_sources_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/payment_intents/pi_xxxxxxxxxxxxx", + "post", + "/v1/customers/cus_xxxxxxxxxxxxx/sources", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.retrieve("pi_xxxxxxxxxxxxx") + await client.customers.payment_sources.create_async( + "cus_xxxxxxxxxxxxx", + {"source": "btok_xxxxxxxxxxxxx"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", api_base="https://api.stripe.com", + post_data="source=btok_xxxxxxxxxxxxx", ) - def test_payment_intents_increment_authorization_post( + def test_customers_sources_post_3( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.increment_authorization( - "pi_xxxxxxxxxxxxx", - amount=2099, + stripe.Customer.create_source( + "cus_xxxxxxxxxxxxx", + source="tok_xxxx", ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", - post_data="amount=2099", + post_data="source=tok_xxxx", ) - def test_payment_intents_increment_authorization_post_service( + def test_customers_sources_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", + "/v1/customers/cus_xxxxxxxxxxxxx/sources", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.increment_authorization( - "pi_xxxxxxxxxxxxx", - {"amount": 2099}, + client.customers.payment_sources.create( + "cus_xxxxxxxxxxxxx", + {"source": "tok_xxxx"}, ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", api_base="https://api.stripe.com", - post_data="amount=2099", + post_data="source=tok_xxxx", ) - def test_payment_intents_post( + @pytest.mark.anyio + async def test_customers_sources_post_3_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.create( - amount=1099, - currency="eur", - automatic_payment_methods={"enabled": True}, + await stripe.Customer.create_source_async( + "cus_xxxxxxxxxxxxx", + source="tok_xxxx", ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", - post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", + post_data="source=tok_xxxx", ) - def test_payment_intents_post_service( + @pytest.mark.anyio + async def test_customers_sources_post_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payment_intents", + "/v1/customers/cus_xxxxxxxxxxxxx/sources", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.create( - { - "amount": 1099, - "currency": "eur", - "automatic_payment_methods": {"enabled": True}, - } + await client.customers.payment_sources.create_async( + "cus_xxxxxxxxxxxxx", + {"source": "tok_xxxx"}, ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", api_base="https://api.stripe.com", - post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", + post_data="source=tok_xxxx", ) - def test_payment_intents_post_2( + def test_customers_sources_post_4( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.create( - amount=2000, - currency="usd", - automatic_payment_methods={"enabled": True}, + stripe.Customer.modify_source( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", - post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", + post_data="metadata[order_id]=6735", ) - def test_payment_intents_post_2_service( + def test_customers_sources_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payment_intents", + "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.create( - { - "amount": 2000, - "currency": "usd", - "automatic_payment_methods": {"enabled": True}, - } + client.customers.payment_sources.update( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", + post_data="metadata[order_id]=6735", ) - def test_payment_intents_post_3( + @pytest.mark.anyio + async def test_customers_sources_post_4_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.modify( - "pi_xxxxxxxxxxxxx", + await stripe.Customer.modify_source_async( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) - def test_payment_intents_post_3_service( + @pytest.mark.anyio + async def test_customers_sources_post_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payment_intents/pi_xxxxxxxxxxxxx", + "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.update( - "pi_xxxxxxxxxxxxx", + await client.customers.payment_sources.update_async( + "cus_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) - def test_payment_intents_post_4( + def test_customers_sources_post_5( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.create( - amount=200, - currency="usd", - payment_method_data={"type": "p24", "p24": {"bank": "blik"}}, + stripe.Customer.modify_source( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + name="Jenny Rosen", ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", - post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", + post_data="name=Jenny%20Rosen", ) - def test_payment_intents_post_4_service( + def test_customers_sources_post_5_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payment_intents", + "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.create( - { - "amount": 200, - "currency": "usd", - "payment_method_data": { - "type": "p24", - "p24": {"bank": "blik"}, - }, - } + client.customers.payment_sources.update( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + {"name": "Jenny Rosen"}, ) http_client_mock.assert_requested( "post", - path="/v1/payment_intents", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", + post_data="name=Jenny%20Rosen", ) - def test_payment_intents_search_get( + @pytest.mark.anyio + async def test_customers_sources_post_5_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.search( - query="status:'succeeded' AND metadata['order_id']:'6735'", + await stripe.Customer.modify_source_async( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + name="Jenny Rosen", ) http_client_mock.assert_requested( - "get", - path="/v1/payment_intents/search", - query_string="query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + query_string="", + post_data="name=Jenny%20Rosen", ) - def test_payment_intents_search_get_service( + @pytest.mark.anyio + async def test_customers_sources_post_5_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/payment_intents/search", - "query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + "post", + "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.search( - { - "query": "status:'succeeded' AND metadata['order_id']:'6735'", - } + await client.customers.payment_sources.update_async( + "cus_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + {"name": "Jenny Rosen"}, ) http_client_mock.assert_requested( - "get", - path="/v1/payment_intents/search", - query_string="query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + "post", + path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", + post_data="name=Jenny%20Rosen", ) - def test_payment_intents_verify_microdeposits_post( + def test_customers_tax_ids_delete( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.verify_microdeposits("pi_xxxxxxxxxxxxx") + stripe.Customer.delete_tax_id( + "cus_xxxxxxxxxxxxx", + "txi_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", ) - def test_payment_intents_verify_microdeposits_post_service( + def test_customers_tax_ids_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + "delete", + "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.verify_microdeposits("pi_xxxxxxxxxxxxx") + client.customers.tax_ids.delete( + "cus_xxxxxxxxxxxxx", + "txi_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_payment_intents_verify_microdeposits_post_2( + @pytest.mark.anyio + async def test_customers_tax_ids_delete_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.verify_microdeposits( - "pi_xxxxxxxxxxxxx", - amounts=[32, 45], + await stripe.Customer.delete_tax_id_async( + "cus_xxxxxxxxxxxxx", + "txi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", - post_data="amounts[0]=32&amounts[1]=45", ) - def test_payment_intents_verify_microdeposits_post_2_service( + @pytest.mark.anyio + async def test_customers_tax_ids_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + "delete", + "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.verify_microdeposits( - "pi_xxxxxxxxxxxxx", - {"amounts": [32, 45]}, + await client.customers.tax_ids.delete_async( + "cus_xxxxxxxxxxxxx", + "txi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + "delete", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="amounts[0]=32&amounts[1]=45", ) - def test_payment_links_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.PaymentLink.retrieve("pl_xyz") + def test_customers_tax_ids_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.list_tax_ids( + "cus_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/payment_links/pl_xyz", - query_string="", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", + query_string="limit=3", ) - def test_payment_links_get_service( + def test_customers_tax_ids_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/payment_links/pl_xyz", + "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.retrieve("pl_xyz") + client.customers.tax_ids.list( + "cus_xxxxxxxxxxxxx", + {"limit": 3}, + ) http_client_mock.assert_requested( "get", - path="/v1/payment_links/pl_xyz", - query_string="", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_payment_links_get_2( + @pytest.mark.anyio + async def test_customers_tax_ids_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentLink.list(limit=3) + await stripe.Customer.list_tax_ids_async( + "cus_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/payment_links", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="limit=3", ) - def test_payment_links_get_2_service( + @pytest.mark.anyio + async def test_customers_tax_ids_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/payment_links", + "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", "limit=3", ) client = StripeClient( @@ -7117,600 +7819,600 @@ def test_payment_links_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.list({"limit": 3}) + await client.customers.tax_ids.list_async( + "cus_xxxxxxxxxxxxx", + {"limit": 3}, + ) http_client_mock.assert_requested( "get", - path="/v1/payment_links", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_payment_links_get_3( + def test_customers_tax_ids_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentLink.retrieve("plink_xxxxxxxxxxxxx") + stripe.Customer.retrieve_tax_id( + "cus_xxxxxxxxxxxxx", + "txi_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/payment_links/plink_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", ) - def test_payment_links_get_3_service( + def test_customers_tax_ids_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/payment_links/plink_xxxxxxxxxxxxx", + "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.retrieve("plink_xxxxxxxxxxxxx") + client.customers.tax_ids.retrieve( + "cus_xxxxxxxxxxxxx", + "txi_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/payment_links/plink_xxxxxxxxxxxxx", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_payment_links_line_items_get( + @pytest.mark.anyio + async def test_customers_tax_ids_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentLink.list_line_items("pl_xyz") + await stripe.Customer.retrieve_tax_id_async( + "cus_xxxxxxxxxxxxx", + "txi_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/payment_links/pl_xyz/line_items", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", ) - def test_payment_links_line_items_get_service( + @pytest.mark.anyio + async def test_customers_tax_ids_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/payment_links/pl_xyz/line_items", + "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.line_items.list("pl_xyz") + await client.customers.tax_ids.retrieve_async( + "cus_xxxxxxxxxxxxx", + "txi_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/payment_links/pl_xyz/line_items", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_payment_links_post( + def test_customers_tax_ids_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentLink.create( - line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], + stripe.Customer.create_tax_id( + "cus_xxxxxxxxxxxxx", + type="eu_vat", + value="DE123456789", ) http_client_mock.assert_requested( "post", - path="/v1/payment_links", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="", - post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + post_data="type=eu_vat&value=DE123456789", ) - def test_payment_links_post_service( + def test_customers_tax_ids_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payment_links", + "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.create( - { - "line_items": [ - {"price": "price_xxxxxxxxxxxxx", "quantity": 1} - ], - } + client.customers.tax_ids.create( + "cus_xxxxxxxxxxxxx", + {"type": "eu_vat", "value": "DE123456789"}, ) http_client_mock.assert_requested( "post", - path="/v1/payment_links", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="", api_base="https://api.stripe.com", - post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + post_data="type=eu_vat&value=DE123456789", ) - def test_payment_links_post_2( + @pytest.mark.anyio + async def test_customers_tax_ids_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentLink.create( - line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], + await stripe.Customer.create_tax_id_async( + "cus_xxxxxxxxxxxxx", + type="eu_vat", + value="DE123456789", ) http_client_mock.assert_requested( "post", - path="/v1/payment_links", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="", - post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + post_data="type=eu_vat&value=DE123456789", ) - def test_payment_links_post_2_service( + @pytest.mark.anyio + async def test_customers_tax_ids_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payment_links", + "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.create( - { - "line_items": [ - {"price": "price_xxxxxxxxxxxxx", "quantity": 1} - ], - } + await client.customers.tax_ids.create_async( + "cus_xxxxxxxxxxxxx", + {"type": "eu_vat", "value": "DE123456789"}, ) http_client_mock.assert_requested( "post", - path="/v1/payment_links", + path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="", api_base="https://api.stripe.com", - post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + post_data="type=eu_vat&value=DE123456789", ) - def test_payment_links_post_3( + def test_disputes_close_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentLink.modify( - "plink_xxxxxxxxxxxxx", - active=False, - ) + stripe.Dispute.close("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/payment_links/plink_xxxxxxxxxxxxx", + path="/v1/disputes/dp_xxxxxxxxxxxxx/close", query_string="", - post_data="active=False", ) - def test_payment_links_post_3_service( + def test_disputes_close_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payment_links/plink_xxxxxxxxxxxxx", + "/v1/disputes/dp_xxxxxxxxxxxxx/close", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.update( - "plink_xxxxxxxxxxxxx", - {"active": False}, - ) + client.disputes.close("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/payment_links/plink_xxxxxxxxxxxxx", + path="/v1/disputes/dp_xxxxxxxxxxxxx/close", query_string="", api_base="https://api.stripe.com", - post_data="active=False", ) - def test_payment_method_configurations_get( + @pytest.mark.anyio + async def test_disputes_close_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentMethodConfiguration.list(application="foo") + await stripe.Dispute.close_async("dp_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/disputes/dp_xxxxxxxxxxxxx/close", + query_string="", + ) + + @pytest.mark.anyio + async def test_disputes_close_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/disputes/dp_xxxxxxxxxxxxx/close", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.disputes.close_async("dp_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/disputes/dp_xxxxxxxxxxxxx/close", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_disputes_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Dispute.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/payment_method_configurations", - query_string="application=foo", + path="/v1/disputes", + query_string="limit=3", ) - def test_payment_method_configurations_get_service( + def test_disputes_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/payment_method_configurations", - "application=foo", + "/v1/disputes", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_method_configurations.list({"application": "foo"}) + client.disputes.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/payment_method_configurations", - query_string="application=foo", + path="/v1/disputes", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_payment_method_configurations_get_2( + @pytest.mark.anyio + async def test_disputes_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentMethodConfiguration.retrieve("foo") + await stripe.Dispute.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/payment_method_configurations/foo", - query_string="", + path="/v1/disputes", + query_string="limit=3", ) - def test_payment_method_configurations_get_2_service( + @pytest.mark.anyio + async def test_disputes_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/payment_method_configurations/foo", + "/v1/disputes", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_method_configurations.retrieve("foo") + await client.disputes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/payment_method_configurations/foo", - query_string="", + path="/v1/disputes", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_payment_method_configurations_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethodConfiguration.create( - acss_debit={"display_preference": {"preference": "none"}}, - affirm={"display_preference": {"preference": "none"}}, - ) + def test_disputes_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Dispute.retrieve("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/payment_method_configurations", + "get", + path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", - post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", ) - def test_payment_method_configurations_post_service( + def test_disputes_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/payment_method_configurations", + "get", + "/v1/disputes/dp_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_method_configurations.create( - { - "acss_debit": {"display_preference": {"preference": "none"}}, - "affirm": {"display_preference": {"preference": "none"}}, - } - ) + client.disputes.retrieve("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/payment_method_configurations", + "get", + path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", ) - def test_payment_method_configurations_post_2( + @pytest.mark.anyio + async def test_disputes_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentMethodConfiguration.modify( - "foo", - acss_debit={"display_preference": {"preference": "on"}}, - ) + await stripe.Dispute.retrieve_async("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/payment_method_configurations/foo", + "get", + path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", - post_data="acss_debit[display_preference][preference]=on", ) - def test_payment_method_configurations_post_2_service( + @pytest.mark.anyio + async def test_disputes_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/payment_method_configurations/foo", + "get", + "/v1/disputes/dp_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_method_configurations.update( - "foo", - {"acss_debit": {"display_preference": {"preference": "on"}}}, - ) + await client.disputes.retrieve_async("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/payment_method_configurations/foo", + "get", + path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="acss_debit[display_preference][preference]=on", ) - def test_payment_methods_attach_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethod.attach( - "pm_xxxxxxxxxxxxx", - customer="cus_xxxxxxxxxxxxx", + def test_disputes_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Dispute.modify( + "dp_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", + path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", - post_data="customer=cus_xxxxxxxxxxxxx", + post_data="metadata[order_id]=6735", ) - def test_payment_methods_attach_post_service( + def test_disputes_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", + "/v1/disputes/dp_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_methods.attach( - "pm_xxxxxxxxxxxxx", - {"customer": "cus_xxxxxxxxxxxxx"}, + client.disputes.update( + "dp_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", + path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="customer=cus_xxxxxxxxxxxxx", + post_data="metadata[order_id]=6735", ) - def test_payment_methods_detach_post( + @pytest.mark.anyio + async def test_disputes_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentMethod.detach("pm_xxxxxxxxxxxxx") + await stripe.Dispute.modify_async( + "dp_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( "post", - path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", + path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_payment_methods_detach_post_service( + @pytest.mark.anyio + async def test_disputes_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", + "/v1/disputes/dp_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_methods.detach("pm_xxxxxxxxxxxxx") + await client.disputes.update_async( + "dp_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( "post", - path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", + path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_payment_methods_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethod.list( - customer="cus_xxxxxxxxxxxxx", - type="card", - ) + def test_events_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Event.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/payment_methods", - query_string="customer=cus_xxxxxxxxxxxxx&type=card", + path="/v1/events", + query_string="limit=3", ) - def test_payment_methods_get_service( + def test_events_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/payment_methods", - "customer=cus_xxxxxxxxxxxxx&type=card", + "/v1/events", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_methods.list( - { - "customer": "cus_xxxxxxxxxxxxx", - "type": "card", - } - ) + client.events.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/payment_methods", - query_string="customer=cus_xxxxxxxxxxxxx&type=card", + path="/v1/events", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_payment_methods_get_2( + @pytest.mark.anyio + async def test_events_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentMethod.retrieve("pm_xxxxxxxxxxxxx") + await stripe.Event.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/payment_methods/pm_xxxxxxxxxxxxx", - query_string="", + path="/v1/events", + query_string="limit=3", ) - def test_payment_methods_get_2_service( + @pytest.mark.anyio + async def test_events_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/payment_methods/pm_xxxxxxxxxxxxx", + "/v1/events", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_methods.retrieve("pm_xxxxxxxxxxxxx") + await client.events.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/payment_methods/pm_xxxxxxxxxxxxx", - query_string="", + path="/v1/events", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_payment_methods_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.PaymentMethod.create( - type="card", - card={ - "number": "4242424242424242", - "exp_month": 8, - "exp_year": 2024, - "cvc": "314", - }, - ) + def test_events_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Event.retrieve("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/payment_methods", + "get", + path="/v1/events/evt_xxxxxxxxxxxxx", query_string="", - post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", ) - def test_payment_methods_post_service( + def test_events_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/payment_methods", + "get", + "/v1/events/evt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_methods.create( - { - "type": "card", - "card": { - "number": "4242424242424242", - "exp_month": 8, - "exp_year": 2024, - "cvc": "314", - }, - } - ) + client.events.retrieve("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/payment_methods", + "get", + path="/v1/events/evt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", ) - def test_payment_methods_post_2( + @pytest.mark.anyio + async def test_events_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentMethod.modify( - "pm_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + await stripe.Event.retrieve_async("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/payment_methods/pm_xxxxxxxxxxxxx", + "get", + path="/v1/events/evt_xxxxxxxxxxxxx", query_string="", - post_data="metadata[order_id]=6735", ) - def test_payment_methods_post_2_service( + @pytest.mark.anyio + async def test_events_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/payment_methods/pm_xxxxxxxxxxxxx", + "get", + "/v1/events/evt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payment_methods.update( - "pm_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + await client.events.retrieve_async("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/payment_methods/pm_xxxxxxxxxxxxx", + "get", + path="/v1/events/evt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_payouts_cancel_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Payout.cancel("po_xxxxxxxxxxxxx") + def test_file_links_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.FileLink.list(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", - query_string="", + "get", + path="/v1/file_links", + query_string="limit=3", ) - def test_payouts_cancel_post_service( + def test_file_links_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/payouts/po_xxxxxxxxxxxxx/cancel", + "get", + "/v1/file_links", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payouts.cancel("po_xxxxxxxxxxxxx") + client.file_links.list({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", - query_string="", + "get", + path="/v1/file_links", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_payouts_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Payout.list(limit=3) + @pytest.mark.anyio + async def test_file_links_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.FileLink.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/payouts", + path="/v1/file_links", query_string="limit=3", ) - def test_payouts_get_service( + @pytest.mark.anyio + async def test_file_links_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/payouts", + "/v1/file_links", "limit=3", ) client = StripeClient( @@ -7718,181 +8420,226 @@ def test_payouts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payouts.list({"limit": 3}) + await client.file_links.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/payouts", + path="/v1/file_links", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_payouts_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Payout.retrieve("po_xxxxxxxxxxxxx") + def test_file_links_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.FileLink.retrieve("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/payouts/po_xxxxxxxxxxxxx", + path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", ) - def test_payouts_get_2_service( + def test_file_links_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/payouts/po_xxxxxxxxxxxxx", + "/v1/file_links/link_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payouts.retrieve("po_xxxxxxxxxxxxx") + client.file_links.retrieve("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/payouts/po_xxxxxxxxxxxxx", + path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_payouts_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Payout.create( - amount=1100, - currency="usd", + @pytest.mark.anyio + async def test_file_links_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.FileLink.retrieve_async("link_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/file_links/link_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_file_links_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/file_links/link_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.file_links.retrieve_async("link_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/file_links/link_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", ) + + def test_file_links_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.FileLink.create(file="file_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/payouts", + path="/v1/file_links", query_string="", - post_data="amount=1100¤cy=usd", + post_data="file=file_xxxxxxxxxxxxx", ) - def test_payouts_post_service( + def test_file_links_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payouts", + "/v1/file_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payouts.create({"amount": 1100, "currency": "usd"}) + client.file_links.create({"file": "file_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", - path="/v1/payouts", + path="/v1/file_links", query_string="", api_base="https://api.stripe.com", - post_data="amount=1100¤cy=usd", + post_data="file=file_xxxxxxxxxxxxx", ) - def test_payouts_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Payout.modify( - "po_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + @pytest.mark.anyio + async def test_file_links_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.FileLink.create_async(file="file_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/payouts/po_xxxxxxxxxxxxx", + path="/v1/file_links", query_string="", - post_data="metadata[order_id]=6735", + post_data="file=file_xxxxxxxxxxxxx", ) - def test_payouts_post_2_service( + @pytest.mark.anyio + async def test_file_links_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payouts/po_xxxxxxxxxxxxx", + "/v1/file_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payouts.update( - "po_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + await client.file_links.create_async({"file": "file_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", - path="/v1/payouts/po_xxxxxxxxxxxxx", + path="/v1/file_links", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", + post_data="file=file_xxxxxxxxxxxxx", ) - def test_payouts_reverse_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Payout.reverse("po_xxxxxxxxxxxxx") + def test_file_links_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.FileLink.modify( + "link_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( "post", - path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", + path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_payouts_reverse_post_service( + def test_file_links_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/payouts/po_xxxxxxxxxxxxx/reverse", + "/v1/file_links/link_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.payouts.reverse("po_xxxxxxxxxxxxx") + client.file_links.update( + "link_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( "post", - path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", + path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_plans_delete(self, http_client_mock: HTTPClientMock) -> None: - stripe.Plan.delete("price_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_file_links_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.FileLink.modify_async( + "link_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/plans/price_xxxxxxxxxxxxx", + "post", + path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_plans_delete_service( + @pytest.mark.anyio + async def test_file_links_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/plans/price_xxxxxxxxxxxxx", + "post", + "/v1/file_links/link_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.plans.delete("price_xxxxxxxxxxxxx") + await client.file_links.update_async( + "link_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/plans/price_xxxxxxxxxxxxx", + "post", + path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_plans_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Plan.list(limit=3) + def test_files_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.File.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/plans", + path="/v1/files", query_string="limit=3", ) - def test_plans_get_service(self, http_client_mock: HTTPClientMock) -> None: + def test_files_get_service(self, http_client_mock: HTTPClientMock) -> None: http_client_mock.stub_request( "get", - "/v1/plans", + "/v1/files", "limit=3", ) client = StripeClient( @@ -7900,1397 +8647,1425 @@ def test_plans_get_service(self, http_client_mock: HTTPClientMock) -> None: http_client=http_client_mock.get_mock_http_client(), ) - client.plans.list({"limit": 3}) + client.files.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/plans", + path="/v1/files", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_plans_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Plan.retrieve("price_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_files_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.File.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/plans/price_xxxxxxxxxxxxx", - query_string="", + path="/v1/files", + query_string="limit=3", ) - def test_plans_get_2_service( + @pytest.mark.anyio + async def test_files_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/plans/price_xxxxxxxxxxxxx", + "/v1/files", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.plans.retrieve("price_xxxxxxxxxxxxx") + await client.files.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/plans/price_xxxxxxxxxxxxx", - query_string="", + path="/v1/files", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_plans_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Plan.create( - amount=2000, - currency="usd", - interval="month", - product="prod_xxxxxxxxxxxxx", - ) + def test_files_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.File.retrieve("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/plans", + "get", + path="/v1/files/file_xxxxxxxxxxxxx", query_string="", - post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", ) - def test_plans_post_service( + def test_files_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/plans", + "get", + "/v1/files/file_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.plans.create( - { - "amount": 2000, - "currency": "usd", - "interval": "month", - "product": "prod_xxxxxxxxxxxxx", - } - ) + client.files.retrieve("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/plans", + "get", + path="/v1/files/file_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", ) - def test_plans_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Plan.create( - amount=2000, - currency="usd", - interval="month", - product={"name": "My product"}, - ) + @pytest.mark.anyio + async def test_files_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.File.retrieve_async("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/plans", + "get", + path="/v1/files/file_xxxxxxxxxxxxx", query_string="", - post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", ) - def test_plans_post_2_service( + @pytest.mark.anyio + async def test_files_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/plans", + "get", + "/v1/files/file_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.plans.create( - { - "amount": 2000, - "currency": "usd", - "interval": "month", - "product": {"name": "My product"}, - } - ) + await client.files.retrieve_async("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/plans", + "get", + path="/v1/files/file_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", ) - def test_plans_post_3(self, http_client_mock: HTTPClientMock) -> None: - stripe.Plan.modify( - "price_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, + def test_files_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.File.create( + purpose="account_requirement", + file=io.StringIO("foo"), ) http_client_mock.assert_requested( "post", - path="/v1/plans/price_xxxxxxxxxxxxx", + path="/v1/files", query_string="", - post_data="metadata[order_id]=6735", ) - def test_plans_post_3_service( + def test_files_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/plans/price_xxxxxxxxxxxxx", + "/v1/files", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.plans.update( - "price_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + client.files.create( + { + "purpose": "account_requirement", + "file": io.StringIO("foo"), + } ) http_client_mock.assert_requested( "post", - path="/v1/plans/price_xxxxxxxxxxxxx", + path="/v1/files", query_string="", - api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", + api_base="https://files.stripe.com", ) - def test_prices_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Price.list(limit=3) + @pytest.mark.anyio + async def test_files_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.File.create_async( + purpose="account_requirement", + file=io.StringIO("foo"), + ) http_client_mock.assert_requested( - "get", - path="/v1/prices", - query_string="limit=3", + "post", + path="/v1/files", + query_string="", ) - def test_prices_get_service( + @pytest.mark.anyio + async def test_files_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/prices", - "limit=3", + "post", + "/v1/files", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.prices.list({"limit": 3}) + await client.files.create_async( + { + "purpose": "account_requirement", + "file": io.StringIO("foo"), + } + ) http_client_mock.assert_requested( - "get", - path="/v1/prices", - query_string="limit=3", - api_base="https://api.stripe.com", + "post", + path="/v1/files", + query_string="", + api_base="https://files.stripe.com", ) - def test_prices_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Price.retrieve("price_xxxxxxxxxxxxx") + def test_financial_connections_accounts_disconnect_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.disconnect("fca_xyz") http_client_mock.assert_requested( - "get", - path="/v1/prices/price_xxxxxxxxxxxxx", + "post", + path="/v1/financial_connections/accounts/fca_xyz/disconnect", query_string="", ) - def test_prices_get_2_service( + def test_financial_connections_accounts_disconnect_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/prices/price_xxxxxxxxxxxxx", + "post", + "/v1/financial_connections/accounts/fca_xyz/disconnect", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.prices.retrieve("price_xxxxxxxxxxxxx") + client.financial_connections.accounts.disconnect("fca_xyz") http_client_mock.assert_requested( - "get", - path="/v1/prices/price_xxxxxxxxxxxxx", + "post", + path="/v1/financial_connections/accounts/fca_xyz/disconnect", query_string="", api_base="https://api.stripe.com", ) - def test_prices_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Price.create( - unit_amount=2000, - currency="usd", - currency_options={ - "uah": {"unit_amount": 5000}, - "eur": {"unit_amount": 1800}, - }, - recurring={"interval": "month"}, - product="prod_xxxxxxxxxxxxx", - ) + @pytest.mark.anyio + async def test_financial_connections_accounts_disconnect_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.financial_connections.Account.disconnect_async("fca_xyz") http_client_mock.assert_requested( "post", - path="/v1/prices", + path="/v1/financial_connections/accounts/fca_xyz/disconnect", query_string="", - post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) - def test_prices_post_service( + @pytest.mark.anyio + async def test_financial_connections_accounts_disconnect_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/prices", + "/v1/financial_connections/accounts/fca_xyz/disconnect", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.prices.create( - { - "unit_amount": 2000, - "currency": "usd", - "currency_options": { - "uah": {"unit_amount": 5000}, - "eur": {"unit_amount": 1800}, - }, - "recurring": {"interval": "month"}, - "product": "prod_xxxxxxxxxxxxx", - } - ) + await client.financial_connections.accounts.disconnect_async("fca_xyz") http_client_mock.assert_requested( "post", - path="/v1/prices", + path="/v1/financial_connections/accounts/fca_xyz/disconnect", query_string="", api_base="https://api.stripe.com", - post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) - def test_prices_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Price.create( - unit_amount=2000, - currency="usd", - recurring={"interval": "month"}, - product="prod_xxxxxxxxxxxxx", - ) + def test_financial_connections_accounts_disconnect_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.disconnect("fca_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/prices", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", query_string="", - post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) - def test_prices_post_2_service( + def test_financial_connections_accounts_disconnect_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/prices", + "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.prices.create( - { - "unit_amount": 2000, - "currency": "usd", - "recurring": {"interval": "month"}, - "product": "prod_xxxxxxxxxxxxx", - } - ) + client.financial_connections.accounts.disconnect("fca_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/prices", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", query_string="", api_base="https://api.stripe.com", - post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) - def test_prices_post_3(self, http_client_mock: HTTPClientMock) -> None: - stripe.Price.modify( - "price_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, + @pytest.mark.anyio + async def test_financial_connections_accounts_disconnect_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.financial_connections.Account.disconnect_async( + "fca_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", - path="/v1/prices/price_xxxxxxxxxxxxx", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", query_string="", - post_data="metadata[order_id]=6735", ) - def test_prices_post_3_service( + @pytest.mark.anyio + async def test_financial_connections_accounts_disconnect_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/prices/price_xxxxxxxxxxxxx", + "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.prices.update( - "price_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + await client.financial_connections.accounts.disconnect_async( + "fca_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", - path="/v1/prices/price_xxxxxxxxxxxxx", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_prices_search_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Price.search( - query="active:'true' AND metadata['order_id']:'6735'", - ) - http_client_mock.assert_requested( - "get", - path="/v1/prices/search", - query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", - ) - - def test_prices_search_get_service( + def test_financial_connections_accounts_get( self, http_client_mock: HTTPClientMock ) -> None: - http_client_mock.stub_request( - "get", - "/v1/prices/search", - "query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.prices.search( - { - "query": "active:'true' AND metadata['order_id']:'6735'", - } - ) + stripe.financial_connections.Account.list() http_client_mock.assert_requested( "get", - path="/v1/prices/search", - query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", - api_base="https://api.stripe.com", - ) - - def test_products_delete(self, http_client_mock: HTTPClientMock) -> None: - stripe.Product.delete("prod_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "delete", - path="/v1/products/prod_xxxxxxxxxxxxx", + path="/v1/financial_connections/accounts", query_string="", ) - def test_products_delete_service( + def test_financial_connections_accounts_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/products/prod_xxxxxxxxxxxxx", + "get", + "/v1/financial_connections/accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.products.delete("prod_xxxxxxxxxxxxx") + client.financial_connections.accounts.list() http_client_mock.assert_requested( - "delete", - path="/v1/products/prod_xxxxxxxxxxxxx", + "get", + path="/v1/financial_connections/accounts", query_string="", api_base="https://api.stripe.com", ) - def test_products_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Product.list(limit=3) + @pytest.mark.anyio + async def test_financial_connections_accounts_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.financial_connections.Account.list_async() http_client_mock.assert_requested( "get", - path="/v1/products", - query_string="limit=3", + path="/v1/financial_connections/accounts", + query_string="", ) - def test_products_get_service( + @pytest.mark.anyio + async def test_financial_connections_accounts_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/products", - "limit=3", + "/v1/financial_connections/accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.products.list({"limit": 3}) + await client.financial_connections.accounts.list_async() http_client_mock.assert_requested( "get", - path="/v1/products", - query_string="limit=3", + path="/v1/financial_connections/accounts", + query_string="", api_base="https://api.stripe.com", ) - def test_products_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Product.retrieve("prod_xxxxxxxxxxxxx") + def test_financial_connections_accounts_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.retrieve("fca_xyz") http_client_mock.assert_requested( "get", - path="/v1/products/prod_xxxxxxxxxxxxx", + path="/v1/financial_connections/accounts/fca_xyz", query_string="", ) - def test_products_get_2_service( + def test_financial_connections_accounts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/products/prod_xxxxxxxxxxxxx", + "/v1/financial_connections/accounts/fca_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.products.retrieve("prod_xxxxxxxxxxxxx") + client.financial_connections.accounts.retrieve("fca_xyz") http_client_mock.assert_requested( "get", - path="/v1/products/prod_xxxxxxxxxxxxx", + path="/v1/financial_connections/accounts/fca_xyz", query_string="", api_base="https://api.stripe.com", ) - def test_products_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Product.create(name="Gold Special") + @pytest.mark.anyio + async def test_financial_connections_accounts_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.financial_connections.Account.retrieve_async("fca_xyz") http_client_mock.assert_requested( - "post", - path="/v1/products", + "get", + path="/v1/financial_connections/accounts/fca_xyz", query_string="", - post_data="name=Gold%20Special", ) - def test_products_post_service( + @pytest.mark.anyio + async def test_financial_connections_accounts_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/products", + "get", + "/v1/financial_connections/accounts/fca_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.products.create({"name": "Gold Special"}) + await client.financial_connections.accounts.retrieve_async("fca_xyz") http_client_mock.assert_requested( - "post", - path="/v1/products", + "get", + path="/v1/financial_connections/accounts/fca_xyz", query_string="", api_base="https://api.stripe.com", - post_data="name=Gold%20Special", ) - def test_products_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Product.modify( - "prod_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, + def test_financial_connections_accounts_get_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.list( + account_holder={"customer": "cus_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( - "post", - path="/v1/products/prod_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", + "get", + path="/v1/financial_connections/accounts", + query_string="account_holder[customer]=cus_xxxxxxxxxxxxx", ) - def test_products_post_2_service( + def test_financial_connections_accounts_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/products/prod_xxxxxxxxxxxxx", + "get", + "/v1/financial_connections/accounts", + "account_holder[customer]=cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.products.update( - "prod_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + client.financial_connections.accounts.list( + { + "account_holder": {"customer": "cus_xxxxxxxxxxxxx"}, + } ) http_client_mock.assert_requested( - "post", - path="/v1/products/prod_xxxxxxxxxxxxx", - query_string="", + "get", + path="/v1/financial_connections/accounts", + query_string="account_holder[customer]=cus_xxxxxxxxxxxxx", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_products_search_get( + @pytest.mark.anyio + async def test_financial_connections_accounts_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Product.search( - query="active:'true' AND metadata['order_id']:'6735'", + await stripe.financial_connections.Account.list_async( + account_holder={"customer": "cus_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "get", - path="/v1/products/search", - query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + path="/v1/financial_connections/accounts", + query_string="account_holder[customer]=cus_xxxxxxxxxxxxx", ) - def test_products_search_get_service( + @pytest.mark.anyio + async def test_financial_connections_accounts_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/products/search", - "query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + "/v1/financial_connections/accounts", + "account_holder[customer]=cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.products.search( + await client.financial_connections.accounts.list_async( { - "query": "active:'true' AND metadata['order_id']:'6735'", + "account_holder": {"customer": "cus_xxxxxxxxxxxxx"}, } ) http_client_mock.assert_requested( "get", - path="/v1/products/search", - query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + path="/v1/financial_connections/accounts", + query_string="account_holder[customer]=cus_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) - def test_promotion_codes_get( + def test_financial_connections_accounts_get_4( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PromotionCode.list(limit=3) + stripe.financial_connections.Account.retrieve("fca_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/promotion_codes", - query_string="limit=3", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", + query_string="", ) - def test_promotion_codes_get_service( + def test_financial_connections_accounts_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/promotion_codes", - "limit=3", + "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.promotion_codes.list({"limit": 3}) + client.financial_connections.accounts.retrieve("fca_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/promotion_codes", - query_string="limit=3", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_promotion_codes_get_2( + @pytest.mark.anyio + async def test_financial_connections_accounts_get_4_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PromotionCode.retrieve("promo_xxxxxxxxxxxxx") + await stripe.financial_connections.Account.retrieve_async( + "fca_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", query_string="", ) - def test_promotion_codes_get_2_service( + @pytest.mark.anyio + async def test_financial_connections_accounts_get_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/promotion_codes/promo_xxxxxxxxxxxxx", + "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.promotion_codes.retrieve("promo_xxxxxxxxxxxxx") + await client.financial_connections.accounts.retrieve_async( + "fca_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_promotion_codes_post( + def test_financial_connections_accounts_owners_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PromotionCode.create(coupon="Z4OV52SU") + stripe.financial_connections.Account.list_owners( + "fca_xyz", + ownership="fcaowns_xyz", + ) http_client_mock.assert_requested( - "post", - path="/v1/promotion_codes", - query_string="", - post_data="coupon=Z4OV52SU", + "get", + path="/v1/financial_connections/accounts/fca_xyz/owners", + query_string="ownership=fcaowns_xyz", ) - def test_promotion_codes_post_service( + def test_financial_connections_accounts_owners_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/promotion_codes", + "get", + "/v1/financial_connections/accounts/fca_xyz/owners", + "ownership=fcaowns_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.promotion_codes.create({"coupon": "Z4OV52SU"}) + client.financial_connections.accounts.owners.list( + "fca_xyz", + {"ownership": "fcaowns_xyz"}, + ) http_client_mock.assert_requested( - "post", - path="/v1/promotion_codes", - query_string="", + "get", + path="/v1/financial_connections/accounts/fca_xyz/owners", + query_string="ownership=fcaowns_xyz", api_base="https://api.stripe.com", - post_data="coupon=Z4OV52SU", ) - def test_promotion_codes_post_2( + @pytest.mark.anyio + async def test_financial_connections_accounts_owners_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PromotionCode.modify( - "promo_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, + await stripe.financial_connections.Account.list_owners_async( + "fca_xyz", + ownership="fcaowns_xyz", ) http_client_mock.assert_requested( - "post", - path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", + "get", + path="/v1/financial_connections/accounts/fca_xyz/owners", + query_string="ownership=fcaowns_xyz", ) - def test_promotion_codes_post_2_service( + @pytest.mark.anyio + async def test_financial_connections_accounts_owners_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/promotion_codes/promo_xxxxxxxxxxxxx", + "get", + "/v1/financial_connections/accounts/fca_xyz/owners", + "ownership=fcaowns_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.promotion_codes.update( - "promo_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + await client.financial_connections.accounts.owners.list_async( + "fca_xyz", + {"ownership": "fcaowns_xyz"}, ) http_client_mock.assert_requested( - "post", - path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", - query_string="", + "get", + path="/v1/financial_connections/accounts/fca_xyz/owners", + query_string="ownership=fcaowns_xyz", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_quotes_accept_post( + def test_financial_connections_accounts_owners_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Quote.accept("qt_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", - query_string="", + stripe.financial_connections.Account.list_owners( + "fca_xxxxxxxxxxxxx", + limit=3, + ownership="fcaowns_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", + query_string="limit=3&ownership=fcaowns_xxxxxxxxxxxxx", ) - def test_quotes_accept_post_service( + def test_financial_connections_accounts_owners_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/quotes/qt_xxxxxxxxxxxxx/accept", + "get", + "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", + "limit=3&ownership=fcaowns_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.accept("qt_xxxxxxxxxxxxx") + client.financial_connections.accounts.owners.list( + "fca_xxxxxxxxxxxxx", + {"limit": 3, "ownership": "fcaowns_xxxxxxxxxxxxx"}, + ) http_client_mock.assert_requested( - "post", - path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", - query_string="", + "get", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", + query_string="limit=3&ownership=fcaowns_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) - def test_quotes_cancel_post( + @pytest.mark.anyio + async def test_financial_connections_accounts_owners_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Quote.cancel("qt_xxxxxxxxxxxxx") + await stripe.financial_connections.Account.list_owners_async( + "fca_xxxxxxxxxxxxx", + limit=3, + ownership="fcaowns_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", - query_string="", + "get", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", + query_string="limit=3&ownership=fcaowns_xxxxxxxxxxxxx", ) - def test_quotes_cancel_post_service( + @pytest.mark.anyio + async def test_financial_connections_accounts_owners_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/quotes/qt_xxxxxxxxxxxxx/cancel", + "get", + "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", + "limit=3&ownership=fcaowns_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.cancel("qt_xxxxxxxxxxxxx") + await client.financial_connections.accounts.owners.list_async( + "fca_xxxxxxxxxxxxx", + {"limit": 3, "ownership": "fcaowns_xxxxxxxxxxxxx"}, + ) http_client_mock.assert_requested( - "post", - path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", - query_string="", + "get", + path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", + query_string="limit=3&ownership=fcaowns_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) - def test_quotes_finalize_post( + def test_financial_connections_accounts_refresh_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Quote.finalize_quote("qt_xxxxxxxxxxxxx") + stripe.financial_connections.Account.refresh_account( + "fca_xyz", + features=["balance"], + ) http_client_mock.assert_requested( "post", - path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", + path="/v1/financial_connections/accounts/fca_xyz/refresh", query_string="", + post_data="features[0]=balance", ) - def test_quotes_finalize_post_service( + def test_financial_connections_accounts_refresh_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/quotes/qt_xxxxxxxxxxxxx/finalize", + "/v1/financial_connections/accounts/fca_xyz/refresh", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.finalize_quote("qt_xxxxxxxxxxxxx") + client.financial_connections.accounts.refresh( + "fca_xyz", + {"features": ["balance"]}, + ) http_client_mock.assert_requested( "post", - path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", + path="/v1/financial_connections/accounts/fca_xyz/refresh", query_string="", api_base="https://api.stripe.com", + post_data="features[0]=balance", ) - def test_quotes_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Quote.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/quotes", - query_string="limit=3", - ) - - def test_quotes_get_service( + @pytest.mark.anyio + async def test_financial_connections_accounts_refresh_post_async( self, http_client_mock: HTTPClientMock ) -> None: - http_client_mock.stub_request( - "get", - "/v1/quotes", - "limit=3", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.quotes.list({"limit": 3}) - http_client_mock.assert_requested( - "get", - path="/v1/quotes", - query_string="limit=3", - api_base="https://api.stripe.com", + await stripe.financial_connections.Account.refresh_account_async( + "fca_xyz", + features=["balance"], ) - - def test_quotes_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Quote.retrieve("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/quotes/qt_xxxxxxxxxxxxx", + "post", + path="/v1/financial_connections/accounts/fca_xyz/refresh", query_string="", + post_data="features[0]=balance", ) - def test_quotes_get_2_service( + @pytest.mark.anyio + async def test_financial_connections_accounts_refresh_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/quotes/qt_xxxxxxxxxxxxx", + "post", + "/v1/financial_connections/accounts/fca_xyz/refresh", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.retrieve("qt_xxxxxxxxxxxxx") + await client.financial_connections.accounts.refresh_async( + "fca_xyz", + {"features": ["balance"]}, + ) http_client_mock.assert_requested( - "get", - path="/v1/quotes/qt_xxxxxxxxxxxxx", + "post", + path="/v1/financial_connections/accounts/fca_xyz/refresh", query_string="", api_base="https://api.stripe.com", + post_data="features[0]=balance", ) - def test_quotes_line_items_get( + def test_financial_connections_accounts_subscribe_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Quote.list_line_items("qt_xxxxxxxxxxxxx") + stripe.financial_connections.Account.subscribe( + "fa_123", + features=["transactions"], + ) http_client_mock.assert_requested( - "get", - path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", + "post", + path="/v1/financial_connections/accounts/fa_123/subscribe", query_string="", + post_data="features[0]=transactions", ) - def test_quotes_line_items_get_service( + def test_financial_connections_accounts_subscribe_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/quotes/qt_xxxxxxxxxxxxx/line_items", + "post", + "/v1/financial_connections/accounts/fa_123/subscribe", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.line_items.list("qt_xxxxxxxxxxxxx") + client.financial_connections.accounts.subscribe( + "fa_123", + {"features": ["transactions"]}, + ) http_client_mock.assert_requested( - "get", - path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", + "post", + path="/v1/financial_connections/accounts/fa_123/subscribe", query_string="", api_base="https://api.stripe.com", + post_data="features[0]=transactions", ) - def test_quotes_pdf_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Quote.pdf("qt_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_financial_connections_accounts_subscribe_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.financial_connections.Account.subscribe_async( + "fa_123", + features=["transactions"], + ) http_client_mock.assert_requested( - "get", - path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", + "post", + path="/v1/financial_connections/accounts/fa_123/subscribe", query_string="", + post_data="features[0]=transactions", ) - def test_quotes_pdf_get_service( + @pytest.mark.anyio + async def test_financial_connections_accounts_subscribe_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/quotes/qt_xxxxxxxxxxxxx/pdf", + "post", + "/v1/financial_connections/accounts/fa_123/subscribe", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.pdf("qt_xxxxxxxxxxxxx") + await client.financial_connections.accounts.subscribe_async( + "fa_123", + {"features": ["transactions"]}, + ) http_client_mock.assert_requested( - "get", - path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", + "post", + path="/v1/financial_connections/accounts/fa_123/subscribe", query_string="", - api_base="https://files.stripe.com", + api_base="https://api.stripe.com", + post_data="features[0]=transactions", ) - def test_quotes_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Quote.create( - customer="cus_xxxxxxxxxxxxx", - line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], + def test_financial_connections_accounts_unsubscribe_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.financial_connections.Account.unsubscribe( + "fa_123", + features=["transactions"], ) http_client_mock.assert_requested( "post", - path="/v1/quotes", + path="/v1/financial_connections/accounts/fa_123/unsubscribe", query_string="", - post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", + post_data="features[0]=transactions", ) - def test_quotes_post_service( + def test_financial_connections_accounts_unsubscribe_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/quotes", + "/v1/financial_connections/accounts/fa_123/unsubscribe", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.create( - { - "customer": "cus_xxxxxxxxxxxxx", - "line_items": [ - {"price": "price_xxxxxxxxxxxxx", "quantity": 2} - ], - } + client.financial_connections.accounts.unsubscribe( + "fa_123", + {"features": ["transactions"]}, ) http_client_mock.assert_requested( "post", - path="/v1/quotes", + path="/v1/financial_connections/accounts/fa_123/unsubscribe", query_string="", api_base="https://api.stripe.com", - post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", + post_data="features[0]=transactions", ) - def test_quotes_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Quote.modify( - "qt_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, + @pytest.mark.anyio + async def test_financial_connections_accounts_unsubscribe_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.financial_connections.Account.unsubscribe_async( + "fa_123", + features=["transactions"], ) http_client_mock.assert_requested( "post", - path="/v1/quotes/qt_xxxxxxxxxxxxx", + path="/v1/financial_connections/accounts/fa_123/unsubscribe", query_string="", - post_data="metadata[order_id]=6735", + post_data="features[0]=transactions", ) - def test_quotes_post_2_service( + @pytest.mark.anyio + async def test_financial_connections_accounts_unsubscribe_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/quotes/qt_xxxxxxxxxxxxx", + "/v1/financial_connections/accounts/fa_123/unsubscribe", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.update( - "qt_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + await client.financial_connections.accounts.unsubscribe_async( + "fa_123", + {"features": ["transactions"]}, ) http_client_mock.assert_requested( "post", - path="/v1/quotes/qt_xxxxxxxxxxxxx", + path="/v1/financial_connections/accounts/fa_123/unsubscribe", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", + post_data="features[0]=transactions", ) - def test_radar_early_fraud_warnings_get( + def test_financial_connections_sessions_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.radar.EarlyFraudWarning.list(limit=3) + stripe.financial_connections.Session.retrieve("fcsess_xyz") http_client_mock.assert_requested( "get", - path="/v1/radar/early_fraud_warnings", - query_string="limit=3", + path="/v1/financial_connections/sessions/fcsess_xyz", + query_string="", ) - def test_radar_early_fraud_warnings_get_service( + def test_financial_connections_sessions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/radar/early_fraud_warnings", - "limit=3", + "/v1/financial_connections/sessions/fcsess_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.radar.early_fraud_warnings.list({"limit": 3}) + client.financial_connections.sessions.retrieve("fcsess_xyz") http_client_mock.assert_requested( "get", - path="/v1/radar/early_fraud_warnings", - query_string="limit=3", + path="/v1/financial_connections/sessions/fcsess_xyz", + query_string="", api_base="https://api.stripe.com", ) - def test_radar_early_fraud_warnings_get_2( + @pytest.mark.anyio + async def test_financial_connections_sessions_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.radar.EarlyFraudWarning.retrieve("issfr_xxxxxxxxxxxxx") + await stripe.financial_connections.Session.retrieve_async("fcsess_xyz") http_client_mock.assert_requested( "get", - path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", + path="/v1/financial_connections/sessions/fcsess_xyz", query_string="", ) - def test_radar_early_fraud_warnings_get_2_service( + @pytest.mark.anyio + async def test_financial_connections_sessions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", + "/v1/financial_connections/sessions/fcsess_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.radar.early_fraud_warnings.retrieve("issfr_xxxxxxxxxxxxx") + await client.financial_connections.sessions.retrieve_async( + "fcsess_xyz" + ) http_client_mock.assert_requested( "get", - path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", + path="/v1/financial_connections/sessions/fcsess_xyz", query_string="", api_base="https://api.stripe.com", ) - def test_radar_value_list_items_delete( + def test_financial_connections_sessions_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.radar.ValueListItem.delete("rsli_xxxxxxxxxxxxx") + stripe.financial_connections.Session.retrieve("fcsess_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + "get", + path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", query_string="", ) - def test_radar_value_list_items_delete_service( + def test_financial_connections_sessions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + "get", + "/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_list_items.delete("rsli_xxxxxxxxxxxxx") + client.financial_connections.sessions.retrieve("fcsess_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + "get", + path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_radar_value_list_items_get( + @pytest.mark.anyio + async def test_financial_connections_sessions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.radar.ValueListItem.list( - limit=3, - value_list="rsl_xxxxxxxxxxxxx", + await stripe.financial_connections.Session.retrieve_async( + "fcsess_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", - path="/v1/radar/value_list_items", - query_string="limit=3&value_list=rsl_xxxxxxxxxxxxx", + path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", + query_string="", ) - def test_radar_value_list_items_get_service( + @pytest.mark.anyio + async def test_financial_connections_sessions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/radar/value_list_items", - "limit=3&value_list=rsl_xxxxxxxxxxxxx", + "/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_list_items.list( - { - "limit": 3, - "value_list": "rsl_xxxxxxxxxxxxx", - } + await client.financial_connections.sessions.retrieve_async( + "fcsess_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", - path="/v1/radar/value_list_items", - query_string="limit=3&value_list=rsl_xxxxxxxxxxxxx", + path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_radar_value_list_items_get_2( + def test_financial_connections_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.radar.ValueListItem.retrieve("rsli_xxxxxxxxxxxxx") + stripe.financial_connections.Session.create( + account_holder={"type": "customer", "customer": "cus_123"}, + permissions=["balances"], + ) http_client_mock.assert_requested( - "get", - path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + "post", + path="/v1/financial_connections/sessions", query_string="", + post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", ) - def test_radar_value_list_items_get_2_service( + def test_financial_connections_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + "post", + "/v1/financial_connections/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_list_items.retrieve("rsli_xxxxxxxxxxxxx") + client.financial_connections.sessions.create( + { + "account_holder": {"type": "customer", "customer": "cus_123"}, + "permissions": ["balances"], + } + ) http_client_mock.assert_requested( - "get", - path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + "post", + path="/v1/financial_connections/sessions", query_string="", api_base="https://api.stripe.com", + post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", ) - def test_radar_value_list_items_post( + @pytest.mark.anyio + async def test_financial_connections_sessions_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.radar.ValueListItem.create( - value_list="rsl_xxxxxxxxxxxxx", - value="1.2.3.4", + await stripe.financial_connections.Session.create_async( + account_holder={"type": "customer", "customer": "cus_123"}, + permissions=["balances"], ) http_client_mock.assert_requested( "post", - path="/v1/radar/value_list_items", + path="/v1/financial_connections/sessions", query_string="", - post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", + post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", ) - def test_radar_value_list_items_post_service( + @pytest.mark.anyio + async def test_financial_connections_sessions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/radar/value_list_items", + "/v1/financial_connections/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_list_items.create( + await client.financial_connections.sessions.create_async( { - "value_list": "rsl_xxxxxxxxxxxxx", - "value": "1.2.3.4", + "account_holder": {"type": "customer", "customer": "cus_123"}, + "permissions": ["balances"], } ) http_client_mock.assert_requested( "post", - path="/v1/radar/value_list_items", + path="/v1/financial_connections/sessions", query_string="", api_base="https://api.stripe.com", - post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", + post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", ) - def test_radar_value_lists_delete( + def test_financial_connections_sessions_post_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.radar.ValueList.delete("rsl_xxxxxxxxxxxxx") + stripe.financial_connections.Session.create( + account_holder={ + "type": "customer", + "customer": "cus_xxxxxxxxxxxxx", + }, + permissions=["payment_method", "balances"], + filters={"countries": ["US"]}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + "post", + path="/v1/financial_connections/sessions", query_string="", + post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", ) - def test_radar_value_lists_delete_service( + def test_financial_connections_sessions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + "post", + "/v1/financial_connections/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_lists.delete("rsl_xxxxxxxxxxxxx") + client.financial_connections.sessions.create( + { + "account_holder": { + "type": "customer", + "customer": "cus_xxxxxxxxxxxxx", + }, + "permissions": ["payment_method", "balances"], + "filters": {"countries": ["US"]}, + } + ) http_client_mock.assert_requested( - "delete", - path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + "post", + path="/v1/financial_connections/sessions", query_string="", api_base="https://api.stripe.com", + post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", ) - def test_radar_value_lists_get( + @pytest.mark.anyio + async def test_financial_connections_sessions_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.radar.ValueList.list(limit=3) + await stripe.financial_connections.Session.create_async( + account_holder={ + "type": "customer", + "customer": "cus_xxxxxxxxxxxxx", + }, + permissions=["payment_method", "balances"], + filters={"countries": ["US"]}, + ) http_client_mock.assert_requested( - "get", - path="/v1/radar/value_lists", - query_string="limit=3", + "post", + path="/v1/financial_connections/sessions", + query_string="", + post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", ) - def test_radar_value_lists_get_service( + @pytest.mark.anyio + async def test_financial_connections_sessions_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/radar/value_lists", - "limit=3", + "post", + "/v1/financial_connections/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_lists.list({"limit": 3}) + await client.financial_connections.sessions.create_async( + { + "account_holder": { + "type": "customer", + "customer": "cus_xxxxxxxxxxxxx", + }, + "permissions": ["payment_method", "balances"], + "filters": {"countries": ["US"]}, + } + ) http_client_mock.assert_requested( - "get", - path="/v1/radar/value_lists", - query_string="limit=3", + "post", + path="/v1/financial_connections/sessions", + query_string="", api_base="https://api.stripe.com", + post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", ) - def test_radar_value_lists_get_2( + def test_financial_connections_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.radar.ValueList.retrieve("rsl_xxxxxxxxxxxxx") + stripe.financial_connections.Transaction.retrieve("tr_123") http_client_mock.assert_requested( "get", - path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + path="/v1/financial_connections/transactions/tr_123", query_string="", ) - def test_radar_value_lists_get_2_service( + def test_financial_connections_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + "/v1/financial_connections/transactions/tr_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_lists.retrieve("rsl_xxxxxxxxxxxxx") + client.financial_connections.transactions.retrieve("tr_123") http_client_mock.assert_requested( "get", - path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + path="/v1/financial_connections/transactions/tr_123", query_string="", api_base="https://api.stripe.com", ) - def test_radar_value_lists_post( + @pytest.mark.anyio + async def test_financial_connections_transactions_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.radar.ValueList.create( - alias="custom_ip_xxxxxxxxxxxxx", - name="Custom IP Blocklist", - item_type="ip_address", - ) + await stripe.financial_connections.Transaction.retrieve_async("tr_123") http_client_mock.assert_requested( - "post", - path="/v1/radar/value_lists", + "get", + path="/v1/financial_connections/transactions/tr_123", query_string="", - post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", ) - def test_radar_value_lists_post_service( + @pytest.mark.anyio + async def test_financial_connections_transactions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/radar/value_lists", + "get", + "/v1/financial_connections/transactions/tr_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_lists.create( - { - "alias": "custom_ip_xxxxxxxxxxxxx", - "name": "Custom IP Blocklist", - "item_type": "ip_address", - } + await client.financial_connections.transactions.retrieve_async( + "tr_123" ) http_client_mock.assert_requested( - "post", - path="/v1/radar/value_lists", + "get", + path="/v1/financial_connections/transactions/tr_123", query_string="", api_base="https://api.stripe.com", - post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", ) - def test_radar_value_lists_post_2( + def test_financial_connections_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.radar.ValueList.modify( - "rsl_xxxxxxxxxxxxx", - name="Updated IP Block List", - ) + stripe.financial_connections.Transaction.list(account="fca_xyz") http_client_mock.assert_requested( - "post", - path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", - query_string="", - post_data="name=Updated%20IP%20Block%20List", + "get", + path="/v1/financial_connections/transactions", + query_string="account=fca_xyz", ) - def test_radar_value_lists_post_2_service( + def test_financial_connections_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + "get", + "/v1/financial_connections/transactions", + "account=fca_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_lists.update( - "rsl_xxxxxxxxxxxxx", - {"name": "Updated IP Block List"}, - ) + client.financial_connections.transactions.list({"account": "fca_xyz"}) http_client_mock.assert_requested( - "post", - path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", - query_string="", - api_base="https://api.stripe.com", - post_data="name=Updated%20IP%20Block%20List", + "get", + path="/v1/financial_connections/transactions", + query_string="account=fca_xyz", + api_base="https://api.stripe.com", ) - def test_refunds_cancel_post( + @pytest.mark.anyio + async def test_financial_connections_transactions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Refund.cancel("re_xxxxxxxxxxxxx") + await stripe.financial_connections.Transaction.list_async( + account="fca_xyz", + ) http_client_mock.assert_requested( - "post", - path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", - query_string="", + "get", + path="/v1/financial_connections/transactions", + query_string="account=fca_xyz", ) - def test_refunds_cancel_post_service( + @pytest.mark.anyio + async def test_financial_connections_transactions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/refunds/re_xxxxxxxxxxxxx/cancel", + "get", + "/v1/financial_connections/transactions", + "account=fca_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.refunds.cancel("re_xxxxxxxxxxxxx") + await client.financial_connections.transactions.list_async( + { + "account": "fca_xyz", + } + ) http_client_mock.assert_requested( - "post", - path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", - query_string="", + "get", + path="/v1/financial_connections/transactions", + query_string="account=fca_xyz", api_base="https://api.stripe.com", ) - def test_refunds_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Refund.list(limit=3) + def test_identity_verification_reports_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.identity.VerificationReport.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/refunds", + path="/v1/identity/verification_reports", query_string="limit=3", ) - def test_refunds_get_service( + def test_identity_verification_reports_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/refunds", + "/v1/identity/verification_reports", "limit=3", ) client = StripeClient( @@ -9298,707 +10073,632 @@ def test_refunds_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.refunds.list({"limit": 3}) + client.identity.verification_reports.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/refunds", + path="/v1/identity/verification_reports", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_refunds_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Refund.retrieve("re_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_identity_verification_reports_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.identity.VerificationReport.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/refunds/re_xxxxxxxxxxxxx", - query_string="", + path="/v1/identity/verification_reports", + query_string="limit=3", ) - def test_refunds_get_2_service( + @pytest.mark.anyio + async def test_identity_verification_reports_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/refunds/re_xxxxxxxxxxxxx", + "/v1/identity/verification_reports", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.refunds.retrieve("re_xxxxxxxxxxxxx") + await client.identity.verification_reports.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/refunds/re_xxxxxxxxxxxxx", - query_string="", + path="/v1/identity/verification_reports", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_refunds_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Refund.create(charge="ch_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/refunds", - query_string="", - post_data="charge=ch_xxxxxxxxxxxxx", - ) - - def test_refunds_post_service( + def test_identity_verification_reports_get_2( self, http_client_mock: HTTPClientMock ) -> None: - http_client_mock.stub_request( - "post", - "/v1/refunds", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.refunds.create({"charge": "ch_xxxxxxxxxxxxx"}) - http_client_mock.assert_requested( - "post", - path="/v1/refunds", - query_string="", - api_base="https://api.stripe.com", - post_data="charge=ch_xxxxxxxxxxxxx", - ) - - def test_refunds_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Refund.modify( - "re_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + stripe.identity.VerificationReport.retrieve("vr_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/refunds/re_xxxxxxxxxxxxx", + "get", + path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", query_string="", - post_data="metadata[order_id]=6735", ) - def test_refunds_post_2_service( + def test_identity_verification_reports_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/refunds/re_xxxxxxxxxxxxx", + "get", + "/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.refunds.update( - "re_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + client.identity.verification_reports.retrieve("vr_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/refunds/re_xxxxxxxxxxxxx", + "get", + path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_reporting_report_runs_get( + @pytest.mark.anyio + async def test_identity_verification_reports_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.reporting.ReportRun.list(limit=3) + await stripe.identity.VerificationReport.retrieve_async( + "vr_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/reporting/report_runs", - query_string="limit=3", + path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", + query_string="", ) - def test_reporting_report_runs_get_service( + @pytest.mark.anyio + async def test_identity_verification_reports_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/reporting/report_runs", - "limit=3", + "/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.reporting.report_runs.list({"limit": 3}) + await client.identity.verification_reports.retrieve_async( + "vr_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/reporting/report_runs", - query_string="limit=3", + path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_reporting_report_runs_get_2( + def test_identity_verification_sessions_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.reporting.ReportRun.retrieve("frr_xxxxxxxxxxxxx") + stripe.identity.VerificationSession.cancel("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", + "post", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", query_string="", ) - def test_reporting_report_runs_get_2_service( + def test_identity_verification_sessions_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", + "post", + "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.reporting.report_runs.retrieve("frr_xxxxxxxxxxxxx") + client.identity.verification_sessions.cancel("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", + "post", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) - def test_reporting_report_runs_post( + @pytest.mark.anyio + async def test_identity_verification_sessions_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.reporting.ReportRun.create( - report_type="balance.summary.1", - parameters={ - "interval_start": 1522540800, - "interval_end": 1525132800, - }, + await stripe.identity.VerificationSession.cancel_async( + "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", - path="/v1/reporting/report_runs", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", query_string="", - post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", ) - def test_reporting_report_runs_post_service( + @pytest.mark.anyio + async def test_identity_verification_sessions_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/reporting/report_runs", + "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.reporting.report_runs.create( - { - "report_type": "balance.summary.1", - "parameters": { - "interval_start": 1522540800, - "interval_end": 1525132800, - }, - } + await client.identity.verification_sessions.cancel_async( + "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", - path="/v1/reporting/report_runs", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", - post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", ) - def test_reporting_report_types_get( + def test_identity_verification_sessions_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.reporting.ReportType.list() + stripe.identity.VerificationSession.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/reporting/report_types", - query_string="", + path="/v1/identity/verification_sessions", + query_string="limit=3", ) - def test_reporting_report_types_get_service( + def test_identity_verification_sessions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/reporting/report_types", + "/v1/identity/verification_sessions", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.reporting.report_types.list() + client.identity.verification_sessions.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/reporting/report_types", - query_string="", + path="/v1/identity/verification_sessions", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_reporting_report_types_get_2( + @pytest.mark.anyio + async def test_identity_verification_sessions_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.reporting.ReportType.retrieve("balance.summary.1") + await stripe.identity.VerificationSession.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/reporting/report_types/balance.summary.1", - query_string="", + path="/v1/identity/verification_sessions", + query_string="limit=3", ) - def test_reporting_report_types_get_2_service( + @pytest.mark.anyio + async def test_identity_verification_sessions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/reporting/report_types/balance.summary.1", + "/v1/identity/verification_sessions", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.reporting.report_types.retrieve("balance.summary.1") + await client.identity.verification_sessions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/reporting/report_types/balance.summary.1", - query_string="", + path="/v1/identity/verification_sessions", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_reviews_approve_post( + def test_identity_verification_sessions_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Review.approve("prv_xxxxxxxxxxxxx") + stripe.identity.VerificationSession.retrieve("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", + "get", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", ) - def test_reviews_approve_post_service( + def test_identity_verification_sessions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/reviews/prv_xxxxxxxxxxxxx/approve", + "get", + "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.reviews.approve("prv_xxxxxxxxxxxxx") + client.identity.verification_sessions.retrieve("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", + "get", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_reviews_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Review.list(limit=3) + @pytest.mark.anyio + async def test_identity_verification_sessions_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.identity.VerificationSession.retrieve_async( + "vs_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/reviews", - query_string="limit=3", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", + query_string="", ) - def test_reviews_get_service( + @pytest.mark.anyio + async def test_identity_verification_sessions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/reviews", - "limit=3", + "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.reviews.list({"limit": 3}) + await client.identity.verification_sessions.retrieve_async( + "vs_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/reviews", - query_string="limit=3", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_reviews_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Review.retrieve("prv_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/reviews/prv_xxxxxxxxxxxxx", - query_string="", - ) - - def test_reviews_get_2_service( + def test_identity_verification_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: - http_client_mock.stub_request( - "get", - "/v1/reviews/prv_xxxxxxxxxxxxx", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.reviews.retrieve("prv_xxxxxxxxxxxxx") + stripe.identity.VerificationSession.create(type="document") http_client_mock.assert_requested( - "get", - path="/v1/reviews/prv_xxxxxxxxxxxxx", + "post", + path="/v1/identity/verification_sessions", query_string="", - api_base="https://api.stripe.com", - ) - - def test_setup_attempts_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SetupAttempt.list( - limit=3, - setup_intent="si_xyz", - ) - http_client_mock.assert_requested( - "get", - path="/v1/setup_attempts", - query_string="limit=3&setup_intent=si_xyz", + post_data="type=document", ) - def test_setup_attempts_get_service( + def test_identity_verification_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/setup_attempts", - "limit=3&setup_intent=si_xyz", + "post", + "/v1/identity/verification_sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.setup_attempts.list({"limit": 3, "setup_intent": "si_xyz"}) + client.identity.verification_sessions.create({"type": "document"}) http_client_mock.assert_requested( - "get", - path="/v1/setup_attempts", - query_string="limit=3&setup_intent=si_xyz", + "post", + path="/v1/identity/verification_sessions", + query_string="", api_base="https://api.stripe.com", + post_data="type=document", ) - def test_setup_intents_cancel_post( + @pytest.mark.anyio + async def test_identity_verification_sessions_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SetupIntent.cancel("seti_xxxxxxxxxxxxx") + await stripe.identity.VerificationSession.create_async(type="document") http_client_mock.assert_requested( "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", + path="/v1/identity/verification_sessions", query_string="", + post_data="type=document", ) - def test_setup_intents_cancel_post_service( + @pytest.mark.anyio + async def test_identity_verification_sessions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", + "/v1/identity/verification_sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.cancel("seti_xxxxxxxxxxxxx") + await client.identity.verification_sessions.create_async( + { + "type": "document", + } + ) http_client_mock.assert_requested( "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", + path="/v1/identity/verification_sessions", query_string="", api_base="https://api.stripe.com", + post_data="type=document", ) - def test_setup_intents_confirm_post( + def test_identity_verification_sessions_post_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SetupIntent.confirm( - "seti_xxxxxxxxxxxxx", - payment_method="pm_card_visa", + stripe.identity.VerificationSession.modify( + "vs_xxxxxxxxxxxxx", + type="id_number", ) http_client_mock.assert_requested( "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", - post_data="payment_method=pm_card_visa", + post_data="type=id_number", ) - def test_setup_intents_confirm_post_service( + def test_identity_verification_sessions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", + "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.confirm( - "seti_xxxxxxxxxxxxx", - {"payment_method": "pm_card_visa"}, + client.identity.verification_sessions.update( + "vs_xxxxxxxxxxxxx", + {"type": "id_number"}, ) http_client_mock.assert_requested( "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="payment_method=pm_card_visa", - ) - - def test_setup_intents_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.SetupIntent.list(limit=3) - http_client_mock.assert_requested( - "get", - path="/v1/setup_intents", - query_string="limit=3", + post_data="type=id_number", ) - def test_setup_intents_get_service( + @pytest.mark.anyio + async def test_identity_verification_sessions_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - http_client_mock.stub_request( - "get", - "/v1/setup_intents", - "limit=3", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.setup_intents.list({"limit": 3}) - http_client_mock.assert_requested( - "get", - path="/v1/setup_intents", - query_string="limit=3", - api_base="https://api.stripe.com", + await stripe.identity.VerificationSession.modify_async( + "vs_xxxxxxxxxxxxx", + type="id_number", ) - - def test_setup_intents_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SetupIntent.retrieve("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + "post", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", + post_data="type=id_number", ) - def test_setup_intents_get_2_service( + @pytest.mark.anyio + async def test_identity_verification_sessions_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/setup_intents/seti_xxxxxxxxxxxxx", + "post", + "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.retrieve("seti_xxxxxxxxxxxxx") + await client.identity.verification_sessions.update_async( + "vs_xxxxxxxxxxxxx", + {"type": "id_number"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + "post", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="type=id_number", ) - def test_setup_intents_post( + def test_identity_verification_sessions_redact_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SetupIntent.create(payment_method_types=["card"]) + stripe.identity.VerificationSession.redact("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/setup_intents", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", query_string="", - post_data="payment_method_types[0]=card", ) - def test_setup_intents_post_service( + def test_identity_verification_sessions_redact_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/setup_intents", + "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.create({"payment_method_types": ["card"]}) + client.identity.verification_sessions.redact("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/setup_intents", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", query_string="", api_base="https://api.stripe.com", - post_data="payment_method_types[0]=card", ) - def test_setup_intents_post_2( + @pytest.mark.anyio + async def test_identity_verification_sessions_redact_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SetupIntent.modify( - "seti_xxxxxxxxxxxxx", - metadata={"user_id": "3435453"}, + await stripe.identity.VerificationSession.redact_async( + "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", query_string="", - post_data="metadata[user_id]=3435453", ) - def test_setup_intents_post_2_service( + @pytest.mark.anyio + async def test_identity_verification_sessions_redact_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/setup_intents/seti_xxxxxxxxxxxxx", + "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.update( - "seti_xxxxxxxxxxxxx", - {"metadata": {"user_id": "3435453"}}, + await client.identity.verification_sessions.redact_async( + "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", query_string="", api_base="https://api.stripe.com", - post_data="metadata[user_id]=3435453", ) - def test_setup_intents_verify_microdeposits_post( + def test_invoiceitems_delete( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SetupIntent.verify_microdeposits("seti_xxxxxxxxxxxxx") + stripe.InvoiceItem.delete("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + "delete", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", ) - def test_setup_intents_verify_microdeposits_post_service( + def test_invoiceitems_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + "delete", + "/v1/invoiceitems/ii_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.verify_microdeposits("seti_xxxxxxxxxxxxx") + client.invoice_items.delete("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + "delete", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_setup_intents_verify_microdeposits_post_2( + @pytest.mark.anyio + async def test_invoiceitems_delete_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SetupIntent.verify_microdeposits( - "seti_xxxxxxxxxxxxx", - amounts=[32, 45], - ) + await stripe.InvoiceItem.delete_async("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + "delete", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", - post_data="amounts[0]=32&amounts[1]=45", ) - def test_setup_intents_verify_microdeposits_post_2_service( + @pytest.mark.anyio + async def test_invoiceitems_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + "delete", + "/v1/invoiceitems/ii_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.verify_microdeposits( - "seti_xxxxxxxxxxxxx", - {"amounts": [32, 45]}, - ) + await client.invoice_items.delete_async("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + "delete", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="amounts[0]=32&amounts[1]=45", ) - def test_shipping_rates_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ShippingRate.list() + def test_invoiceitems_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.InvoiceItem.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/shipping_rates", - query_string="", + path="/v1/invoiceitems", + query_string="limit=3", ) - def test_shipping_rates_get_service( + def test_invoiceitems_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/shipping_rates", + "/v1/invoiceitems", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.shipping_rates.list() + client.invoice_items.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/shipping_rates", - query_string="", + path="/v1/invoiceitems", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_shipping_rates_get_2( + @pytest.mark.anyio + async def test_invoiceitems_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.ShippingRate.list(limit=3) + await stripe.InvoiceItem.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/shipping_rates", + path="/v1/invoiceitems", query_string="limit=3", ) - def test_shipping_rates_get_2_service( + @pytest.mark.anyio + async def test_invoiceitems_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/shipping_rates", + "/v1/invoiceitems", "limit=3", ) client = StripeClient( @@ -10006,1293 +10706,1257 @@ def test_shipping_rates_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.shipping_rates.list({"limit": 3}) + await client.invoice_items.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/shipping_rates", + path="/v1/invoiceitems", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_shipping_rates_get_3( + def test_invoiceitems_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.ShippingRate.retrieve("shr_xxxxxxxxxxxxx") + stripe.InvoiceItem.retrieve("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", ) - def test_shipping_rates_get_3_service( + def test_invoiceitems_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/shipping_rates/shr_xxxxxxxxxxxxx", + "/v1/invoiceitems/ii_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.shipping_rates.retrieve("shr_xxxxxxxxxxxxx") + client.invoice_items.retrieve("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_shipping_rates_post( + @pytest.mark.anyio + async def test_invoiceitems_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.ShippingRate.create( - display_name="Sample Shipper", - fixed_amount={"currency": "usd", "amount": 400}, - type="fixed_amount", - ) + await stripe.InvoiceItem.retrieve_async("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/shipping_rates", + "get", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", - post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", ) - def test_shipping_rates_post_service( + @pytest.mark.anyio + async def test_invoiceitems_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/shipping_rates", + "get", + "/v1/invoiceitems/ii_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.shipping_rates.create( - { - "display_name": "Sample Shipper", - "fixed_amount": {"currency": "usd", "amount": 400}, - "type": "fixed_amount", - } - ) + await client.invoice_items.retrieve_async("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/shipping_rates", + "get", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", ) - def test_shipping_rates_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.ShippingRate.create( - display_name="Ground shipping", - type="fixed_amount", - fixed_amount={"amount": 500, "currency": "usd"}, + def test_invoiceitems_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.InvoiceItem.create( + customer="cus_xxxxxxxxxxxxx", + price="price_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", - path="/v1/shipping_rates", + path="/v1/invoiceitems", query_string="", - post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", + post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", ) - def test_shipping_rates_post_2_service( + def test_invoiceitems_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/shipping_rates", + "/v1/invoiceitems", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.shipping_rates.create( + client.invoice_items.create( { - "display_name": "Ground shipping", - "type": "fixed_amount", - "fixed_amount": {"amount": 500, "currency": "usd"}, + "customer": "cus_xxxxxxxxxxxxx", + "price": "price_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", - path="/v1/shipping_rates", + path="/v1/invoiceitems", query_string="", api_base="https://api.stripe.com", - post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", + post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", ) - def test_shipping_rates_post_3( + @pytest.mark.anyio + async def test_invoiceitems_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.ShippingRate.modify( - "shr_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, + await stripe.InvoiceItem.create_async( + customer="cus_xxxxxxxxxxxxx", + price="price_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", - path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + path="/v1/invoiceitems", query_string="", - post_data="metadata[order_id]=6735", + post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", ) - def test_shipping_rates_post_3_service( + @pytest.mark.anyio + async def test_invoiceitems_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/shipping_rates/shr_xxxxxxxxxxxxx", + "/v1/invoiceitems", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.shipping_rates.update( - "shr_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + await client.invoice_items.create_async( + { + "customer": "cus_xxxxxxxxxxxxx", + "price": "price_xxxxxxxxxxxxx", + } ) http_client_mock.assert_requested( "post", - path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + path="/v1/invoiceitems", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", + post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", ) - def test_sigma_scheduled_query_runs_get( + def test_invoiceitems_post_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.sigma.ScheduledQueryRun.list(limit=3) + stripe.InvoiceItem.modify( + "ii_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/sigma/scheduled_query_runs", - query_string="limit=3", + "post", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", ) - def test_sigma_scheduled_query_runs_get_service( + def test_invoiceitems_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/sigma/scheduled_query_runs", - "limit=3", + "post", + "/v1/invoiceitems/ii_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.sigma.scheduled_query_runs.list({"limit": 3}) + client.invoice_items.update( + "ii_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "get", - path="/v1/sigma/scheduled_query_runs", - query_string="limit=3", + "post", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_sigma_scheduled_query_runs_get_2( + @pytest.mark.anyio + async def test_invoiceitems_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.sigma.ScheduledQueryRun.retrieve("sqr_xxxxxxxxxxxxx") + await stripe.InvoiceItem.modify_async( + "ii_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", + "post", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_sigma_scheduled_query_runs_get_2_service( + @pytest.mark.anyio + async def test_invoiceitems_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", + "post", + "/v1/invoiceitems/ii_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.sigma.scheduled_query_runs.retrieve("sqr_xxxxxxxxxxxxx") + await client.invoice_items.update_async( + "ii_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "get", - path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", + "post", + path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_sources_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Source.retrieve("src_xxxxxxxxxxxxx") + def test_invoices_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.delete("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/sources/src_xxxxxxxxxxxxx", + "delete", + path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", ) - def test_sources_get_service( + def test_invoices_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/sources/src_xxxxxxxxxxxxx", + "delete", + "/v1/invoices/in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.sources.retrieve("src_xxxxxxxxxxxxx") + client.invoices.delete("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/sources/src_xxxxxxxxxxxxx", + "delete", + path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_sources_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Source.retrieve("src_xxxxxxxxxxxxx") + @pytest.mark.anyio + async def test_invoices_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Invoice.delete_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/sources/src_xxxxxxxxxxxxx", + "delete", + path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", ) - def test_sources_get_2_service( + @pytest.mark.anyio + async def test_invoices_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/sources/src_xxxxxxxxxxxxx", + "delete", + "/v1/invoices/in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.sources.retrieve("src_xxxxxxxxxxxxx") + await client.invoices.delete_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/sources/src_xxxxxxxxxxxxx", + "delete", + path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_sources_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Source.modify( - "src_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + def test_invoices_finalize_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Invoice.finalize_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/sources/src_xxxxxxxxxxxxx", + path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", query_string="", - post_data="metadata[order_id]=6735", ) - def test_sources_post_service( + def test_invoices_finalize_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/sources/src_xxxxxxxxxxxxx", + "/v1/invoices/in_xxxxxxxxxxxxx/finalize", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.sources.update( - "src_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + client.invoices.finalize_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/sources/src_xxxxxxxxxxxxx", + path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_subscription_items_delete( + @pytest.mark.anyio + async def test_invoices_finalize_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SubscriptionItem.delete("si_xxxxxxxxxxxxx") + await stripe.Invoice.finalize_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/subscription_items/si_xxxxxxxxxxxxx", + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", query_string="", ) - def test_subscription_items_delete_service( + @pytest.mark.anyio + async def test_invoices_finalize_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/subscription_items/si_xxxxxxxxxxxxx", + "post", + "/v1/invoices/in_xxxxxxxxxxxxx/finalize", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_items.delete("si_xxxxxxxxxxxxx") + await client.invoices.finalize_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/subscription_items/si_xxxxxxxxxxxxx", + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", query_string="", api_base="https://api.stripe.com", ) - def test_subscription_items_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionItem.list(subscription="sub_xxxxxxxxxxxxx") + def test_invoices_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/subscription_items", - query_string="subscription=sub_xxxxxxxxxxxxx", + path="/v1/invoices", + query_string="limit=3", ) - def test_subscription_items_get_service( + def test_invoices_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/subscription_items", - "subscription=sub_xxxxxxxxxxxxx", + "/v1/invoices", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_items.list({"subscription": "sub_xxxxxxxxxxxxx"}) + client.invoices.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/subscription_items", - query_string="subscription=sub_xxxxxxxxxxxxx", + path="/v1/invoices", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_subscription_items_get_2( + @pytest.mark.anyio + async def test_invoices_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SubscriptionItem.retrieve("si_xxxxxxxxxxxxx") + await stripe.Invoice.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/subscription_items/si_xxxxxxxxxxxxx", - query_string="", + path="/v1/invoices", + query_string="limit=3", ) - def test_subscription_items_get_2_service( + @pytest.mark.anyio + async def test_invoices_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/subscription_items/si_xxxxxxxxxxxxx", + "/v1/invoices", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_items.retrieve("si_xxxxxxxxxxxxx") + await client.invoices.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/subscription_items/si_xxxxxxxxxxxxx", - query_string="", + path="/v1/invoices", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_subscription_items_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionItem.create( - subscription="sub_xxxxxxxxxxxxx", - price="price_xxxxxxxxxxxxx", - quantity=2, - ) + def test_invoices_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.retrieve("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/subscription_items", + "get", + path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", - post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", ) - def test_subscription_items_post_service( + def test_invoices_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/subscription_items", + "get", + "/v1/invoices/in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_items.create( - { - "subscription": "sub_xxxxxxxxxxxxx", - "price": "price_xxxxxxxxxxxxx", - "quantity": 2, - } - ) + client.invoices.retrieve("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/subscription_items", + "get", + path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", ) - def test_subscription_items_post_2( + @pytest.mark.anyio + async def test_invoices_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SubscriptionItem.modify( - "si_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + await stripe.Invoice.retrieve_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/subscription_items/si_xxxxxxxxxxxxx", + "get", + path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", - post_data="metadata[order_id]=6735", ) - def test_subscription_items_post_2_service( + @pytest.mark.anyio + async def test_invoices_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/subscription_items/si_xxxxxxxxxxxxx", + "get", + "/v1/invoices/in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_items.update( - "si_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + await client.invoices.retrieve_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/subscription_items/si_xxxxxxxxxxxxx", + "get", + path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_subscription_items_usage_record_summaries_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionItem.list_usage_record_summaries( - "si_xxxxxxxxxxxxx", - limit=3, + def test_invoices_get_3(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.retrieve( + "in_xxxxxxxxxxxxx", + expand=["customer"], ) http_client_mock.assert_requested( "get", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", - query_string="limit=3", + path="/v1/invoices/in_xxxxxxxxxxxxx", + query_string="expand[0]=customer", ) - def test_subscription_items_usage_record_summaries_get_service( + def test_invoices_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", - "limit=3", + "/v1/invoices/in_xxxxxxxxxxxxx", + "expand[0]=customer", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_items.usage_record_summaries.list( - "si_xxxxxxxxxxxxx", - {"limit": 3}, + client.invoices.retrieve( + "in_xxxxxxxxxxxxx", + {"expand": ["customer"]}, ) http_client_mock.assert_requested( "get", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", - query_string="limit=3", + path="/v1/invoices/in_xxxxxxxxxxxxx", + query_string="expand[0]=customer", api_base="https://api.stripe.com", ) - def test_subscription_items_usage_records_post( + @pytest.mark.anyio + async def test_invoices_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SubscriptionItem.create_usage_record( - "si_xxxxxxxxxxxxx", - quantity=100, - timestamp=1571252444, + await stripe.Invoice.retrieve_async( + "in_xxxxxxxxxxxxx", + expand=["customer"], ) http_client_mock.assert_requested( - "post", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", - query_string="", - post_data="quantity=100×tamp=1571252444", + "get", + path="/v1/invoices/in_xxxxxxxxxxxxx", + query_string="expand[0]=customer", ) - def test_subscription_items_usage_records_post_service( + @pytest.mark.anyio + async def test_invoices_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", + "get", + "/v1/invoices/in_xxxxxxxxxxxxx", + "expand[0]=customer", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_items.usage_records.create( - "si_xxxxxxxxxxxxx", - {"quantity": 100, "timestamp": 1571252444}, + await client.invoices.retrieve_async( + "in_xxxxxxxxxxxxx", + {"expand": ["customer"]}, ) http_client_mock.assert_requested( - "post", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", - query_string="", + "get", + path="/v1/invoices/in_xxxxxxxxxxxxx", + query_string="expand[0]=customer", api_base="https://api.stripe.com", - post_data="quantity=100×tamp=1571252444", ) - def test_subscription_schedules_cancel_post( + def test_invoices_mark_uncollectible_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SubscriptionSchedule.cancel("sub_sched_xxxxxxxxxxxxx") + stripe.Invoice.mark_uncollectible("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", + path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", query_string="", ) - def test_subscription_schedules_cancel_post_service( + def test_invoices_mark_uncollectible_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", + "/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_schedules.cancel("sub_sched_xxxxxxxxxxxxx") + client.invoices.mark_uncollectible("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", + path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", query_string="", api_base="https://api.stripe.com", ) - def test_subscription_schedules_get( + @pytest.mark.anyio + async def test_invoices_mark_uncollectible_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SubscriptionSchedule.list(limit=3) + await stripe.Invoice.mark_uncollectible_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/subscription_schedules", - query_string="limit=3", + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", + query_string="", ) - def test_subscription_schedules_get_service( + @pytest.mark.anyio + async def test_invoices_mark_uncollectible_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/subscription_schedules", - "limit=3", + "post", + "/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_schedules.list({"limit": 3}) + await client.invoices.mark_uncollectible_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/subscription_schedules", - query_string="limit=3", + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", + query_string="", api_base="https://api.stripe.com", ) - def test_subscription_schedules_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionSchedule.retrieve("sub_sched_xxxxxxxxxxxxx") + def test_invoices_pay_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.pay("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/pay", query_string="", ) - def test_subscription_schedules_get_2_service( + def test_invoices_pay_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + "post", + "/v1/invoices/in_xxxxxxxxxxxxx/pay", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_schedules.retrieve("sub_sched_xxxxxxxxxxxxx") + client.invoices.pay("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/pay", query_string="", api_base="https://api.stripe.com", ) - def test_subscription_schedules_post( + @pytest.mark.anyio + async def test_invoices_pay_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SubscriptionSchedule.create( - customer="cus_xxxxxxxxxxxxx", - start_date=1676070661, - end_behavior="release", - phases=[ - { - "items": [{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], - "iterations": 12, - }, - ], - ) + await stripe.Invoice.pay_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/subscription_schedules", + path="/v1/invoices/in_xxxxxxxxxxxxx/pay", query_string="", - post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", ) - def test_subscription_schedules_post_service( + @pytest.mark.anyio + async def test_invoices_pay_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/subscription_schedules", + "/v1/invoices/in_xxxxxxxxxxxxx/pay", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_schedules.create( - { - "customer": "cus_xxxxxxxxxxxxx", - "start_date": 1676070661, - "end_behavior": "release", - "phases": [ - { - "items": [ - {"price": "price_xxxxxxxxxxxxx", "quantity": 1} - ], - "iterations": 12, - }, - ], - } - ) + await client.invoices.pay_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/subscription_schedules", + path="/v1/invoices/in_xxxxxxxxxxxxx/pay", query_string="", api_base="https://api.stripe.com", - post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", ) - def test_subscription_schedules_post_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionSchedule.modify( - "sub_sched_xxxxxxxxxxxxx", - end_behavior="release", - ) + def test_invoices_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.create(customer="cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + path="/v1/invoices", query_string="", - post_data="end_behavior=release", + post_data="customer=cus_xxxxxxxxxxxxx", ) - def test_subscription_schedules_post_2_service( + def test_invoices_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + "/v1/invoices", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_schedules.update( - "sub_sched_xxxxxxxxxxxxx", - {"end_behavior": "release"}, - ) + client.invoices.create({"customer": "cus_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", - path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + path="/v1/invoices", query_string="", api_base="https://api.stripe.com", - post_data="end_behavior=release", + post_data="customer=cus_xxxxxxxxxxxxx", ) - def test_subscription_schedules_release_post( + @pytest.mark.anyio + async def test_invoices_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.SubscriptionSchedule.release("sub_sched_xxxxxxxxxxxxx") + await stripe.Invoice.create_async(customer="cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", + path="/v1/invoices", query_string="", + post_data="customer=cus_xxxxxxxxxxxxx", ) - def test_subscription_schedules_release_post_service( + @pytest.mark.anyio + async def test_invoices_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", + "/v1/invoices", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_schedules.release("sub_sched_xxxxxxxxxxxxx") + await client.invoices.create_async({"customer": "cus_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", - path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", + path="/v1/invoices", query_string="", api_base="https://api.stripe.com", + post_data="customer=cus_xxxxxxxxxxxxx", ) - def test_subscriptions_delete( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Subscription.cancel("sub_xxxxxxxxxxxxx") + def test_invoices_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Invoice.modify( + "in_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_subscriptions_delete_service( + def test_invoices_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/subscriptions/sub_xxxxxxxxxxxxx", + "post", + "/v1/invoices/in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.cancel("sub_xxxxxxxxxxxxx") + client.invoices.update( + "in_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_subscriptions_discount_delete( + @pytest.mark.anyio + async def test_invoices_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Subscription.delete_discount("sub_xyz") + await stripe.Invoice.modify_async( + "in_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/subscriptions/sub_xyz/discount", + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_subscriptions_discount_delete_service( + @pytest.mark.anyio + async def test_invoices_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/subscriptions/sub_xyz/discount", + "post", + "/v1/invoices/in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.delete_discount("sub_xyz") + await client.invoices.update_async( + "in_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/subscriptions/sub_xyz/discount", + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_subscriptions_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Subscription.list(limit=3) + def test_invoices_search_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Invoice.search( + query="total>999 AND metadata['order_id']:'6735'" + ) http_client_mock.assert_requested( "get", - path="/v1/subscriptions", - query_string="limit=3", + path="/v1/invoices/search", + query_string="query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) - def test_subscriptions_get_service( + def test_invoices_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/subscriptions", - "limit=3", + "/v1/invoices/search", + "query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.list({"limit": 3}) + client.invoices.search( + { + "query": "total>999 AND metadata['order_id']:'6735'", + } + ) http_client_mock.assert_requested( "get", - path="/v1/subscriptions", - query_string="limit=3", + path="/v1/invoices/search", + query_string="query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) - def test_subscriptions_get_2( + @pytest.mark.anyio + async def test_invoices_search_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Subscription.retrieve("sub_xxxxxxxxxxxxx") + await stripe.Invoice.search_async( + query="total>999 AND metadata['order_id']:'6735'", + ) http_client_mock.assert_requested( "get", - path="/v1/subscriptions/sub_xxxxxxxxxxxxx", - query_string="", + path="/v1/invoices/search", + query_string="query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) - def test_subscriptions_get_2_service( + @pytest.mark.anyio + async def test_invoices_search_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/subscriptions/sub_xxxxxxxxxxxxx", + "/v1/invoices/search", + "query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.retrieve("sub_xxxxxxxxxxxxx") + await client.invoices.search_async( + { + "query": "total>999 AND metadata['order_id']:'6735'", + } + ) http_client_mock.assert_requested( "get", - path="/v1/subscriptions/sub_xxxxxxxxxxxxx", - query_string="", + path="/v1/invoices/search", + query_string="query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) - def test_subscriptions_post( + def test_invoices_send_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Subscription.create( - customer="cus_xxxxxxxxxxxxx", - items=[{"price": "price_xxxxxxxxxxxxx"}], - ) + stripe.Invoice.send_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/subscriptions", + path="/v1/invoices/in_xxxxxxxxxxxxx/send", query_string="", - post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", ) - def test_subscriptions_post_service( + def test_invoices_send_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/subscriptions", + "/v1/invoices/in_xxxxxxxxxxxxx/send", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.create( - { - "customer": "cus_xxxxxxxxxxxxx", - "items": [{"price": "price_xxxxxxxxxxxxx"}], - } - ) + client.invoices.send_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/subscriptions", + path="/v1/invoices/in_xxxxxxxxxxxxx/send", query_string="", api_base="https://api.stripe.com", - post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", ) - def test_subscriptions_post_2( + @pytest.mark.anyio + async def test_invoices_send_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Subscription.modify( - "sub_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + await stripe.Invoice.send_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + path="/v1/invoices/in_xxxxxxxxxxxxx/send", query_string="", - post_data="metadata[order_id]=6735", ) - def test_subscriptions_post_2_service( + @pytest.mark.anyio + async def test_invoices_send_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/subscriptions/sub_xxxxxxxxxxxxx", + "/v1/invoices/in_xxxxxxxxxxxxx/send", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.update( - "sub_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + await client.invoices.send_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + path="/v1/invoices/in_xxxxxxxxxxxxx/send", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_subscriptions_search_get( + def test_invoices_upcoming_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Subscription.search( - query="status:'active' AND metadata['order_id']:'6735'", - ) + stripe.Invoice.upcoming(customer="cus_9utnxg47pWjV1e") http_client_mock.assert_requested( "get", - path="/v1/subscriptions/search", - query_string="query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + path="/v1/invoices/upcoming", + query_string="customer=cus_9utnxg47pWjV1e", ) - def test_subscriptions_search_get_service( + def test_invoices_upcoming_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/subscriptions/search", - "query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + "/v1/invoices/upcoming", + "customer=cus_9utnxg47pWjV1e", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.search( - { - "query": "status:'active' AND metadata['order_id']:'6735'", - } - ) + client.invoices.upcoming({"customer": "cus_9utnxg47pWjV1e"}) http_client_mock.assert_requested( "get", - path="/v1/subscriptions/search", - query_string="query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + path="/v1/invoices/upcoming", + query_string="customer=cus_9utnxg47pWjV1e", api_base="https://api.stripe.com", ) - def test_tax_calculations_line_items_get( + @pytest.mark.anyio + async def test_invoices_upcoming_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.tax.Calculation.list_line_items("xxx") + await stripe.Invoice.upcoming_async(customer="cus_9utnxg47pWjV1e") http_client_mock.assert_requested( "get", - path="/v1/tax/calculations/xxx/line_items", - query_string="", + path="/v1/invoices/upcoming", + query_string="customer=cus_9utnxg47pWjV1e", ) - def test_tax_calculations_line_items_get_service( + @pytest.mark.anyio + async def test_invoices_upcoming_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/tax/calculations/xxx/line_items", + "/v1/invoices/upcoming", + "customer=cus_9utnxg47pWjV1e", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax.calculations.line_items.list("xxx") + await client.invoices.upcoming_async( + {"customer": "cus_9utnxg47pWjV1e"} + ) http_client_mock.assert_requested( "get", - path="/v1/tax/calculations/xxx/line_items", - query_string="", + path="/v1/invoices/upcoming", + query_string="customer=cus_9utnxg47pWjV1e", api_base="https://api.stripe.com", ) - def test_tax_calculations_post( + def test_invoices_void_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.tax.Calculation.create( - currency="usd", - line_items=[{"amount": 1000, "reference": "L1"}], - customer_details={ - "address": { - "line1": "354 Oyster Point Blvd", - "city": "South San Francisco", - "state": "CA", - "postal_code": "94080", - "country": "US", - }, - "address_source": "shipping", - }, - ) + stripe.Invoice.void_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/tax/calculations", + path="/v1/invoices/in_xxxxxxxxxxxxx/void", query_string="", - post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", ) - def test_tax_calculations_post_service( + def test_invoices_void_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/tax/calculations", + "/v1/invoices/in_xxxxxxxxxxxxx/void", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax.calculations.create( - { - "currency": "usd", - "line_items": [{"amount": 1000, "reference": "L1"}], - "customer_details": { - "address": { - "line1": "354 Oyster Point Blvd", - "city": "South San Francisco", - "state": "CA", - "postal_code": "94080", - "country": "US", - }, - "address_source": "shipping", - }, - } - ) + client.invoices.void_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/tax/calculations", + path="/v1/invoices/in_xxxxxxxxxxxxx/void", query_string="", api_base="https://api.stripe.com", - post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", ) - def test_tax_codes_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxCode.list(limit=3) + @pytest.mark.anyio + async def test_invoices_void_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Invoice.void_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/tax_codes", - query_string="limit=3", + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/void", + query_string="", ) - def test_tax_codes_get_service( + @pytest.mark.anyio + async def test_invoices_void_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/tax_codes", - "limit=3", + "post", + "/v1/invoices/in_xxxxxxxxxxxxx/void", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax_codes.list({"limit": 3}) + await client.invoices.void_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/tax_codes", - query_string="limit=3", + "post", + path="/v1/invoices/in_xxxxxxxxxxxxx/void", + query_string="", api_base="https://api.stripe.com", ) - def test_tax_codes_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxCode.retrieve("txcd_xxxxxxxxxxxxx") + def test_issuing_authorizations_approve_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.approve("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", query_string="", ) - def test_tax_codes_get_2_service( + def test_issuing_authorizations_approve_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/tax_codes/txcd_xxxxxxxxxxxxx", + "post", + "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax_codes.retrieve("txcd_xxxxxxxxxxxxx") + client.issuing.authorizations.approve("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", query_string="", api_base="https://api.stripe.com", ) - def test_tax_ids_delete(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxId.delete("taxid_123") + @pytest.mark.anyio + async def test_issuing_authorizations_approve_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Authorization.approve_async("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/tax_ids/taxid_123", + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", query_string="", ) - def test_tax_ids_delete_service( + @pytest.mark.anyio + async def test_issuing_authorizations_approve_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/tax_ids/taxid_123", + "post", + "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax_ids.delete("taxid_123") + await client.issuing.authorizations.approve_async( + "iauth_xxxxxxxxxxxxx" + ) http_client_mock.assert_requested( - "delete", - path="/v1/tax_ids/taxid_123", + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", query_string="", api_base="https://api.stripe.com", ) - def test_tax_ids_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxId.list() + def test_issuing_authorizations_decline_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.decline("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/tax_ids", + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", query_string="", ) - def test_tax_ids_get_service( + def test_issuing_authorizations_decline_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/tax_ids", + "post", + "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax_ids.list() + client.issuing.authorizations.decline("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/tax_ids", + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", query_string="", api_base="https://api.stripe.com", ) - def test_tax_ids_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxId.retrieve("taxid_123") + @pytest.mark.anyio + async def test_issuing_authorizations_decline_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Authorization.decline_async("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/tax_ids/taxid_123", + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", query_string="", ) - def test_tax_ids_get_2_service( + @pytest.mark.anyio + async def test_issuing_authorizations_decline_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/tax_ids/taxid_123", + "post", + "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax_ids.retrieve("taxid_123") + await client.issuing.authorizations.decline_async( + "iauth_xxxxxxxxxxxxx" + ) http_client_mock.assert_requested( - "get", - path="/v1/tax_ids/taxid_123", + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", query_string="", api_base="https://api.stripe.com", ) - def test_tax_ids_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxId.create( - type="eu_vat", - value="123", - ) + def test_issuing_authorizations_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.list(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/tax_ids", - query_string="", - post_data="type=eu_vat&value=123", + "get", + path="/v1/issuing/authorizations", + query_string="limit=3", ) - def test_tax_ids_post_service( + def test_issuing_authorizations_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/tax_ids", + "get", + "/v1/issuing/authorizations", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax_ids.create({"type": "eu_vat", "value": "123"}) + client.issuing.authorizations.list({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/tax_ids", - query_string="", + "get", + path="/v1/issuing/authorizations", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="type=eu_vat&value=123", ) - def test_tax_rates_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxRate.list(limit=3) + @pytest.mark.anyio + async def test_issuing_authorizations_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Authorization.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/tax_rates", + path="/v1/issuing/authorizations", query_string="limit=3", ) - def test_tax_rates_get_service( + @pytest.mark.anyio + async def test_issuing_authorizations_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/tax_rates", + "/v1/issuing/authorizations", "limit=3", ) client = StripeClient( @@ -11300,467 +11964,535 @@ def test_tax_rates_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax_rates.list({"limit": 3}) + await client.issuing.authorizations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/tax_rates", + path="/v1/issuing/authorizations", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_tax_rates_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxRate.retrieve("txr_xxxxxxxxxxxxx") + def test_issuing_authorizations_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.retrieve("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", ) - def test_tax_rates_get_2_service( + def test_issuing_authorizations_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/tax_rates/txr_xxxxxxxxxxxxx", + "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax_rates.retrieve("txr_xxxxxxxxxxxxx") + client.issuing.authorizations.retrieve("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_tax_rates_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxRate.create( - display_name="VAT", - description="VAT Germany", - jurisdiction="DE", - percentage=16, - inclusive=False, + @pytest.mark.anyio + async def test_issuing_authorizations_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Authorization.retrieve_async( + "iauth_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( - "post", - path="/v1/tax_rates", + "get", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", - post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", ) - def test_tax_rates_post_service( + @pytest.mark.anyio + async def test_issuing_authorizations_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/tax_rates", + "get", + "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax_rates.create( - { - "display_name": "VAT", - "description": "VAT Germany", - "jurisdiction": "DE", - "percentage": 16, - "inclusive": False, - } + await client.issuing.authorizations.retrieve_async( + "iauth_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/tax_rates", + "get", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", ) - def test_tax_rates_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.TaxRate.modify( - "txr_xxxxxxxxxxxxx", - active=False, + def test_issuing_authorizations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.modify( + "iauth_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", - post_data="active=False", + post_data="metadata[order_id]=6735", ) - def test_tax_rates_post_2_service( + def test_issuing_authorizations_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/tax_rates/txr_xxxxxxxxxxxxx", + "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax_rates.update( - "txr_xxxxxxxxxxxxx", - {"active": False}, + client.issuing.authorizations.update( + "iauth_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="active=False", + post_data="metadata[order_id]=6735", ) - def test_tax_registrations_get( + @pytest.mark.anyio + async def test_issuing_authorizations_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.tax.Registration.list(status="all") + await stripe.issuing.Authorization.modify_async( + "iauth_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/tax/registrations", - query_string="status=all", + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", ) - def test_tax_registrations_get_service( + @pytest.mark.anyio + async def test_issuing_authorizations_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/tax/registrations", - "status=all", + "post", + "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax.registrations.list({"status": "all"}) + await client.issuing.authorizations.update_async( + "iauth_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "get", - path="/v1/tax/registrations", - query_string="status=all", + "post", + path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_tax_registrations_post( + def test_issuing_cardholders_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.tax.Registration.create( - country="IE", - country_options={"ie": {"type": "oss_union"}}, - active_from="now", - ) + stripe.issuing.Cardholder.list(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/tax/registrations", - query_string="", - post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", + "get", + path="/v1/issuing/cardholders", + query_string="limit=3", ) - def test_tax_registrations_post_service( + def test_issuing_cardholders_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/tax/registrations", + "get", + "/v1/issuing/cardholders", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax.registrations.create( - { - "country": "IE", - "country_options": {"ie": {"type": "oss_union"}}, - "active_from": "now", - } - ) + client.issuing.cardholders.list({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/tax/registrations", - query_string="", + "get", + path="/v1/issuing/cardholders", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", ) - def test_tax_registrations_post_2( + @pytest.mark.anyio + async def test_issuing_cardholders_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.tax.Registration.modify( - "taxreg_xxxxxxxxxxxxx", - expires_at="now", - ) + await stripe.issuing.Cardholder.list_async(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", - query_string="", - post_data="expires_at=now", + "get", + path="/v1/issuing/cardholders", + query_string="limit=3", ) - def test_tax_registrations_post_2_service( + @pytest.mark.anyio + async def test_issuing_cardholders_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", + "get", + "/v1/issuing/cardholders", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax.registrations.update( - "taxreg_xxxxxxxxxxxxx", - {"expires_at": "now"}, - ) + await client.issuing.cardholders.list_async({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", - query_string="", + "get", + path="/v1/issuing/cardholders", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="expires_at=now", ) - def test_tax_settings_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.tax.Settings.retrieve() + def test_issuing_cardholders_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Cardholder.retrieve("ich_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/tax/settings", + path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", ) - def test_tax_settings_get_service( + def test_issuing_cardholders_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/tax/settings", + "/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax.settings.retrieve() + client.issuing.cardholders.retrieve("ich_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/tax/settings", + path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_tax_settings_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.tax.Settings.modify(defaults={"tax_code": "txcd_10000000"}) + @pytest.mark.anyio + async def test_issuing_cardholders_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Cardholder.retrieve_async("ich_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/tax/settings", + "get", + path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", - post_data="defaults[tax_code]=txcd_10000000", ) - def test_tax_settings_post_service( + @pytest.mark.anyio + async def test_issuing_cardholders_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/tax/settings", + "get", + "/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax.settings.update({"defaults": {"tax_code": "txcd_10000000"}}) + await client.issuing.cardholders.retrieve_async("ich_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/tax/settings", + "get", + path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="defaults[tax_code]=txcd_10000000", ) - def test_tax_transactions_create_from_calculation_post( + def test_issuing_cardholders_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.tax.Transaction.create_from_calculation( - calculation="xxx", - reference="yyy", + stripe.issuing.Cardholder.create( + type="individual", + name="Jenny Rosen", + email="jenny.rosen@example.com", + phone_number="+18888675309", + billing={ + "address": { + "line1": "1234 Main Street", + "city": "San Francisco", + "state": "CA", + "country": "US", + "postal_code": "94111", + }, + }, ) http_client_mock.assert_requested( "post", - path="/v1/tax/transactions/create_from_calculation", + path="/v1/issuing/cardholders", query_string="", - post_data="calculation=xxx&reference=yyy", + post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", ) - def test_tax_transactions_create_from_calculation_post_service( + def test_issuing_cardholders_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/tax/transactions/create_from_calculation", + "/v1/issuing/cardholders", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tax.transactions.create_from_calculation( + client.issuing.cardholders.create( { - "calculation": "xxx", - "reference": "yyy", + "type": "individual", + "name": "Jenny Rosen", + "email": "jenny.rosen@example.com", + "phone_number": "+18888675309", + "billing": { + "address": { + "line1": "1234 Main Street", + "city": "San Francisco", + "state": "CA", + "country": "US", + "postal_code": "94111", + }, + }, } ) http_client_mock.assert_requested( "post", - path="/v1/tax/transactions/create_from_calculation", + path="/v1/issuing/cardholders", query_string="", api_base="https://api.stripe.com", - post_data="calculation=xxx&reference=yyy", + post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", ) - def test_terminal_configurations_delete( + @pytest.mark.anyio + async def test_issuing_cardholders_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Configuration.delete("uc_123") + await stripe.issuing.Cardholder.create_async( + type="individual", + name="Jenny Rosen", + email="jenny.rosen@example.com", + phone_number="+18888675309", + billing={ + "address": { + "line1": "1234 Main Street", + "city": "San Francisco", + "state": "CA", + "country": "US", + "postal_code": "94111", + }, + }, + ) http_client_mock.assert_requested( - "delete", - path="/v1/terminal/configurations/uc_123", + "post", + path="/v1/issuing/cardholders", query_string="", + post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", ) - def test_terminal_configurations_delete_service( + @pytest.mark.anyio + async def test_issuing_cardholders_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/terminal/configurations/uc_123", + "post", + "/v1/issuing/cardholders", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.delete("uc_123") + await client.issuing.cardholders.create_async( + { + "type": "individual", + "name": "Jenny Rosen", + "email": "jenny.rosen@example.com", + "phone_number": "+18888675309", + "billing": { + "address": { + "line1": "1234 Main Street", + "city": "San Francisco", + "state": "CA", + "country": "US", + "postal_code": "94111", + }, + }, + } + ) http_client_mock.assert_requested( - "delete", - path="/v1/terminal/configurations/uc_123", + "post", + path="/v1/issuing/cardholders", query_string="", api_base="https://api.stripe.com", + post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", ) - def test_terminal_configurations_delete_2( + def test_issuing_cardholders_post_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Configuration.delete("tmc_xxxxxxxxxxxxx") + stripe.issuing.Cardholder.modify( + "ich_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + "post", + path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_terminal_configurations_delete_2_service( + def test_issuing_cardholders_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + "post", + "/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.delete("tmc_xxxxxxxxxxxxx") + client.issuing.cardholders.update( + "ich_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + "post", + path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_terminal_configurations_get( + @pytest.mark.anyio + async def test_issuing_cardholders_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Configuration.list() + await stripe.issuing.Cardholder.modify_async( + "ich_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/terminal/configurations", + "post", + path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_terminal_configurations_get_service( + @pytest.mark.anyio + async def test_issuing_cardholders_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/terminal/configurations", + "post", + "/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.list() + await client.issuing.cardholders.update_async( + "ich_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "get", - path="/v1/terminal/configurations", + "post", + path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_terminal_configurations_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Configuration.retrieve("uc_123") + def test_issuing_cards_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.issuing.Card.list(limit=3) http_client_mock.assert_requested( "get", - path="/v1/terminal/configurations/uc_123", - query_string="", + path="/v1/issuing/cards", + query_string="limit=3", ) - def test_terminal_configurations_get_2_service( + def test_issuing_cards_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/terminal/configurations/uc_123", + "/v1/issuing/cards", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.retrieve("uc_123") + client.issuing.cards.list({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/terminal/configurations/uc_123", - query_string="", + path="/v1/issuing/cards", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_terminal_configurations_get_3( + @pytest.mark.anyio + async def test_issuing_cards_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Configuration.list(limit=3) + await stripe.issuing.Card.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/terminal/configurations", + path="/v1/issuing/cards", query_string="limit=3", ) - def test_terminal_configurations_get_3_service( + @pytest.mark.anyio + async def test_issuing_cards_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/terminal/configurations", + "/v1/issuing/cards", "limit=3", ) client = StripeClient( @@ -11768,264 +12500,289 @@ def test_terminal_configurations_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.list({"limit": 3}) + await client.issuing.cards.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/terminal/configurations", + path="/v1/issuing/cards", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_terminal_configurations_get_4( + def test_issuing_cards_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Configuration.retrieve("tmc_xxxxxxxxxxxxx") + stripe.issuing.Card.retrieve("ic_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", ) - def test_terminal_configurations_get_4_service( + def test_issuing_cards_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + "/v1/issuing/cards/ic_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.retrieve("tmc_xxxxxxxxxxxxx") + client.issuing.cards.retrieve("ic_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_terminal_configurations_post( + @pytest.mark.anyio + async def test_issuing_cards_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Configuration.create() + await stripe.issuing.Card.retrieve_async("ic_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/terminal/configurations", + "get", + path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", ) - def test_terminal_configurations_post_service( + @pytest.mark.anyio + async def test_issuing_cards_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/terminal/configurations", + "get", + "/v1/issuing/cards/ic_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.create() + await client.issuing.cards.retrieve_async("ic_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/terminal/configurations", + "get", + path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_terminal_configurations_post_2( + def test_issuing_cards_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Configuration.modify( - "uc_123", - tipping={"usd": {"fixed_amounts": [10]}}, + stripe.issuing.Card.create( + cardholder="ich_xxxxxxxxxxxxx", + currency="usd", + type="virtual", ) http_client_mock.assert_requested( "post", - path="/v1/terminal/configurations/uc_123", + path="/v1/issuing/cards", query_string="", - post_data="tipping[usd][fixed_amounts][0]=10", + post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", ) - def test_terminal_configurations_post_2_service( + def test_issuing_cards_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/terminal/configurations/uc_123", + "/v1/issuing/cards", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.update( - "uc_123", - {"tipping": {"usd": {"fixed_amounts": [10]}}}, + client.issuing.cards.create( + { + "cardholder": "ich_xxxxxxxxxxxxx", + "currency": "usd", + "type": "virtual", + } ) http_client_mock.assert_requested( "post", - path="/v1/terminal/configurations/uc_123", + path="/v1/issuing/cards", query_string="", api_base="https://api.stripe.com", - post_data="tipping[usd][fixed_amounts][0]=10", + post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", ) - def test_terminal_configurations_post_3( + @pytest.mark.anyio + async def test_issuing_cards_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Configuration.create( - bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, + await stripe.issuing.Card.create_async( + cardholder="ich_xxxxxxxxxxxxx", + currency="usd", + type="virtual", ) http_client_mock.assert_requested( "post", - path="/v1/terminal/configurations", + path="/v1/issuing/cards", query_string="", - post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", ) - def test_terminal_configurations_post_3_service( + @pytest.mark.anyio + async def test_issuing_cards_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/terminal/configurations", + "/v1/issuing/cards", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.create( + await client.issuing.cards.create_async( { - "bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}, + "cardholder": "ich_xxxxxxxxxxxxx", + "currency": "usd", + "type": "virtual", } ) http_client_mock.assert_requested( "post", - path="/v1/terminal/configurations", + path="/v1/issuing/cards", query_string="", api_base="https://api.stripe.com", - post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", ) - def test_terminal_configurations_post_4( + def test_issuing_cards_post_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Configuration.modify( - "tmc_xxxxxxxxxxxxx", - bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, + stripe.issuing.Card.modify( + "ic_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", - post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + post_data="metadata[order_id]=6735", ) - def test_terminal_configurations_post_4_service( + def test_issuing_cards_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + "/v1/issuing/cards/ic_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.update( - "tmc_xxxxxxxxxxxxx", - {"bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}}, + client.issuing.cards.update( + "ic_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + post_data="metadata[order_id]=6735", ) - def test_terminal_connection_tokens_post( + @pytest.mark.anyio + async def test_issuing_cards_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.ConnectionToken.create() + await stripe.issuing.Card.modify_async( + "ic_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( "post", - path="/v1/terminal/connection_tokens", + path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_terminal_connection_tokens_post_service( + @pytest.mark.anyio + async def test_issuing_cards_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/terminal/connection_tokens", + "/v1/issuing/cards/ic_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.connection_tokens.create() + await client.issuing.cards.update_async( + "ic_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( "post", - path="/v1/terminal/connection_tokens", + path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_terminal_locations_delete( + def test_issuing_disputes_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Location.delete("tml_xxxxxxxxxxxxx") + stripe.issuing.Dispute.list(limit=3) http_client_mock.assert_requested( - "delete", - path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", - query_string="", + "get", + path="/v1/issuing/disputes", + query_string="limit=3", ) - def test_terminal_locations_delete_service( + def test_issuing_disputes_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/terminal/locations/tml_xxxxxxxxxxxxx", + "get", + "/v1/issuing/disputes", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.locations.delete("tml_xxxxxxxxxxxxx") + client.issuing.disputes.list({"limit": 3}) http_client_mock.assert_requested( - "delete", - path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", - query_string="", + "get", + path="/v1/issuing/disputes", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_terminal_locations_get( + @pytest.mark.anyio + async def test_issuing_disputes_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Location.list(limit=3) + await stripe.issuing.Dispute.list_async(limit=3) http_client_mock.assert_requested( "get", - path="/v1/terminal/locations", + path="/v1/issuing/disputes", query_string="limit=3", ) - def test_terminal_locations_get_service( + @pytest.mark.anyio + async def test_issuing_disputes_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/terminal/locations", + "/v1/issuing/disputes", "limit=3", ) client = StripeClient( @@ -12033,2771 +12790,18966 @@ def test_terminal_locations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.locations.list({"limit": 3}) + await client.issuing.disputes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", - path="/v1/terminal/locations", + path="/v1/issuing/disputes", query_string="limit=3", api_base="https://api.stripe.com", ) - def test_terminal_locations_get_2( + def test_issuing_disputes_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Location.retrieve("tml_xxxxxxxxxxxxx") + stripe.issuing.Dispute.retrieve("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", query_string="", ) - def test_terminal_locations_get_2_service( + def test_issuing_disputes_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/terminal/locations/tml_xxxxxxxxxxxxx", + "/v1/issuing/disputes/idp_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.locations.retrieve("tml_xxxxxxxxxxxxx") + client.issuing.disputes.retrieve("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_terminal_locations_post( + @pytest.mark.anyio + async def test_issuing_disputes_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Location.create( - display_name="My First Store", - address={ - "line1": "1234 Main Street", - "city": "San Francisco", - "postal_code": "94111", - "state": "CA", - "country": "US", - }, - ) + await stripe.issuing.Dispute.retrieve_async("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/terminal/locations", + "get", + path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", query_string="", - post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", ) - def test_terminal_locations_post_service( + @pytest.mark.anyio + async def test_issuing_disputes_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/terminal/locations", + "get", + "/v1/issuing/disputes/idp_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.locations.create( - { - "display_name": "My First Store", - "address": { - "line1": "1234 Main Street", - "city": "San Francisco", - "postal_code": "94111", - "state": "CA", - "country": "US", - }, - } - ) + await client.issuing.disputes.retrieve_async("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/terminal/locations", + "get", + path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", ) - def test_terminal_locations_post_2( + def test_issuing_disputes_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Location.modify( - "tml_xxxxxxxxxxxxx", - display_name="My First Store", + stripe.issuing.Dispute.create( + transaction="ipi_xxxxxxxxxxxxx", + evidence={ + "reason": "fraudulent", + "fraudulent": {"explanation": "Purchase was unrecognized."}, + }, ) http_client_mock.assert_requested( "post", - path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + path="/v1/issuing/disputes", query_string="", - post_data="display_name=My%20First%20Store", + post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", ) - def test_terminal_locations_post_2_service( + def test_issuing_disputes_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/terminal/locations/tml_xxxxxxxxxxxxx", + "/v1/issuing/disputes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.locations.update( - "tml_xxxxxxxxxxxxx", - {"display_name": "My First Store"}, + client.issuing.disputes.create( + { + "transaction": "ipi_xxxxxxxxxxxxx", + "evidence": { + "reason": "fraudulent", + "fraudulent": { + "explanation": "Purchase was unrecognized." + }, + }, + } ) http_client_mock.assert_requested( "post", - path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + path="/v1/issuing/disputes", query_string="", api_base="https://api.stripe.com", - post_data="display_name=My%20First%20Store", + post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", ) - def test_terminal_readers_cancel_action_post( + @pytest.mark.anyio + async def test_issuing_disputes_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Reader.cancel_action("tmr_xxxxxxxxxxxxx") + await stripe.issuing.Dispute.create_async( + transaction="ipi_xxxxxxxxxxxxx", + evidence={ + "reason": "fraudulent", + "fraudulent": {"explanation": "Purchase was unrecognized."}, + }, + ) http_client_mock.assert_requested( "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", + path="/v1/issuing/disputes", query_string="", + post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", ) - def test_terminal_readers_cancel_action_post_service( + @pytest.mark.anyio + async def test_issuing_disputes_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", + "/v1/issuing/disputes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.cancel_action("tmr_xxxxxxxxxxxxx") + await client.issuing.disputes.create_async( + { + "transaction": "ipi_xxxxxxxxxxxxx", + "evidence": { + "reason": "fraudulent", + "fraudulent": { + "explanation": "Purchase was unrecognized." + }, + }, + } + ) http_client_mock.assert_requested( "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", + path="/v1/issuing/disputes", query_string="", api_base="https://api.stripe.com", + post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", ) - def test_terminal_readers_delete( + def test_issuing_disputes_submit_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Reader.delete("tmr_xxxxxxxxxxxxx") + stripe.issuing.Dispute.submit("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + "post", + path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", query_string="", ) - def test_terminal_readers_delete_service( + def test_issuing_disputes_submit_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + "post", + "/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.delete("tmr_xxxxxxxxxxxxx") + client.issuing.disputes.submit("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "delete", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + "post", + path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", query_string="", api_base="https://api.stripe.com", ) - def test_terminal_readers_get( + @pytest.mark.anyio + async def test_issuing_disputes_submit_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Reader.list(limit=3) + await stripe.issuing.Dispute.submit_async("idp_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", + query_string="", + ) + + @pytest.mark.anyio + async def test_issuing_disputes_submit_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.issuing.disputes.submit_async("idp_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_issuing_personalization_designs_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PersonalizationDesign.list() http_client_mock.assert_requested( "get", - path="/v1/terminal/readers", - query_string="limit=3", + path="/v1/issuing/personalization_designs", + query_string="", ) - def test_terminal_readers_get_service( + def test_issuing_personalization_designs_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/terminal/readers", - "limit=3", + "/v1/issuing/personalization_designs", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.list({"limit": 3}) + client.issuing.personalization_designs.list() http_client_mock.assert_requested( "get", - path="/v1/terminal/readers", - query_string="limit=3", + path="/v1/issuing/personalization_designs", + query_string="", api_base="https://api.stripe.com", ) - def test_terminal_readers_get_2( + @pytest.mark.anyio + async def test_issuing_personalization_designs_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Reader.retrieve("tmr_xxxxxxxxxxxxx") + await stripe.issuing.PersonalizationDesign.list_async() http_client_mock.assert_requested( "get", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + path="/v1/issuing/personalization_designs", query_string="", ) - def test_terminal_readers_get_2_service( + @pytest.mark.anyio + async def test_issuing_personalization_designs_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + "/v1/issuing/personalization_designs", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.retrieve("tmr_xxxxxxxxxxxxx") + await client.issuing.personalization_designs.list_async() http_client_mock.assert_requested( "get", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + path="/v1/issuing/personalization_designs", query_string="", api_base="https://api.stripe.com", ) - def test_terminal_readers_post( + def test_issuing_personalization_designs_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Reader.create( - registration_code="puppies-plug-could", - label="Blue Rabbit", - location="tml_1234", - ) + stripe.issuing.PersonalizationDesign.retrieve("pd_xyz") http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers", + "get", + path="/v1/issuing/personalization_designs/pd_xyz", query_string="", - post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", ) - def test_terminal_readers_post_service( + def test_issuing_personalization_designs_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/terminal/readers", + "get", + "/v1/issuing/personalization_designs/pd_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.create( - { - "registration_code": "puppies-plug-could", - "label": "Blue Rabbit", - "location": "tml_1234", - } - ) + client.issuing.personalization_designs.retrieve("pd_xyz") http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers", + "get", + path="/v1/issuing/personalization_designs/pd_xyz", query_string="", api_base="https://api.stripe.com", - post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", ) - def test_terminal_readers_post_2( + @pytest.mark.anyio + async def test_issuing_personalization_designs_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Reader.modify( - "tmr_xxxxxxxxxxxxx", - label="Blue Rabbit", + await stripe.issuing.PersonalizationDesign.retrieve_async("pd_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/personalization_designs/pd_xyz", + query_string="", + ) + + @pytest.mark.anyio + async def test_issuing_personalization_designs_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/issuing/personalization_designs/pd_xyz", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.issuing.personalization_designs.retrieve_async("pd_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/personalization_designs/pd_xyz", + query_string="", + api_base="https://api.stripe.com", ) + + def test_issuing_personalization_designs_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PersonalizationDesign.create(physical_bundle="pb_xyz") http_client_mock.assert_requested( "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + path="/v1/issuing/personalization_designs", query_string="", - post_data="label=Blue%20Rabbit", + post_data="physical_bundle=pb_xyz", ) - def test_terminal_readers_post_2_service( + def test_issuing_personalization_designs_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + "/v1/issuing/personalization_designs", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.update( - "tmr_xxxxxxxxxxxxx", - {"label": "Blue Rabbit"}, + client.issuing.personalization_designs.create( + { + "physical_bundle": "pb_xyz", + } ) http_client_mock.assert_requested( "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + path="/v1/issuing/personalization_designs", query_string="", api_base="https://api.stripe.com", - post_data="label=Blue%20Rabbit", + post_data="physical_bundle=pb_xyz", ) - def test_terminal_readers_process_payment_intent_post( + @pytest.mark.anyio + async def test_issuing_personalization_designs_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Reader.process_payment_intent( - "tmr_xxxxxxxxxxxxx", - payment_intent="pi_xxxxxxxxxxxxx", + await stripe.issuing.PersonalizationDesign.create_async( + physical_bundle="pb_xyz", ) http_client_mock.assert_requested( "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", + path="/v1/issuing/personalization_designs", query_string="", - post_data="payment_intent=pi_xxxxxxxxxxxxx", + post_data="physical_bundle=pb_xyz", ) - def test_terminal_readers_process_payment_intent_post_service( + @pytest.mark.anyio + async def test_issuing_personalization_designs_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", + "/v1/issuing/personalization_designs", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.process_payment_intent( - "tmr_xxxxxxxxxxxxx", - {"payment_intent": "pi_xxxxxxxxxxxxx"}, + await client.issuing.personalization_designs.create_async( + { + "physical_bundle": "pb_xyz", + } ) http_client_mock.assert_requested( "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", + path="/v1/issuing/personalization_designs", query_string="", api_base="https://api.stripe.com", - post_data="payment_intent=pi_xxxxxxxxxxxxx", + post_data="physical_bundle=pb_xyz", ) - def test_terminal_readers_process_setup_intent_post( + def test_issuing_personalization_designs_post_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Reader.process_setup_intent( - "tmr_xxxxxxxxxxxxx", - setup_intent="seti_xxxxxxxxxxxxx", - customer_consent_collected=True, - ) + stripe.issuing.PersonalizationDesign.modify("pd_xyz") http_client_mock.assert_requested( "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + path="/v1/issuing/personalization_designs/pd_xyz", query_string="", - post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", ) - def test_terminal_readers_process_setup_intent_post_service( + def test_issuing_personalization_designs_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + "/v1/issuing/personalization_designs/pd_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.process_setup_intent( - "tmr_xxxxxxxxxxxxx", - { - "setup_intent": "seti_xxxxxxxxxxxxx", - "customer_consent_collected": True, - }, - ) + client.issuing.personalization_designs.update("pd_xyz") http_client_mock.assert_requested( "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + path="/v1/issuing/personalization_designs/pd_xyz", query_string="", api_base="https://api.stripe.com", - post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", ) - def test_test_helpers_customers_fund_cash_balance_post( + @pytest.mark.anyio + async def test_issuing_personalization_designs_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.TestHelpers.fund_cash_balance( - "cus_123", - amount=30, - currency="eur", - ) + await stripe.issuing.PersonalizationDesign.modify_async("pd_xyz") http_client_mock.assert_requested( "post", - path="/v1/test_helpers/customers/cus_123/fund_cash_balance", + path="/v1/issuing/personalization_designs/pd_xyz", query_string="", - post_data="amount=30¤cy=eur", ) - def test_test_helpers_customers_fund_cash_balance_post_service( + @pytest.mark.anyio + async def test_issuing_personalization_designs_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/customers/cus_123/fund_cash_balance", + "/v1/issuing/personalization_designs/pd_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.customers.fund_cash_balance( - "cus_123", - {"amount": 30, "currency": "eur"}, - ) + await client.issuing.personalization_designs.update_async("pd_xyz") http_client_mock.assert_requested( "post", - path="/v1/test_helpers/customers/cus_123/fund_cash_balance", + path="/v1/issuing/personalization_designs/pd_xyz", query_string="", api_base="https://api.stripe.com", - post_data="amount=30¤cy=eur", ) - def test_test_helpers_issuing_authorizations_capture_post( + def test_issuing_physical_bundles_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Authorization.TestHelpers.capture( - "example_authorization", - capture_amount=100, - close_authorization=True, - purchase_details={ - "flight": { - "departure_at": 1633651200, - "passenger_name": "John Doe", - "refundable": True, - "segments": [ - { - "arrival_airport_code": "SFO", - "carrier": "Delta", - "departure_airport_code": "LAX", - "flight_number": "DL100", - "service_class": "Economy", - "stopover_allowed": True, - }, - ], - "travel_agency": "Orbitz", - }, - "fuel": { - "type": "diesel", - "unit": "liter", - "unit_cost_decimal": "3.5", - "volume_decimal": "10", - }, - "lodging": {"check_in_at": 1633651200, "nights": 2}, - "receipt": [ - { - "description": "Room charge", - "quantity": "1", - "total": 200, - "unit_cost": 200, - }, - ], - "reference": "foo", - }, - ) + stripe.issuing.PhysicalBundle.list() http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", + "get", + path="/v1/issuing/physical_bundles", query_string="", - post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) - def test_test_helpers_issuing_authorizations_capture_post_service( + def test_issuing_physical_bundles_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/issuing/authorizations/example_authorization/capture", + "get", + "/v1/issuing/physical_bundles", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.authorizations.capture( - "example_authorization", - { - "capture_amount": 100, - "close_authorization": True, - "purchase_details": { - "flight": { - "departure_at": 1633651200, - "passenger_name": "John Doe", - "refundable": True, - "segments": [ - { - "arrival_airport_code": "SFO", - "carrier": "Delta", - "departure_airport_code": "LAX", - "flight_number": "DL100", - "service_class": "Economy", - "stopover_allowed": True, - }, - ], - "travel_agency": "Orbitz", - }, - "fuel": { - "type": "diesel", - "unit": "liter", - "unit_cost_decimal": "3.5", - "volume_decimal": "10", - }, - "lodging": {"check_in_at": 1633651200, "nights": 2}, - "receipt": [ - { - "description": "Room charge", - "quantity": "1", - "total": 200, - "unit_cost": 200, - }, - ], - "reference": "foo", - }, - }, - ) + client.issuing.physical_bundles.list() http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", + "get", + path="/v1/issuing/physical_bundles", query_string="", api_base="https://api.stripe.com", - post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) - def test_test_helpers_issuing_authorizations_expire_post( + @pytest.mark.anyio + async def test_issuing_physical_bundles_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Authorization.TestHelpers.expire( - "example_authorization" - ) + await stripe.issuing.PhysicalBundle.list_async() http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations/example_authorization/expire", + "get", + path="/v1/issuing/physical_bundles", query_string="", ) - def test_test_helpers_issuing_authorizations_expire_post_service( + @pytest.mark.anyio + async def test_issuing_physical_bundles_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/issuing/authorizations/example_authorization/expire", + "get", + "/v1/issuing/physical_bundles", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.authorizations.expire( - "example_authorization", - ) + await client.issuing.physical_bundles.list_async() http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations/example_authorization/expire", + "get", + path="/v1/issuing/physical_bundles", query_string="", api_base="https://api.stripe.com", ) - def test_test_helpers_issuing_authorizations_increment_post( + def test_issuing_physical_bundles_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Authorization.TestHelpers.increment( - "example_authorization", - increment_amount=50, - is_amount_controllable=True, - ) + stripe.issuing.PhysicalBundle.retrieve("pb_xyz") http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations/example_authorization/increment", + "get", + path="/v1/issuing/physical_bundles/pb_xyz", query_string="", - post_data="increment_amount=50&is_amount_controllable=True", ) - def test_test_helpers_issuing_authorizations_increment_post_service( + def test_issuing_physical_bundles_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/issuing/authorizations/example_authorization/increment", + "get", + "/v1/issuing/physical_bundles/pb_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.authorizations.increment( - "example_authorization", - {"increment_amount": 50, "is_amount_controllable": True}, - ) + client.issuing.physical_bundles.retrieve("pb_xyz") http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations/example_authorization/increment", + "get", + path="/v1/issuing/physical_bundles/pb_xyz", query_string="", api_base="https://api.stripe.com", - post_data="increment_amount=50&is_amount_controllable=True", ) - def test_test_helpers_issuing_authorizations_post( + @pytest.mark.anyio + async def test_issuing_physical_bundles_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Authorization.TestHelpers.create( - amount=100, - amount_details={"atm_fee": 10, "cashback_amount": 5}, - authorization_method="chip", - card="foo", - currency="usd", - is_amount_controllable=True, - merchant_data={ - "category": "ac_refrigeration_repair", - "city": "foo", - "country": "bar", - "name": "foo", - "network_id": "bar", - "postal_code": "foo", - "state": "bar", - "terminal_id": "foo", - }, - network_data={"acquiring_institution_id": "foo"}, - verification_data={ - "address_line1_check": "mismatch", - "address_postal_code_check": "match", - "cvc_check": "match", - "expiry_check": "mismatch", - }, - wallet="apple_pay", - ) + await stripe.issuing.PhysicalBundle.retrieve_async("pb_xyz") http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations", + "get", + path="/v1/issuing/physical_bundles/pb_xyz", query_string="", - post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", ) - def test_test_helpers_issuing_authorizations_post_service( + @pytest.mark.anyio + async def test_issuing_physical_bundles_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/issuing/authorizations", + "get", + "/v1/issuing/physical_bundles/pb_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.authorizations.create( - { - "amount": 100, - "amount_details": {"atm_fee": 10, "cashback_amount": 5}, - "authorization_method": "chip", - "card": "foo", - "currency": "usd", - "is_amount_controllable": True, - "merchant_data": { - "category": "ac_refrigeration_repair", - "city": "foo", - "country": "bar", - "name": "foo", - "network_id": "bar", - "postal_code": "foo", - "state": "bar", - "terminal_id": "foo", - }, - "network_data": {"acquiring_institution_id": "foo"}, - "verification_data": { - "address_line1_check": "mismatch", - "address_postal_code_check": "match", - "cvc_check": "match", - "expiry_check": "mismatch", - }, - "wallet": "apple_pay", - } - ) + await client.issuing.physical_bundles.retrieve_async("pb_xyz") http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations", + "get", + path="/v1/issuing/physical_bundles/pb_xyz", query_string="", api_base="https://api.stripe.com", - post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", ) - def test_test_helpers_issuing_authorizations_reverse_post( + def test_issuing_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Authorization.TestHelpers.reverse( - "example_authorization", - reverse_amount=20, - ) + stripe.issuing.Transaction.list(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations/example_authorization/reverse", - query_string="", - post_data="reverse_amount=20", + "get", + path="/v1/issuing/transactions", + query_string="limit=3", ) - def test_test_helpers_issuing_authorizations_reverse_post_service( + def test_issuing_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/issuing/authorizations/example_authorization/reverse", + "get", + "/v1/issuing/transactions", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.authorizations.reverse( - "example_authorization", - {"reverse_amount": 20}, - ) + client.issuing.transactions.list({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/authorizations/example_authorization/reverse", - query_string="", + "get", + path="/v1/issuing/transactions", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="reverse_amount=20", ) - def test_test_helpers_issuing_cards_shipping_deliver_post( + @pytest.mark.anyio + async def test_issuing_transactions_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Card.TestHelpers.deliver_card("card_123") + await stripe.issuing.Transaction.list_async(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", - query_string="", + "get", + path="/v1/issuing/transactions", + query_string="limit=3", ) - def test_test_helpers_issuing_cards_shipping_deliver_post_service( + @pytest.mark.anyio + async def test_issuing_transactions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/issuing/cards/card_123/shipping/deliver", + "get", + "/v1/issuing/transactions", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.cards.deliver_card("card_123") + await client.issuing.transactions.list_async({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", + "get", + path="/v1/issuing/transactions", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_issuing_transactions_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Transaction.retrieve("ipi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", + query_string="", + ) + + def test_issuing_transactions_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.issuing.transactions.retrieve("ipi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_test_helpers_issuing_cards_shipping_fail_post( + @pytest.mark.anyio + async def test_issuing_transactions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Card.TestHelpers.fail_card("card_123") + await stripe.issuing.Transaction.retrieve_async("ipi_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", + "get", + path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", ) - def test_test_helpers_issuing_cards_shipping_fail_post_service( + @pytest.mark.anyio + async def test_issuing_transactions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/issuing/cards/card_123/shipping/fail", + "get", + "/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.cards.fail_card("card_123") + await client.issuing.transactions.retrieve_async("ipi_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", + "get", + path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_test_helpers_issuing_cards_shipping_return_post( + def test_issuing_transactions_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Card.TestHelpers.return_card("card_123") + stripe.issuing.Transaction.modify( + "ipi_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/return", + path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_test_helpers_issuing_cards_shipping_return_post_service( + def test_issuing_transactions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/issuing/cards/card_123/shipping/return", + "/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.cards.return_card("card_123") + client.issuing.transactions.update( + "ipi_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/return", + path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_test_helpers_issuing_cards_shipping_ship_post( + @pytest.mark.anyio + async def test_issuing_transactions_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Card.TestHelpers.ship_card("card_123") + await stripe.issuing.Transaction.modify_async( + "ipi_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", + path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_test_helpers_issuing_cards_shipping_ship_post_service( + @pytest.mark.anyio + async def test_issuing_transactions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/issuing/cards/card_123/shipping/ship", + "/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.cards.ship_card("card_123") + await client.issuing.transactions.update_async( + "ipi_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", + path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_test_helpers_issuing_personalization_designs_activate_post( + def test_mandates_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Mandate.retrieve("mandate_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/mandates/mandate_xxxxxxxxxxxxx", + query_string="", + ) + + def test_mandates_get_service( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.PersonalizationDesign.TestHelpers.activate("pd_xyz") + http_client_mock.stub_request( + "get", + "/v1/mandates/mandate_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.mandates.retrieve("mandate_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/mandates/mandate_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_mandates_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Mandate.retrieve_async("mandate_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/mandates/mandate_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_mandates_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/mandates/mandate_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.mandates.retrieve_async("mandate_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/mandates/mandate_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payment_intents_apply_customer_balance_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.apply_customer_balance("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", query_string="", ) - def test_test_helpers_issuing_personalization_designs_activate_post_service( + def test_payment_intents_apply_customer_balance_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.personalization_designs.activate("pd_xyz") + client.payment_intents.apply_customer_balance("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", query_string="", api_base="https://api.stripe.com", ) - def test_test_helpers_issuing_personalization_designs_deactivate_post( + @pytest.mark.anyio + async def test_payment_intents_apply_customer_balance_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.PersonalizationDesign.TestHelpers.deactivate("pd_xyz") + await stripe.PaymentIntent.apply_customer_balance_async( + "pi_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", query_string="", ) - def test_test_helpers_issuing_personalization_designs_deactivate_post_service( + @pytest.mark.anyio + async def test_payment_intents_apply_customer_balance_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.personalization_designs.deactivate( - "pd_xyz" + await client.payment_intents.apply_customer_balance_async( + "pi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", query_string="", api_base="https://api.stripe.com", ) - def test_test_helpers_issuing_personalization_designs_reject_post( + def test_payment_intents_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.PersonalizationDesign.TestHelpers.reject( - "pd_xyz", - rejection_reasons={"card_logo": ["geographic_location"]}, - ) + stripe.PaymentIntent.cancel("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", query_string="", - post_data="rejection_reasons[card_logo][0]=geographic_location", ) - def test_test_helpers_issuing_personalization_designs_reject_post_service( + def test_payment_intents_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.personalization_designs.reject( - "pd_xyz", - {"rejection_reasons": {"card_logo": ["geographic_location"]}}, - ) + client.payment_intents.cancel("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", - post_data="rejection_reasons[card_logo][0]=geographic_location", ) - def test_test_helpers_issuing_transactions_create_force_capture_post( + @pytest.mark.anyio + async def test_payment_intents_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Transaction.TestHelpers.create_force_capture( - amount=100, - card="foo", - currency="usd", - merchant_data={ - "category": "ac_refrigeration_repair", - "city": "foo", - "country": "US", - "name": "foo", - "network_id": "bar", - "postal_code": "10001", - "state": "NY", - "terminal_id": "foo", - }, - purchase_details={ - "flight": { - "departure_at": 1633651200, - "passenger_name": "John Doe", - "refundable": True, - "segments": [ - { - "arrival_airport_code": "SFO", - "carrier": "Delta", - "departure_airport_code": "LAX", - "flight_number": "DL100", - "service_class": "Economy", - "stopover_allowed": True, - }, - ], - "travel_agency": "Orbitz", - }, - "fuel": { - "type": "diesel", - "unit": "liter", - "unit_cost_decimal": "3.5", - "volume_decimal": "10", - }, - "lodging": {"check_in_at": 1533651200, "nights": 2}, - "receipt": [ - { - "description": "Room charge", - "quantity": "1", - "total": 200, - "unit_cost": 200, - }, - ], - "reference": "foo", - }, - ) + await stripe.PaymentIntent.cancel_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/transactions/create_force_capture", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", query_string="", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) - def test_test_helpers_issuing_transactions_create_force_capture_post_service( + @pytest.mark.anyio + async def test_payment_intents_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/issuing/transactions/create_force_capture", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.transactions.create_force_capture( + await client.payment_intents.cancel_async("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payment_intents_capture_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.capture("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", + query_string="", + ) + + def test_payment_intents_capture_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_intents.capture("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_intents_capture_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentIntent.capture_async("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", + query_string="", + ) + + @pytest.mark.anyio + async def test_payment_intents_capture_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_intents.capture_async("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payment_intents_confirm_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.confirm( + "pi_xxxxxxxxxxxxx", + payment_method="pm_card_visa", + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", + query_string="", + post_data="payment_method=pm_card_visa", + ) + + def test_payment_intents_confirm_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_intents.confirm( + "pi_xxxxxxxxxxxxx", + {"payment_method": "pm_card_visa"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", + query_string="", + api_base="https://api.stripe.com", + post_data="payment_method=pm_card_visa", + ) + + @pytest.mark.anyio + async def test_payment_intents_confirm_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentIntent.confirm_async( + "pi_xxxxxxxxxxxxx", + payment_method="pm_card_visa", + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", + query_string="", + post_data="payment_method=pm_card_visa", + ) + + @pytest.mark.anyio + async def test_payment_intents_confirm_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_intents.confirm_async( + "pi_xxxxxxxxxxxxx", + {"payment_method": "pm_card_visa"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", + query_string="", + api_base="https://api.stripe.com", + post_data="payment_method=pm_card_visa", + ) + + def test_payment_intents_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents", + query_string="limit=3", + ) + + def test_payment_intents_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_intents", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_intents.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_intents_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentIntent.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_payment_intents_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_intents", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_intents.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_payment_intents_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.retrieve("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + query_string="", + ) + + def test_payment_intents_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_intents/pi_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_intents.retrieve("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_intents_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentIntent.retrieve_async("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_payment_intents_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_intents/pi_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_intents.retrieve_async("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payment_intents_increment_authorization_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.increment_authorization( + "pi_xxxxxxxxxxxxx", + amount=2099, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", + query_string="", + post_data="amount=2099", + ) + + def test_payment_intents_increment_authorization_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_intents.increment_authorization( + "pi_xxxxxxxxxxxxx", + {"amount": 2099}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=2099", + ) + + @pytest.mark.anyio + async def test_payment_intents_increment_authorization_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentIntent.increment_authorization_async( + "pi_xxxxxxxxxxxxx", + amount=2099, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", + query_string="", + post_data="amount=2099", + ) + + @pytest.mark.anyio + async def test_payment_intents_increment_authorization_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_intents.increment_authorization_async( + "pi_xxxxxxxxxxxxx", + {"amount": 2099}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=2099", + ) + + def test_payment_intents_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.create( + amount=1099, + currency="eur", + automatic_payment_methods={"enabled": True}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", + ) + + def test_payment_intents_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_intents.create( + { + "amount": 1099, + "currency": "eur", + "automatic_payment_methods": {"enabled": True}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", + ) + + @pytest.mark.anyio + async def test_payment_intents_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentIntent.create_async( + amount=1099, + currency="eur", + automatic_payment_methods={"enabled": True}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", + ) + + @pytest.mark.anyio + async def test_payment_intents_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_intents.create_async( + { + "amount": 1099, + "currency": "eur", + "automatic_payment_methods": {"enabled": True}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", + ) + + def test_payment_intents_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.create( + amount=2000, + currency="usd", + automatic_payment_methods={"enabled": True}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", + ) + + def test_payment_intents_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_intents.create( + { + "amount": 2000, + "currency": "usd", + "automatic_payment_methods": {"enabled": True}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", + ) + + @pytest.mark.anyio + async def test_payment_intents_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentIntent.create_async( + amount=2000, + currency="usd", + automatic_payment_methods={"enabled": True}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", + ) + + @pytest.mark.anyio + async def test_payment_intents_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_intents.create_async( + { + "amount": 2000, + "currency": "usd", + "automatic_payment_methods": {"enabled": True}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", + ) + + def test_payment_intents_post_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.modify( + "pi_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_payment_intents_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents/pi_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_intents.update( + "pi_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_payment_intents_post_3_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentIntent.modify_async( + "pi_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_payment_intents_post_3_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents/pi_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_intents.update_async( + "pi_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_payment_intents_post_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.create( + amount=200, + currency="usd", + payment_method_data={"type": "p24", "p24": {"bank": "blik"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", + ) + + def test_payment_intents_post_4_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_intents.create( + { + "amount": 200, + "currency": "usd", + "payment_method_data": { + "type": "p24", + "p24": {"bank": "blik"}, + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", + ) + + @pytest.mark.anyio + async def test_payment_intents_post_4_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentIntent.create_async( + amount=200, + currency="usd", + payment_method_data={"type": "p24", "p24": {"bank": "blik"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", + ) + + @pytest.mark.anyio + async def test_payment_intents_post_4_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_intents.create_async( + { + "amount": 200, + "currency": "usd", + "payment_method_data": { + "type": "p24", + "p24": {"bank": "blik"}, + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", + ) + + def test_payment_intents_search_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.search( + query="status:'succeeded' AND metadata['order_id']:'6735'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents/search", + query_string="query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + + def test_payment_intents_search_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_intents/search", + "query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_intents.search( + { + "query": "status:'succeeded' AND metadata['order_id']:'6735'", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents/search", + query_string="query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_intents_search_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentIntent.search_async( + query="status:'succeeded' AND metadata['order_id']:'6735'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents/search", + query_string="query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + + @pytest.mark.anyio + async def test_payment_intents_search_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_intents/search", + "query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_intents.search_async( + { + "query": "status:'succeeded' AND metadata['order_id']:'6735'", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/payment_intents/search", + query_string="query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + api_base="https://api.stripe.com", + ) + + def test_payment_intents_verify_microdeposits_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.verify_microdeposits("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + ) + + def test_payment_intents_verify_microdeposits_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_intents.verify_microdeposits("pi_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_intents_verify_microdeposits_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentIntent.verify_microdeposits_async( + "pi_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + ) + + @pytest.mark.anyio + async def test_payment_intents_verify_microdeposits_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_intents.verify_microdeposits_async( + "pi_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payment_intents_verify_microdeposits_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentIntent.verify_microdeposits( + "pi_xxxxxxxxxxxxx", + amounts=[32, 45], + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + post_data="amounts[0]=32&amounts[1]=45", + ) + + def test_payment_intents_verify_microdeposits_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_intents.verify_microdeposits( + "pi_xxxxxxxxxxxxx", + {"amounts": [32, 45]}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + api_base="https://api.stripe.com", + post_data="amounts[0]=32&amounts[1]=45", + ) + + @pytest.mark.anyio + async def test_payment_intents_verify_microdeposits_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentIntent.verify_microdeposits_async( + "pi_xxxxxxxxxxxxx", + amounts=[32, 45], + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + post_data="amounts[0]=32&amounts[1]=45", + ) + + @pytest.mark.anyio + async def test_payment_intents_verify_microdeposits_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_intents.verify_microdeposits_async( + "pi_xxxxxxxxxxxxx", + {"amounts": [32, 45]}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + api_base="https://api.stripe.com", + post_data="amounts[0]=32&amounts[1]=45", + ) + + def test_payment_links_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.PaymentLink.retrieve("pl_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/pl_xyz", + query_string="", + ) + + def test_payment_links_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_links/pl_xyz", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_links.retrieve("pl_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/pl_xyz", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_links_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentLink.retrieve_async("pl_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/pl_xyz", + query_string="", + ) + + @pytest.mark.anyio + async def test_payment_links_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_links/pl_xyz", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_links.retrieve_async("pl_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/pl_xyz", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payment_links_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentLink.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/payment_links", + query_string="limit=3", + ) + + def test_payment_links_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_links", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_links.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/payment_links", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_links_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentLink.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/payment_links", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_payment_links_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_links", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_links.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/payment_links", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_payment_links_get_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentLink.retrieve("plink_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/plink_xxxxxxxxxxxxx", + query_string="", + ) + + def test_payment_links_get_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_links/plink_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_links.retrieve("plink_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/plink_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_links_get_3_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentLink.retrieve_async("plink_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/plink_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_payment_links_get_3_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_links/plink_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_links.retrieve_async("plink_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/plink_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payment_links_line_items_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentLink.list_line_items("pl_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/pl_xyz/line_items", + query_string="", + ) + + def test_payment_links_line_items_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_links/pl_xyz/line_items", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_links.line_items.list("pl_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/pl_xyz/line_items", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_links_line_items_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentLink.list_line_items_async("pl_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/pl_xyz/line_items", + query_string="", + ) + + @pytest.mark.anyio + async def test_payment_links_line_items_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_links/pl_xyz/line_items", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_links.line_items.list_async("pl_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/payment_links/pl_xyz/line_items", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payment_links_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentLink.create( + line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links", + query_string="", + post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + ) + + def test_payment_links_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_links", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_links.create( + { + "line_items": [ + {"price": "price_xxxxxxxxxxxxx", "quantity": 1} + ], + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links", + query_string="", + api_base="https://api.stripe.com", + post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + ) + + @pytest.mark.anyio + async def test_payment_links_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentLink.create_async( + line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links", + query_string="", + post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + ) + + @pytest.mark.anyio + async def test_payment_links_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_links", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_links.create_async( + { + "line_items": [ + {"price": "price_xxxxxxxxxxxxx", "quantity": 1} + ], + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links", + query_string="", + api_base="https://api.stripe.com", + post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + ) + + def test_payment_links_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentLink.create( + line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links", + query_string="", + post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + ) + + def test_payment_links_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_links", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_links.create( + { + "line_items": [ + {"price": "price_xxxxxxxxxxxxx", "quantity": 1} + ], + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links", + query_string="", + api_base="https://api.stripe.com", + post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + ) + + @pytest.mark.anyio + async def test_payment_links_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentLink.create_async( + line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links", + query_string="", + post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + ) + + @pytest.mark.anyio + async def test_payment_links_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_links", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_links.create_async( + { + "line_items": [ + {"price": "price_xxxxxxxxxxxxx", "quantity": 1} + ], + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links", + query_string="", + api_base="https://api.stripe.com", + post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", + ) + + def test_payment_links_post_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentLink.modify( + "plink_xxxxxxxxxxxxx", + active=False, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links/plink_xxxxxxxxxxxxx", + query_string="", + post_data="active=False", + ) + + def test_payment_links_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_links/plink_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_links.update( + "plink_xxxxxxxxxxxxx", + {"active": False}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links/plink_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="active=False", + ) + + @pytest.mark.anyio + async def test_payment_links_post_3_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentLink.modify_async( + "plink_xxxxxxxxxxxxx", + active=False, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links/plink_xxxxxxxxxxxxx", + query_string="", + post_data="active=False", + ) + + @pytest.mark.anyio + async def test_payment_links_post_3_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_links/plink_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_links.update_async( + "plink_xxxxxxxxxxxxx", + {"active": False}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_links/plink_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="active=False", + ) + + def test_payment_method_configurations_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethodConfiguration.list(application="foo") + http_client_mock.assert_requested( + "get", + path="/v1/payment_method_configurations", + query_string="application=foo", + ) + + def test_payment_method_configurations_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_method_configurations", + "application=foo", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_method_configurations.list({"application": "foo"}) + http_client_mock.assert_requested( + "get", + path="/v1/payment_method_configurations", + query_string="application=foo", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_method_configurations_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentMethodConfiguration.list_async(application="foo") + http_client_mock.assert_requested( + "get", + path="/v1/payment_method_configurations", + query_string="application=foo", + ) + + @pytest.mark.anyio + async def test_payment_method_configurations_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_method_configurations", + "application=foo", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_method_configurations.list_async( + { + "application": "foo", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/payment_method_configurations", + query_string="application=foo", + api_base="https://api.stripe.com", + ) + + def test_payment_method_configurations_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethodConfiguration.retrieve("foo") + http_client_mock.assert_requested( + "get", + path="/v1/payment_method_configurations/foo", + query_string="", + ) + + def test_payment_method_configurations_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_method_configurations/foo", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_method_configurations.retrieve("foo") + http_client_mock.assert_requested( + "get", + path="/v1/payment_method_configurations/foo", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_method_configurations_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentMethodConfiguration.retrieve_async("foo") + http_client_mock.assert_requested( + "get", + path="/v1/payment_method_configurations/foo", + query_string="", + ) + + @pytest.mark.anyio + async def test_payment_method_configurations_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_method_configurations/foo", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_method_configurations.retrieve_async("foo") + http_client_mock.assert_requested( + "get", + path="/v1/payment_method_configurations/foo", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payment_method_configurations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethodConfiguration.create( + acss_debit={"display_preference": {"preference": "none"}}, + affirm={"display_preference": {"preference": "none"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_method_configurations", + query_string="", + post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", + ) + + def test_payment_method_configurations_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_method_configurations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_method_configurations.create( + { + "acss_debit": {"display_preference": {"preference": "none"}}, + "affirm": {"display_preference": {"preference": "none"}}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_method_configurations", + query_string="", + api_base="https://api.stripe.com", + post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", + ) + + @pytest.mark.anyio + async def test_payment_method_configurations_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentMethodConfiguration.create_async( + acss_debit={"display_preference": {"preference": "none"}}, + affirm={"display_preference": {"preference": "none"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_method_configurations", + query_string="", + post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", + ) + + @pytest.mark.anyio + async def test_payment_method_configurations_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_method_configurations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_method_configurations.create_async( + { + "acss_debit": {"display_preference": {"preference": "none"}}, + "affirm": {"display_preference": {"preference": "none"}}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_method_configurations", + query_string="", + api_base="https://api.stripe.com", + post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", + ) + + def test_payment_method_configurations_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethodConfiguration.modify( + "foo", + acss_debit={"display_preference": {"preference": "on"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_method_configurations/foo", + query_string="", + post_data="acss_debit[display_preference][preference]=on", + ) + + def test_payment_method_configurations_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_method_configurations/foo", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_method_configurations.update( + "foo", + {"acss_debit": {"display_preference": {"preference": "on"}}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_method_configurations/foo", + query_string="", + api_base="https://api.stripe.com", + post_data="acss_debit[display_preference][preference]=on", + ) + + @pytest.mark.anyio + async def test_payment_method_configurations_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentMethodConfiguration.modify_async( + "foo", + acss_debit={"display_preference": {"preference": "on"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_method_configurations/foo", + query_string="", + post_data="acss_debit[display_preference][preference]=on", + ) + + @pytest.mark.anyio + async def test_payment_method_configurations_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_method_configurations/foo", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_method_configurations.update_async( + "foo", + {"acss_debit": {"display_preference": {"preference": "on"}}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_method_configurations/foo", + query_string="", + api_base="https://api.stripe.com", + post_data="acss_debit[display_preference][preference]=on", + ) + + def test_payment_methods_attach_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethod.attach( + "pm_xxxxxxxxxxxxx", + customer="cus_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx", + ) + + def test_payment_methods_attach_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_methods.attach( + "pm_xxxxxxxxxxxxx", + {"customer": "cus_xxxxxxxxxxxxx"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", + query_string="", + api_base="https://api.stripe.com", + post_data="customer=cus_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_payment_methods_attach_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentMethod.attach_async( + "pm_xxxxxxxxxxxxx", + customer="cus_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_payment_methods_attach_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_methods.attach_async( + "pm_xxxxxxxxxxxxx", + {"customer": "cus_xxxxxxxxxxxxx"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", + query_string="", + api_base="https://api.stripe.com", + post_data="customer=cus_xxxxxxxxxxxxx", + ) + + def test_payment_methods_detach_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethod.detach("pm_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", + query_string="", + ) + + def test_payment_methods_detach_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_methods.detach("pm_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_methods_detach_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentMethod.detach_async("pm_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", + query_string="", + ) + + @pytest.mark.anyio + async def test_payment_methods_detach_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_methods.detach_async("pm_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payment_methods_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethod.list( + customer="cus_xxxxxxxxxxxxx", + type="card", + ) + http_client_mock.assert_requested( + "get", + path="/v1/payment_methods", + query_string="customer=cus_xxxxxxxxxxxxx&type=card", + ) + + def test_payment_methods_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_methods", + "customer=cus_xxxxxxxxxxxxx&type=card", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_methods.list( + { + "customer": "cus_xxxxxxxxxxxxx", + "type": "card", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/payment_methods", + query_string="customer=cus_xxxxxxxxxxxxx&type=card", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_methods_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentMethod.list_async( + customer="cus_xxxxxxxxxxxxx", + type="card", + ) + http_client_mock.assert_requested( + "get", + path="/v1/payment_methods", + query_string="customer=cus_xxxxxxxxxxxxx&type=card", + ) + + @pytest.mark.anyio + async def test_payment_methods_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_methods", + "customer=cus_xxxxxxxxxxxxx&type=card", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_methods.list_async( + { + "customer": "cus_xxxxxxxxxxxxx", + "type": "card", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/payment_methods", + query_string="customer=cus_xxxxxxxxxxxxx&type=card", + api_base="https://api.stripe.com", + ) + + def test_payment_methods_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethod.retrieve("pm_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx", + query_string="", + ) + + def test_payment_methods_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_methods/pm_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_methods.retrieve("pm_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payment_methods_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentMethod.retrieve_async("pm_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_payment_methods_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payment_methods/pm_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_methods.retrieve_async("pm_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payment_methods_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethod.create( + type="card", + card={ + "number": "4242424242424242", + "exp_month": 8, + "exp_year": 2024, + "cvc": "314", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods", + query_string="", + post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", + ) + + def test_payment_methods_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_methods", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_methods.create( + { + "type": "card", + "card": { + "number": "4242424242424242", + "exp_month": 8, + "exp_year": 2024, + "cvc": "314", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods", + query_string="", + api_base="https://api.stripe.com", + post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", + ) + + @pytest.mark.anyio + async def test_payment_methods_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentMethod.create_async( + type="card", + card={ + "number": "4242424242424242", + "exp_month": 8, + "exp_year": 2024, + "cvc": "314", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods", + query_string="", + post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", + ) + + @pytest.mark.anyio + async def test_payment_methods_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_methods", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_methods.create_async( + { + "type": "card", + "card": { + "number": "4242424242424242", + "exp_month": 8, + "exp_year": 2024, + "cvc": "314", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods", + query_string="", + api_base="https://api.stripe.com", + post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", + ) + + def test_payment_methods_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PaymentMethod.modify( + "pm_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_payment_methods_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_methods/pm_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payment_methods.update( + "pm_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_payment_methods_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PaymentMethod.modify_async( + "pm_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_payment_methods_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payment_methods/pm_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payment_methods.update_async( + "pm_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payment_methods/pm_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_payouts_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Payout.cancel("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", + query_string="", + ) + + def test_payouts_cancel_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payouts/po_xxxxxxxxxxxxx/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payouts.cancel("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payouts_cancel_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Payout.cancel_async("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", + query_string="", + ) + + @pytest.mark.anyio + async def test_payouts_cancel_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payouts/po_xxxxxxxxxxxxx/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payouts.cancel_async("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payouts_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Payout.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/payouts", + query_string="limit=3", + ) + + def test_payouts_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payouts", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payouts.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/payouts", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payouts_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Payout.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/payouts", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_payouts_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payouts", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payouts.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/payouts", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_payouts_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Payout.retrieve("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payouts/po_xxxxxxxxxxxxx", + query_string="", + ) + + def test_payouts_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payouts/po_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payouts.retrieve("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payouts/po_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payouts_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Payout.retrieve_async("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payouts/po_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_payouts_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/payouts/po_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payouts.retrieve_async("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/payouts/po_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_payouts_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Payout.create( + amount=1100, + currency="usd", + ) + http_client_mock.assert_requested( + "post", + path="/v1/payouts", + query_string="", + post_data="amount=1100¤cy=usd", + ) + + def test_payouts_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payouts", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payouts.create({"amount": 1100, "currency": "usd"}) + http_client_mock.assert_requested( + "post", + path="/v1/payouts", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=1100¤cy=usd", + ) + + @pytest.mark.anyio + async def test_payouts_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Payout.create_async( + amount=1100, + currency="usd", + ) + http_client_mock.assert_requested( + "post", + path="/v1/payouts", + query_string="", + post_data="amount=1100¤cy=usd", + ) + + @pytest.mark.anyio + async def test_payouts_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payouts", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payouts.create_async({"amount": 1100, "currency": "usd"}) + http_client_mock.assert_requested( + "post", + path="/v1/payouts", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=1100¤cy=usd", + ) + + def test_payouts_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Payout.modify( + "po_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_payouts_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payouts/po_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payouts.update( + "po_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_payouts_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Payout.modify_async( + "po_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_payouts_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payouts/po_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payouts.update_async( + "po_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_payouts_reverse_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Payout.reverse("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", + query_string="", + ) + + def test_payouts_reverse_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payouts/po_xxxxxxxxxxxxx/reverse", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.payouts.reverse("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_payouts_reverse_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Payout.reverse_async("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", + query_string="", + ) + + @pytest.mark.anyio + async def test_payouts_reverse_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/payouts/po_xxxxxxxxxxxxx/reverse", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.payouts.reverse_async("po_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_plans_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.Plan.delete("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + ) + + def test_plans_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/plans/price_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.plans.delete("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_plans_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Plan.delete_async("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_plans_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/plans/price_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.plans.delete_async("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_plans_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Plan.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/plans", + query_string="limit=3", + ) + + def test_plans_get_service(self, http_client_mock: HTTPClientMock) -> None: + http_client_mock.stub_request( + "get", + "/v1/plans", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.plans.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/plans", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_plans_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Plan.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/plans", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_plans_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/plans", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.plans.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/plans", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_plans_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Plan.retrieve("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + ) + + def test_plans_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/plans/price_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.plans.retrieve("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_plans_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Plan.retrieve_async("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_plans_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/plans/price_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.plans.retrieve_async("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_plans_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Plan.create( + amount=2000, + currency="usd", + interval="month", + product="prod_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans", + query_string="", + post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", + ) + + def test_plans_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/plans", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.plans.create( + { + "amount": 2000, + "currency": "usd", + "interval": "month", + "product": "prod_xxxxxxxxxxxxx", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_plans_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Plan.create_async( + amount=2000, + currency="usd", + interval="month", + product="prod_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans", + query_string="", + post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_plans_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/plans", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.plans.create_async( + { + "amount": 2000, + "currency": "usd", + "interval": "month", + "product": "prod_xxxxxxxxxxxxx", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", + ) + + def test_plans_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Plan.create( + amount=2000, + currency="usd", + interval="month", + product={"name": "My product"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans", + query_string="", + post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", + ) + + def test_plans_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/plans", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.plans.create( + { + "amount": 2000, + "currency": "usd", + "interval": "month", + "product": {"name": "My product"}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", + ) + + @pytest.mark.anyio + async def test_plans_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Plan.create_async( + amount=2000, + currency="usd", + interval="month", + product={"name": "My product"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans", + query_string="", + post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", + ) + + @pytest.mark.anyio + async def test_plans_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/plans", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.plans.create_async( + { + "amount": 2000, + "currency": "usd", + "interval": "month", + "product": {"name": "My product"}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", + ) + + def test_plans_post_3(self, http_client_mock: HTTPClientMock) -> None: + stripe.Plan.modify( + "price_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_plans_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/plans/price_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.plans.update( + "price_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_plans_post_3_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Plan.modify_async( + "price_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_plans_post_3_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/plans/price_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.plans.update_async( + "price_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/plans/price_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_prices_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Price.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/prices", + query_string="limit=3", + ) + + def test_prices_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/prices", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.prices.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/prices", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_prices_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Price.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/prices", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_prices_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/prices", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.prices.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/prices", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_prices_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Price.retrieve("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/prices/price_xxxxxxxxxxxxx", + query_string="", + ) + + def test_prices_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/prices/price_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.prices.retrieve("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/prices/price_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_prices_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Price.retrieve_async("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/prices/price_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_prices_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/prices/price_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.prices.retrieve_async("price_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/prices/price_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_prices_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Price.create( + unit_amount=2000, + currency="usd", + currency_options={ + "uah": {"unit_amount": 5000}, + "eur": {"unit_amount": 1800}, + }, + recurring={"interval": "month"}, + product="prod_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices", + query_string="", + post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", + ) + + def test_prices_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/prices", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.prices.create( + { + "unit_amount": 2000, + "currency": "usd", + "currency_options": { + "uah": {"unit_amount": 5000}, + "eur": {"unit_amount": 1800}, + }, + "recurring": {"interval": "month"}, + "product": "prod_xxxxxxxxxxxxx", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices", + query_string="", + api_base="https://api.stripe.com", + post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_prices_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Price.create_async( + unit_amount=2000, + currency="usd", + currency_options={ + "uah": {"unit_amount": 5000}, + "eur": {"unit_amount": 1800}, + }, + recurring={"interval": "month"}, + product="prod_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices", + query_string="", + post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_prices_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/prices", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.prices.create_async( + { + "unit_amount": 2000, + "currency": "usd", + "currency_options": { + "uah": {"unit_amount": 5000}, + "eur": {"unit_amount": 1800}, + }, + "recurring": {"interval": "month"}, + "product": "prod_xxxxxxxxxxxxx", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices", + query_string="", + api_base="https://api.stripe.com", + post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", + ) + + def test_prices_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Price.create( + unit_amount=2000, + currency="usd", + recurring={"interval": "month"}, + product="prod_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices", + query_string="", + post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", + ) + + def test_prices_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/prices", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.prices.create( + { + "unit_amount": 2000, + "currency": "usd", + "recurring": {"interval": "month"}, + "product": "prod_xxxxxxxxxxxxx", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices", + query_string="", + api_base="https://api.stripe.com", + post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_prices_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Price.create_async( + unit_amount=2000, + currency="usd", + recurring={"interval": "month"}, + product="prod_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices", + query_string="", + post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_prices_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/prices", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.prices.create_async( + { + "unit_amount": 2000, + "currency": "usd", + "recurring": {"interval": "month"}, + "product": "prod_xxxxxxxxxxxxx", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices", + query_string="", + api_base="https://api.stripe.com", + post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", + ) + + def test_prices_post_3(self, http_client_mock: HTTPClientMock) -> None: + stripe.Price.modify( + "price_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices/price_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_prices_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/prices/price_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.prices.update( + "price_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices/price_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_prices_post_3_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Price.modify_async( + "price_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices/price_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_prices_post_3_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/prices/price_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.prices.update_async( + "price_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/prices/price_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_prices_search_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Price.search( + query="active:'true' AND metadata['order_id']:'6735'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/prices/search", + query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + + def test_prices_search_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/prices/search", + "query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.prices.search( + { + "query": "active:'true' AND metadata['order_id']:'6735'", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/prices/search", + query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_prices_search_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Price.search_async( + query="active:'true' AND metadata['order_id']:'6735'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/prices/search", + query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + + @pytest.mark.anyio + async def test_prices_search_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/prices/search", + "query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.prices.search_async( + { + "query": "active:'true' AND metadata['order_id']:'6735'", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/prices/search", + query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + api_base="https://api.stripe.com", + ) + + def test_products_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.Product.delete("prod_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + ) + + def test_products_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/products/prod_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.products.delete("prod_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_products_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Product.delete_async("prod_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_products_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/products/prod_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.products.delete_async("prod_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_products_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Product.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/products", + query_string="limit=3", + ) + + def test_products_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/products", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.products.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/products", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_products_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Product.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/products", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_products_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/products", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.products.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/products", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_products_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Product.retrieve("prod_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + ) + + def test_products_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/products/prod_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.products.retrieve("prod_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_products_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Product.retrieve_async("prod_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_products_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/products/prod_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.products.retrieve_async("prod_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_products_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Product.create(name="Gold Special") + http_client_mock.assert_requested( + "post", + path="/v1/products", + query_string="", + post_data="name=Gold%20Special", + ) + + def test_products_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/products", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.products.create({"name": "Gold Special"}) + http_client_mock.assert_requested( + "post", + path="/v1/products", + query_string="", + api_base="https://api.stripe.com", + post_data="name=Gold%20Special", + ) + + @pytest.mark.anyio + async def test_products_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Product.create_async(name="Gold Special") + http_client_mock.assert_requested( + "post", + path="/v1/products", + query_string="", + post_data="name=Gold%20Special", + ) + + @pytest.mark.anyio + async def test_products_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/products", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.products.create_async({"name": "Gold Special"}) + http_client_mock.assert_requested( + "post", + path="/v1/products", + query_string="", + api_base="https://api.stripe.com", + post_data="name=Gold%20Special", + ) + + def test_products_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Product.modify( + "prod_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_products_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/products/prod_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.products.update( + "prod_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_products_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Product.modify_async( + "prod_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_products_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/products/prod_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.products.update_async( + "prod_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/products/prod_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_products_search_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Product.search( + query="active:'true' AND metadata['order_id']:'6735'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/products/search", + query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + + def test_products_search_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/products/search", + "query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.products.search( + { + "query": "active:'true' AND metadata['order_id']:'6735'", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/products/search", + query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_products_search_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Product.search_async( + query="active:'true' AND metadata['order_id']:'6735'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/products/search", + query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + + @pytest.mark.anyio + async def test_products_search_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/products/search", + "query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.products.search_async( + { + "query": "active:'true' AND metadata['order_id']:'6735'", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/products/search", + query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + api_base="https://api.stripe.com", + ) + + def test_promotion_codes_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PromotionCode.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/promotion_codes", + query_string="limit=3", + ) + + def test_promotion_codes_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/promotion_codes", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.promotion_codes.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/promotion_codes", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_promotion_codes_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PromotionCode.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/promotion_codes", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_promotion_codes_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/promotion_codes", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.promotion_codes.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/promotion_codes", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_promotion_codes_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PromotionCode.retrieve("promo_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", + query_string="", + ) + + def test_promotion_codes_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/promotion_codes/promo_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.promotion_codes.retrieve("promo_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_promotion_codes_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PromotionCode.retrieve_async("promo_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_promotion_codes_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/promotion_codes/promo_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.promotion_codes.retrieve_async("promo_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_promotion_codes_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PromotionCode.create(coupon="Z4OV52SU") + http_client_mock.assert_requested( + "post", + path="/v1/promotion_codes", + query_string="", + post_data="coupon=Z4OV52SU", + ) + + def test_promotion_codes_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/promotion_codes", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.promotion_codes.create({"coupon": "Z4OV52SU"}) + http_client_mock.assert_requested( + "post", + path="/v1/promotion_codes", + query_string="", + api_base="https://api.stripe.com", + post_data="coupon=Z4OV52SU", + ) + + @pytest.mark.anyio + async def test_promotion_codes_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PromotionCode.create_async(coupon="Z4OV52SU") + http_client_mock.assert_requested( + "post", + path="/v1/promotion_codes", + query_string="", + post_data="coupon=Z4OV52SU", + ) + + @pytest.mark.anyio + async def test_promotion_codes_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/promotion_codes", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.promotion_codes.create_async({"coupon": "Z4OV52SU"}) + http_client_mock.assert_requested( + "post", + path="/v1/promotion_codes", + query_string="", + api_base="https://api.stripe.com", + post_data="coupon=Z4OV52SU", + ) + + def test_promotion_codes_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.PromotionCode.modify( + "promo_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_promotion_codes_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/promotion_codes/promo_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.promotion_codes.update( + "promo_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_promotion_codes_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.PromotionCode.modify_async( + "promo_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_promotion_codes_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/promotion_codes/promo_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.promotion_codes.update_async( + "promo_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_quotes_accept_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Quote.accept("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", + query_string="", + ) + + def test_quotes_accept_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/quotes/qt_xxxxxxxxxxxxx/accept", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.quotes.accept("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_quotes_accept_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Quote.accept_async("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", + query_string="", + ) + + @pytest.mark.anyio + async def test_quotes_accept_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/quotes/qt_xxxxxxxxxxxxx/accept", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.quotes.accept_async("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_quotes_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Quote.cancel("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", + query_string="", + ) + + def test_quotes_cancel_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/quotes/qt_xxxxxxxxxxxxx/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.quotes.cancel("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_quotes_cancel_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Quote.cancel_async("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", + query_string="", + ) + + @pytest.mark.anyio + async def test_quotes_cancel_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/quotes/qt_xxxxxxxxxxxxx/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.quotes.cancel_async("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_quotes_finalize_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Quote.finalize_quote("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", + query_string="", + ) + + def test_quotes_finalize_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/quotes/qt_xxxxxxxxxxxxx/finalize", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.quotes.finalize_quote("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_quotes_finalize_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Quote.finalize_quote_async("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", + query_string="", + ) + + @pytest.mark.anyio + async def test_quotes_finalize_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/quotes/qt_xxxxxxxxxxxxx/finalize", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.quotes.finalize_quote_async("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_quotes_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Quote.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/quotes", + query_string="limit=3", + ) + + def test_quotes_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/quotes", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.quotes.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/quotes", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_quotes_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Quote.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/quotes", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_quotes_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/quotes", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.quotes.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/quotes", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_quotes_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Quote.retrieve("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx", + query_string="", + ) + + def test_quotes_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/quotes/qt_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.quotes.retrieve("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_quotes_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Quote.retrieve_async("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_quotes_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/quotes/qt_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.quotes.retrieve_async("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_quotes_line_items_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Quote.list_line_items("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", + query_string="", + ) + + def test_quotes_line_items_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/quotes/qt_xxxxxxxxxxxxx/line_items", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.quotes.line_items.list("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_quotes_line_items_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Quote.list_line_items_async("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", + query_string="", + ) + + @pytest.mark.anyio + async def test_quotes_line_items_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/quotes/qt_xxxxxxxxxxxxx/line_items", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.quotes.line_items.list_async("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_quotes_pdf_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Quote.pdf("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", + query_string="", + ) + + def test_quotes_pdf_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/quotes/qt_xxxxxxxxxxxxx/pdf", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.quotes.pdf("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", + query_string="", + api_base="https://files.stripe.com", + ) + + @pytest.mark.anyio + async def test_quotes_pdf_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Quote.pdf_async("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", + query_string="", + ) + + @pytest.mark.anyio + async def test_quotes_pdf_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/quotes/qt_xxxxxxxxxxxxx/pdf", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.quotes.pdf_async("qt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", + query_string="", + api_base="https://files.stripe.com", + ) + + def test_quotes_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Quote.create( + customer="cus_xxxxxxxxxxxxx", + line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], + ) + http_client_mock.assert_requested( + "post", + path="/v1/quotes", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", + ) + + def test_quotes_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/quotes", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.quotes.create( + { + "customer": "cus_xxxxxxxxxxxxx", + "line_items": [ + {"price": "price_xxxxxxxxxxxxx", "quantity": 2} + ], + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/quotes", + query_string="", + api_base="https://api.stripe.com", + post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", + ) + + @pytest.mark.anyio + async def test_quotes_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Quote.create_async( + customer="cus_xxxxxxxxxxxxx", + line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], + ) + http_client_mock.assert_requested( + "post", + path="/v1/quotes", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", + ) + + @pytest.mark.anyio + async def test_quotes_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/quotes", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.quotes.create_async( + { + "customer": "cus_xxxxxxxxxxxxx", + "line_items": [ + {"price": "price_xxxxxxxxxxxxx", "quantity": 2} + ], + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/quotes", + query_string="", + api_base="https://api.stripe.com", + post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", + ) + + def test_quotes_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Quote.modify( + "qt_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_quotes_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/quotes/qt_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.quotes.update( + "qt_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_quotes_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Quote.modify_async( + "qt_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_quotes_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/quotes/qt_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.quotes.update_async( + "qt_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/quotes/qt_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_radar_early_fraud_warnings_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.EarlyFraudWarning.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/radar/early_fraud_warnings", + query_string="limit=3", + ) + + def test_radar_early_fraud_warnings_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/radar/early_fraud_warnings", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.radar.early_fraud_warnings.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/radar/early_fraud_warnings", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_radar_early_fraud_warnings_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.radar.EarlyFraudWarning.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/radar/early_fraud_warnings", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_radar_early_fraud_warnings_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/radar/early_fraud_warnings", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.radar.early_fraud_warnings.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/radar/early_fraud_warnings", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_radar_early_fraud_warnings_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.EarlyFraudWarning.retrieve("issfr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", + query_string="", + ) + + def test_radar_early_fraud_warnings_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.radar.early_fraud_warnings.retrieve("issfr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_radar_early_fraud_warnings_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.radar.EarlyFraudWarning.retrieve_async( + "issfr_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_radar_early_fraud_warnings_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.radar.early_fraud_warnings.retrieve_async( + "issfr_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_radar_value_list_items_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueListItem.delete("rsli_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + query_string="", + ) + + def test_radar_value_list_items_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.radar.value_list_items.delete("rsli_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_radar_value_list_items_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.radar.ValueListItem.delete_async("rsli_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_radar_value_list_items_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.radar.value_list_items.delete_async("rsli_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_radar_value_list_items_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueListItem.list( + limit=3, + value_list="rsl_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_list_items", + query_string="limit=3&value_list=rsl_xxxxxxxxxxxxx", + ) + + def test_radar_value_list_items_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/radar/value_list_items", + "limit=3&value_list=rsl_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.radar.value_list_items.list( + { + "limit": 3, + "value_list": "rsl_xxxxxxxxxxxxx", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_list_items", + query_string="limit=3&value_list=rsl_xxxxxxxxxxxxx", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_radar_value_list_items_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.radar.ValueListItem.list_async( + limit=3, + value_list="rsl_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_list_items", + query_string="limit=3&value_list=rsl_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_radar_value_list_items_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/radar/value_list_items", + "limit=3&value_list=rsl_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.radar.value_list_items.list_async( + { + "limit": 3, + "value_list": "rsl_xxxxxxxxxxxxx", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_list_items", + query_string="limit=3&value_list=rsl_xxxxxxxxxxxxx", + api_base="https://api.stripe.com", + ) + + def test_radar_value_list_items_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueListItem.retrieve("rsli_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + query_string="", + ) + + def test_radar_value_list_items_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.radar.value_list_items.retrieve("rsli_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_radar_value_list_items_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.radar.ValueListItem.retrieve_async("rsli_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_radar_value_list_items_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.radar.value_list_items.retrieve_async( + "rsli_xxxxxxxxxxxxx" + ) + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_radar_value_list_items_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueListItem.create( + value_list="rsl_xxxxxxxxxxxxx", + value="1.2.3.4", + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_list_items", + query_string="", + post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", + ) + + def test_radar_value_list_items_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/radar/value_list_items", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.radar.value_list_items.create( + { + "value_list": "rsl_xxxxxxxxxxxxx", + "value": "1.2.3.4", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_list_items", + query_string="", + api_base="https://api.stripe.com", + post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", + ) + + @pytest.mark.anyio + async def test_radar_value_list_items_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.radar.ValueListItem.create_async( + value_list="rsl_xxxxxxxxxxxxx", + value="1.2.3.4", + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_list_items", + query_string="", + post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", + ) + + @pytest.mark.anyio + async def test_radar_value_list_items_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/radar/value_list_items", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.radar.value_list_items.create_async( + { + "value_list": "rsl_xxxxxxxxxxxxx", + "value": "1.2.3.4", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_list_items", + query_string="", + api_base="https://api.stripe.com", + post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", + ) + + def test_radar_value_lists_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueList.delete("rsl_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + ) + + def test_radar_value_lists_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.radar.value_lists.delete("rsl_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_radar_value_lists_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.radar.ValueList.delete_async("rsl_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_radar_value_lists_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.radar.value_lists.delete_async("rsl_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_radar_value_lists_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueList.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_lists", + query_string="limit=3", + ) + + def test_radar_value_lists_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/radar/value_lists", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.radar.value_lists.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_lists", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_radar_value_lists_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.radar.ValueList.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_lists", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_radar_value_lists_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/radar/value_lists", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.radar.value_lists.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_lists", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_radar_value_lists_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueList.retrieve("rsl_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + ) + + def test_radar_value_lists_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.radar.value_lists.retrieve("rsl_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_radar_value_lists_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.radar.ValueList.retrieve_async("rsl_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_radar_value_lists_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.radar.value_lists.retrieve_async("rsl_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_radar_value_lists_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueList.create( + alias="custom_ip_xxxxxxxxxxxxx", + name="Custom IP Blocklist", + item_type="ip_address", + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_lists", + query_string="", + post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", + ) + + def test_radar_value_lists_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/radar/value_lists", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.radar.value_lists.create( + { + "alias": "custom_ip_xxxxxxxxxxxxx", + "name": "Custom IP Blocklist", + "item_type": "ip_address", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_lists", + query_string="", + api_base="https://api.stripe.com", + post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", + ) + + @pytest.mark.anyio + async def test_radar_value_lists_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.radar.ValueList.create_async( + alias="custom_ip_xxxxxxxxxxxxx", + name="Custom IP Blocklist", + item_type="ip_address", + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_lists", + query_string="", + post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", + ) + + @pytest.mark.anyio + async def test_radar_value_lists_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/radar/value_lists", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.radar.value_lists.create_async( + { + "alias": "custom_ip_xxxxxxxxxxxxx", + "name": "Custom IP Blocklist", + "item_type": "ip_address", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_lists", + query_string="", + api_base="https://api.stripe.com", + post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", + ) + + def test_radar_value_lists_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.radar.ValueList.modify( + "rsl_xxxxxxxxxxxxx", + name="Updated IP Block List", + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + post_data="name=Updated%20IP%20Block%20List", + ) + + def test_radar_value_lists_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.radar.value_lists.update( + "rsl_xxxxxxxxxxxxx", + {"name": "Updated IP Block List"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="name=Updated%20IP%20Block%20List", + ) + + @pytest.mark.anyio + async def test_radar_value_lists_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.radar.ValueList.modify_async( + "rsl_xxxxxxxxxxxxx", + name="Updated IP Block List", + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + post_data="name=Updated%20IP%20Block%20List", + ) + + @pytest.mark.anyio + async def test_radar_value_lists_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.radar.value_lists.update_async( + "rsl_xxxxxxxxxxxxx", + {"name": "Updated IP Block List"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="name=Updated%20IP%20Block%20List", + ) + + def test_refunds_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Refund.cancel("re_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", + query_string="", + ) + + def test_refunds_cancel_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/refunds/re_xxxxxxxxxxxxx/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.refunds.cancel("re_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_refunds_cancel_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Refund.cancel_async("re_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", + query_string="", + ) + + @pytest.mark.anyio + async def test_refunds_cancel_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/refunds/re_xxxxxxxxxxxxx/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.refunds.cancel_async("re_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_refunds_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Refund.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/refunds", + query_string="limit=3", + ) + + def test_refunds_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/refunds", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.refunds.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/refunds", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_refunds_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Refund.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/refunds", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_refunds_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/refunds", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.refunds.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/refunds", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_refunds_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Refund.retrieve("re_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/refunds/re_xxxxxxxxxxxxx", + query_string="", + ) + + def test_refunds_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/refunds/re_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.refunds.retrieve("re_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/refunds/re_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_refunds_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Refund.retrieve_async("re_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/refunds/re_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_refunds_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/refunds/re_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.refunds.retrieve_async("re_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/refunds/re_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_refunds_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Refund.create(charge="ch_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/refunds", + query_string="", + post_data="charge=ch_xxxxxxxxxxxxx", + ) + + def test_refunds_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/refunds", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.refunds.create({"charge": "ch_xxxxxxxxxxxxx"}) + http_client_mock.assert_requested( + "post", + path="/v1/refunds", + query_string="", + api_base="https://api.stripe.com", + post_data="charge=ch_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_refunds_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Refund.create_async(charge="ch_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/refunds", + query_string="", + post_data="charge=ch_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_refunds_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/refunds", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.refunds.create_async({"charge": "ch_xxxxxxxxxxxxx"}) + http_client_mock.assert_requested( + "post", + path="/v1/refunds", + query_string="", + api_base="https://api.stripe.com", + post_data="charge=ch_xxxxxxxxxxxxx", + ) + + def test_refunds_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Refund.modify( + "re_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/refunds/re_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_refunds_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/refunds/re_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.refunds.update( + "re_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/refunds/re_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_refunds_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Refund.modify_async( + "re_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/refunds/re_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_refunds_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/refunds/re_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.refunds.update_async( + "re_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/refunds/re_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_reporting_report_runs_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.reporting.ReportRun.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_runs", + query_string="limit=3", + ) + + def test_reporting_report_runs_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/reporting/report_runs", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.reporting.report_runs.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_runs", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_reporting_report_runs_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.reporting.ReportRun.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_runs", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_reporting_report_runs_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/reporting/report_runs", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.reporting.report_runs.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_runs", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_reporting_report_runs_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.reporting.ReportRun.retrieve("frr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", + query_string="", + ) + + def test_reporting_report_runs_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.reporting.report_runs.retrieve("frr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_reporting_report_runs_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.reporting.ReportRun.retrieve_async("frr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_reporting_report_runs_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.reporting.report_runs.retrieve_async("frr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_reporting_report_runs_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.reporting.ReportRun.create( + report_type="balance.summary.1", + parameters={ + "interval_start": 1522540800, + "interval_end": 1525132800, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/reporting/report_runs", + query_string="", + post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", + ) + + def test_reporting_report_runs_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/reporting/report_runs", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.reporting.report_runs.create( + { + "report_type": "balance.summary.1", + "parameters": { + "interval_start": 1522540800, + "interval_end": 1525132800, + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/reporting/report_runs", + query_string="", + api_base="https://api.stripe.com", + post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", + ) + + @pytest.mark.anyio + async def test_reporting_report_runs_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.reporting.ReportRun.create_async( + report_type="balance.summary.1", + parameters={ + "interval_start": 1522540800, + "interval_end": 1525132800, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/reporting/report_runs", + query_string="", + post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", + ) + + @pytest.mark.anyio + async def test_reporting_report_runs_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/reporting/report_runs", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.reporting.report_runs.create_async( + { + "report_type": "balance.summary.1", + "parameters": { + "interval_start": 1522540800, + "interval_end": 1525132800, + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/reporting/report_runs", + query_string="", + api_base="https://api.stripe.com", + post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", + ) + + def test_reporting_report_types_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.reporting.ReportType.list() + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_types", + query_string="", + ) + + def test_reporting_report_types_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/reporting/report_types", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.reporting.report_types.list() + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_types", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_reporting_report_types_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.reporting.ReportType.list_async() + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_types", + query_string="", + ) + + @pytest.mark.anyio + async def test_reporting_report_types_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/reporting/report_types", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.reporting.report_types.list_async() + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_types", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_reporting_report_types_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.reporting.ReportType.retrieve("balance.summary.1") + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_types/balance.summary.1", + query_string="", + ) + + def test_reporting_report_types_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/reporting/report_types/balance.summary.1", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.reporting.report_types.retrieve("balance.summary.1") + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_types/balance.summary.1", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_reporting_report_types_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.reporting.ReportType.retrieve_async("balance.summary.1") + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_types/balance.summary.1", + query_string="", + ) + + @pytest.mark.anyio + async def test_reporting_report_types_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/reporting/report_types/balance.summary.1", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.reporting.report_types.retrieve_async("balance.summary.1") + http_client_mock.assert_requested( + "get", + path="/v1/reporting/report_types/balance.summary.1", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_reviews_approve_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Review.approve("prv_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", + query_string="", + ) + + def test_reviews_approve_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/reviews/prv_xxxxxxxxxxxxx/approve", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.reviews.approve("prv_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_reviews_approve_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Review.approve_async("prv_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", + query_string="", + ) + + @pytest.mark.anyio + async def test_reviews_approve_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/reviews/prv_xxxxxxxxxxxxx/approve", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.reviews.approve_async("prv_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_reviews_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Review.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/reviews", + query_string="limit=3", + ) + + def test_reviews_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/reviews", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.reviews.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/reviews", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_reviews_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Review.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/reviews", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_reviews_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/reviews", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.reviews.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/reviews", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_reviews_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Review.retrieve("prv_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/reviews/prv_xxxxxxxxxxxxx", + query_string="", + ) + + def test_reviews_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/reviews/prv_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.reviews.retrieve("prv_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/reviews/prv_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_reviews_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Review.retrieve_async("prv_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/reviews/prv_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_reviews_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/reviews/prv_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.reviews.retrieve_async("prv_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/reviews/prv_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_setup_attempts_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupAttempt.list( + limit=3, + setup_intent="si_xyz", + ) + http_client_mock.assert_requested( + "get", + path="/v1/setup_attempts", + query_string="limit=3&setup_intent=si_xyz", + ) + + def test_setup_attempts_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/setup_attempts", + "limit=3&setup_intent=si_xyz", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.setup_attempts.list({"limit": 3, "setup_intent": "si_xyz"}) + http_client_mock.assert_requested( + "get", + path="/v1/setup_attempts", + query_string="limit=3&setup_intent=si_xyz", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_setup_attempts_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SetupAttempt.list_async( + limit=3, + setup_intent="si_xyz", + ) + http_client_mock.assert_requested( + "get", + path="/v1/setup_attempts", + query_string="limit=3&setup_intent=si_xyz", + ) + + @pytest.mark.anyio + async def test_setup_attempts_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/setup_attempts", + "limit=3&setup_intent=si_xyz", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.setup_attempts.list_async( + { + "limit": 3, + "setup_intent": "si_xyz", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/setup_attempts", + query_string="limit=3&setup_intent=si_xyz", + api_base="https://api.stripe.com", + ) + + def test_setup_intents_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.cancel("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", + query_string="", + ) + + def test_setup_intents_cancel_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.setup_intents.cancel("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_setup_intents_cancel_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SetupIntent.cancel_async("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", + query_string="", + ) + + @pytest.mark.anyio + async def test_setup_intents_cancel_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.setup_intents.cancel_async("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_setup_intents_confirm_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.confirm( + "seti_xxxxxxxxxxxxx", + payment_method="pm_card_visa", + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", + query_string="", + post_data="payment_method=pm_card_visa", + ) + + def test_setup_intents_confirm_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.setup_intents.confirm( + "seti_xxxxxxxxxxxxx", + {"payment_method": "pm_card_visa"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", + query_string="", + api_base="https://api.stripe.com", + post_data="payment_method=pm_card_visa", + ) + + @pytest.mark.anyio + async def test_setup_intents_confirm_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SetupIntent.confirm_async( + "seti_xxxxxxxxxxxxx", + payment_method="pm_card_visa", + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", + query_string="", + post_data="payment_method=pm_card_visa", + ) + + @pytest.mark.anyio + async def test_setup_intents_confirm_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.setup_intents.confirm_async( + "seti_xxxxxxxxxxxxx", + {"payment_method": "pm_card_visa"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", + query_string="", + api_base="https://api.stripe.com", + post_data="payment_method=pm_card_visa", + ) + + def test_setup_intents_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.SetupIntent.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/setup_intents", + query_string="limit=3", + ) + + def test_setup_intents_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/setup_intents", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.setup_intents.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/setup_intents", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_setup_intents_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SetupIntent.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/setup_intents", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_setup_intents_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/setup_intents", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.setup_intents.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/setup_intents", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_setup_intents_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.retrieve("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + query_string="", + ) + + def test_setup_intents_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/setup_intents/seti_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.setup_intents.retrieve("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_setup_intents_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SetupIntent.retrieve_async("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_setup_intents_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/setup_intents/seti_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.setup_intents.retrieve_async("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_setup_intents_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.create(payment_method_types=["card"]) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents", + query_string="", + post_data="payment_method_types[0]=card", + ) + + def test_setup_intents_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/setup_intents", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.setup_intents.create({"payment_method_types": ["card"]}) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents", + query_string="", + api_base="https://api.stripe.com", + post_data="payment_method_types[0]=card", + ) + + @pytest.mark.anyio + async def test_setup_intents_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SetupIntent.create_async(payment_method_types=["card"]) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents", + query_string="", + post_data="payment_method_types[0]=card", + ) + + @pytest.mark.anyio + async def test_setup_intents_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/setup_intents", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.setup_intents.create_async( + { + "payment_method_types": ["card"], + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents", + query_string="", + api_base="https://api.stripe.com", + post_data="payment_method_types[0]=card", + ) + + def test_setup_intents_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.modify( + "seti_xxxxxxxxxxxxx", + metadata={"user_id": "3435453"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[user_id]=3435453", + ) + + def test_setup_intents_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/setup_intents/seti_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.setup_intents.update( + "seti_xxxxxxxxxxxxx", + {"metadata": {"user_id": "3435453"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[user_id]=3435453", + ) + + @pytest.mark.anyio + async def test_setup_intents_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SetupIntent.modify_async( + "seti_xxxxxxxxxxxxx", + metadata={"user_id": "3435453"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[user_id]=3435453", + ) + + @pytest.mark.anyio + async def test_setup_intents_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/setup_intents/seti_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.setup_intents.update_async( + "seti_xxxxxxxxxxxxx", + {"metadata": {"user_id": "3435453"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[user_id]=3435453", + ) + + def test_setup_intents_verify_microdeposits_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.verify_microdeposits("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + ) + + def test_setup_intents_verify_microdeposits_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.setup_intents.verify_microdeposits("seti_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_setup_intents_verify_microdeposits_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SetupIntent.verify_microdeposits_async( + "seti_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + ) + + @pytest.mark.anyio + async def test_setup_intents_verify_microdeposits_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.setup_intents.verify_microdeposits_async( + "seti_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_setup_intents_verify_microdeposits_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SetupIntent.verify_microdeposits( + "seti_xxxxxxxxxxxxx", + amounts=[32, 45], + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + post_data="amounts[0]=32&amounts[1]=45", + ) + + def test_setup_intents_verify_microdeposits_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.setup_intents.verify_microdeposits( + "seti_xxxxxxxxxxxxx", + {"amounts": [32, 45]}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + api_base="https://api.stripe.com", + post_data="amounts[0]=32&amounts[1]=45", + ) + + @pytest.mark.anyio + async def test_setup_intents_verify_microdeposits_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SetupIntent.verify_microdeposits_async( + "seti_xxxxxxxxxxxxx", + amounts=[32, 45], + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + post_data="amounts[0]=32&amounts[1]=45", + ) + + @pytest.mark.anyio + async def test_setup_intents_verify_microdeposits_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.setup_intents.verify_microdeposits_async( + "seti_xxxxxxxxxxxxx", + {"amounts": [32, 45]}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", + query_string="", + api_base="https://api.stripe.com", + post_data="amounts[0]=32&amounts[1]=45", + ) + + def test_shipping_rates_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ShippingRate.list() + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates", + query_string="", + ) + + def test_shipping_rates_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/shipping_rates", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.shipping_rates.list() + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_shipping_rates_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.ShippingRate.list_async() + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates", + query_string="", + ) + + @pytest.mark.anyio + async def test_shipping_rates_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/shipping_rates", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.shipping_rates.list_async() + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_shipping_rates_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ShippingRate.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates", + query_string="limit=3", + ) + + def test_shipping_rates_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/shipping_rates", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.shipping_rates.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_shipping_rates_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.ShippingRate.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_shipping_rates_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/shipping_rates", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.shipping_rates.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_shipping_rates_get_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ShippingRate.retrieve("shr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + query_string="", + ) + + def test_shipping_rates_get_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/shipping_rates/shr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.shipping_rates.retrieve("shr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_shipping_rates_get_3_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.ShippingRate.retrieve_async("shr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_shipping_rates_get_3_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/shipping_rates/shr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.shipping_rates.retrieve_async("shr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_shipping_rates_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ShippingRate.create( + display_name="Sample Shipper", + fixed_amount={"currency": "usd", "amount": 400}, + type="fixed_amount", + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates", + query_string="", + post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", + ) + + def test_shipping_rates_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/shipping_rates", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.shipping_rates.create( + { + "display_name": "Sample Shipper", + "fixed_amount": {"currency": "usd", "amount": 400}, + "type": "fixed_amount", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates", + query_string="", + api_base="https://api.stripe.com", + post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", + ) + + @pytest.mark.anyio + async def test_shipping_rates_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.ShippingRate.create_async( + display_name="Sample Shipper", + fixed_amount={"currency": "usd", "amount": 400}, + type="fixed_amount", + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates", + query_string="", + post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", + ) + + @pytest.mark.anyio + async def test_shipping_rates_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/shipping_rates", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.shipping_rates.create_async( + { + "display_name": "Sample Shipper", + "fixed_amount": {"currency": "usd", "amount": 400}, + "type": "fixed_amount", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates", + query_string="", + api_base="https://api.stripe.com", + post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", + ) + + def test_shipping_rates_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ShippingRate.create( + display_name="Ground shipping", + type="fixed_amount", + fixed_amount={"amount": 500, "currency": "usd"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates", + query_string="", + post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", + ) + + def test_shipping_rates_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/shipping_rates", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.shipping_rates.create( + { + "display_name": "Ground shipping", + "type": "fixed_amount", + "fixed_amount": {"amount": 500, "currency": "usd"}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates", + query_string="", + api_base="https://api.stripe.com", + post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", + ) + + @pytest.mark.anyio + async def test_shipping_rates_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.ShippingRate.create_async( + display_name="Ground shipping", + type="fixed_amount", + fixed_amount={"amount": 500, "currency": "usd"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates", + query_string="", + post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", + ) + + @pytest.mark.anyio + async def test_shipping_rates_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/shipping_rates", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.shipping_rates.create_async( + { + "display_name": "Ground shipping", + "type": "fixed_amount", + "fixed_amount": {"amount": 500, "currency": "usd"}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates", + query_string="", + api_base="https://api.stripe.com", + post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", + ) + + def test_shipping_rates_post_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.ShippingRate.modify( + "shr_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_shipping_rates_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/shipping_rates/shr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.shipping_rates.update( + "shr_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_shipping_rates_post_3_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.ShippingRate.modify_async( + "shr_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_shipping_rates_post_3_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/shipping_rates/shr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.shipping_rates.update_async( + "shr_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_sigma_scheduled_query_runs_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.sigma.ScheduledQueryRun.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/sigma/scheduled_query_runs", + query_string="limit=3", + ) + + def test_sigma_scheduled_query_runs_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/sigma/scheduled_query_runs", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.sigma.scheduled_query_runs.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/sigma/scheduled_query_runs", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_sigma_scheduled_query_runs_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.sigma.ScheduledQueryRun.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/sigma/scheduled_query_runs", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_sigma_scheduled_query_runs_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/sigma/scheduled_query_runs", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.sigma.scheduled_query_runs.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/sigma/scheduled_query_runs", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_sigma_scheduled_query_runs_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.sigma.ScheduledQueryRun.retrieve("sqr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", + query_string="", + ) + + def test_sigma_scheduled_query_runs_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.sigma.scheduled_query_runs.retrieve("sqr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_sigma_scheduled_query_runs_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.sigma.ScheduledQueryRun.retrieve_async( + "sqr_xxxxxxxxxxxxx" + ) + http_client_mock.assert_requested( + "get", + path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_sigma_scheduled_query_runs_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.sigma.scheduled_query_runs.retrieve_async( + "sqr_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_sources_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Source.retrieve("src_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + ) + + def test_sources_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/sources/src_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.sources.retrieve("src_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_sources_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Source.retrieve_async("src_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_sources_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/sources/src_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.sources.retrieve_async("src_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_sources_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Source.retrieve("src_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + ) + + def test_sources_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/sources/src_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.sources.retrieve("src_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_sources_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Source.retrieve_async("src_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_sources_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/sources/src_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.sources.retrieve_async("src_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_sources_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Source.modify( + "src_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_sources_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/sources/src_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.sources.update( + "src_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_sources_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Source.modify_async( + "src_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_sources_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/sources/src_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.sources.update_async( + "src_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/sources/src_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_subscription_items_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.delete("si_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + ) + + def test_subscription_items_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/subscription_items/si_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_items.delete("si_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscription_items_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionItem.delete_async("si_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_subscription_items_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/subscription_items/si_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_items.delete_async("si_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_subscription_items_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.list(subscription="sub_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items", + query_string="subscription=sub_xxxxxxxxxxxxx", + ) + + def test_subscription_items_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscription_items", + "subscription=sub_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_items.list({"subscription": "sub_xxxxxxxxxxxxx"}) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items", + query_string="subscription=sub_xxxxxxxxxxxxx", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscription_items_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionItem.list_async( + subscription="sub_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items", + query_string="subscription=sub_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_subscription_items_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscription_items", + "subscription=sub_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_items.list_async( + { + "subscription": "sub_xxxxxxxxxxxxx", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items", + query_string="subscription=sub_xxxxxxxxxxxxx", + api_base="https://api.stripe.com", + ) + + def test_subscription_items_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.retrieve("si_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + ) + + def test_subscription_items_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscription_items/si_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_items.retrieve("si_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscription_items_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionItem.retrieve_async("si_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_subscription_items_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscription_items/si_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_items.retrieve_async("si_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_subscription_items_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.create( + subscription="sub_xxxxxxxxxxxxx", + price="price_xxxxxxxxxxxxx", + quantity=2, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items", + query_string="", + post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", + ) + + def test_subscription_items_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_items", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_items.create( + { + "subscription": "sub_xxxxxxxxxxxxx", + "price": "price_xxxxxxxxxxxxx", + "quantity": 2, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items", + query_string="", + api_base="https://api.stripe.com", + post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", + ) + + @pytest.mark.anyio + async def test_subscription_items_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionItem.create_async( + subscription="sub_xxxxxxxxxxxxx", + price="price_xxxxxxxxxxxxx", + quantity=2, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items", + query_string="", + post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", + ) + + @pytest.mark.anyio + async def test_subscription_items_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_items", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_items.create_async( + { + "subscription": "sub_xxxxxxxxxxxxx", + "price": "price_xxxxxxxxxxxxx", + "quantity": 2, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items", + query_string="", + api_base="https://api.stripe.com", + post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", + ) + + def test_subscription_items_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.modify( + "si_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_subscription_items_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_items/si_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_items.update( + "si_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_subscription_items_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionItem.modify_async( + "si_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_subscription_items_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_items/si_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_items.update_async( + "si_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items/si_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_subscription_items_usage_record_summaries_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.list_usage_record_summaries( + "si_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", + query_string="limit=3", + ) + + def test_subscription_items_usage_record_summaries_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_items.usage_record_summaries.list( + "si_xxxxxxxxxxxxx", + {"limit": 3}, + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscription_items_usage_record_summaries_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionItem.list_usage_record_summaries_async( + "si_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_subscription_items_usage_record_summaries_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_items.usage_record_summaries.list_async( + "si_xxxxxxxxxxxxx", + {"limit": 3}, + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_subscription_items_usage_records_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionItem.create_usage_record( + "si_xxxxxxxxxxxxx", + quantity=100, + timestamp=1571252444, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", + query_string="", + post_data="quantity=100×tamp=1571252444", + ) + + def test_subscription_items_usage_records_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_items.usage_records.create( + "si_xxxxxxxxxxxxx", + {"quantity": 100, "timestamp": 1571252444}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", + query_string="", + api_base="https://api.stripe.com", + post_data="quantity=100×tamp=1571252444", + ) + + @pytest.mark.anyio + async def test_subscription_items_usage_records_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionItem.create_usage_record_async( + "si_xxxxxxxxxxxxx", + quantity=100, + timestamp=1571252444, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", + query_string="", + post_data="quantity=100×tamp=1571252444", + ) + + @pytest.mark.anyio + async def test_subscription_items_usage_records_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_items.usage_records.create_async( + "si_xxxxxxxxxxxxx", + {"quantity": 100, "timestamp": 1571252444}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", + query_string="", + api_base="https://api.stripe.com", + post_data="quantity=100×tamp=1571252444", + ) + + def test_subscription_schedules_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionSchedule.cancel("sub_sched_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", + query_string="", + ) + + def test_subscription_schedules_cancel_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_schedules.cancel("sub_sched_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscription_schedules_cancel_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionSchedule.cancel_async( + "sub_sched_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", + query_string="", + ) + + @pytest.mark.anyio + async def test_subscription_schedules_cancel_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_schedules.cancel_async( + "sub_sched_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_subscription_schedules_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionSchedule.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_schedules", + query_string="limit=3", + ) + + def test_subscription_schedules_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscription_schedules", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_schedules.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_schedules", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscription_schedules_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionSchedule.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_schedules", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_subscription_schedules_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscription_schedules", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_schedules.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_schedules", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_subscription_schedules_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionSchedule.retrieve("sub_sched_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + query_string="", + ) + + def test_subscription_schedules_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_schedules.retrieve("sub_sched_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscription_schedules_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionSchedule.retrieve_async( + "sub_sched_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_subscription_schedules_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_schedules.retrieve_async( + "sub_sched_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_subscription_schedules_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionSchedule.create( + customer="cus_xxxxxxxxxxxxx", + start_date=1676070661, + end_behavior="release", + phases=[ + { + "items": [{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], + "iterations": 12, + }, + ], + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", + ) + + def test_subscription_schedules_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_schedules", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_schedules.create( + { + "customer": "cus_xxxxxxxxxxxxx", + "start_date": 1676070661, + "end_behavior": "release", + "phases": [ + { + "items": [ + {"price": "price_xxxxxxxxxxxxx", "quantity": 1} + ], + "iterations": 12, + }, + ], + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules", + query_string="", + api_base="https://api.stripe.com", + post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", + ) + + @pytest.mark.anyio + async def test_subscription_schedules_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionSchedule.create_async( + customer="cus_xxxxxxxxxxxxx", + start_date=1676070661, + end_behavior="release", + phases=[ + { + "items": [{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], + "iterations": 12, + }, + ], + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", + ) + + @pytest.mark.anyio + async def test_subscription_schedules_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_schedules", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_schedules.create_async( + { + "customer": "cus_xxxxxxxxxxxxx", + "start_date": 1676070661, + "end_behavior": "release", + "phases": [ + { + "items": [ + {"price": "price_xxxxxxxxxxxxx", "quantity": 1} + ], + "iterations": 12, + }, + ], + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules", + query_string="", + api_base="https://api.stripe.com", + post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", + ) + + def test_subscription_schedules_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionSchedule.modify( + "sub_sched_xxxxxxxxxxxxx", + end_behavior="release", + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + query_string="", + post_data="end_behavior=release", + ) + + def test_subscription_schedules_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_schedules.update( + "sub_sched_xxxxxxxxxxxxx", + {"end_behavior": "release"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="end_behavior=release", + ) + + @pytest.mark.anyio + async def test_subscription_schedules_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionSchedule.modify_async( + "sub_sched_xxxxxxxxxxxxx", + end_behavior="release", + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + query_string="", + post_data="end_behavior=release", + ) + + @pytest.mark.anyio + async def test_subscription_schedules_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_schedules.update_async( + "sub_sched_xxxxxxxxxxxxx", + {"end_behavior": "release"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="end_behavior=release", + ) + + def test_subscription_schedules_release_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.SubscriptionSchedule.release("sub_sched_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", + query_string="", + ) + + def test_subscription_schedules_release_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscription_schedules.release("sub_sched_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscription_schedules_release_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.SubscriptionSchedule.release_async( + "sub_sched_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", + query_string="", + ) + + @pytest.mark.anyio + async def test_subscription_schedules_release_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscription_schedules.release_async( + "sub_sched_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_subscriptions_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Subscription.cancel("sub_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + ) + + def test_subscriptions_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/subscriptions/sub_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscriptions.cancel("sub_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscriptions_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Subscription.cancel_async("sub_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_subscriptions_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/subscriptions/sub_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscriptions.cancel_async("sub_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_subscriptions_discount_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Subscription.delete_discount("sub_xyz") + http_client_mock.assert_requested( + "delete", + path="/v1/subscriptions/sub_xyz/discount", + query_string="", + ) + + def test_subscriptions_discount_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/subscriptions/sub_xyz/discount", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscriptions.delete_discount("sub_xyz") + http_client_mock.assert_requested( + "delete", + path="/v1/subscriptions/sub_xyz/discount", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscriptions_discount_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Subscription.delete_discount_async("sub_xyz") + http_client_mock.assert_requested( + "delete", + path="/v1/subscriptions/sub_xyz/discount", + query_string="", + ) + + @pytest.mark.anyio + async def test_subscriptions_discount_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/subscriptions/sub_xyz/discount", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscriptions.delete_discount_async("sub_xyz") + http_client_mock.assert_requested( + "delete", + path="/v1/subscriptions/sub_xyz/discount", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_subscriptions_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Subscription.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions", + query_string="limit=3", + ) + + def test_subscriptions_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscriptions", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscriptions.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscriptions_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Subscription.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_subscriptions_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscriptions", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscriptions.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_subscriptions_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Subscription.retrieve("sub_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + ) + + def test_subscriptions_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscriptions/sub_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscriptions.retrieve("sub_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscriptions_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Subscription.retrieve_async("sub_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_subscriptions_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscriptions/sub_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscriptions.retrieve_async("sub_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_subscriptions_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Subscription.create( + customer="cus_xxxxxxxxxxxxx", + items=[{"price": "price_xxxxxxxxxxxxx"}], + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscriptions", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", + ) + + def test_subscriptions_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscriptions", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscriptions.create( + { + "customer": "cus_xxxxxxxxxxxxx", + "items": [{"price": "price_xxxxxxxxxxxxx"}], + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscriptions", + query_string="", + api_base="https://api.stripe.com", + post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_subscriptions_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Subscription.create_async( + customer="cus_xxxxxxxxxxxxx", + items=[{"price": "price_xxxxxxxxxxxxx"}], + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscriptions", + query_string="", + post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_subscriptions_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscriptions", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscriptions.create_async( + { + "customer": "cus_xxxxxxxxxxxxx", + "items": [{"price": "price_xxxxxxxxxxxxx"}], + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscriptions", + query_string="", + api_base="https://api.stripe.com", + post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", + ) + + def test_subscriptions_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Subscription.modify( + "sub_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_subscriptions_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscriptions/sub_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscriptions.update( + "sub_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_subscriptions_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Subscription.modify_async( + "sub_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_subscriptions_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/subscriptions/sub_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscriptions.update_async( + "sub_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/subscriptions/sub_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_subscriptions_search_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Subscription.search( + query="status:'active' AND metadata['order_id']:'6735'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions/search", + query_string="query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + + def test_subscriptions_search_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscriptions/search", + "query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.subscriptions.search( + { + "query": "status:'active' AND metadata['order_id']:'6735'", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions/search", + query_string="query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_subscriptions_search_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Subscription.search_async( + query="status:'active' AND metadata['order_id']:'6735'", + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions/search", + query_string="query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + + @pytest.mark.anyio + async def test_subscriptions_search_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/subscriptions/search", + "query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.subscriptions.search_async( + { + "query": "status:'active' AND metadata['order_id']:'6735'", + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/subscriptions/search", + query_string="query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", + api_base="https://api.stripe.com", + ) + + def test_tax_calculations_line_items_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.tax.Calculation.list_line_items("xxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax/calculations/xxx/line_items", + query_string="", + ) + + def test_tax_calculations_line_items_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax/calculations/xxx/line_items", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax.calculations.line_items.list("xxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax/calculations/xxx/line_items", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_tax_calculations_line_items_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.tax.Calculation.list_line_items_async("xxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax/calculations/xxx/line_items", + query_string="", + ) + + @pytest.mark.anyio + async def test_tax_calculations_line_items_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax/calculations/xxx/line_items", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax.calculations.line_items.list_async("xxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax/calculations/xxx/line_items", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_tax_calculations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.tax.Calculation.create( + currency="usd", + line_items=[{"amount": 1000, "reference": "L1"}], + customer_details={ + "address": { + "line1": "354 Oyster Point Blvd", + "city": "South San Francisco", + "state": "CA", + "postal_code": "94080", + "country": "US", + }, + "address_source": "shipping", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/calculations", + query_string="", + post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", + ) + + def test_tax_calculations_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax/calculations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax.calculations.create( + { + "currency": "usd", + "line_items": [{"amount": 1000, "reference": "L1"}], + "customer_details": { + "address": { + "line1": "354 Oyster Point Blvd", + "city": "South San Francisco", + "state": "CA", + "postal_code": "94080", + "country": "US", + }, + "address_source": "shipping", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/calculations", + query_string="", + api_base="https://api.stripe.com", + post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", + ) + + @pytest.mark.anyio + async def test_tax_calculations_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.tax.Calculation.create_async( + currency="usd", + line_items=[{"amount": 1000, "reference": "L1"}], + customer_details={ + "address": { + "line1": "354 Oyster Point Blvd", + "city": "South San Francisco", + "state": "CA", + "postal_code": "94080", + "country": "US", + }, + "address_source": "shipping", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/calculations", + query_string="", + post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", + ) + + @pytest.mark.anyio + async def test_tax_calculations_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax/calculations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax.calculations.create_async( + { + "currency": "usd", + "line_items": [{"amount": 1000, "reference": "L1"}], + "customer_details": { + "address": { + "line1": "354 Oyster Point Blvd", + "city": "South San Francisco", + "state": "CA", + "postal_code": "94080", + "country": "US", + }, + "address_source": "shipping", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/calculations", + query_string="", + api_base="https://api.stripe.com", + post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", + ) + + def test_tax_codes_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxCode.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/tax_codes", + query_string="limit=3", + ) + + def test_tax_codes_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_codes", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_codes.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/tax_codes", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_tax_codes_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.TaxCode.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/tax_codes", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_tax_codes_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_codes", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax_codes.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/tax_codes", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_tax_codes_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxCode.retrieve("txcd_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", + query_string="", + ) + + def test_tax_codes_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_codes/txcd_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_codes.retrieve("txcd_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_tax_codes_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.TaxCode.retrieve_async("txcd_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_tax_codes_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_codes/txcd_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax_codes.retrieve_async("txcd_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_tax_ids_delete(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxId.delete("taxid_123") + http_client_mock.assert_requested( + "delete", + path="/v1/tax_ids/taxid_123", + query_string="", + ) + + def test_tax_ids_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/tax_ids/taxid_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_ids.delete("taxid_123") + http_client_mock.assert_requested( + "delete", + path="/v1/tax_ids/taxid_123", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_tax_ids_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.TaxId.delete_async("taxid_123") + http_client_mock.assert_requested( + "delete", + path="/v1/tax_ids/taxid_123", + query_string="", + ) + + @pytest.mark.anyio + async def test_tax_ids_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/tax_ids/taxid_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax_ids.delete_async("taxid_123") + http_client_mock.assert_requested( + "delete", + path="/v1/tax_ids/taxid_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_tax_ids_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxId.list() + http_client_mock.assert_requested( + "get", + path="/v1/tax_ids", + query_string="", + ) + + def test_tax_ids_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_ids", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_ids.list() + http_client_mock.assert_requested( + "get", + path="/v1/tax_ids", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_tax_ids_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.TaxId.list_async() + http_client_mock.assert_requested( + "get", + path="/v1/tax_ids", + query_string="", + ) + + @pytest.mark.anyio + async def test_tax_ids_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_ids", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax_ids.list_async() + http_client_mock.assert_requested( + "get", + path="/v1/tax_ids", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_tax_ids_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxId.retrieve("taxid_123") + http_client_mock.assert_requested( + "get", + path="/v1/tax_ids/taxid_123", + query_string="", + ) + + def test_tax_ids_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_ids/taxid_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_ids.retrieve("taxid_123") + http_client_mock.assert_requested( + "get", + path="/v1/tax_ids/taxid_123", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_tax_ids_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.TaxId.retrieve_async("taxid_123") + http_client_mock.assert_requested( + "get", + path="/v1/tax_ids/taxid_123", + query_string="", + ) + + @pytest.mark.anyio + async def test_tax_ids_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_ids/taxid_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax_ids.retrieve_async("taxid_123") + http_client_mock.assert_requested( + "get", + path="/v1/tax_ids/taxid_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_tax_ids_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxId.create( + type="eu_vat", + value="123", + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_ids", + query_string="", + post_data="type=eu_vat&value=123", + ) + + def test_tax_ids_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax_ids", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_ids.create({"type": "eu_vat", "value": "123"}) + http_client_mock.assert_requested( + "post", + path="/v1/tax_ids", + query_string="", + api_base="https://api.stripe.com", + post_data="type=eu_vat&value=123", + ) + + @pytest.mark.anyio + async def test_tax_ids_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.TaxId.create_async( + type="eu_vat", + value="123", + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_ids", + query_string="", + post_data="type=eu_vat&value=123", + ) + + @pytest.mark.anyio + async def test_tax_ids_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax_ids", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax_ids.create_async({"type": "eu_vat", "value": "123"}) + http_client_mock.assert_requested( + "post", + path="/v1/tax_ids", + query_string="", + api_base="https://api.stripe.com", + post_data="type=eu_vat&value=123", + ) + + def test_tax_rates_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxRate.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/tax_rates", + query_string="limit=3", + ) + + def test_tax_rates_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_rates", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_rates.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/tax_rates", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_tax_rates_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.TaxRate.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/tax_rates", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_tax_rates_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_rates", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax_rates.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/tax_rates", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_tax_rates_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxRate.retrieve("txr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + query_string="", + ) + + def test_tax_rates_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_rates/txr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_rates.retrieve("txr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_tax_rates_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.TaxRate.retrieve_async("txr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_tax_rates_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax_rates/txr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax_rates.retrieve_async("txr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_tax_rates_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxRate.create( + display_name="VAT", + description="VAT Germany", + jurisdiction="DE", + percentage=16, + inclusive=False, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_rates", + query_string="", + post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", + ) + + def test_tax_rates_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax_rates", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_rates.create( + { + "display_name": "VAT", + "description": "VAT Germany", + "jurisdiction": "DE", + "percentage": 16, + "inclusive": False, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_rates", + query_string="", + api_base="https://api.stripe.com", + post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", + ) + + @pytest.mark.anyio + async def test_tax_rates_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.TaxRate.create_async( + display_name="VAT", + description="VAT Germany", + jurisdiction="DE", + percentage=16, + inclusive=False, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_rates", + query_string="", + post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", + ) + + @pytest.mark.anyio + async def test_tax_rates_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax_rates", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax_rates.create_async( + { + "display_name": "VAT", + "description": "VAT Germany", + "jurisdiction": "DE", + "percentage": 16, + "inclusive": False, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_rates", + query_string="", + api_base="https://api.stripe.com", + post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", + ) + + def test_tax_rates_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.TaxRate.modify( + "txr_xxxxxxxxxxxxx", + active=False, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + query_string="", + post_data="active=False", + ) + + def test_tax_rates_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax_rates/txr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax_rates.update( + "txr_xxxxxxxxxxxxx", + {"active": False}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="active=False", + ) + + @pytest.mark.anyio + async def test_tax_rates_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.TaxRate.modify_async( + "txr_xxxxxxxxxxxxx", + active=False, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + query_string="", + post_data="active=False", + ) + + @pytest.mark.anyio + async def test_tax_rates_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax_rates/txr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax_rates.update_async( + "txr_xxxxxxxxxxxxx", + {"active": False}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax_rates/txr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="active=False", + ) + + def test_tax_registrations_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.tax.Registration.list(status="all") + http_client_mock.assert_requested( + "get", + path="/v1/tax/registrations", + query_string="status=all", + ) + + def test_tax_registrations_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax/registrations", + "status=all", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax.registrations.list({"status": "all"}) + http_client_mock.assert_requested( + "get", + path="/v1/tax/registrations", + query_string="status=all", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_tax_registrations_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.tax.Registration.list_async(status="all") + http_client_mock.assert_requested( + "get", + path="/v1/tax/registrations", + query_string="status=all", + ) + + @pytest.mark.anyio + async def test_tax_registrations_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax/registrations", + "status=all", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax.registrations.list_async({"status": "all"}) + http_client_mock.assert_requested( + "get", + path="/v1/tax/registrations", + query_string="status=all", + api_base="https://api.stripe.com", + ) + + def test_tax_registrations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.tax.Registration.create( + country="IE", + country_options={"ie": {"type": "oss_union"}}, + active_from="now", + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/registrations", + query_string="", + post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", + ) + + def test_tax_registrations_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax/registrations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax.registrations.create( + { + "country": "IE", + "country_options": {"ie": {"type": "oss_union"}}, + "active_from": "now", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/registrations", + query_string="", + api_base="https://api.stripe.com", + post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", + ) + + @pytest.mark.anyio + async def test_tax_registrations_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.tax.Registration.create_async( + country="IE", + country_options={"ie": {"type": "oss_union"}}, + active_from="now", + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/registrations", + query_string="", + post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", + ) + + @pytest.mark.anyio + async def test_tax_registrations_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax/registrations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax.registrations.create_async( + { + "country": "IE", + "country_options": {"ie": {"type": "oss_union"}}, + "active_from": "now", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/registrations", + query_string="", + api_base="https://api.stripe.com", + post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", + ) + + def test_tax_registrations_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.tax.Registration.modify( + "taxreg_xxxxxxxxxxxxx", + expires_at="now", + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", + query_string="", + post_data="expires_at=now", + ) + + def test_tax_registrations_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax.registrations.update( + "taxreg_xxxxxxxxxxxxx", + {"expires_at": "now"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="expires_at=now", + ) + + @pytest.mark.anyio + async def test_tax_registrations_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.tax.Registration.modify_async( + "taxreg_xxxxxxxxxxxxx", + expires_at="now", + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", + query_string="", + post_data="expires_at=now", + ) + + @pytest.mark.anyio + async def test_tax_registrations_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax.registrations.update_async( + "taxreg_xxxxxxxxxxxxx", + {"expires_at": "now"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="expires_at=now", + ) + + def test_tax_settings_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.tax.Settings.retrieve() + http_client_mock.assert_requested( + "get", + path="/v1/tax/settings", + query_string="", + ) + + def test_tax_settings_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax/settings", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax.settings.retrieve() + http_client_mock.assert_requested( + "get", + path="/v1/tax/settings", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_tax_settings_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.tax.Settings.retrieve_async() + http_client_mock.assert_requested( + "get", + path="/v1/tax/settings", + query_string="", + ) + + @pytest.mark.anyio + async def test_tax_settings_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax/settings", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax.settings.retrieve_async() + http_client_mock.assert_requested( + "get", + path="/v1/tax/settings", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_tax_settings_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.tax.Settings.modify(defaults={"tax_code": "txcd_10000000"}) + http_client_mock.assert_requested( + "post", + path="/v1/tax/settings", + query_string="", + post_data="defaults[tax_code]=txcd_10000000", + ) + + def test_tax_settings_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax/settings", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax.settings.update({"defaults": {"tax_code": "txcd_10000000"}}) + http_client_mock.assert_requested( + "post", + path="/v1/tax/settings", + query_string="", + api_base="https://api.stripe.com", + post_data="defaults[tax_code]=txcd_10000000", + ) + + @pytest.mark.anyio + async def test_tax_settings_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.tax.Settings.modify_async( + defaults={"tax_code": "txcd_10000000"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/settings", + query_string="", + post_data="defaults[tax_code]=txcd_10000000", + ) + + @pytest.mark.anyio + async def test_tax_settings_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax/settings", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax.settings.update_async( + { + "defaults": {"tax_code": "txcd_10000000"}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/settings", + query_string="", + api_base="https://api.stripe.com", + post_data="defaults[tax_code]=txcd_10000000", + ) + + def test_tax_transactions_create_from_calculation_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.tax.Transaction.create_from_calculation( + calculation="xxx", + reference="yyy", + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/transactions/create_from_calculation", + query_string="", + post_data="calculation=xxx&reference=yyy", + ) + + def test_tax_transactions_create_from_calculation_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax/transactions/create_from_calculation", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax.transactions.create_from_calculation( + { + "calculation": "xxx", + "reference": "yyy", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/transactions/create_from_calculation", + query_string="", + api_base="https://api.stripe.com", + post_data="calculation=xxx&reference=yyy", + ) + + @pytest.mark.anyio + async def test_tax_transactions_create_from_calculation_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.tax.Transaction.create_from_calculation_async( + calculation="xxx", + reference="yyy", + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/transactions/create_from_calculation", + query_string="", + post_data="calculation=xxx&reference=yyy", + ) + + @pytest.mark.anyio + async def test_tax_transactions_create_from_calculation_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tax/transactions/create_from_calculation", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax.transactions.create_from_calculation_async( + { + "calculation": "xxx", + "reference": "yyy", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tax/transactions/create_from_calculation", + query_string="", + api_base="https://api.stripe.com", + post_data="calculation=xxx&reference=yyy", + ) + + def test_terminal_configurations_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.delete("uc_123") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/configurations/uc_123", + query_string="", + ) + + def test_terminal_configurations_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/terminal/configurations/uc_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.configurations.delete("uc_123") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/configurations/uc_123", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Configuration.delete_async("uc_123") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/configurations/uc_123", + query_string="", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/terminal/configurations/uc_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.configurations.delete_async("uc_123") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/configurations/uc_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_configurations_delete_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.delete("tmc_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + ) + + def test_terminal_configurations_delete_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.configurations.delete("tmc_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_delete_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Configuration.delete_async("tmc_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_delete_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.configurations.delete_async("tmc_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_configurations_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.list() + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations", + query_string="", + ) + + def test_terminal_configurations_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/configurations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.configurations.list() + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Configuration.list_async() + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations", + query_string="", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/configurations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.configurations.list_async() + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_configurations_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.retrieve("uc_123") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations/uc_123", + query_string="", + ) + + def test_terminal_configurations_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/configurations/uc_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.configurations.retrieve("uc_123") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations/uc_123", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Configuration.retrieve_async("uc_123") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations/uc_123", + query_string="", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/configurations/uc_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.configurations.retrieve_async("uc_123") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations/uc_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_configurations_get_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations", + query_string="limit=3", + ) + + def test_terminal_configurations_get_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/configurations", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.configurations.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_get_3_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Configuration.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_get_3_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/configurations", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.configurations.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_terminal_configurations_get_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.retrieve("tmc_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + ) + + def test_terminal_configurations_get_4_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.configurations.retrieve("tmc_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_get_4_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Configuration.retrieve_async("tmc_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_get_4_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.configurations.retrieve_async( + "tmc_xxxxxxxxxxxxx" + ) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_configurations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.create() + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations", + query_string="", + ) + + def test_terminal_configurations_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/configurations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.configurations.create() + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Configuration.create_async() + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations", + query_string="", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/configurations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.configurations.create_async() + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_configurations_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.modify( + "uc_123", + tipping={"usd": {"fixed_amounts": [10]}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations/uc_123", + query_string="", + post_data="tipping[usd][fixed_amounts][0]=10", + ) + + def test_terminal_configurations_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/configurations/uc_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.configurations.update( + "uc_123", + {"tipping": {"usd": {"fixed_amounts": [10]}}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations/uc_123", + query_string="", + api_base="https://api.stripe.com", + post_data="tipping[usd][fixed_amounts][0]=10", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Configuration.modify_async( + "uc_123", + tipping={"usd": {"fixed_amounts": [10]}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations/uc_123", + query_string="", + post_data="tipping[usd][fixed_amounts][0]=10", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/configurations/uc_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.configurations.update_async( + "uc_123", + {"tipping": {"usd": {"fixed_amounts": [10]}}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations/uc_123", + query_string="", + api_base="https://api.stripe.com", + post_data="tipping[usd][fixed_amounts][0]=10", + ) + + def test_terminal_configurations_post_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.create( + bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations", + query_string="", + post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + ) + + def test_terminal_configurations_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/configurations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.configurations.create( + { + "bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations", + query_string="", + api_base="https://api.stripe.com", + post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_post_3_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Configuration.create_async( + bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations", + query_string="", + post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_post_3_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/configurations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.configurations.create_async( + { + "bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations", + query_string="", + api_base="https://api.stripe.com", + post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + ) + + def test_terminal_configurations_post_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Configuration.modify( + "tmc_xxxxxxxxxxxxx", + bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + ) + + def test_terminal_configurations_post_4_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.configurations.update( + "tmc_xxxxxxxxxxxxx", + {"bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_post_4_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Configuration.modify_async( + "tmc_xxxxxxxxxxxxx", + bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_terminal_configurations_post_4_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.configurations.update_async( + "tmc_xxxxxxxxxxxxx", + {"bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", + ) + + def test_terminal_connection_tokens_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.ConnectionToken.create() + http_client_mock.assert_requested( + "post", + path="/v1/terminal/connection_tokens", + query_string="", + ) + + def test_terminal_connection_tokens_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/connection_tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.connection_tokens.create() + http_client_mock.assert_requested( + "post", + path="/v1/terminal/connection_tokens", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_connection_tokens_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.ConnectionToken.create_async() + http_client_mock.assert_requested( + "post", + path="/v1/terminal/connection_tokens", + query_string="", + ) + + @pytest.mark.anyio + async def test_terminal_connection_tokens_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/connection_tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.connection_tokens.create_async() + http_client_mock.assert_requested( + "post", + path="/v1/terminal/connection_tokens", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_locations_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Location.delete("tml_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + ) + + def test_terminal_locations_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/terminal/locations/tml_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.locations.delete("tml_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_locations_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Location.delete_async("tml_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_terminal_locations_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/terminal/locations/tml_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.locations.delete_async("tml_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_locations_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Location.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/locations", + query_string="limit=3", + ) + + def test_terminal_locations_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/locations", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.locations.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/locations", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_locations_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Location.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/locations", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_terminal_locations_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/locations", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.locations.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/locations", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_terminal_locations_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Location.retrieve("tml_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + ) + + def test_terminal_locations_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/locations/tml_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.locations.retrieve("tml_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_locations_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Location.retrieve_async("tml_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_terminal_locations_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/locations/tml_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.locations.retrieve_async("tml_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_locations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Location.create( + display_name="My First Store", + address={ + "line1": "1234 Main Street", + "city": "San Francisco", + "postal_code": "94111", + "state": "CA", + "country": "US", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/locations", + query_string="", + post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", + ) + + def test_terminal_locations_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/locations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.locations.create( + { + "display_name": "My First Store", + "address": { + "line1": "1234 Main Street", + "city": "San Francisco", + "postal_code": "94111", + "state": "CA", + "country": "US", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/locations", + query_string="", + api_base="https://api.stripe.com", + post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", + ) + + @pytest.mark.anyio + async def test_terminal_locations_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Location.create_async( + display_name="My First Store", + address={ + "line1": "1234 Main Street", + "city": "San Francisco", + "postal_code": "94111", + "state": "CA", + "country": "US", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/locations", + query_string="", + post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", + ) + + @pytest.mark.anyio + async def test_terminal_locations_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/locations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.locations.create_async( + { + "display_name": "My First Store", + "address": { + "line1": "1234 Main Street", + "city": "San Francisco", + "postal_code": "94111", + "state": "CA", + "country": "US", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/locations", + query_string="", + api_base="https://api.stripe.com", + post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", + ) + + def test_terminal_locations_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Location.modify( + "tml_xxxxxxxxxxxxx", + display_name="My First Store", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + post_data="display_name=My%20First%20Store", + ) + + def test_terminal_locations_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/locations/tml_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.locations.update( + "tml_xxxxxxxxxxxxx", + {"display_name": "My First Store"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="display_name=My%20First%20Store", + ) + + @pytest.mark.anyio + async def test_terminal_locations_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Location.modify_async( + "tml_xxxxxxxxxxxxx", + display_name="My First Store", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + post_data="display_name=My%20First%20Store", + ) + + @pytest.mark.anyio + async def test_terminal_locations_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/locations/tml_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.locations.update_async( + "tml_xxxxxxxxxxxxx", + {"display_name": "My First Store"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="display_name=My%20First%20Store", + ) + + def test_terminal_readers_cancel_action_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.cancel_action("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", + query_string="", + ) + + def test_terminal_readers_cancel_action_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.readers.cancel_action("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_readers_cancel_action_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Reader.cancel_action_async("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", + query_string="", + ) + + @pytest.mark.anyio + async def test_terminal_readers_cancel_action_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.readers.cancel_action_async("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_readers_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.delete("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + ) + + def test_terminal_readers_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.readers.delete("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_readers_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Reader.delete_async("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_terminal_readers_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.readers.delete_async("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_readers_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/readers", + query_string="limit=3", + ) + + def test_terminal_readers_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/readers", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.readers.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/readers", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_readers_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Reader.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/readers", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_terminal_readers_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/readers", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.readers.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/terminal/readers", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_terminal_readers_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.retrieve("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + ) + + def test_terminal_readers_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.readers.retrieve("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_terminal_readers_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Reader.retrieve_async("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_terminal_readers_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.readers.retrieve_async("tmr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_terminal_readers_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.create( + registration_code="puppies-plug-could", + label="Blue Rabbit", + location="tml_1234", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers", + query_string="", + post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", + ) + + def test_terminal_readers_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/readers", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.readers.create( + { + "registration_code": "puppies-plug-could", + "label": "Blue Rabbit", + "location": "tml_1234", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers", + query_string="", + api_base="https://api.stripe.com", + post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", + ) + + @pytest.mark.anyio + async def test_terminal_readers_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Reader.create_async( + registration_code="puppies-plug-could", + label="Blue Rabbit", + location="tml_1234", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers", + query_string="", + post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", + ) + + @pytest.mark.anyio + async def test_terminal_readers_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/readers", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.readers.create_async( + { + "registration_code": "puppies-plug-could", + "label": "Blue Rabbit", + "location": "tml_1234", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers", + query_string="", + api_base="https://api.stripe.com", + post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", + ) + + def test_terminal_readers_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.modify( + "tmr_xxxxxxxxxxxxx", + label="Blue Rabbit", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + post_data="label=Blue%20Rabbit", + ) + + def test_terminal_readers_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.readers.update( + "tmr_xxxxxxxxxxxxx", + {"label": "Blue Rabbit"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="label=Blue%20Rabbit", + ) + + @pytest.mark.anyio + async def test_terminal_readers_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Reader.modify_async( + "tmr_xxxxxxxxxxxxx", + label="Blue Rabbit", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + post_data="label=Blue%20Rabbit", + ) + + @pytest.mark.anyio + async def test_terminal_readers_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.readers.update_async( + "tmr_xxxxxxxxxxxxx", + {"label": "Blue Rabbit"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="label=Blue%20Rabbit", + ) + + def test_terminal_readers_process_payment_intent_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.process_payment_intent( + "tmr_xxxxxxxxxxxxx", + payment_intent="pi_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", + query_string="", + post_data="payment_intent=pi_xxxxxxxxxxxxx", + ) + + def test_terminal_readers_process_payment_intent_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.readers.process_payment_intent( + "tmr_xxxxxxxxxxxxx", + {"payment_intent": "pi_xxxxxxxxxxxxx"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", + query_string="", + api_base="https://api.stripe.com", + post_data="payment_intent=pi_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_terminal_readers_process_payment_intent_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Reader.process_payment_intent_async( + "tmr_xxxxxxxxxxxxx", + payment_intent="pi_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", + query_string="", + post_data="payment_intent=pi_xxxxxxxxxxxxx", + ) + + @pytest.mark.anyio + async def test_terminal_readers_process_payment_intent_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.readers.process_payment_intent_async( + "tmr_xxxxxxxxxxxxx", + {"payment_intent": "pi_xxxxxxxxxxxxx"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", + query_string="", + api_base="https://api.stripe.com", + post_data="payment_intent=pi_xxxxxxxxxxxxx", + ) + + def test_terminal_readers_process_setup_intent_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.process_setup_intent( + "tmr_xxxxxxxxxxxxx", + setup_intent="seti_xxxxxxxxxxxxx", + customer_consent_collected=True, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + query_string="", + post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", + ) + + def test_terminal_readers_process_setup_intent_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.readers.process_setup_intent( + "tmr_xxxxxxxxxxxxx", + { + "setup_intent": "seti_xxxxxxxxxxxxx", + "customer_consent_collected": True, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + query_string="", + api_base="https://api.stripe.com", + post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", + ) + + @pytest.mark.anyio + async def test_terminal_readers_process_setup_intent_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Reader.process_setup_intent_async( + "tmr_xxxxxxxxxxxxx", + setup_intent="seti_xxxxxxxxxxxxx", + customer_consent_collected=True, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + query_string="", + post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", + ) + + @pytest.mark.anyio + async def test_terminal_readers_process_setup_intent_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.readers.process_setup_intent_async( + "tmr_xxxxxxxxxxxxx", + { + "setup_intent": "seti_xxxxxxxxxxxxx", + "customer_consent_collected": True, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + query_string="", + api_base="https://api.stripe.com", + post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", + ) + + def test_test_helpers_customers_fund_cash_balance_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Customer.TestHelpers.fund_cash_balance( + "cus_123", + amount=30, + currency="eur", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/customers/cus_123/fund_cash_balance", + query_string="", + post_data="amount=30¤cy=eur", + ) + + def test_test_helpers_customers_fund_cash_balance_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/customers/cus_123/fund_cash_balance", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.customers.fund_cash_balance( + "cus_123", + {"amount": 30, "currency": "eur"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/customers/cus_123/fund_cash_balance", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=30¤cy=eur", + ) + + @pytest.mark.anyio + async def test_test_helpers_customers_fund_cash_balance_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Customer.TestHelpers.fund_cash_balance_async( + "cus_123", + amount=30, + currency="eur", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/customers/cus_123/fund_cash_balance", + query_string="", + post_data="amount=30¤cy=eur", + ) + + @pytest.mark.anyio + async def test_test_helpers_customers_fund_cash_balance_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/customers/cus_123/fund_cash_balance", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.customers.fund_cash_balance_async( + "cus_123", + {"amount": 30, "currency": "eur"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/customers/cus_123/fund_cash_balance", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=30¤cy=eur", + ) + + def test_test_helpers_issuing_authorizations_capture_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.TestHelpers.capture( + "example_authorization", + capture_amount=100, + close_authorization=True, + purchase_details={ + "flight": { + "departure_at": 1633651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1633651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", + query_string="", + post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + + def test_test_helpers_issuing_authorizations_capture_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/authorizations/example_authorization/capture", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.authorizations.capture( + "example_authorization", + { + "capture_amount": 100, + "close_authorization": True, + "purchase_details": { + "flight": { + "departure_at": 1633651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1633651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", + query_string="", + api_base="https://api.stripe.com", + post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_authorizations_capture_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Authorization.TestHelpers.capture_async( + "example_authorization", + capture_amount=100, + close_authorization=True, + purchase_details={ + "flight": { + "departure_at": 1633651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1633651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", + query_string="", + post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_authorizations_capture_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/authorizations/example_authorization/capture", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.authorizations.capture_async( + "example_authorization", + { + "capture_amount": 100, + "close_authorization": True, + "purchase_details": { + "flight": { + "departure_at": 1633651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1633651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", + query_string="", + api_base="https://api.stripe.com", + post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + + def test_test_helpers_issuing_authorizations_expire_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.TestHelpers.expire( + "example_authorization" + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/expire", + query_string="", + ) + + def test_test_helpers_issuing_authorizations_expire_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/authorizations/example_authorization/expire", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.authorizations.expire( + "example_authorization", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/expire", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_authorizations_expire_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Authorization.TestHelpers.expire_async( + "example_authorization", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/expire", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_authorizations_expire_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/authorizations/example_authorization/expire", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.authorizations.expire_async( + "example_authorization", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/expire", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_issuing_authorizations_increment_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.TestHelpers.increment( + "example_authorization", + increment_amount=50, + is_amount_controllable=True, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/increment", + query_string="", + post_data="increment_amount=50&is_amount_controllable=True", + ) + + def test_test_helpers_issuing_authorizations_increment_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/authorizations/example_authorization/increment", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.authorizations.increment( + "example_authorization", + {"increment_amount": 50, "is_amount_controllable": True}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/increment", + query_string="", + api_base="https://api.stripe.com", + post_data="increment_amount=50&is_amount_controllable=True", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_authorizations_increment_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Authorization.TestHelpers.increment_async( + "example_authorization", + increment_amount=50, + is_amount_controllable=True, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/increment", + query_string="", + post_data="increment_amount=50&is_amount_controllable=True", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_authorizations_increment_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/authorizations/example_authorization/increment", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.authorizations.increment_async( + "example_authorization", + {"increment_amount": 50, "is_amount_controllable": True}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/increment", + query_string="", + api_base="https://api.stripe.com", + post_data="increment_amount=50&is_amount_controllable=True", + ) + + def test_test_helpers_issuing_authorizations_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.TestHelpers.create( + amount=100, + amount_details={"atm_fee": 10, "cashback_amount": 5}, + authorization_method="chip", + card="foo", + currency="usd", + is_amount_controllable=True, + merchant_data={ + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "bar", + "name": "foo", + "network_id": "bar", + "postal_code": "foo", + "state": "bar", + "terminal_id": "foo", + }, + network_data={"acquiring_institution_id": "foo"}, + verification_data={ + "address_line1_check": "mismatch", + "address_postal_code_check": "match", + "cvc_check": "match", + "expiry_check": "mismatch", + }, + wallet="apple_pay", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations", + query_string="", + post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", + ) + + def test_test_helpers_issuing_authorizations_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/authorizations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.authorizations.create( + { + "amount": 100, + "amount_details": {"atm_fee": 10, "cashback_amount": 5}, + "authorization_method": "chip", + "card": "foo", + "currency": "usd", + "is_amount_controllable": True, + "merchant_data": { + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "bar", + "name": "foo", + "network_id": "bar", + "postal_code": "foo", + "state": "bar", + "terminal_id": "foo", + }, + "network_data": {"acquiring_institution_id": "foo"}, + "verification_data": { + "address_line1_check": "mismatch", + "address_postal_code_check": "match", + "cvc_check": "match", + "expiry_check": "mismatch", + }, + "wallet": "apple_pay", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_authorizations_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Authorization.TestHelpers.create_async( + amount=100, + amount_details={"atm_fee": 10, "cashback_amount": 5}, + authorization_method="chip", + card="foo", + currency="usd", + is_amount_controllable=True, + merchant_data={ + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "bar", + "name": "foo", + "network_id": "bar", + "postal_code": "foo", + "state": "bar", + "terminal_id": "foo", + }, + network_data={"acquiring_institution_id": "foo"}, + verification_data={ + "address_line1_check": "mismatch", + "address_postal_code_check": "match", + "cvc_check": "match", + "expiry_check": "mismatch", + }, + wallet="apple_pay", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations", + query_string="", + post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_authorizations_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/authorizations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.authorizations.create_async( + { + "amount": 100, + "amount_details": {"atm_fee": 10, "cashback_amount": 5}, + "authorization_method": "chip", + "card": "foo", + "currency": "usd", + "is_amount_controllable": True, + "merchant_data": { + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "bar", + "name": "foo", + "network_id": "bar", + "postal_code": "foo", + "state": "bar", + "terminal_id": "foo", + }, + "network_data": {"acquiring_institution_id": "foo"}, + "verification_data": { + "address_line1_check": "mismatch", + "address_postal_code_check": "match", + "cvc_check": "match", + "expiry_check": "mismatch", + }, + "wallet": "apple_pay", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", + ) + + def test_test_helpers_issuing_authorizations_reverse_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Authorization.TestHelpers.reverse( + "example_authorization", + reverse_amount=20, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/reverse", + query_string="", + post_data="reverse_amount=20", + ) + + def test_test_helpers_issuing_authorizations_reverse_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/authorizations/example_authorization/reverse", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.authorizations.reverse( + "example_authorization", + {"reverse_amount": 20}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/reverse", + query_string="", + api_base="https://api.stripe.com", + post_data="reverse_amount=20", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_authorizations_reverse_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Authorization.TestHelpers.reverse_async( + "example_authorization", + reverse_amount=20, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/reverse", + query_string="", + post_data="reverse_amount=20", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_authorizations_reverse_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/authorizations/example_authorization/reverse", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.authorizations.reverse_async( + "example_authorization", + {"reverse_amount": 20}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/authorizations/example_authorization/reverse", + query_string="", + api_base="https://api.stripe.com", + post_data="reverse_amount=20", + ) + + def test_test_helpers_issuing_cards_shipping_deliver_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Card.TestHelpers.deliver_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", + query_string="", + ) + + def test_test_helpers_issuing_cards_shipping_deliver_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/cards/card_123/shipping/deliver", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.cards.deliver_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_cards_shipping_deliver_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Card.TestHelpers.deliver_card_async("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_cards_shipping_deliver_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/cards/card_123/shipping/deliver", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.cards.deliver_card_async("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_issuing_cards_shipping_fail_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Card.TestHelpers.fail_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", + query_string="", + ) + + def test_test_helpers_issuing_cards_shipping_fail_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/cards/card_123/shipping/fail", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.cards.fail_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_cards_shipping_fail_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Card.TestHelpers.fail_card_async("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_cards_shipping_fail_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/cards/card_123/shipping/fail", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.cards.fail_card_async("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_issuing_cards_shipping_return_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Card.TestHelpers.return_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/return", + query_string="", + ) + + def test_test_helpers_issuing_cards_shipping_return_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/cards/card_123/shipping/return", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.cards.return_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/return", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_cards_shipping_return_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Card.TestHelpers.return_card_async("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/return", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_cards_shipping_return_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/cards/card_123/shipping/return", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.cards.return_card_async("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/return", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_issuing_cards_shipping_ship_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Card.TestHelpers.ship_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", + query_string="", + ) + + def test_test_helpers_issuing_cards_shipping_ship_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/cards/card_123/shipping/ship", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.cards.ship_card("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_cards_shipping_ship_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Card.TestHelpers.ship_card_async("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_cards_shipping_ship_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/cards/card_123/shipping/ship", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.cards.ship_card_async("card_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_issuing_personalization_designs_activate_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PersonalizationDesign.TestHelpers.activate("pd_xyz") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", + query_string="", + ) + + def test_test_helpers_issuing_personalization_designs_activate_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.personalization_designs.activate("pd_xyz") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_personalization_designs_activate_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.PersonalizationDesign.TestHelpers.activate_async( + "pd_xyz", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_personalization_designs_activate_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.personalization_designs.activate_async( + "pd_xyz" + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_issuing_personalization_designs_deactivate_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PersonalizationDesign.TestHelpers.deactivate("pd_xyz") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", + query_string="", + ) + + def test_test_helpers_issuing_personalization_designs_deactivate_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.personalization_designs.deactivate( + "pd_xyz" + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_personalization_designs_deactivate_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.PersonalizationDesign.TestHelpers.deactivate_async( + "pd_xyz", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_personalization_designs_deactivate_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.personalization_designs.deactivate_async( + "pd_xyz" + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_issuing_personalization_designs_reject_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.PersonalizationDesign.TestHelpers.reject( + "pd_xyz", + rejection_reasons={"card_logo": ["geographic_location"]}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", + query_string="", + post_data="rejection_reasons[card_logo][0]=geographic_location", + ) + + def test_test_helpers_issuing_personalization_designs_reject_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.personalization_designs.reject( + "pd_xyz", + {"rejection_reasons": {"card_logo": ["geographic_location"]}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", + query_string="", + api_base="https://api.stripe.com", + post_data="rejection_reasons[card_logo][0]=geographic_location", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_personalization_designs_reject_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.PersonalizationDesign.TestHelpers.reject_async( + "pd_xyz", + rejection_reasons={"card_logo": ["geographic_location"]}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", + query_string="", + post_data="rejection_reasons[card_logo][0]=geographic_location", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_personalization_designs_reject_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.personalization_designs.reject_async( + "pd_xyz", + {"rejection_reasons": {"card_logo": ["geographic_location"]}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", + query_string="", + api_base="https://api.stripe.com", + post_data="rejection_reasons[card_logo][0]=geographic_location", + ) + + def test_test_helpers_issuing_transactions_create_force_capture_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Transaction.TestHelpers.create_force_capture( + amount=100, + card="foo", + currency="usd", + merchant_data={ + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "US", + "name": "foo", + "network_id": "bar", + "postal_code": "10001", + "state": "NY", + "terminal_id": "foo", + }, + purchase_details={ + "flight": { + "departure_at": 1633651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1533651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/create_force_capture", + query_string="", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + + def test_test_helpers_issuing_transactions_create_force_capture_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/transactions/create_force_capture", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.transactions.create_force_capture( + { + "amount": 100, + "card": "foo", + "currency": "usd", + "merchant_data": { + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "US", + "name": "foo", + "network_id": "bar", + "postal_code": "10001", + "state": "NY", + "terminal_id": "foo", + }, + "purchase_details": { + "flight": { + "departure_at": 1633651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1533651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/create_force_capture", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_transactions_create_force_capture_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Transaction.TestHelpers.create_force_capture_async( + amount=100, + card="foo", + currency="usd", + merchant_data={ + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "US", + "name": "foo", + "network_id": "bar", + "postal_code": "10001", + "state": "NY", + "terminal_id": "foo", + }, + purchase_details={ + "flight": { + "departure_at": 1633651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1533651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/create_force_capture", + query_string="", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_transactions_create_force_capture_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/transactions/create_force_capture", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.transactions.create_force_capture_async( + { + "amount": 100, + "card": "foo", + "currency": "usd", + "merchant_data": { + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "US", + "name": "foo", + "network_id": "bar", + "postal_code": "10001", + "state": "NY", + "terminal_id": "foo", + }, + "purchase_details": { + "flight": { + "departure_at": 1633651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1533651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/create_force_capture", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + + def test_test_helpers_issuing_transactions_create_unlinked_refund_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Transaction.TestHelpers.create_unlinked_refund( + amount=100, + card="foo", + currency="usd", + merchant_data={ + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "bar", + "name": "foo", + "network_id": "bar", + "postal_code": "foo", + "state": "bar", + "terminal_id": "foo", + }, + purchase_details={ + "flight": { + "departure_at": 1533651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1533651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", + query_string="", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + + def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/transactions/create_unlinked_refund", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.transactions.create_unlinked_refund( + { + "amount": 100, + "card": "foo", + "currency": "usd", + "merchant_data": { + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "bar", + "name": "foo", + "network_id": "bar", + "postal_code": "foo", + "state": "bar", + "terminal_id": "foo", + }, + "purchase_details": { + "flight": { + "departure_at": 1533651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1533651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_transactions_create_unlinked_refund_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Transaction.TestHelpers.create_unlinked_refund_async( + amount=100, + card="foo", + currency="usd", + merchant_data={ + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "bar", + "name": "foo", + "network_id": "bar", + "postal_code": "foo", + "state": "bar", + "terminal_id": "foo", + }, + purchase_details={ + "flight": { + "departure_at": 1533651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1533651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", + query_string="", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/transactions/create_unlinked_refund", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.transactions.create_unlinked_refund_async( + { + "amount": 100, + "card": "foo", + "currency": "usd", + "merchant_data": { + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "bar", + "name": "foo", + "network_id": "bar", + "postal_code": "foo", + "state": "bar", + "terminal_id": "foo", + }, + "purchase_details": { + "flight": { + "departure_at": 1533651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1533651200, "nights": 2}, + "receipt": [ + { + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, + }, + ], + "reference": "foo", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + ) + + def test_test_helpers_issuing_transactions_refund_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.issuing.Transaction.TestHelpers.refund( + "example_transaction", + refund_amount=50, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/example_transaction/refund", + query_string="", + post_data="refund_amount=50", + ) + + def test_test_helpers_issuing_transactions_refund_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/transactions/example_transaction/refund", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.issuing.transactions.refund( + "example_transaction", + {"refund_amount": 50}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/example_transaction/refund", + query_string="", + api_base="https://api.stripe.com", + post_data="refund_amount=50", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_transactions_refund_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.issuing.Transaction.TestHelpers.refund_async( + "example_transaction", + refund_amount=50, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/example_transaction/refund", + query_string="", + post_data="refund_amount=50", + ) + + @pytest.mark.anyio + async def test_test_helpers_issuing_transactions_refund_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/issuing/transactions/example_transaction/refund", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.issuing.transactions.refund_async( + "example_transaction", + {"refund_amount": 50}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/issuing/transactions/example_transaction/refund", + query_string="", + api_base="https://api.stripe.com", + post_data="refund_amount=50", + ) + + def test_test_helpers_refunds_expire_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Refund.TestHelpers.expire("re_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/refunds/re_123/expire", + query_string="", + ) + + def test_test_helpers_refunds_expire_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/refunds/re_123/expire", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.refunds.expire("re_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/refunds/re_123/expire", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_refunds_expire_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Refund.TestHelpers.expire_async("re_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/refunds/re_123/expire", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_refunds_expire_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/refunds/re_123/expire", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.refunds.expire_async("re_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/refunds/re_123/expire", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_test_clocks_advance_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.advance( + "clock_xyz", + frozen_time=142, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks/clock_xyz/advance", + query_string="", + post_data="frozen_time=142", + ) + + def test_test_helpers_test_clocks_advance_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/test_clocks/clock_xyz/advance", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.test_clocks.advance( + "clock_xyz", + {"frozen_time": 142}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks/clock_xyz/advance", + query_string="", + api_base="https://api.stripe.com", + post_data="frozen_time=142", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_advance_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.test_helpers.TestClock.advance_async( + "clock_xyz", + frozen_time=142, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks/clock_xyz/advance", + query_string="", + post_data="frozen_time=142", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_advance_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/test_clocks/clock_xyz/advance", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.test_clocks.advance_async( + "clock_xyz", + {"frozen_time": 142}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks/clock_xyz/advance", + query_string="", + api_base="https://api.stripe.com", + post_data="frozen_time=142", + ) + + def test_test_helpers_test_clocks_advance_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.advance( + "clock_xxxxxxxxxxxxx", + frozen_time=1675552261, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", + query_string="", + post_data="frozen_time=1675552261", + ) + + def test_test_helpers_test_clocks_advance_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.test_clocks.advance( + "clock_xxxxxxxxxxxxx", + {"frozen_time": 1675552261}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", + query_string="", + api_base="https://api.stripe.com", + post_data="frozen_time=1675552261", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_advance_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.test_helpers.TestClock.advance_async( + "clock_xxxxxxxxxxxxx", + frozen_time=1675552261, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", + query_string="", + post_data="frozen_time=1675552261", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_advance_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.test_clocks.advance_async( + "clock_xxxxxxxxxxxxx", + {"frozen_time": 1675552261}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", + query_string="", + api_base="https://api.stripe.com", + post_data="frozen_time=1675552261", + ) + + def test_test_helpers_test_clocks_delete( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.delete("clock_xyz") + http_client_mock.assert_requested( + "delete", + path="/v1/test_helpers/test_clocks/clock_xyz", + query_string="", + ) + + def test_test_helpers_test_clocks_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/test_helpers/test_clocks/clock_xyz", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.test_clocks.delete("clock_xyz") + http_client_mock.assert_requested( + "delete", + path="/v1/test_helpers/test_clocks/clock_xyz", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.test_helpers.TestClock.delete_async("clock_xyz") + http_client_mock.assert_requested( + "delete", + path="/v1/test_helpers/test_clocks/clock_xyz", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/test_helpers/test_clocks/clock_xyz", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.test_clocks.delete_async("clock_xyz") + http_client_mock.assert_requested( + "delete", + path="/v1/test_helpers/test_clocks/clock_xyz", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_test_clocks_delete_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.delete("clock_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + query_string="", + ) + + def test_test_helpers_test_clocks_delete_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.test_clocks.delete("clock_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_delete_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.test_helpers.TestClock.delete_async("clock_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_delete_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.test_clocks.delete_async( + "clock_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "delete", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_test_clocks_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.list() + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks", + query_string="", + ) + + def test_test_helpers_test_clocks_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/test_helpers/test_clocks", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.test_clocks.list() + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.test_helpers.TestClock.list_async() + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/test_helpers/test_clocks", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.test_clocks.list_async() + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_test_clocks_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.retrieve("clock_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks/clock_xyz", + query_string="", + ) + + def test_test_helpers_test_clocks_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/test_helpers/test_clocks/clock_xyz", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.test_clocks.retrieve("clock_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks/clock_xyz", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.test_helpers.TestClock.retrieve_async("clock_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks/clock_xyz", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/test_helpers/test_clocks/clock_xyz", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.test_clocks.retrieve_async("clock_xyz") + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks/clock_xyz", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_test_clocks_get_3( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks", + query_string="limit=3", + ) + + def test_test_helpers_test_clocks_get_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/test_helpers/test_clocks", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.test_clocks.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_get_3_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.test_helpers.TestClock.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_get_3_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/test_helpers/test_clocks", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.test_clocks.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_test_clocks_get_4( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.retrieve("clock_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + query_string="", + ) + + def test_test_helpers_test_clocks_get_4_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.test_clocks.retrieve("clock_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_get_4_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.test_helpers.TestClock.retrieve_async( + "clock_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_get_4_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.test_clocks.retrieve_async( + "clock_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_test_clocks_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.create( + frozen_time=123, + name="cogsworth", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks", + query_string="", + post_data="frozen_time=123&name=cogsworth", + ) + + def test_test_helpers_test_clocks_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/test_clocks", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.test_clocks.create( + { + "frozen_time": 123, + "name": "cogsworth", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks", + query_string="", + api_base="https://api.stripe.com", + post_data="frozen_time=123&name=cogsworth", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.test_helpers.TestClock.create_async( + frozen_time=123, + name="cogsworth", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks", + query_string="", + post_data="frozen_time=123&name=cogsworth", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/test_clocks", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.test_clocks.create_async( + { + "frozen_time": 123, + "name": "cogsworth", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks", + query_string="", + api_base="https://api.stripe.com", + post_data="frozen_time=123&name=cogsworth", + ) + + def test_test_helpers_test_clocks_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.test_helpers.TestClock.create(frozen_time=1577836800) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks", + query_string="", + post_data="frozen_time=1577836800", + ) + + def test_test_helpers_test_clocks_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/test_clocks", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.test_clocks.create({"frozen_time": 1577836800}) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks", + query_string="", + api_base="https://api.stripe.com", + post_data="frozen_time=1577836800", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.test_helpers.TestClock.create_async( + frozen_time=1577836800 + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks", + query_string="", + post_data="frozen_time=1577836800", + ) + + @pytest.mark.anyio + async def test_test_helpers_test_clocks_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/test_clocks", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.test_clocks.create_async( + { + "frozen_time": 1577836800, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/test_clocks", + query_string="", + api_base="https://api.stripe.com", + post_data="frozen_time=1577836800", + ) + + def test_test_helpers_treasury_inbound_transfers_fail_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.InboundTransfer.TestHelpers.fail( + "ibt_123", + failure_details={"code": "account_closed"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", + query_string="", + post_data="failure_details[code]=account_closed", + ) + + def test_test_helpers_treasury_inbound_transfers_fail_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.treasury.inbound_transfers.fail( + "ibt_123", + {"failure_details": {"code": "account_closed"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", + query_string="", + api_base="https://api.stripe.com", + post_data="failure_details[code]=account_closed", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_inbound_transfers_fail_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.InboundTransfer.TestHelpers.fail_async( + "ibt_123", + failure_details={"code": "account_closed"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", + query_string="", + post_data="failure_details[code]=account_closed", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_inbound_transfers_fail_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.treasury.inbound_transfers.fail_async( + "ibt_123", + {"failure_details": {"code": "account_closed"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", + query_string="", + api_base="https://api.stripe.com", + post_data="failure_details[code]=account_closed", + ) + + def test_test_helpers_treasury_inbound_transfers_return_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.InboundTransfer.TestHelpers.return_inbound_transfer( + "ibt_123", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", + query_string="", + ) + + def test_test_helpers_treasury_inbound_transfers_return_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.treasury.inbound_transfers.return_inbound_transfer( + "ibt_123", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_inbound_transfers_return_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.InboundTransfer.TestHelpers.return_inbound_transfer_async( + "ibt_123", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_inbound_transfers_return_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.treasury.inbound_transfers.return_inbound_transfer_async( + "ibt_123" + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_treasury_inbound_transfers_succeed_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.InboundTransfer.TestHelpers.succeed("ibt_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", + query_string="", + ) + + def test_test_helpers_treasury_inbound_transfers_succeed_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.treasury.inbound_transfers.succeed("ibt_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_inbound_transfers_succeed_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.InboundTransfer.TestHelpers.succeed_async( + "ibt_123", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_inbound_transfers_succeed_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.treasury.inbound_transfers.succeed_async( + "ibt_123", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_treasury_outbound_transfers_fail_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundTransfer.TestHelpers.fail("obt_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", + query_string="", + ) + + def test_test_helpers_treasury_outbound_transfers_fail_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.treasury.outbound_transfers.fail("obt_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_outbound_transfers_fail_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.OutboundTransfer.TestHelpers.fail_async( + "obt_123" + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_outbound_transfers_fail_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.treasury.outbound_transfers.fail_async( + "obt_123", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_treasury_outbound_transfers_post_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundTransfer.TestHelpers.post("obt_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", + query_string="", + ) + + def test_test_helpers_treasury_outbound_transfers_post_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/outbound_transfers/obt_123/post", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.treasury.outbound_transfers.post("obt_123") + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_outbound_transfers_post_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.OutboundTransfer.TestHelpers.post_async( + "obt_123" + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", + query_string="", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_outbound_transfers_post_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/outbound_transfers/obt_123/post", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.treasury.outbound_transfers.post_async( + "obt_123", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_test_helpers_treasury_outbound_transfers_return_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundTransfer.TestHelpers.return_outbound_transfer( + "obt_123", + returned_details={"code": "account_closed"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/return", + query_string="", + post_data="returned_details[code]=account_closed", + ) + + def test_test_helpers_treasury_outbound_transfers_return_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/outbound_transfers/obt_123/return", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.treasury.outbound_transfers.return_outbound_transfer( + "obt_123", + {"returned_details": {"code": "account_closed"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/return", + query_string="", + api_base="https://api.stripe.com", + post_data="returned_details[code]=account_closed", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_outbound_transfers_return_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.OutboundTransfer.TestHelpers.return_outbound_transfer_async( + "obt_123", + returned_details={"code": "account_closed"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/return", + query_string="", + post_data="returned_details[code]=account_closed", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_outbound_transfers_return_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/outbound_transfers/obt_123/return", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.treasury.outbound_transfers.return_outbound_transfer_async( + "obt_123", + {"returned_details": {"code": "account_closed"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/outbound_transfers/obt_123/return", + query_string="", + api_base="https://api.stripe.com", + post_data="returned_details[code]=account_closed", + ) + + def test_test_helpers_treasury_received_credits_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.ReceivedCredit.TestHelpers.create( + financial_account="fa_123", + network="ach", + amount=1234, + currency="usd", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/received_credits", + query_string="", + post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", + ) + + def test_test_helpers_treasury_received_credits_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/received_credits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.treasury.received_credits.create( + { + "financial_account": "fa_123", + "network": "ach", + "amount": 1234, + "currency": "usd", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/received_credits", + query_string="", + api_base="https://api.stripe.com", + post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_received_credits_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.ReceivedCredit.TestHelpers.create_async( + financial_account="fa_123", + network="ach", + amount=1234, + currency="usd", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/received_credits", + query_string="", + post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_received_credits_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/received_credits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.treasury.received_credits.create_async( + { + "financial_account": "fa_123", + "network": "ach", + "amount": 1234, + "currency": "usd", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/received_credits", + query_string="", + api_base="https://api.stripe.com", + post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", + ) + + def test_test_helpers_treasury_received_debits_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.ReceivedDebit.TestHelpers.create( + financial_account="fa_123", + network="ach", + amount=1234, + currency="usd", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/received_debits", + query_string="", + post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", + ) + + def test_test_helpers_treasury_received_debits_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/received_debits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.test_helpers.treasury.received_debits.create( + { + "financial_account": "fa_123", + "network": "ach", + "amount": 1234, + "currency": "usd", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/received_debits", + query_string="", + api_base="https://api.stripe.com", + post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_received_debits_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.ReceivedDebit.TestHelpers.create_async( + financial_account="fa_123", + network="ach", + amount=1234, + currency="usd", + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/received_debits", + query_string="", + post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", + ) + + @pytest.mark.anyio + async def test_test_helpers_treasury_received_debits_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/test_helpers/treasury/received_debits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.test_helpers.treasury.received_debits.create_async( + { + "financial_account": "fa_123", + "network": "ach", + "amount": 1234, + "currency": "usd", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/test_helpers/treasury/received_debits", + query_string="", + api_base="https://api.stripe.com", + post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", + ) + + def test_tokens_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.retrieve("tok_xxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tokens/tok_xxxx", + query_string="", + ) + + def test_tokens_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tokens/tok_xxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tokens.retrieve("tok_xxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tokens/tok_xxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_tokens_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Token.retrieve_async("tok_xxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tokens/tok_xxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_tokens_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tokens/tok_xxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tokens.retrieve_async("tok_xxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tokens/tok_xxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_tokens_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.create( + card={ + "number": "4242424242424242", + "exp_month": "5", + "exp_year": "2023", + "cvc": "314", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", + ) + + def test_tokens_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tokens.create( + { + "card": { + "number": "4242424242424242", + "exp_month": "5", + "exp_year": "2023", + "cvc": "314", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + api_base="https://api.stripe.com", + post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", + ) + + @pytest.mark.anyio + async def test_tokens_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Token.create_async( + card={ + "number": "4242424242424242", + "exp_month": "5", + "exp_year": "2023", + "cvc": "314", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", + ) + + @pytest.mark.anyio + async def test_tokens_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tokens.create_async( + { + "card": { + "number": "4242424242424242", + "exp_month": "5", + "exp_year": "2023", + "cvc": "314", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + api_base="https://api.stripe.com", + post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", + ) + + def test_tokens_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.create( + bank_account={ + "country": "US", + "currency": "usd", + "account_holder_name": "Jenny Rosen", + "account_holder_type": "individual", + "routing_number": "110000000", + "account_number": "000123456789", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", + ) + + def test_tokens_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tokens.create( + { + "bank_account": { + "country": "US", + "currency": "usd", + "account_holder_name": "Jenny Rosen", + "account_holder_type": "individual", + "routing_number": "110000000", + "account_number": "000123456789", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + api_base="https://api.stripe.com", + post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", + ) + + @pytest.mark.anyio + async def test_tokens_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Token.create_async( + bank_account={ + "country": "US", + "currency": "usd", + "account_holder_name": "Jenny Rosen", + "account_holder_type": "individual", + "routing_number": "110000000", + "account_number": "000123456789", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", + ) + + @pytest.mark.anyio + async def test_tokens_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tokens.create_async( + { + "bank_account": { + "country": "US", + "currency": "usd", + "account_holder_name": "Jenny Rosen", + "account_holder_type": "individual", + "routing_number": "110000000", + "account_number": "000123456789", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + api_base="https://api.stripe.com", + post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", + ) + + def test_tokens_post_3(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.create(pii={"id_number": "000000000"}) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="pii[id_number]=000000000", + ) + + def test_tokens_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tokens.create({"pii": {"id_number": "000000000"}}) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + api_base="https://api.stripe.com", + post_data="pii[id_number]=000000000", + ) + + @pytest.mark.anyio + async def test_tokens_post_3_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Token.create_async(pii={"id_number": "000000000"}) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="pii[id_number]=000000000", + ) + + @pytest.mark.anyio + async def test_tokens_post_3_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tokens.create_async({"pii": {"id_number": "000000000"}}) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + api_base="https://api.stripe.com", + post_data="pii[id_number]=000000000", + ) + + def test_tokens_post_4(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.create( + account={ + "individual": {"first_name": "Jane", "last_name": "Doe"}, + "tos_shown_and_accepted": True, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", + ) + + def test_tokens_post_4_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tokens.create( + { + "account": { + "individual": {"first_name": "Jane", "last_name": "Doe"}, + "tos_shown_and_accepted": True, + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + api_base="https://api.stripe.com", + post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", + ) + + @pytest.mark.anyio + async def test_tokens_post_4_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Token.create_async( + account={ + "individual": {"first_name": "Jane", "last_name": "Doe"}, + "tos_shown_and_accepted": True, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", + ) + + @pytest.mark.anyio + async def test_tokens_post_4_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tokens.create_async( + { + "account": { + "individual": {"first_name": "Jane", "last_name": "Doe"}, + "tos_shown_and_accepted": True, + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + api_base="https://api.stripe.com", + post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", + ) + + def test_tokens_post_5(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.create( + person={ + "first_name": "Jane", + "last_name": "Doe", + "relationship": {"owner": True}, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", + ) + + def test_tokens_post_5_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tokens.create( + { + "person": { + "first_name": "Jane", + "last_name": "Doe", + "relationship": {"owner": True}, + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + api_base="https://api.stripe.com", + post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", + ) + + @pytest.mark.anyio + async def test_tokens_post_5_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Token.create_async( + person={ + "first_name": "Jane", + "last_name": "Doe", + "relationship": {"owner": True}, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", + ) + + @pytest.mark.anyio + async def test_tokens_post_5_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tokens.create_async( + { + "person": { + "first_name": "Jane", + "last_name": "Doe", + "relationship": {"owner": True}, + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + api_base="https://api.stripe.com", + post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", + ) + + def test_tokens_post_6(self, http_client_mock: HTTPClientMock) -> None: + stripe.Token.create(cvc_update={"cvc": "123"}) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="cvc_update[cvc]=123", + ) + + def test_tokens_post_6_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tokens.create({"cvc_update": {"cvc": "123"}}) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + api_base="https://api.stripe.com", + post_data="cvc_update[cvc]=123", + ) + + @pytest.mark.anyio + async def test_tokens_post_6_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Token.create_async(cvc_update={"cvc": "123"}) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + post_data="cvc_update[cvc]=123", + ) + + @pytest.mark.anyio + async def test_tokens_post_6_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/tokens", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tokens.create_async({"cvc_update": {"cvc": "123"}}) + http_client_mock.assert_requested( + "post", + path="/v1/tokens", + query_string="", + api_base="https://api.stripe.com", + post_data="cvc_update[cvc]=123", + ) + + def test_topups_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Topup.cancel("tu_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", + query_string="", + ) + + def test_topups_cancel_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/topups/tu_xxxxxxxxxxxxx/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.topups.cancel("tu_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_topups_cancel_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Topup.cancel_async("tu_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", + query_string="", + ) + + @pytest.mark.anyio + async def test_topups_cancel_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/topups/tu_xxxxxxxxxxxxx/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.topups.cancel_async("tu_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "post", + path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_topups_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Topup.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/topups", + query_string="limit=3", + ) + + def test_topups_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/topups", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.topups.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/topups", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_topups_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Topup.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/topups", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_topups_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/topups", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.topups.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/topups", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_topups_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Topup.retrieve("tu_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/topups/tu_xxxxxxxxxxxxx", + query_string="", + ) + + def test_topups_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/topups/tu_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.topups.retrieve("tu_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/topups/tu_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_topups_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Topup.retrieve_async("tu_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/topups/tu_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_topups_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/topups/tu_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.topups.retrieve_async("tu_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/topups/tu_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_topups_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Topup.create( + amount=2000, + currency="usd", + description="Top-up for Jenny Rosen", + statement_descriptor="Top-up", + ) + http_client_mock.assert_requested( + "post", + path="/v1/topups", + query_string="", + post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", + ) + + def test_topups_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/topups", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.topups.create( { - "amount": 100, - "card": "foo", + "amount": 2000, "currency": "usd", - "merchant_data": { - "category": "ac_refrigeration_repair", - "city": "foo", - "country": "US", - "name": "foo", - "network_id": "bar", - "postal_code": "10001", - "state": "NY", - "terminal_id": "foo", - }, - "purchase_details": { - "flight": { - "departure_at": 1633651200, - "passenger_name": "John Doe", - "refundable": True, - "segments": [ - { - "arrival_airport_code": "SFO", - "carrier": "Delta", - "departure_airport_code": "LAX", - "flight_number": "DL100", - "service_class": "Economy", - "stopover_allowed": True, - }, - ], - "travel_agency": "Orbitz", - }, - "fuel": { - "type": "diesel", - "unit": "liter", - "unit_cost_decimal": "3.5", - "volume_decimal": "10", - }, - "lodging": {"check_in_at": 1533651200, "nights": 2}, - "receipt": [ - { - "description": "Room charge", - "quantity": "1", - "total": 200, - "unit_cost": 200, - }, - ], - "reference": "foo", - }, + "description": "Top-up for Jenny Rosen", + "statement_descriptor": "Top-up", + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/topups", + query_string="", + api_base="https://api.stripe.com", + post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", + ) + + @pytest.mark.anyio + async def test_topups_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Topup.create_async( + amount=2000, + currency="usd", + description="Top-up for Jenny Rosen", + statement_descriptor="Top-up", + ) + http_client_mock.assert_requested( + "post", + path="/v1/topups", + query_string="", + post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", + ) + + @pytest.mark.anyio + async def test_topups_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/topups", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.topups.create_async( + { + "amount": 2000, + "currency": "usd", + "description": "Top-up for Jenny Rosen", + "statement_descriptor": "Top-up", } ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/transactions/create_force_capture", + path="/v1/topups", query_string="", api_base="https://api.stripe.com", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", ) - def test_test_helpers_issuing_transactions_create_unlinked_refund_post( + def test_topups_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Topup.modify( + "tu_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/topups/tu_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + def test_topups_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Transaction.TestHelpers.create_unlinked_refund( - amount=100, - card="foo", - currency="usd", - merchant_data={ - "category": "ac_refrigeration_repair", - "city": "foo", - "country": "bar", - "name": "foo", - "network_id": "bar", - "postal_code": "foo", - "state": "bar", - "terminal_id": "foo", - }, - purchase_details={ - "flight": { - "departure_at": 1533651200, - "passenger_name": "John Doe", - "refundable": True, - "segments": [ - { - "arrival_airport_code": "SFO", - "carrier": "Delta", - "departure_airport_code": "LAX", - "flight_number": "DL100", - "service_class": "Economy", - "stopover_allowed": True, - }, - ], - "travel_agency": "Orbitz", - }, - "fuel": { - "type": "diesel", - "unit": "liter", - "unit_cost_decimal": "3.5", - "volume_decimal": "10", - }, - "lodging": {"check_in_at": 1533651200, "nights": 2}, - "receipt": [ - { - "description": "Room charge", - "quantity": "1", - "total": 200, - "unit_cost": 200, - }, - ], - "reference": "foo", - }, + http_client_mock.stub_request( + "post", + "/v1/topups/tu_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.topups.update( + "tu_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/topups/tu_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_topups_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Topup.modify_async( + "tu_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/topups/tu_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", + ) + + @pytest.mark.anyio + async def test_topups_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/topups/tu_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.topups.update_async( + "tu_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/topups/tu_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", + ) + + def test_transfers_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.Transfer.list(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/transfers", + query_string="limit=3", + ) + + def test_transfers_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/transfers", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.transfers.list({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/transfers", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_transfers_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Transfer.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/transfers", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_transfers_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/transfers", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.transfers.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/transfers", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + + def test_transfers_get_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Transfer.retrieve("tr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx", + query_string="", + ) + + def test_transfers_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/transfers/tr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.transfers.retrieve("tr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_transfers_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Transfer.retrieve_async("tr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_transfers_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/transfers/tr_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.transfers.retrieve_async("tr_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_transfers_post(self, http_client_mock: HTTPClientMock) -> None: + stripe.Transfer.create( + amount=400, + currency="usd", + destination="acct_xxxxxxxxxxxxx", + transfer_group="ORDER_95", ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", + path="/v1/transfers", query_string="", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) - def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service( + def test_transfers_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/issuing/transactions/create_unlinked_refund", + "/v1/transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.transactions.create_unlinked_refund( + client.transfers.create( { - "amount": 100, - "card": "foo", + "amount": 400, "currency": "usd", - "merchant_data": { - "category": "ac_refrigeration_repair", - "city": "foo", - "country": "bar", - "name": "foo", - "network_id": "bar", - "postal_code": "foo", - "state": "bar", - "terminal_id": "foo", - }, - "purchase_details": { - "flight": { - "departure_at": 1533651200, - "passenger_name": "John Doe", - "refundable": True, - "segments": [ - { - "arrival_airport_code": "SFO", - "carrier": "Delta", - "departure_airport_code": "LAX", - "flight_number": "DL100", - "service_class": "Economy", - "stopover_allowed": True, - }, - ], - "travel_agency": "Orbitz", - }, - "fuel": { - "type": "diesel", - "unit": "liter", - "unit_cost_decimal": "3.5", - "volume_decimal": "10", - }, - "lodging": {"check_in_at": 1533651200, "nights": 2}, - "receipt": [ - { - "description": "Room charge", - "quantity": "1", - "total": 200, - "unit_cost": 200, - }, - ], - "reference": "foo", - }, + "destination": "acct_xxxxxxxxxxxxx", + "transfer_group": "ORDER_95", } ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", + path="/v1/transfers", query_string="", api_base="https://api.stripe.com", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) - def test_test_helpers_issuing_transactions_refund_post( + @pytest.mark.anyio + async def test_transfers_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Transaction.TestHelpers.refund( - "example_transaction", - refund_amount=50, + await stripe.Transfer.create_async( + amount=400, + currency="usd", + destination="acct_xxxxxxxxxxxxx", + transfer_group="ORDER_95", ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/transactions/example_transaction/refund", + path="/v1/transfers", query_string="", - post_data="refund_amount=50", + post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) - def test_test_helpers_issuing_transactions_refund_post_service( + @pytest.mark.anyio + async def test_transfers_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/issuing/transactions/example_transaction/refund", + "/v1/transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.transactions.refund( - "example_transaction", - {"refund_amount": 50}, + await client.transfers.create_async( + { + "amount": 400, + "currency": "usd", + "destination": "acct_xxxxxxxxxxxxx", + "transfer_group": "ORDER_95", + } ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/issuing/transactions/example_transaction/refund", + path="/v1/transfers", query_string="", api_base="https://api.stripe.com", - post_data="refund_amount=50", + post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) - def test_test_helpers_refunds_expire_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Refund.TestHelpers.expire("re_123") + def test_transfers_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Transfer.modify( + "tr_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/refunds/re_123/expire", + path="/v1/transfers/tr_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_test_helpers_refunds_expire_post_service( + def test_transfers_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/refunds/re_123/expire", + "/v1/transfers/tr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.refunds.expire("re_123") + client.transfers.update( + "tr_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/refunds/re_123/expire", + path="/v1/transfers/tr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_test_helpers_test_clocks_advance_post( + @pytest.mark.anyio + async def test_transfers_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.test_helpers.TestClock.advance( - "clock_xyz", - frozen_time=142, + await stripe.Transfer.modify_async( + "tr_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/test_clocks/clock_xyz/advance", + path="/v1/transfers/tr_xxxxxxxxxxxxx", query_string="", - post_data="frozen_time=142", + post_data="metadata[order_id]=6735", ) - def test_test_helpers_test_clocks_advance_post_service( + @pytest.mark.anyio + async def test_transfers_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/test_clocks/clock_xyz/advance", + "/v1/transfers/tr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.advance( - "clock_xyz", - {"frozen_time": 142}, + await client.transfers.update_async( + "tr_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/test_clocks/clock_xyz/advance", + path="/v1/transfers/tr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="frozen_time=142", + post_data="metadata[order_id]=6735", ) - def test_test_helpers_test_clocks_advance_post_2( + def test_transfers_reversals_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.test_helpers.TestClock.advance( - "clock_xxxxxxxxxxxxx", - frozen_time=1675552261, + stripe.Transfer.list_reversals( + "tr_xxxxxxxxxxxxx", + limit=3, ) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", - query_string="", - post_data="frozen_time=1675552261", + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + query_string="limit=3", ) - def test_test_helpers_test_clocks_advance_post_2_service( + def test_transfers_reversals_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", + "get", + "/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.advance( - "clock_xxxxxxxxxxxxx", - {"frozen_time": 1675552261}, + client.transfers.reversals.list( + "tr_xxxxxxxxxxxxx", + {"limit": 3}, ) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", - query_string="", + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="frozen_time=1675552261", ) - def test_test_helpers_test_clocks_delete( + @pytest.mark.anyio + async def test_transfers_reversals_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.test_helpers.TestClock.delete("clock_xyz") + await stripe.Transfer.list_reversals_async( + "tr_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( - "delete", - path="/v1/test_helpers/test_clocks/clock_xyz", - query_string="", + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + query_string="limit=3", ) - def test_test_helpers_test_clocks_delete_service( + @pytest.mark.anyio + async def test_transfers_reversals_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/test_helpers/test_clocks/clock_xyz", + "get", + "/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.delete("clock_xyz") + await client.transfers.reversals.list_async( + "tr_xxxxxxxxxxxxx", + {"limit": 3}, + ) http_client_mock.assert_requested( - "delete", - path="/v1/test_helpers/test_clocks/clock_xyz", - query_string="", + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + query_string="limit=3", api_base="https://api.stripe.com", ) - def test_test_helpers_test_clocks_delete_2( + def test_transfers_reversals_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.test_helpers.TestClock.delete("clock_xxxxxxxxxxxxx") + stripe.Transfer.retrieve_reversal( + "tr_xxxxxxxxxxxxx", + "trr_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "delete", - path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", ) - def test_test_helpers_test_clocks_delete_2_service( + def test_transfers_reversals_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + "get", + "/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.delete("clock_xxxxxxxxxxxxx") + client.transfers.reversals.retrieve( + "tr_xxxxxxxxxxxxx", + "trr_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "delete", - path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + "get", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_test_helpers_test_clocks_get( + @pytest.mark.anyio + async def test_transfers_reversals_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.test_helpers.TestClock.list() + await stripe.Transfer.retrieve_reversal_async( + "tr_xxxxxxxxxxxxx", + "trr_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/test_helpers/test_clocks", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", ) - def test_test_helpers_test_clocks_get_service( + @pytest.mark.anyio + async def test_transfers_reversals_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/test_helpers/test_clocks", + "/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.list() + await client.transfers.reversals.retrieve_async( + "tr_xxxxxxxxxxxxx", + "trr_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/test_helpers/test_clocks", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_test_helpers_test_clocks_get_2( + def test_transfers_reversals_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.test_helpers.TestClock.retrieve("clock_xyz") + stripe.Transfer.create_reversal( + "tr_xxxxxxxxxxxxx", + amount=100, + ) http_client_mock.assert_requested( - "get", - path="/v1/test_helpers/test_clocks/clock_xyz", + "post", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", query_string="", + post_data="amount=100", ) - def test_test_helpers_test_clocks_get_2_service( + def test_transfers_reversals_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/test_helpers/test_clocks/clock_xyz", + "post", + "/v1/transfers/tr_xxxxxxxxxxxxx/reversals", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.retrieve("clock_xyz") + client.transfers.reversals.create( + "tr_xxxxxxxxxxxxx", + {"amount": 100}, + ) http_client_mock.assert_requested( - "get", - path="/v1/test_helpers/test_clocks/clock_xyz", + "post", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", query_string="", api_base="https://api.stripe.com", + post_data="amount=100", ) - def test_test_helpers_test_clocks_get_3( + @pytest.mark.anyio + async def test_transfers_reversals_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.test_helpers.TestClock.list(limit=3) + await stripe.Transfer.create_reversal_async( + "tr_xxxxxxxxxxxxx", + amount=100, + ) http_client_mock.assert_requested( - "get", - path="/v1/test_helpers/test_clocks", - query_string="limit=3", + "post", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + query_string="", + post_data="amount=100", ) - def test_test_helpers_test_clocks_get_3_service( + @pytest.mark.anyio + async def test_transfers_reversals_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/test_helpers/test_clocks", - "limit=3", + "post", + "/v1/transfers/tr_xxxxxxxxxxxxx/reversals", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.list({"limit": 3}) + await client.transfers.reversals.create_async( + "tr_xxxxxxxxxxxxx", + {"amount": 100}, + ) http_client_mock.assert_requested( - "get", - path="/v1/test_helpers/test_clocks", - query_string="limit=3", + "post", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + query_string="", api_base="https://api.stripe.com", + post_data="amount=100", ) - def test_test_helpers_test_clocks_get_4( + def test_transfers_reversals_post_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.test_helpers.TestClock.retrieve("clock_xxxxxxxxxxxxx") + stripe.Transfer.modify_reversal( + "tr_xxxxxxxxxxxxx", + "trr_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + "post", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", + post_data="metadata[order_id]=6735", ) - def test_test_helpers_test_clocks_get_4_service( + def test_transfers_reversals_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + "post", + "/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.retrieve("clock_xxxxxxxxxxxxx") + client.transfers.reversals.update( + "tr_xxxxxxxxxxxxx", + "trr_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "get", - path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", + "post", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_test_helpers_test_clocks_post( + @pytest.mark.anyio + async def test_transfers_reversals_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.test_helpers.TestClock.create( - frozen_time=123, - name="cogsworth", + await stripe.Transfer.modify_reversal_async( + "tr_xxxxxxxxxxxxx", + "trr_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/test_clocks", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", - post_data="frozen_time=123&name=cogsworth", + post_data="metadata[order_id]=6735", ) - def test_test_helpers_test_clocks_post_service( + @pytest.mark.anyio + async def test_transfers_reversals_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/test_clocks", + "/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.create( - { - "frozen_time": 123, - "name": "cogsworth", - } + await client.transfers.reversals.update_async( + "tr_xxxxxxxxxxxxx", + "trr_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/test_clocks", + path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="frozen_time=123&name=cogsworth", + post_data="metadata[order_id]=6735", ) - def test_test_helpers_test_clocks_post_2( + def test_treasury_credit_reversals_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.test_helpers.TestClock.create(frozen_time=1577836800) + stripe.treasury.CreditReversal.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/test_clocks", - query_string="", - post_data="frozen_time=1577836800", + "get", + path="/v1/treasury/credit_reversals", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_test_helpers_test_clocks_post_2_service( + def test_treasury_credit_reversals_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/test_clocks", + "get", + "/v1/treasury/credit_reversals", + "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.create({"frozen_time": 1577836800}) + client.treasury.credit_reversals.list( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "limit": 3, + } + ) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/test_clocks", - query_string="", + "get", + path="/v1/treasury/credit_reversals", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", - post_data="frozen_time=1577836800", ) - def test_test_helpers_treasury_inbound_transfers_fail_post( + @pytest.mark.anyio + async def test_treasury_credit_reversals_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.InboundTransfer.TestHelpers.fail( - "ibt_123", - failure_details={"code": "account_closed"}, + await stripe.treasury.CreditReversal.list_async( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, ) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", - query_string="", - post_data="failure_details[code]=account_closed", + "get", + path="/v1/treasury/credit_reversals", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_test_helpers_treasury_inbound_transfers_fail_post_service( + @pytest.mark.anyio + async def test_treasury_credit_reversals_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", + "get", + "/v1/treasury/credit_reversals", + "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.inbound_transfers.fail( - "ibt_123", - {"failure_details": {"code": "account_closed"}}, + await client.treasury.credit_reversals.list_async( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "limit": 3, + } ) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", - query_string="", + "get", + path="/v1/treasury/credit_reversals", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", - post_data="failure_details[code]=account_closed", ) - def test_test_helpers_treasury_inbound_transfers_return_post( + def test_treasury_credit_reversals_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.InboundTransfer.TestHelpers.return_inbound_transfer( - "ibt_123", - ) + stripe.treasury.CreditReversal.retrieve("credrev_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", + "get", + path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", query_string="", ) - def test_test_helpers_treasury_inbound_transfers_return_post_service( + def test_treasury_credit_reversals_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", + "get", + "/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.inbound_transfers.return_inbound_transfer( - "ibt_123", - ) + client.treasury.credit_reversals.retrieve("credrev_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", + "get", + path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_test_helpers_treasury_inbound_transfers_succeed_post( + @pytest.mark.anyio + async def test_treasury_credit_reversals_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.InboundTransfer.TestHelpers.succeed("ibt_123") + await stripe.treasury.CreditReversal.retrieve_async( + "credrev_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", + "get", + path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", query_string="", ) - def test_test_helpers_treasury_inbound_transfers_succeed_post_service( + @pytest.mark.anyio + async def test_treasury_credit_reversals_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", + "get", + "/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.inbound_transfers.succeed("ibt_123") + await client.treasury.credit_reversals.retrieve_async( + "credrev_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", + "get", + path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_test_helpers_treasury_outbound_transfers_fail_post( + def test_treasury_credit_reversals_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.OutboundTransfer.TestHelpers.fail("obt_123") + stripe.treasury.CreditReversal.create( + received_credit="rc_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", + path="/v1/treasury/credit_reversals", query_string="", + post_data="received_credit=rc_xxxxxxxxxxxxx", ) - def test_test_helpers_treasury_outbound_transfers_fail_post_service( + def test_treasury_credit_reversals_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", + "/v1/treasury/credit_reversals", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.outbound_transfers.fail("obt_123") + client.treasury.credit_reversals.create( + { + "received_credit": "rc_xxxxxxxxxxxxx", + } + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", + path="/v1/treasury/credit_reversals", query_string="", api_base="https://api.stripe.com", + post_data="received_credit=rc_xxxxxxxxxxxxx", ) - def test_test_helpers_treasury_outbound_transfers_post_post( + @pytest.mark.anyio + async def test_treasury_credit_reversals_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.OutboundTransfer.TestHelpers.post("obt_123") + await stripe.treasury.CreditReversal.create_async( + received_credit="rc_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", + path="/v1/treasury/credit_reversals", query_string="", + post_data="received_credit=rc_xxxxxxxxxxxxx", ) - def test_test_helpers_treasury_outbound_transfers_post_post_service( + @pytest.mark.anyio + async def test_treasury_credit_reversals_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/test_helpers/treasury/outbound_transfers/obt_123/post", + "/v1/treasury/credit_reversals", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.outbound_transfers.post("obt_123") + await client.treasury.credit_reversals.create_async( + { + "received_credit": "rc_xxxxxxxxxxxxx", + } + ) http_client_mock.assert_requested( "post", - path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", + path="/v1/treasury/credit_reversals", query_string="", api_base="https://api.stripe.com", + post_data="received_credit=rc_xxxxxxxxxxxxx", ) - def test_test_helpers_treasury_outbound_transfers_return_post( + def test_treasury_debit_reversals_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.OutboundTransfer.TestHelpers.return_outbound_transfer( - "obt_123", - returned_details={"code": "account_closed"}, + stripe.treasury.DebitReversal.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, ) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/outbound_transfers/obt_123/return", - query_string="", - post_data="returned_details[code]=account_closed", + "get", + path="/v1/treasury/debit_reversals", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_test_helpers_treasury_outbound_transfers_return_post_service( + def test_treasury_debit_reversals_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/treasury/outbound_transfers/obt_123/return", + "get", + "/v1/treasury/debit_reversals", + "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.outbound_transfers.return_outbound_transfer( - "obt_123", - {"returned_details": {"code": "account_closed"}}, + client.treasury.debit_reversals.list( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "limit": 3, + } ) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/outbound_transfers/obt_123/return", - query_string="", + "get", + path="/v1/treasury/debit_reversals", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", - post_data="returned_details[code]=account_closed", ) - def test_test_helpers_treasury_received_credits_post( + @pytest.mark.anyio + async def test_treasury_debit_reversals_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.ReceivedCredit.TestHelpers.create( - financial_account="fa_123", - network="ach", - amount=1234, - currency="usd", + await stripe.treasury.DebitReversal.list_async( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, ) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/received_credits", - query_string="", - post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", + "get", + path="/v1/treasury/debit_reversals", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_test_helpers_treasury_received_credits_post_service( + @pytest.mark.anyio + async def test_treasury_debit_reversals_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/treasury/received_credits", + "get", + "/v1/treasury/debit_reversals", + "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.received_credits.create( + await client.treasury.debit_reversals.list_async( { - "financial_account": "fa_123", - "network": "ach", - "amount": 1234, - "currency": "usd", + "financial_account": "fa_xxxxxxxxxxxxx", + "limit": 3, } ) http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/received_credits", - query_string="", + "get", + path="/v1/treasury/debit_reversals", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", - post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) - def test_test_helpers_treasury_received_debits_post( + def test_treasury_debit_reversals_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.ReceivedDebit.TestHelpers.create( - financial_account="fa_123", - network="ach", - amount=1234, - currency="usd", - ) + stripe.treasury.DebitReversal.retrieve("debrev_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/received_debits", + "get", + path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", query_string="", - post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) - def test_test_helpers_treasury_received_debits_post_service( + def test_treasury_debit_reversals_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/test_helpers/treasury/received_debits", + "get", + "/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.received_debits.create( - { - "financial_account": "fa_123", - "network": "ach", - "amount": 1234, - "currency": "usd", - } - ) + client.treasury.debit_reversals.retrieve("debrev_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/test_helpers/treasury/received_debits", + "get", + path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) - def test_tokens_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.retrieve("tok_xxxx") + @pytest.mark.anyio + async def test_treasury_debit_reversals_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.DebitReversal.retrieve_async( + "debrev_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/tokens/tok_xxxx", + path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", query_string="", ) - def test_tokens_get_service( + @pytest.mark.anyio + async def test_treasury_debit_reversals_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/tokens/tok_xxxx", + "/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.retrieve("tok_xxxx") + await client.treasury.debit_reversals.retrieve_async( + "debrev_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/tokens/tok_xxxx", + path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_tokens_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.create( - card={ - "number": "4242424242424242", - "exp_month": "5", - "exp_year": "2023", - "cvc": "314", - }, - ) + def test_treasury_debit_reversals_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.DebitReversal.create(received_debit="rd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/tokens", + path="/v1/treasury/debit_reversals", query_string="", - post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", + post_data="received_debit=rd_xxxxxxxxxxxxx", ) - def test_tokens_post_service( + def test_treasury_debit_reversals_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/tokens", + "/v1/treasury/debit_reversals", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.create( + client.treasury.debit_reversals.create( { - "card": { - "number": "4242424242424242", - "exp_month": "5", - "exp_year": "2023", - "cvc": "314", - }, + "received_debit": "rd_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", - path="/v1/tokens", + path="/v1/treasury/debit_reversals", query_string="", api_base="https://api.stripe.com", - post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", + post_data="received_debit=rd_xxxxxxxxxxxxx", ) - def test_tokens_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.create( - bank_account={ - "country": "US", - "currency": "usd", - "account_holder_name": "Jenny Rosen", - "account_holder_type": "individual", - "routing_number": "110000000", - "account_number": "000123456789", - }, + @pytest.mark.anyio + async def test_treasury_debit_reversals_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.DebitReversal.create_async( + received_debit="rd_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", - path="/v1/tokens", + path="/v1/treasury/debit_reversals", query_string="", - post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", + post_data="received_debit=rd_xxxxxxxxxxxxx", ) - def test_tokens_post_2_service( + @pytest.mark.anyio + async def test_treasury_debit_reversals_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/tokens", + "/v1/treasury/debit_reversals", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.create( + await client.treasury.debit_reversals.create_async( { - "bank_account": { - "country": "US", - "currency": "usd", - "account_holder_name": "Jenny Rosen", - "account_holder_type": "individual", - "routing_number": "110000000", - "account_number": "000123456789", - }, + "received_debit": "rd_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", - path="/v1/tokens", + path="/v1/treasury/debit_reversals", query_string="", api_base="https://api.stripe.com", - post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", + post_data="received_debit=rd_xxxxxxxxxxxxx", ) - def test_tokens_post_3(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.create(pii={"id_number": "000000000"}) + def test_treasury_financial_accounts_features_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.FinancialAccount.retrieve_features("fa_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/tokens", + "get", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", query_string="", - post_data="pii[id_number]=000000000", ) - def test_tokens_post_3_service( + def test_treasury_financial_accounts_features_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/tokens", + "get", + "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.create({"pii": {"id_number": "000000000"}}) + client.treasury.financial_accounts.features.list("fa_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/tokens", + "get", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", query_string="", api_base="https://api.stripe.com", - post_data="pii[id_number]=000000000", ) - def test_tokens_post_4(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.create( - account={ - "individual": {"first_name": "Jane", "last_name": "Doe"}, - "tos_shown_and_accepted": True, - }, + @pytest.mark.anyio + async def test_treasury_financial_accounts_features_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.FinancialAccount.retrieve_features_async( + "fa_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/tokens", + "get", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", query_string="", - post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", ) - def test_tokens_post_4_service( + @pytest.mark.anyio + async def test_treasury_financial_accounts_features_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/tokens", + "get", + "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.create( - { - "account": { - "individual": {"first_name": "Jane", "last_name": "Doe"}, - "tos_shown_and_accepted": True, - }, - } + await client.treasury.financial_accounts.features.list_async( + "fa_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/tokens", + "get", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", query_string="", api_base="https://api.stripe.com", - post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", ) - def test_tokens_post_5(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.create( - person={ - "first_name": "Jane", - "last_name": "Doe", - "relationship": {"owner": True}, - }, - ) + def test_treasury_financial_accounts_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.FinancialAccount.list(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/tokens", - query_string="", - post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", + "get", + path="/v1/treasury/financial_accounts", + query_string="limit=3", ) - def test_tokens_post_5_service( + def test_treasury_financial_accounts_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/tokens", + "get", + "/v1/treasury/financial_accounts", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.create( - { - "person": { - "first_name": "Jane", - "last_name": "Doe", - "relationship": {"owner": True}, - }, - } - ) + client.treasury.financial_accounts.list({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/tokens", - query_string="", + "get", + path="/v1/treasury/financial_accounts", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", ) - def test_tokens_post_6(self, http_client_mock: HTTPClientMock) -> None: - stripe.Token.create(cvc_update={"cvc": "123"}) + @pytest.mark.anyio + async def test_treasury_financial_accounts_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.FinancialAccount.list_async(limit=3) http_client_mock.assert_requested( - "post", - path="/v1/tokens", - query_string="", - post_data="cvc_update[cvc]=123", + "get", + path="/v1/treasury/financial_accounts", + query_string="limit=3", ) - def test_tokens_post_6_service( + @pytest.mark.anyio + async def test_treasury_financial_accounts_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/tokens", + "get", + "/v1/treasury/financial_accounts", + "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.create({"cvc_update": {"cvc": "123"}}) + await client.treasury.financial_accounts.list_async({"limit": 3}) http_client_mock.assert_requested( - "post", - path="/v1/tokens", - query_string="", + "get", + path="/v1/treasury/financial_accounts", + query_string="limit=3", api_base="https://api.stripe.com", - post_data="cvc_update[cvc]=123", ) - def test_topups_cancel_post( + def test_treasury_financial_accounts_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Topup.cancel("tu_xxxxxxxxxxxxx") + stripe.treasury.FinancialAccount.retrieve("fa_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", + "get", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", query_string="", ) - def test_topups_cancel_post_service( + def test_treasury_financial_accounts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/topups/tu_xxxxxxxxxxxxx/cancel", + "get", + "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.topups.cancel("tu_xxxxxxxxxxxxx") + client.treasury.financial_accounts.retrieve("fa_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", + "get", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_topups_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Topup.list(limit=3) + @pytest.mark.anyio + async def test_treasury_financial_accounts_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.FinancialAccount.retrieve_async( + "fa_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/topups", - query_string="limit=3", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", + query_string="", ) - def test_topups_get_service( + @pytest.mark.anyio + async def test_treasury_financial_accounts_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/topups", - "limit=3", + "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.topups.list({"limit": 3}) + await client.treasury.financial_accounts.retrieve_async( + "fa_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/topups", - query_string="limit=3", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_topups_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Topup.retrieve("tu_xxxxxxxxxxxxx") + def test_treasury_financial_accounts_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.FinancialAccount.create( + supported_currencies=["usd"], + features={}, + ) http_client_mock.assert_requested( - "get", - path="/v1/topups/tu_xxxxxxxxxxxxx", + "post", + path="/v1/treasury/financial_accounts", query_string="", + post_data="supported_currencies[0]=usd", ) - def test_topups_get_2_service( + def test_treasury_financial_accounts_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/topups/tu_xxxxxxxxxxxxx", + "post", + "/v1/treasury/financial_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.topups.retrieve("tu_xxxxxxxxxxxxx") + client.treasury.financial_accounts.create( + { + "supported_currencies": ["usd"], + "features": {}, + } + ) http_client_mock.assert_requested( - "get", - path="/v1/topups/tu_xxxxxxxxxxxxx", + "post", + path="/v1/treasury/financial_accounts", query_string="", api_base="https://api.stripe.com", + post_data="supported_currencies[0]=usd", ) - def test_topups_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Topup.create( - amount=2000, - currency="usd", - description="Top-up for Jenny Rosen", - statement_descriptor="Top-up", + @pytest.mark.anyio + async def test_treasury_financial_accounts_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.FinancialAccount.create_async( + supported_currencies=["usd"], + features={}, ) http_client_mock.assert_requested( "post", - path="/v1/topups", + path="/v1/treasury/financial_accounts", query_string="", - post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", + post_data="supported_currencies[0]=usd", ) - def test_topups_post_service( + @pytest.mark.anyio + async def test_treasury_financial_accounts_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/topups", + "/v1/treasury/financial_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.topups.create( + await client.treasury.financial_accounts.create_async( { - "amount": 2000, - "currency": "usd", - "description": "Top-up for Jenny Rosen", - "statement_descriptor": "Top-up", + "supported_currencies": ["usd"], + "features": {}, } ) http_client_mock.assert_requested( "post", - path="/v1/topups", + path="/v1/treasury/financial_accounts", query_string="", api_base="https://api.stripe.com", - post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", + post_data="supported_currencies[0]=usd", ) - def test_topups_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Topup.modify( - "tu_xxxxxxxxxxxxx", + def test_treasury_financial_accounts_post_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.FinancialAccount.modify( + "fa_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/topups/tu_xxxxxxxxxxxxx", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) - def test_topups_post_2_service( + def test_treasury_financial_accounts_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/topups/tu_xxxxxxxxxxxxx", + "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.topups.update( - "tu_xxxxxxxxxxxxx", + client.treasury.financial_accounts.update( + "fa_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", - path="/v1/topups/tu_xxxxxxxxxxxxx", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) - def test_transfers_get(self, http_client_mock: HTTPClientMock) -> None: - stripe.Transfer.list(limit=3) + @pytest.mark.anyio + async def test_treasury_financial_accounts_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.FinancialAccount.modify_async( + "fa_xxxxxxxxxxxxx", + metadata={"order_id": "6735"}, + ) http_client_mock.assert_requested( - "get", - path="/v1/transfers", - query_string="limit=3", + "post", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", + query_string="", + post_data="metadata[order_id]=6735", ) - def test_transfers_get_service( + @pytest.mark.anyio + async def test_treasury_financial_accounts_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/transfers", - "limit=3", + "post", + "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.list({"limit": 3}) + await client.treasury.financial_accounts.update_async( + "fa_xxxxxxxxxxxxx", + {"metadata": {"order_id": "6735"}}, + ) http_client_mock.assert_requested( - "get", - path="/v1/transfers", - query_string="limit=3", + "post", + path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", + post_data="metadata[order_id]=6735", ) - def test_transfers_get_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Transfer.retrieve("tr_xxxxxxxxxxxxx") + def test_treasury_inbound_transfers_cancel_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.InboundTransfer.cancel("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/transfers/tr_xxxxxxxxxxxxx", + "post", + path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", query_string="", ) - def test_transfers_get_2_service( + def test_treasury_inbound_transfers_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/transfers/tr_xxxxxxxxxxxxx", + "post", + "/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.retrieve("tr_xxxxxxxxxxxxx") + client.treasury.inbound_transfers.cancel("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/transfers/tr_xxxxxxxxxxxxx", + "post", + path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) - def test_transfers_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.Transfer.create( - amount=400, - currency="usd", - destination="acct_xxxxxxxxxxxxx", - transfer_group="ORDER_95", - ) + @pytest.mark.anyio + async def test_treasury_inbound_transfers_cancel_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.InboundTransfer.cancel_async("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/transfers", + path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", query_string="", - post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) - def test_transfers_post_service( + @pytest.mark.anyio + async def test_treasury_inbound_transfers_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/transfers", + "/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.create( - { - "amount": 400, - "currency": "usd", - "destination": "acct_xxxxxxxxxxxxx", - "transfer_group": "ORDER_95", - } + await client.treasury.inbound_transfers.cancel_async( + "ibt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", - path="/v1/transfers", + path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", - post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) - def test_transfers_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Transfer.modify( - "tr_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, + def test_treasury_inbound_transfers_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.InboundTransfer.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, ) http_client_mock.assert_requested( - "post", - path="/v1/transfers/tr_xxxxxxxxxxxxx", - query_string="", - post_data="metadata[order_id]=6735", + "get", + path="/v1/treasury/inbound_transfers", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_transfers_post_2_service( + def test_treasury_inbound_transfers_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/transfers/tr_xxxxxxxxxxxxx", + "get", + "/v1/treasury/inbound_transfers", + "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.update( - "tr_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + client.treasury.inbound_transfers.list( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "limit": 3, + } ) http_client_mock.assert_requested( - "post", - path="/v1/transfers/tr_xxxxxxxxxxxxx", - query_string="", + "get", + path="/v1/treasury/inbound_transfers", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_transfers_reversals_get( + @pytest.mark.anyio + async def test_treasury_inbound_transfers_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Transfer.list_reversals( - "tr_xxxxxxxxxxxxx", + await stripe.treasury.InboundTransfer.list_async( + financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", - path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", - query_string="limit=3", + path="/v1/treasury/inbound_transfers", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_transfers_reversals_get_service( + @pytest.mark.anyio + async def test_treasury_inbound_transfers_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/transfers/tr_xxxxxxxxxxxxx/reversals", - "limit=3", + "/v1/treasury/inbound_transfers", + "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.reversals.list( - "tr_xxxxxxxxxxxxx", - {"limit": 3}, + await client.treasury.inbound_transfers.list_async( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "limit": 3, + } ) http_client_mock.assert_requested( "get", - path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", - query_string="limit=3", + path="/v1/treasury/inbound_transfers", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) - def test_transfers_reversals_get_2( + def test_treasury_inbound_transfers_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Transfer.retrieve_reversal( - "tr_xxxxxxxxxxxxx", - "trr_xxxxxxxxxxxxx", - ) + stripe.treasury.InboundTransfer.retrieve("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", + path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", query_string="", ) - def test_transfers_reversals_get_2_service( + def test_treasury_inbound_transfers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", + "/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.reversals.retrieve( - "tr_xxxxxxxxxxxxx", - "trr_xxxxxxxxxxxxx", - ) + client.treasury.inbound_transfers.retrieve("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", + path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_transfers_reversals_post( + @pytest.mark.anyio + async def test_treasury_inbound_transfers_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Transfer.create_reversal( - "tr_xxxxxxxxxxxxx", - amount=100, + await stripe.treasury.InboundTransfer.retrieve_async( + "ibt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + "get", + path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", query_string="", - post_data="amount=100", ) - def test_transfers_reversals_post_service( + @pytest.mark.anyio + async def test_treasury_inbound_transfers_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + "get", + "/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.reversals.create( - "tr_xxxxxxxxxxxxx", - {"amount": 100}, + await client.treasury.inbound_transfers.retrieve_async( + "ibt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( - "post", - path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", + "get", + path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="amount=100", ) - def test_transfers_reversals_post_2( + def test_treasury_inbound_transfers_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Transfer.modify_reversal( - "tr_xxxxxxxxxxxxx", - "trr_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, + stripe.treasury.InboundTransfer.create( + financial_account="fa_xxxxxxxxxxxxx", + amount=10000, + currency="usd", + origin_payment_method="pm_xxxxxxxxxxxxx", + description="InboundTransfer from my bank account", ) http_client_mock.assert_requested( "post", - path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", + path="/v1/treasury/inbound_transfers", query_string="", - post_data="metadata[order_id]=6735", + post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", ) - def test_transfers_reversals_post_2_service( + def test_treasury_inbound_transfers_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", + "/v1/treasury/inbound_transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.reversals.update( - "tr_xxxxxxxxxxxxx", - "trr_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, + client.treasury.inbound_transfers.create( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "amount": 10000, + "currency": "usd", + "origin_payment_method": "pm_xxxxxxxxxxxxx", + "description": "InboundTransfer from my bank account", + } ) http_client_mock.assert_requested( "post", - path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", + path="/v1/treasury/inbound_transfers", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", + post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", ) - def test_treasury_credit_reversals_get( + @pytest.mark.anyio + async def test_treasury_inbound_transfers_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.CreditReversal.list( + await stripe.treasury.InboundTransfer.create_async( financial_account="fa_xxxxxxxxxxxxx", - limit=3, + amount=10000, + currency="usd", + origin_payment_method="pm_xxxxxxxxxxxxx", + description="InboundTransfer from my bank account", ) http_client_mock.assert_requested( - "get", - path="/v1/treasury/credit_reversals", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + "post", + path="/v1/treasury/inbound_transfers", + query_string="", + post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", ) - def test_treasury_credit_reversals_get_service( + @pytest.mark.anyio + async def test_treasury_inbound_transfers_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/treasury/credit_reversals", - "financial_account=fa_xxxxxxxxxxxxx&limit=3", + "post", + "/v1/treasury/inbound_transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.credit_reversals.list( + await client.treasury.inbound_transfers.create_async( { "financial_account": "fa_xxxxxxxxxxxxx", - "limit": 3, + "amount": 10000, + "currency": "usd", + "origin_payment_method": "pm_xxxxxxxxxxxxx", + "description": "InboundTransfer from my bank account", } ) http_client_mock.assert_requested( - "get", - path="/v1/treasury/credit_reversals", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + "post", + path="/v1/treasury/inbound_transfers", + query_string="", api_base="https://api.stripe.com", + post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", ) - def test_treasury_credit_reversals_get_2( + def test_treasury_outbound_payments_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.CreditReversal.retrieve("credrev_xxxxxxxxxxxxx") + stripe.treasury.OutboundPayment.cancel("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", + "post", + path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", query_string="", ) - def test_treasury_credit_reversals_get_2_service( + def test_treasury_outbound_payments_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", + "post", + "/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.credit_reversals.retrieve("credrev_xxxxxxxxxxxxx") + client.treasury.outbound_payments.cancel("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "get", - path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", + "post", + path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) - def test_treasury_credit_reversals_post( + @pytest.mark.anyio + async def test_treasury_outbound_payments_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.CreditReversal.create( - received_credit="rc_xxxxxxxxxxxxx", - ) + await stripe.treasury.OutboundPayment.cancel_async("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/treasury/credit_reversals", + path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", query_string="", - post_data="received_credit=rc_xxxxxxxxxxxxx", ) - def test_treasury_credit_reversals_post_service( + @pytest.mark.anyio + async def test_treasury_outbound_payments_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/treasury/credit_reversals", + "/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.credit_reversals.create( - { - "received_credit": "rc_xxxxxxxxxxxxx", - } + await client.treasury.outbound_payments.cancel_async( + "bot_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", - path="/v1/treasury/credit_reversals", + path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", - post_data="received_credit=rc_xxxxxxxxxxxxx", ) - def test_treasury_debit_reversals_get( + def test_treasury_outbound_payments_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.DebitReversal.list( + stripe.treasury.OutboundPayment.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", - path="/v1/treasury/debit_reversals", + path="/v1/treasury/outbound_payments", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_treasury_debit_reversals_get_service( + def test_treasury_outbound_payments_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/debit_reversals", + "/v1/treasury/outbound_payments", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( @@ -14805,7 +31757,7 @@ def test_treasury_debit_reversals_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.debit_reversals.list( + client.treasury.outbound_payments.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -14813,295 +31765,301 @@ def test_treasury_debit_reversals_get_service( ) http_client_mock.assert_requested( "get", - path="/v1/treasury/debit_reversals", + path="/v1/treasury/outbound_payments", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) - def test_treasury_debit_reversals_get_2( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.treasury.DebitReversal.retrieve("debrev_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", - query_string="", - ) - - def test_treasury_debit_reversals_get_2_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.treasury.debit_reversals.retrieve("debrev_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "get", - path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", - query_string="", - api_base="https://api.stripe.com", - ) - - def test_treasury_debit_reversals_post( + @pytest.mark.anyio + async def test_treasury_outbound_payments_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.DebitReversal.create(received_debit="rd_xxxxxxxxxxxxx") - http_client_mock.assert_requested( - "post", - path="/v1/treasury/debit_reversals", - query_string="", - post_data="received_debit=rd_xxxxxxxxxxxxx", + await stripe.treasury.OutboundPayment.list_async( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/outbound_payments", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_treasury_debit_reversals_post_service( + @pytest.mark.anyio + async def test_treasury_outbound_payments_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/treasury/debit_reversals", + "get", + "/v1/treasury/outbound_payments", + "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.debit_reversals.create( + await client.treasury.outbound_payments.list_async( { - "received_debit": "rd_xxxxxxxxxxxxx", + "financial_account": "fa_xxxxxxxxxxxxx", + "limit": 3, } ) http_client_mock.assert_requested( - "post", - path="/v1/treasury/debit_reversals", - query_string="", + "get", + path="/v1/treasury/outbound_payments", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", - post_data="received_debit=rd_xxxxxxxxxxxxx", ) - def test_treasury_financial_accounts_features_get( + def test_treasury_outbound_payments_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.FinancialAccount.retrieve_features("fa_xxxxxxxxxxxxx") + stripe.treasury.OutboundPayment.retrieve("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", + path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", query_string="", ) - def test_treasury_financial_accounts_features_get_service( + def test_treasury_outbound_payments_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", + "/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.financial_accounts.features.list("fa_xxxxxxxxxxxxx") + client.treasury.outbound_payments.retrieve("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", + path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_treasury_financial_accounts_get( + @pytest.mark.anyio + async def test_treasury_outbound_payments_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.FinancialAccount.list(limit=3) + await stripe.treasury.OutboundPayment.retrieve_async( + "bot_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/treasury/financial_accounts", - query_string="limit=3", + path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", + query_string="", ) - def test_treasury_financial_accounts_get_service( + @pytest.mark.anyio + async def test_treasury_outbound_payments_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/financial_accounts", - "limit=3", + "/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.financial_accounts.list({"limit": 3}) + await client.treasury.outbound_payments.retrieve_async( + "bot_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", - path="/v1/treasury/financial_accounts", - query_string="limit=3", + path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_treasury_financial_accounts_get_2( + def test_treasury_outbound_payments_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.FinancialAccount.retrieve("fa_xxxxxxxxxxxxx") + stripe.treasury.OutboundPayment.create( + financial_account="fa_xxxxxxxxxxxxx", + amount=10000, + currency="usd", + customer="cus_xxxxxxxxxxxxx", + destination_payment_method="pm_xxxxxxxxxxxxx", + description="OutboundPayment to a 3rd party", + ) http_client_mock.assert_requested( - "get", - path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", + "post", + path="/v1/treasury/outbound_payments", query_string="", + post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", ) - def test_treasury_financial_accounts_get_2_service( + def test_treasury_outbound_payments_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", + "post", + "/v1/treasury/outbound_payments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.financial_accounts.retrieve("fa_xxxxxxxxxxxxx") + client.treasury.outbound_payments.create( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "amount": 10000, + "currency": "usd", + "customer": "cus_xxxxxxxxxxxxx", + "destination_payment_method": "pm_xxxxxxxxxxxxx", + "description": "OutboundPayment to a 3rd party", + } + ) http_client_mock.assert_requested( - "get", - path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", + "post", + path="/v1/treasury/outbound_payments", query_string="", api_base="https://api.stripe.com", + post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", ) - def test_treasury_financial_accounts_post( + @pytest.mark.anyio + async def test_treasury_outbound_payments_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.FinancialAccount.create( - supported_currencies=["usd"], - features={}, + await stripe.treasury.OutboundPayment.create_async( + financial_account="fa_xxxxxxxxxxxxx", + amount=10000, + currency="usd", + customer="cus_xxxxxxxxxxxxx", + destination_payment_method="pm_xxxxxxxxxxxxx", + description="OutboundPayment to a 3rd party", ) http_client_mock.assert_requested( "post", - path="/v1/treasury/financial_accounts", + path="/v1/treasury/outbound_payments", query_string="", - post_data="supported_currencies[0]=usd", + post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", ) - def test_treasury_financial_accounts_post_service( + @pytest.mark.anyio + async def test_treasury_outbound_payments_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/treasury/financial_accounts", + "/v1/treasury/outbound_payments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.financial_accounts.create( + await client.treasury.outbound_payments.create_async( { - "supported_currencies": ["usd"], - "features": {}, + "financial_account": "fa_xxxxxxxxxxxxx", + "amount": 10000, + "currency": "usd", + "customer": "cus_xxxxxxxxxxxxx", + "destination_payment_method": "pm_xxxxxxxxxxxxx", + "description": "OutboundPayment to a 3rd party", } ) http_client_mock.assert_requested( "post", - path="/v1/treasury/financial_accounts", + path="/v1/treasury/outbound_payments", query_string="", api_base="https://api.stripe.com", - post_data="supported_currencies[0]=usd", + post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", ) - def test_treasury_financial_accounts_post_2( + def test_treasury_outbound_transfers_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.FinancialAccount.modify( - "fa_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, - ) + stripe.treasury.OutboundTransfer.cancel("obt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", + path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", query_string="", - post_data="metadata[order_id]=6735", ) - def test_treasury_financial_accounts_post_2_service( + def test_treasury_outbound_transfers_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", + "/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.financial_accounts.update( - "fa_xxxxxxxxxxxxx", - {"metadata": {"order_id": "6735"}}, - ) + client.treasury.outbound_transfers.cancel("obt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", - path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", + path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", - post_data="metadata[order_id]=6735", ) - def test_treasury_inbound_transfers_cancel_post( + @pytest.mark.anyio + async def test_treasury_outbound_transfers_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.InboundTransfer.cancel("ibt_xxxxxxxxxxxxx") + await stripe.treasury.OutboundTransfer.cancel_async( + "obt_xxxxxxxxxxxxx" + ) http_client_mock.assert_requested( "post", - path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", + path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", query_string="", ) - def test_treasury_inbound_transfers_cancel_post_service( + @pytest.mark.anyio + async def test_treasury_outbound_transfers_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", + "/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.inbound_transfers.cancel("ibt_xxxxxxxxxxxxx") + await client.treasury.outbound_transfers.cancel_async( + "obt_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "post", - path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", + path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) - def test_treasury_inbound_transfers_get( + def test_treasury_outbound_transfers_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.InboundTransfer.list( + stripe.treasury.OutboundTransfer.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", - path="/v1/treasury/inbound_transfers", + path="/v1/treasury/outbound_transfers", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_treasury_inbound_transfers_get_service( + def test_treasury_outbound_transfers_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/inbound_transfers", + "/v1/treasury/outbound_transfers", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( @@ -15109,7 +32067,7 @@ def test_treasury_inbound_transfers_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.inbound_transfers.list( + client.treasury.outbound_transfers.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -15117,136 +32075,231 @@ def test_treasury_inbound_transfers_get_service( ) http_client_mock.assert_requested( "get", - path="/v1/treasury/inbound_transfers", + path="/v1/treasury/outbound_transfers", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) - def test_treasury_inbound_transfers_get_2( + @pytest.mark.anyio + async def test_treasury_outbound_transfers_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.InboundTransfer.retrieve("ibt_xxxxxxxxxxxxx") + await stripe.treasury.OutboundTransfer.list_async( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", + path="/v1/treasury/outbound_transfers", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + ) + + @pytest.mark.anyio + async def test_treasury_outbound_transfers_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/treasury/outbound_transfers", + "financial_account=fa_xxxxxxxxxxxxx&limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.treasury.outbound_transfers.list_async( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "limit": 3, + } + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/outbound_transfers", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + api_base="https://api.stripe.com", + ) + + def test_treasury_outbound_transfers_get_2( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundTransfer.retrieve("obt_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", query_string="", ) - def test_treasury_inbound_transfers_get_2_service( + def test_treasury_outbound_transfers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", + "/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.inbound_transfers.retrieve("ibt_xxxxxxxxxxxxx") + client.treasury.outbound_transfers.retrieve("obt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", + path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_treasury_inbound_transfers_post( + @pytest.mark.anyio + async def test_treasury_outbound_transfers_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.InboundTransfer.create( + await stripe.treasury.OutboundTransfer.retrieve_async( + "obt_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_treasury_outbound_transfers_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.treasury.outbound_transfers.retrieve_async( + "obt_xxxxxxxxxxxxx", + ) + http_client_mock.assert_requested( + "get", + path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_treasury_outbound_transfers_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.treasury.OutboundTransfer.create( financial_account="fa_xxxxxxxxxxxxx", - amount=10000, + destination_payment_method="pm_xxxxxxxxxxxxx", + amount=500, currency="usd", - origin_payment_method="pm_xxxxxxxxxxxxx", - description="InboundTransfer from my bank account", + description="OutboundTransfer to my external bank account", ) http_client_mock.assert_requested( "post", - path="/v1/treasury/inbound_transfers", + path="/v1/treasury/outbound_transfers", query_string="", - post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", + post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", ) - def test_treasury_inbound_transfers_post_service( + def test_treasury_outbound_transfers_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/treasury/inbound_transfers", + "/v1/treasury/outbound_transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.inbound_transfers.create( + client.treasury.outbound_transfers.create( { "financial_account": "fa_xxxxxxxxxxxxx", - "amount": 10000, + "destination_payment_method": "pm_xxxxxxxxxxxxx", + "amount": 500, "currency": "usd", - "origin_payment_method": "pm_xxxxxxxxxxxxx", - "description": "InboundTransfer from my bank account", + "description": "OutboundTransfer to my external bank account", } ) http_client_mock.assert_requested( "post", - path="/v1/treasury/inbound_transfers", + path="/v1/treasury/outbound_transfers", query_string="", api_base="https://api.stripe.com", - post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", + post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", ) - def test_treasury_outbound_payments_cancel_post( + @pytest.mark.anyio + async def test_treasury_outbound_transfers_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.OutboundPayment.cancel("bot_xxxxxxxxxxxxx") + await stripe.treasury.OutboundTransfer.create_async( + financial_account="fa_xxxxxxxxxxxxx", + destination_payment_method="pm_xxxxxxxxxxxxx", + amount=500, + currency="usd", + description="OutboundTransfer to my external bank account", + ) http_client_mock.assert_requested( "post", - path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", + path="/v1/treasury/outbound_transfers", query_string="", + post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", ) - def test_treasury_outbound_payments_cancel_post_service( + @pytest.mark.anyio + async def test_treasury_outbound_transfers_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", + "/v1/treasury/outbound_transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_payments.cancel("bot_xxxxxxxxxxxxx") + await client.treasury.outbound_transfers.create_async( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "destination_payment_method": "pm_xxxxxxxxxxxxx", + "amount": 500, + "currency": "usd", + "description": "OutboundTransfer to my external bank account", + } + ) http_client_mock.assert_requested( "post", - path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", + path="/v1/treasury/outbound_transfers", query_string="", api_base="https://api.stripe.com", + post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", ) - def test_treasury_outbound_payments_get( + def test_treasury_received_credits_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.OutboundPayment.list( + stripe.treasury.ReceivedCredit.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", - path="/v1/treasury/outbound_payments", + path="/v1/treasury/received_credits", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_treasury_outbound_payments_get_service( + def test_treasury_received_credits_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/outbound_payments", + "/v1/treasury/received_credits", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( @@ -15254,7 +32307,7 @@ def test_treasury_outbound_payments_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_payments.list( + client.treasury.received_credits.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -15262,138 +32315,135 @@ def test_treasury_outbound_payments_get_service( ) http_client_mock.assert_requested( "get", - path="/v1/treasury/outbound_payments", + path="/v1/treasury/received_credits", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) - def test_treasury_outbound_payments_get_2( + @pytest.mark.anyio + async def test_treasury_received_credits_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.OutboundPayment.retrieve("bot_xxxxxxxxxxxxx") + await stripe.treasury.ReceivedCredit.list_async( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", - query_string="", + path="/v1/treasury/received_credits", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_treasury_outbound_payments_get_2_service( + @pytest.mark.anyio + async def test_treasury_received_credits_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", + "/v1/treasury/received_credits", + "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_payments.retrieve("bot_xxxxxxxxxxxxx") + await client.treasury.received_credits.list_async( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "limit": 3, + } + ) http_client_mock.assert_requested( "get", - path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", - query_string="", + path="/v1/treasury/received_credits", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) - def test_treasury_outbound_payments_post( + def test_treasury_received_credits_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.OutboundPayment.create( - financial_account="fa_xxxxxxxxxxxxx", - amount=10000, - currency="usd", - customer="cus_xxxxxxxxxxxxx", - destination_payment_method="pm_xxxxxxxxxxxxx", - description="OutboundPayment to a 3rd party", - ) + stripe.treasury.ReceivedCredit.retrieve("rc_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/treasury/outbound_payments", + "get", + path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", query_string="", - post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", ) - def test_treasury_outbound_payments_post_service( + def test_treasury_received_credits_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/treasury/outbound_payments", + "get", + "/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_payments.create( - { - "financial_account": "fa_xxxxxxxxxxxxx", - "amount": 10000, - "currency": "usd", - "customer": "cus_xxxxxxxxxxxxx", - "destination_payment_method": "pm_xxxxxxxxxxxxx", - "description": "OutboundPayment to a 3rd party", - } - ) + client.treasury.received_credits.retrieve("rc_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/treasury/outbound_payments", + "get", + path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", ) - def test_treasury_outbound_transfers_cancel_post( + @pytest.mark.anyio + async def test_treasury_received_credits_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.OutboundTransfer.cancel("obt_xxxxxxxxxxxxx") + await stripe.treasury.ReceivedCredit.retrieve_async("rc_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", + "get", + path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", query_string="", ) - def test_treasury_outbound_transfers_cancel_post_service( + @pytest.mark.anyio + async def test_treasury_received_credits_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", + "get", + "/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_transfers.cancel("obt_xxxxxxxxxxxxx") + await client.treasury.received_credits.retrieve_async( + "rc_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( - "post", - path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", + "get", + path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_treasury_outbound_transfers_get( + def test_treasury_received_debits_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.OutboundTransfer.list( + stripe.treasury.ReceivedDebit.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", - path="/v1/treasury/outbound_transfers", + path="/v1/treasury/received_debits", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_treasury_outbound_transfers_get_service( + def test_treasury_received_debits_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/outbound_transfers", + "/v1/treasury/received_debits", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( @@ -15401,7 +32451,7 @@ def test_treasury_outbound_transfers_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_transfers.list( + client.treasury.received_debits.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -15409,175 +32459,176 @@ def test_treasury_outbound_transfers_get_service( ) http_client_mock.assert_requested( "get", - path="/v1/treasury/outbound_transfers", + path="/v1/treasury/received_debits", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) - def test_treasury_outbound_transfers_get_2( + @pytest.mark.anyio + async def test_treasury_received_debits_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.OutboundTransfer.retrieve("obt_xxxxxxxxxxxxx") + await stripe.treasury.ReceivedDebit.list_async( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", - query_string="", + path="/v1/treasury/received_debits", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_treasury_outbound_transfers_get_2_service( + @pytest.mark.anyio + async def test_treasury_received_debits_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", + "/v1/treasury/received_debits", + "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_transfers.retrieve("obt_xxxxxxxxxxxxx") + await client.treasury.received_debits.list_async( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "limit": 3, + } + ) http_client_mock.assert_requested( "get", - path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", - query_string="", + path="/v1/treasury/received_debits", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) - def test_treasury_outbound_transfers_post( + def test_treasury_received_debits_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.OutboundTransfer.create( - financial_account="fa_xxxxxxxxxxxxx", - destination_payment_method="pm_xxxxxxxxxxxxx", - amount=500, - currency="usd", - description="OutboundTransfer to my external bank account", - ) + stripe.treasury.ReceivedDebit.retrieve("rd_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/treasury/outbound_transfers", + "get", + path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", query_string="", - post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", ) - def test_treasury_outbound_transfers_post_service( + def test_treasury_received_debits_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v1/treasury/outbound_transfers", + "get", + "/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_transfers.create( - { - "financial_account": "fa_xxxxxxxxxxxxx", - "destination_payment_method": "pm_xxxxxxxxxxxxx", - "amount": 500, - "currency": "usd", - "description": "OutboundTransfer to my external bank account", - } - ) + client.treasury.received_debits.retrieve("rd_xxxxxxxxxxxxx") http_client_mock.assert_requested( - "post", - path="/v1/treasury/outbound_transfers", + "get", + path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", - post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", ) - def test_treasury_received_credits_get( + @pytest.mark.anyio + async def test_treasury_received_debits_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.ReceivedCredit.list( - financial_account="fa_xxxxxxxxxxxxx", - limit=3, - ) + await stripe.treasury.ReceivedDebit.retrieve_async("rd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/treasury/received_credits", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", + query_string="", ) - def test_treasury_received_credits_get_service( + @pytest.mark.anyio + async def test_treasury_received_debits_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/received_credits", - "financial_account=fa_xxxxxxxxxxxxx&limit=3", + "/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.received_credits.list( - { - "financial_account": "fa_xxxxxxxxxxxxx", - "limit": 3, - } + await client.treasury.received_debits.retrieve_async( + "rd_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "get", - path="/v1/treasury/received_credits", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_treasury_received_credits_get_2( + def test_treasury_transaction_entries_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.ReceivedCredit.retrieve("rc_xxxxxxxxxxxxx") + stripe.treasury.TransactionEntry.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", - query_string="", + path="/v1/treasury/transaction_entries", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_treasury_received_credits_get_2_service( + def test_treasury_transaction_entries_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", + "/v1/treasury/transaction_entries", + "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.received_credits.retrieve("rc_xxxxxxxxxxxxx") + client.treasury.transaction_entries.list( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "limit": 3, + } + ) http_client_mock.assert_requested( "get", - path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", - query_string="", + path="/v1/treasury/transaction_entries", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) - def test_treasury_received_debits_get( + @pytest.mark.anyio + async def test_treasury_transaction_entries_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.ReceivedDebit.list( + await stripe.treasury.TransactionEntry.list_async( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", - path="/v1/treasury/received_debits", + path="/v1/treasury/transaction_entries", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_treasury_received_debits_get_service( + @pytest.mark.anyio + async def test_treasury_transaction_entries_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/received_debits", + "/v1/treasury/transaction_entries", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( @@ -15585,7 +32636,7 @@ def test_treasury_received_debits_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.received_debits.list( + await client.treasury.transaction_entries.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -15593,114 +32644,121 @@ def test_treasury_received_debits_get_service( ) http_client_mock.assert_requested( "get", - path="/v1/treasury/received_debits", + path="/v1/treasury/transaction_entries", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) - def test_treasury_received_debits_get_2( + def test_treasury_transaction_entries_get_2( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.ReceivedDebit.retrieve("rd_xxxxxxxxxxxxx") + stripe.treasury.TransactionEntry.retrieve("trxne_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", + path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", query_string="", ) - def test_treasury_received_debits_get_2_service( + def test_treasury_transaction_entries_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", + "/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.received_debits.retrieve("rd_xxxxxxxxxxxxx") + client.treasury.transaction_entries.retrieve("trxne_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", - path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", + path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) - def test_treasury_transaction_entries_get( + @pytest.mark.anyio + async def test_treasury_transaction_entries_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.TransactionEntry.list( - financial_account="fa_xxxxxxxxxxxxx", - limit=3, + await stripe.treasury.TransactionEntry.retrieve_async( + "trxne_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", - path="/v1/treasury/transaction_entries", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", + query_string="", ) - def test_treasury_transaction_entries_get_service( + @pytest.mark.anyio + async def test_treasury_transaction_entries_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/transaction_entries", - "financial_account=fa_xxxxxxxxxxxxx&limit=3", + "/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.transaction_entries.list( - { - "financial_account": "fa_xxxxxxxxxxxxx", - "limit": 3, - } + await client.treasury.transaction_entries.retrieve_async( + "trxne_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", - path="/v1/treasury/transaction_entries", - query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", + path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", + query_string="", api_base="https://api.stripe.com", ) - def test_treasury_transaction_entries_get_2( + def test_treasury_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.TransactionEntry.retrieve("trxne_xxxxxxxxxxxxx") + stripe.treasury.Transaction.list( + financial_account="fa_xxxxxxxxxxxxx", + limit=3, + ) http_client_mock.assert_requested( "get", - path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", - query_string="", + path="/v1/treasury/transactions", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_treasury_transaction_entries_get_2_service( + def test_treasury_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", + "/v1/treasury/transactions", + "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.transaction_entries.retrieve("trxne_xxxxxxxxxxxxx") + client.treasury.transactions.list( + { + "financial_account": "fa_xxxxxxxxxxxxx", + "limit": 3, + } + ) http_client_mock.assert_requested( "get", - path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", - query_string="", + path="/v1/treasury/transactions", + query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) - def test_treasury_transactions_get( + @pytest.mark.anyio + async def test_treasury_transactions_get_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.treasury.Transaction.list( + await stripe.treasury.Transaction.list_async( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) @@ -15710,7 +32768,8 @@ def test_treasury_transactions_get( query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) - def test_treasury_transactions_get_service( + @pytest.mark.anyio + async def test_treasury_transactions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -15723,7 +32782,7 @@ def test_treasury_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.transactions.list( + await client.treasury.transactions.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -15766,6 +32825,38 @@ def test_treasury_transactions_get_2_service( api_base="https://api.stripe.com", ) + @pytest.mark.anyio + async def test_treasury_transactions_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.treasury.Transaction.retrieve_async("trxn_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_treasury_transactions_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.treasury.transactions.retrieve_async("trxn_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + def test_webhook_endpoints_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -15796,6 +32887,38 @@ def test_webhook_endpoints_delete_service( api_base="https://api.stripe.com", ) + @pytest.mark.anyio + async def test_webhook_endpoints_delete_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.WebhookEndpoint.delete_async("we_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_webhook_endpoints_delete_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v1/webhook_endpoints/we_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.webhook_endpoints.delete_async("we_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "delete", + path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + def test_webhook_endpoints_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -15827,6 +32950,39 @@ def test_webhook_endpoints_get_service( api_base="https://api.stripe.com", ) + @pytest.mark.anyio + async def test_webhook_endpoints_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.WebhookEndpoint.list_async(limit=3) + http_client_mock.assert_requested( + "get", + path="/v1/webhook_endpoints", + query_string="limit=3", + ) + + @pytest.mark.anyio + async def test_webhook_endpoints_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/webhook_endpoints", + "limit=3", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.webhook_endpoints.list_async({"limit": 3}) + http_client_mock.assert_requested( + "get", + path="/v1/webhook_endpoints", + query_string="limit=3", + api_base="https://api.stripe.com", + ) + def test_webhook_endpoints_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -15857,6 +33013,38 @@ def test_webhook_endpoints_get_2_service( api_base="https://api.stripe.com", ) + @pytest.mark.anyio + async def test_webhook_endpoints_get_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.WebhookEndpoint.retrieve_async("we_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", + query_string="", + ) + + @pytest.mark.anyio + async def test_webhook_endpoints_get_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/webhook_endpoints/we_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.webhook_endpoints.retrieve_async("we_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + ) + def test_webhook_endpoints_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -15897,6 +33085,48 @@ def test_webhook_endpoints_post_service( post_data="url=https%3A%2F%2Fexample.com%2Fmy%2Fwebhook%2Fendpoint&enabled_events[0]=charge.failed&enabled_events[1]=charge.succeeded", ) + @pytest.mark.anyio + async def test_webhook_endpoints_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.WebhookEndpoint.create_async( + url="https://example.com/my/webhook/endpoint", + enabled_events=["charge.failed", "charge.succeeded"], + ) + http_client_mock.assert_requested( + "post", + path="/v1/webhook_endpoints", + query_string="", + post_data="url=https%3A%2F%2Fexample.com%2Fmy%2Fwebhook%2Fendpoint&enabled_events[0]=charge.failed&enabled_events[1]=charge.succeeded", + ) + + @pytest.mark.anyio + async def test_webhook_endpoints_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/webhook_endpoints", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.webhook_endpoints.create_async( + { + "url": "https://example.com/my/webhook/endpoint", + "enabled_events": ["charge.failed", "charge.succeeded"], + } + ) + http_client_mock.assert_requested( + "post", + path="/v1/webhook_endpoints", + query_string="", + api_base="https://api.stripe.com", + post_data="url=https%3A%2F%2Fexample.com%2Fmy%2Fwebhook%2Fendpoint&enabled_events[0]=charge.failed&enabled_events[1]=charge.succeeded", + ) + def test_webhook_endpoints_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -15934,3 +33164,43 @@ def test_webhook_endpoints_post_2_service( api_base="https://api.stripe.com", post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", ) + + @pytest.mark.anyio + async def test_webhook_endpoints_post_2_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.WebhookEndpoint.modify_async( + "we_xxxxxxxxxxxxx", + url="https://example.com/new_endpoint", + ) + http_client_mock.assert_requested( + "post", + path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", + query_string="", + post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", + ) + + @pytest.mark.anyio + async def test_webhook_endpoints_post_2_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/webhook_endpoints/we_xxxxxxxxxxxxx", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.webhook_endpoints.update_async( + "we_xxxxxxxxxxxxx", + {"url": "https://example.com/new_endpoint"}, + ) + http_client_mock.assert_requested( + "post", + path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", + query_string="", + api_base="https://api.stripe.com", + post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", + ) diff --git a/tests/test_http_client.py b/tests/test_http_client.py index 07c378ecb..0e04e47f0 100644 --- a/tests/test_http_client.py +++ b/tests/test_http_client.py @@ -3,6 +3,7 @@ from unittest.mock import call import pytest import json +from mock import AsyncMock import stripe from stripe import _http_client @@ -20,6 +21,8 @@ class StripeClientTestCase(object): ("requests", "stripe._http_client.requests"), ("pycurl", "stripe._http_client.pycurl"), ("urllib.request", "stripe._http_client.urllibrequest"), + ("httpx", "stripe._http_client.httpx"), + ("aiohttp", "stripe._http_client.aiohttp"), ] @pytest.fixture @@ -55,6 +58,36 @@ def test_new_default_http_client_urllib2(self, request_mocks): ) +class TestNewHttpClientAsyncFallback(StripeClientTestCase): + def check_default(self, none_libs, expected): + for lib in none_libs: + setattr(_http_client, lib, None) + + inst = _http_client.new_http_client_async_fallback() + + assert isinstance(inst, expected) + + def test_new_http_client_async_fallback_httpx(self, request_mocks): + self.check_default((), _http_client.HTTPXClient) + + def test_new_http_client_async_fallback_aiohttp(self, request_mocks): + self.check_default( + (("httpx"),), + _http_client.AIOHTTPClient, + ) + + def test_new_http_client_async_fallback_no_import_found( + self, request_mocks + ): + self.check_default( + ( + ("httpx"), + ("aiohttp"), + ), + _http_client.NoImportFoundAsyncClient, + ) + + class TestRetrySleepTimeDefaultHttpClient(StripeClientTestCase): from contextlib import contextmanager @@ -319,6 +352,18 @@ def make_request_stream(self, method, url, headers, post_data): method, url, headers, post_data ) + def make_request_async(self, method, url, headers, post_data): + client = self.REQUEST_CLIENT(verify_ssl_certs=True) + return client.request_with_retries_async( + method, url, headers, post_data + ) + + async def make_request_stream_async(self, method, url, headers, post_data): + client = self.REQUEST_CLIENT(verify_ssl_certs=True) + return await client.request_stream_with_retries_async( + method, url, headers, post_data + ) + @pytest.fixture def mock_response(self): def mock_response(mock, body, code): @@ -383,19 +428,23 @@ def test_request_stream( headers = {"my-header": "header val"} - print(dir(self)) - print("make_request_stream" in dir(self)) stream, code, _ = self.make_request_stream( method, abs_url, headers, data ) assert code == 200 + body_content = None # Here we need to convert and align all content on one type (string) # as some clients return a string stream others a byte stream. - body_content = stream.read() - if hasattr(body_content, "decode"): - body_content = body_content.decode("utf-8") + if hasattr(stream, "read"): + body_content = stream.read() + if hasattr(body_content, "decode"): + body_content = body_content.decode("utf-8") + elif hasattr(stream, "__iter__"): + body_content = "".join( + [chunk.decode("utf-8") for chunk in stream] + ) assert body_content == "some streamed content" @@ -1048,3 +1097,862 @@ def test_encode_array(self): assert ("foo[0][dob][month]", 1) in values assert ("foo[0][name]", "bat") in values + + +class TestHTTPXClient(StripeClientTestCase, ClientTestBase): + REQUEST_CLIENT: Type[_http_client.HTTPXClient] = _http_client.HTTPXClient + + @pytest.fixture + def mock_response(self, mocker, request_mock): + def mock_response(mock, body={}, code=200): + result = mocker.Mock() + result.content = body + + async def aiter_bytes(): + yield bytes(body, "utf-8") + + def iter_bytes(): + yield bytes(body, "utf-8") + + result.aiter_bytes = aiter_bytes + result.iter_bytes = iter_bytes + result.status_code = code + result.headers = {} + + async def do_buffered(*args, **kwargs): + return result + + async def do_stream(*args, **kwargs): + return result + + async_mock = AsyncMock(side_effect=do_buffered) + async_mock_stream = AsyncMock(side_effect=do_stream) + + request_mock.Client().send = mocker.Mock(return_value=result) + request_mock.Client().request = mocker.Mock(return_value=result) + request_mock.AsyncClient().send = async_mock_stream + request_mock.AsyncClient().request = async_mock + return result + + return mock_response + + @pytest.fixture + def mock_error(self, mocker, request_mock): + def mock_error(mock): + # The first kind of request exceptions we catch + mock.exceptions.SSLError = Exception + request_mock.AsyncClient().request.side_effect = ( + mock.exceptions.SSLError() + ) + + return mock_error + + @pytest.fixture + def check_call(self, request_mock, mocker): + def check_call( + mock, + method, + url, + post_data, + headers, + is_streaming=False, + timeout=80, + times=None, + ): + times = times or 1 + args = (method, url) + kwargs = { + "headers": headers, + "data": post_data or {}, + "timeout": timeout, + "proxies": {"http": "http://slap/", "https": "http://slap/"}, + } + + if is_streaming: + kwargs["stream"] = True + + calls = [mocker.call(*args, **kwargs) for _ in range(times)] + request_mock.Client().request.assert_has_calls(calls) + + return check_call + + @pytest.fixture + def check_call_async(self, request_mock, mocker): + def check_call_async( + mock, + method, + url, + post_data, + headers, + is_streaming=False, + timeout=80, + times=None, + ): + times = times or 1 + args = (method, url) + kwargs = { + "headers": headers, + "data": post_data, + "timeout": timeout, + "proxies": {"http": "http://slap/", "https": "http://slap/"}, + } + + if is_streaming: + kwargs["stream"] = True + + calls = [mocker.call(*args, **kwargs) for _ in range(times)] + request_mock.AsyncClient().request.assert_has_calls(calls) + + return check_call_async + + def make_request(self, method, url, headers, post_data, timeout=80): + client = self.REQUEST_CLIENT( + verify_ssl_certs=True, + proxy="http://slap/", + timeout=timeout, + allow_sync_methods=True, + ) + return client.request_with_retries(method, url, headers, post_data) + + def make_request_stream(self, method, url, headers, post_data, timeout=80): + client = self.REQUEST_CLIENT( + verify_ssl_certs=True, + proxy="http://slap/", + timeout=timeout, + allow_sync_methods=True, + ) + return client.request_stream_with_retries( + method, url, headers, post_data + ) + + async def make_request_async( + self, method, url, headers, post_data, timeout=80 + ): + client = self.REQUEST_CLIENT( + verify_ssl_certs=True, proxy="http://slap/", timeout=timeout + ) + return await client.request_with_retries_async( + method, url, headers, post_data + ) + + async def make_request_stream_async( + self, method, url, headers, post_data, timeout=80 + ): + client = self.REQUEST_CLIENT( + verify_ssl_certs=True, proxy="http://slap/" + ) + return await client.request_stream_with_retries_async( + method, url, headers, post_data + ) + + @pytest.mark.anyio + async def test_request_async( + self, request_mock, mock_response, check_call_async + ): + + mock_response(request_mock, '{"foo": "baz"}', 200) + + for method in VALID_API_METHODS: + abs_url = self.valid_url + data = {} + + if method != "post": + abs_url = "%s?%s" % (abs_url, data) + data = {} + + headers = {"my-header": "header val"} + body, code, _ = await self.make_request_async( + method, abs_url, headers, data + ) + assert code == 200 + assert body == '{"foo": "baz"}' + + check_call_async(request_mock, method, abs_url, data, headers) + + @pytest.mark.anyio + async def test_request_stream_async( + self, mocker, request_mock, mock_response, check_call + ): + for method in VALID_API_METHODS: + mock_response(request_mock, "some streamed content", 200) + + abs_url = self.valid_url + data = "" + + if method != "post": + abs_url = "%s?%s" % (abs_url, data) + data = None + + headers = {"my-header": "header val"} + + stream, code, _ = await self.make_request_stream_async( + method, abs_url, headers, data + ) + + assert code == 200 + + # Here we need to convert and align all content on one type (string) + # as some clients return a string stream others a byte stream. + body_content = b"".join([x async for x in stream]) + if hasattr(body_content, "decode"): + body_content = body_content.decode("utf-8") + + assert body_content == "some streamed content" + + mocker.resetall() + + @pytest.mark.anyio + async def test_exception(self, request_mock, mock_error): + mock_error(request_mock) + with pytest.raises(stripe.APIConnectionError): + await self.make_request_async("get", self.valid_url, {}, None) + + @pytest.mark.anyio + def test_timeout(self, request_mock, mock_response, check_call): + headers = {"my-header": "header val"} + data = {} + mock_response(request_mock, '{"foo": "baz"}', 200) + self.make_request("POST", self.valid_url, headers, data, timeout=5) + + check_call( + request_mock, "POST", self.valid_url, data, headers, timeout=5 + ) + + @pytest.mark.anyio + async def test_timeout_async( + self, request_mock, mock_response, check_call_async + ): + headers = {"my-header": "header val"} + data = {} + mock_response(request_mock, '{"foo": "baz"}', 200) + await self.make_request_async( + "POST", self.valid_url, headers, data, timeout=5 + ) + + check_call_async( + request_mock, "POST", self.valid_url, data, headers, timeout=5 + ) + + @pytest.mark.anyio + async def test_request_stream_forwards_stream_param( + self, mocker, request_mock, mock_response, check_call + ): + # TODO + pass + + def test_allow_sync_methods(self, request_mock, mock_response): + client = self.REQUEST_CLIENT() + assert client._client is None + with pytest.raises(RuntimeError): + client.request("GET", "http://foo", {}) + with pytest.raises(RuntimeError): + client.request_stream("GET", "http://foo", {}) + client = self.REQUEST_CLIENT(allow_sync_methods=True) + assert client._client is not None + mock_response(request_mock, '{"foo": "baz"}', 200) + client.request("GET", "http://foo", {}) + mock_response(request_mock, '{"foo": "baz"}', 200) + client.request_stream("GET", "http://foo", {}) + + +class TestHTTPXClientRetryBehavior(TestHTTPXClient): + responses = None + + @pytest.fixture + def mock_retry(self, mocker, request_mock): + def mock_retry( + retry_error_num=0, no_retry_error_num=0, responses=None + ): + if responses is None: + responses = [] + # Mocking classes of exception we catch. Any group of exceptions + # with the same inheritance pattern will work + request_root_error_class = Exception + request_mock.exceptions.RequestException = request_root_error_class + + no_retry_parent_class = LookupError + no_retry_child_class = KeyError + request_mock.exceptions.SSLError = no_retry_parent_class + no_retry_errors = [no_retry_child_class()] * no_retry_error_num + + retry_parent_class = EnvironmentError + retry_child_class = IOError + request_mock.exceptions.Timeout = retry_parent_class + request_mock.exceptions.ConnectionError = retry_parent_class + retry_errors = [retry_child_class()] * retry_error_num + # Include mock responses as possible side-effects + # to simulate returning proper results after some exceptions + + results = retry_errors + no_retry_errors + responses + + request_mock.AsyncClient().request = AsyncMock(side_effect=results) + self.responses = results + + return request_mock + + return mock_retry + + @pytest.fixture + def check_call_numbers(self, check_call_async): + valid_url = self.valid_url + + def check_call_numbers(times, is_streaming=False): + check_call_async( + None, + "GET", + valid_url, + {}, + {}, + times=times, + is_streaming=is_streaming, + ) + + return check_call_numbers + + def max_retries(self): + return 3 + + def make_client(self, **kwargs): + client = self.REQUEST_CLIENT( + verify_ssl_certs=True, timeout=80, proxy="http://slap/", **kwargs + ) + # Override sleep time to speed up tests + client._sleep_time_seconds = lambda num_retries, response=None: 0.0001 + # Override configured max retries + return client + + def make_request(self, *args, **kwargs): + client = self.make_client(allow_sync_methods=True) + return client.request_with_retries( + "GET", self.valid_url, {}, None, self.max_retries() + ) + + def make_request_stream(self, *args, **kwargs): + client = self.make_client(allow_sync_methods=True) + return client.request_stream_with_retries( + "GET", self.valid_url, {}, None, self.max_retries() + ) + + async def make_request_async(self, *args, **kwargs): + client = self.make_client() + return await client.request_with_retries_async( + "GET", self.valid_url, {}, None, self.max_retries() + ) + + async def make_request_stream_async(self, *args, **kwargs): + client = self.make_client() + return await client.request_stream_with_retries_async( + "GET", self.valid_url, {}, None, self.max_retries() + ) + + @pytest.mark.anyio + async def test_retry_error_until_response( + self, + mock_retry, + mock_response, + check_call_numbers, + request_mock, + mocker, + ): + mock_retry( + retry_error_num=1, + responses=[mock_response(request_mock, code=202)], + ) + _, code, _ = await self.make_request_async() + assert code == 202 + check_call_numbers(2) + + @pytest.mark.anyio + async def test_retry_error_until_exceeded( + self, mock_retry, mock_response, check_call_numbers + ): + mock_retry(retry_error_num=self.max_retries()) + with pytest.raises(stripe.APIConnectionError): + await self.make_request_async() + + check_call_numbers(self.max_retries()) + + @pytest.mark.anyio + async def test_no_retry_error( + self, mock_retry, mock_response, check_call_numbers + ): + mock_retry(no_retry_error_num=self.max_retries()) + with pytest.raises(stripe.APIConnectionError): + await self.make_request_async() + check_call_numbers(1) + + @pytest.mark.anyio + async def test_retry_codes( + self, mock_retry, mock_response, request_mock, check_call_numbers + ): + mock_retry( + responses=[ + mock_response(request_mock, code=409), + mock_response(request_mock, code=202), + ] + ) + _, code, _ = await self.make_request_async() + assert code == 202 + check_call_numbers(2) + + @pytest.mark.anyio + async def test_retry_codes_until_exceeded( + self, mock_retry, mock_response, request_mock, check_call_numbers + ): + mock_retry( + responses=[mock_response(request_mock, code=409)] + * (self.max_retries() + 1) + ) + _, code, _ = await self.make_request_async() + assert code == 409 + check_call_numbers(self.max_retries() + 1) + + @pytest.fixture + def connection_error(self): + client = self.REQUEST_CLIENT() + + def connection_error(given_exception): + with pytest.raises(stripe.APIConnectionError) as error: + client._handle_request_error(given_exception) + return error.value + + return connection_error + + def test_handle_request_error_should_retry( + self, connection_error, mock_retry + ): + request_mock = mock_retry() + + error = connection_error(request_mock.exceptions.Timeout()) + assert error.should_retry + + error = connection_error(request_mock.exceptions.ConnectionError()) + assert error.should_retry + + # Skip inherited basic client tests + def test_request(self): + pass + + def test_request_async(self): + pass + + def test_timeout(self): + pass + + def test_timeout_async(self): + pass + + +class TestAIOHTTPClient(StripeClientTestCase, ClientTestBase): + REQUEST_CLIENT: Type[ + _http_client.AIOHTTPClient + ] = _http_client.AIOHTTPClient + + @pytest.fixture + def mock_response(self, mocker, request_mock): + def mock_response(mock, body={}, code=200): + class Content: + def __aiter__(self): + async def chunk(): + yield bytes(body, "utf-8") if isinstance( + body, str + ) else body + + return chunk() + + async def read(self): + return body + + class Result: + def __init__(self): + self.content = Content() + self.status = code + self.headers = {} + + result = Result() + + request_mock.ClientSession().request = AsyncMock( + return_value=result + ) + return result + + return mock_response + + @pytest.fixture + def mock_error(self, mocker, request_mock): + def mock_error(mock): + # The first kind of request exceptions we catch + mock.exceptions.SSLError = Exception + request_mock.ClientSession().request.side_effect = ( + mock.exceptions.SSLError() + ) + + return mock_error + + @pytest.fixture + def check_call(self, request_mock, mocker): + def check_call( + mock, + method, + url, + post_data, + headers, + is_streaming=False, + timeout=80, + times=None, + ): + times = times or 1 + args = (method, url) + kwargs = { + "headers": headers, + "data": post_data or {}, + "timeout": timeout, + "proxies": {"http": "http://slap/", "https": "http://slap/"}, + } + + if is_streaming: + kwargs["stream"] = True + + calls = [mocker.call(*args, **kwargs) for _ in range(times)] + request_mock.ClientSession().request.assert_has_calls(calls) + + return check_call + + @pytest.fixture + def check_call_async(self, request_mock, mocker): + def check_call_async( + mock, + method, + url, + post_data, + headers, + is_streaming=False, + timeout=80, + times=None, + ): + times = times or 1 + args = (method, url) + kwargs = { + "headers": headers, + "data": post_data, + "timeout": timeout, + "proxy": "http://slap/", + } + + calls = [mocker.call(*args, **kwargs) for _ in range(times)] + request_mock.ClientSession().request.assert_has_calls(calls) + + return check_call_async + + def make_request(self, method, url, headers, post_data, timeout=80): + pass + + async def make_request_async( + self, method, url, headers, post_data, timeout=80 + ): + client = self.REQUEST_CLIENT( + verify_ssl_certs=True, proxy="http://slap/", timeout=timeout + ) + return await client.request_with_retries_async( + method, url, headers, post_data + ) + + async def make_request_stream_async( + self, method, url, headers, post_data, timeout=80 + ): + client = self.REQUEST_CLIENT( + verify_ssl_certs=True, proxy="http://slap/" + ) + return await client.request_stream_with_retries_async( + method, url, headers, post_data + ) + + def test_request(self): + pass + + def test_request_stream(self): + pass + + @pytest.mark.parametrize("anyio_backend", ["asyncio"]) + @pytest.mark.anyio + async def test_request_async( + self, request_mock, mock_response, check_call_async + ): + + mock_response(request_mock, '{"foo": "baz"}', 200) + + for method in VALID_API_METHODS: + abs_url = self.valid_url + data = {} + + if method != "post": + abs_url = "%s?%s" % (abs_url, data) + data = {} + + headers = {"my-header": "header val"} + body, code, _ = await self.make_request_async( + method, abs_url, headers, data + ) + assert code == 200 + assert body == '{"foo": "baz"}' + + check_call_async(request_mock, method, abs_url, data, headers) + + @pytest.mark.parametrize("anyio_backend", ["asyncio"]) + @pytest.mark.anyio + async def test_request_stream_async( + self, mocker, request_mock, mock_response, check_call + ): + for method in VALID_API_METHODS: + mock_response(request_mock, "some streamed content", 200) + + abs_url = self.valid_url + data = "" + + if method != "post": + abs_url = "%s?%s" % (abs_url, data) + data = None + + headers = {"my-header": "header val"} + + stream, code, _ = await self.make_request_stream_async( + method, abs_url, headers, data + ) + + assert code == 200 + + # Here we need to convert and align all content on one type (string) + # as some clients return a string stream others a byte stream. + body_content = b"".join([x async for x in stream]) + if hasattr(body_content, "decode"): + body_content = body_content.decode("utf-8") + + assert body_content == "some streamed content" + + mocker.resetall() + + @pytest.mark.parametrize("anyio_backend", ["asyncio"]) + @pytest.mark.anyio + async def test_exception(self, request_mock, mock_error): + mock_error(request_mock) + with pytest.raises(stripe.APIConnectionError): + await self.make_request_async("get", self.valid_url, {}, None) + + def test_timeout( + self, request_mock, mock_response, check_call, anyio_backend + ): + pass + + @pytest.mark.parametrize("anyio_backend", ["asyncio"]) + @pytest.mark.anyio + async def test_timeout_async( + self, request_mock, mock_response, check_call_async + ): + headers = {"my-header": "header val"} + data = {} + mock_response(request_mock, '{"foo": "baz"}', 200) + await self.make_request_async( + "POST", self.valid_url, headers, data, timeout=5 + ) + + check_call_async( + request_mock, "POST", self.valid_url, data, headers, timeout=5 + ) + + @pytest.mark.parametrize("anyio_backend", ["asyncio"]) + @pytest.mark.anyio + async def test_request_stream_forwards_stream_param( + self, mocker, request_mock, mock_response, check_call + ): + # TODO + pass + + +class TestAIOHTTPClientRetryBehavior(TestAIOHTTPClient): + responses = None + + @pytest.fixture + def mock_retry(self, mocker, request_mock): + def mock_retry( + retry_error_num=0, no_retry_error_num=0, responses=None + ): + if responses is None: + responses = [] + # Mocking classes of exception we catch. Any group of exceptions + # with the same inheritance pattern will work + request_root_error_class = Exception + request_mock.exceptions.RequestException = request_root_error_class + + no_retry_parent_class = LookupError + no_retry_child_class = KeyError + request_mock.exceptions.SSLError = no_retry_parent_class + no_retry_errors = [no_retry_child_class()] * no_retry_error_num + + retry_parent_class = EnvironmentError + retry_child_class = IOError + request_mock.exceptions.Timeout = retry_parent_class + request_mock.exceptions.ConnectionError = retry_parent_class + retry_errors = [retry_child_class()] * retry_error_num + # Include mock responses as possible side-effects + # to simulate returning proper results after some exceptions + + results = retry_errors + no_retry_errors + responses + + request_mock.ClientSession().request = AsyncMock( + side_effect=results + ) + self.responses = results + + return request_mock + + return mock_retry + + @pytest.fixture + def check_call_numbers(self, check_call_async): + valid_url = self.valid_url + + def check_call_numbers(times, is_streaming=False): + check_call_async( + None, + "GET", + valid_url, + None, + {}, + times=times, + is_streaming=is_streaming, + ) + + return check_call_numbers + + def max_retries(self): + return 3 + + def make_client(self): + client = self.REQUEST_CLIENT( + verify_ssl_certs=True, timeout=80, proxy="http://slap/" + ) + # Override sleep time to speed up tests + client._sleep_time_seconds = lambda num_retries, response=None: 0.0001 + # Override configured max retries + return client + + def make_request(self, *args, **kwargs): + pass + + def make_request_stream(self, *args, **kwargs): + pass + + async def make_request_async(self, *args, **kwargs): + client = self.make_client() + return await client.request_with_retries_async( + "GET", self.valid_url, {}, None, self.max_retries() + ) + + async def make_request_stream_async(self, *args, **kwargs): + client = self.make_client() + return await client.request_stream_with_retries_async( + "GET", self.valid_url, {}, None, self.max_retries() + ) + + @pytest.mark.parametrize("anyio_backend", ["asyncio"]) + @pytest.mark.anyio + async def test_retry_error_until_response( + self, + mock_retry, + mock_response, + check_call_numbers, + request_mock, + mocker, + ): + mock_retry( + retry_error_num=1, + responses=[mock_response(request_mock, code=202)], + ) + _, code, _ = await self.make_request_async() + assert code == 202 + check_call_numbers(2) + + @pytest.mark.parametrize("anyio_backend", ["asyncio"]) + @pytest.mark.anyio + async def test_retry_error_until_exceeded( + self, mock_retry, mock_response, check_call_numbers + ): + mock_retry(retry_error_num=self.max_retries()) + with pytest.raises(stripe.APIConnectionError): + await self.make_request_async() + + check_call_numbers(self.max_retries()) + + @pytest.mark.parametrize("anyio_backend", ["asyncio"]) + @pytest.mark.anyio + async def test_no_retry_error( + self, mock_retry, mock_response, check_call_numbers + ): + mock_retry(no_retry_error_num=self.max_retries()) + with pytest.raises(stripe.APIConnectionError): + await self.make_request_async() + check_call_numbers(1) + + @pytest.mark.parametrize("anyio_backend", ["asyncio"]) + @pytest.mark.anyio + async def test_retry_codes( + self, mock_retry, mock_response, request_mock, check_call_numbers + ): + mock_retry( + responses=[ + mock_response(request_mock, code=409), + mock_response(request_mock, code=202), + ] + ) + _, code, _ = await self.make_request_async() + assert code == 202 + check_call_numbers(2) + + @pytest.mark.parametrize("anyio_backend", ["asyncio"]) + @pytest.mark.anyio + async def test_retry_codes_until_exceeded( + self, mock_retry, mock_response, request_mock, check_call_numbers + ): + mock_retry( + responses=[mock_response(request_mock, code=409)] + * (self.max_retries() + 1) + ) + _, code, _ = await self.make_request_async() + assert code == 409 + check_call_numbers(self.max_retries() + 1) + + def connection_error(self, client, given_exception): + with pytest.raises(stripe.APIConnectionError) as error: + client._handle_request_error(given_exception) + return error.value + + @pytest.mark.parametrize("anyio_backend", ["asyncio"]) + @pytest.mark.anyio + async def test_handle_request_error_should_retry( + self, mock_retry, anyio_backend + ): + client = self.REQUEST_CLIENT() + request_mock = mock_retry() + + error = self.connection_error( + client, request_mock.exceptions.Timeout() + ) + assert error.should_retry + + error = self.connection_error( + client, request_mock.exceptions.ConnectionError() + ) + assert error.should_retry + + # Skip inherited basic client tests + def test_request(self): + pass + + def test_request_async(self): + pass + + def test_timeout(self): + pass + + def test_timeout_async(self): + pass diff --git a/tests/test_integration.py b/tests/test_integration.py index 7080b4556..a96f9b533 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -1,10 +1,12 @@ import platform -import sys from threading import Thread, Lock import json import warnings import time +import httpx +import aiohttp + import stripe import pytest from queue import Queue @@ -14,10 +16,7 @@ if platform.python_implementation() == "PyPy": pytest.skip("skip integration tests with PyPy", allow_module_level=True) -if sys.version_info[0] < 3: - from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer -else: - from http.server import BaseHTTPRequestHandler, HTTPServer +from http.server import BaseHTTPRequestHandler, HTTPServer class MyTestHandler(BaseHTTPRequestHandler): @@ -54,9 +53,11 @@ def _do_request(self): status = provided_status or self.default_status headers = provided_headers or self.default_headers body = provided_body or self.default_body + content_length = len(body) self.send_response(status) for header_name, header_value in headers.items(): self.send_header(header_name, header_value) + self.send_header("Content-Length", str(content_length)) self.end_headers() self.wfile.write(body) return @@ -72,6 +73,8 @@ def do_request( class TestIntegration(object): + mock_server = None + @pytest.fixture(autouse=True) def close_mock_server(self): yield @@ -84,6 +87,7 @@ def close_mock_server(self): def setup_stripe(self): orig_attrs = { "api_base": stripe.api_base, + "upload_api_base": stripe.upload_api_base, "api_key": stripe.api_key, "default_http_client": stripe.default_http_client, "enable_telemetry": stripe.enable_telemetry, @@ -91,6 +95,7 @@ def setup_stripe(self): "proxy": stripe.proxy, } stripe.api_base = "http://localhost:12111" # stripe-mock + stripe.upload_api_base = "http://localhost:12111" # stripe-mock stripe.api_key = "sk_test_123" stripe.default_http_client = None stripe._default_proxy = None @@ -99,6 +104,7 @@ def setup_stripe(self): stripe.proxy = None yield stripe.api_base = orig_attrs["api_base"] + stripe.upload_api_base = orig_attrs["api_base"] stripe.api_key = orig_attrs["api_key"] stripe.default_http_client = orig_attrs["default_http_client"] stripe.enable_telemetry = orig_attrs["enable_telemetry"] @@ -155,10 +161,8 @@ class MockServerRequestHandler(MyTestHandler): self.setup_mock_server(MockServerRequestHandler) - stripe.default_http_client = ( - stripe.http_client.new_default_http_client( - proxy="http://localhost:%s" % self.mock_server_port - ) + stripe.default_http_client = stripe.new_default_http_client( + proxy="http://localhost:%s" % self.mock_server_port ) stripe.Balance.retrieve() assert MockServerRequestHandler.num_requests == 1 @@ -277,7 +281,7 @@ def do_request(self, _n): self.setup_mock_server(MockServerRequestHandler) stripe.api_base = "http://localhost:%s" % self.mock_server_port stripe.enable_telemetry = True - stripe.default_http_client = stripe.http_client.RequestsClient() + stripe.default_http_client = stripe.RequestsClient() def work(): stripe.Balance.retrieve() @@ -292,7 +296,8 @@ def work(): assert MockServerRequestHandler.num_requests == 20 assert len(MockServerRequestHandler.seen_metrics) == 10 - def test_measures_stripe_client_telemetry(self): + @pytest.mark.anyio + async def test_measures_stripe_client_telemetry(self): class MockServerRequestHandler(MyTestHandler): def do_request(self, req_num): return [ @@ -313,8 +318,8 @@ def do_request(self, req_num): "api": "http://localhost:%s" % self.mock_server_port }, ) - client.customers.create() - client.customers.create() + await client.customers.create_async() + await client.customers.create_async() reqs = MockServerRequestHandler.get_requests(2) @@ -325,4 +330,148 @@ def do_request(self, req_num): assert "last_request_metrics" in telemetry usage = telemetry["last_request_metrics"]["usage"] - assert usage == ["stripe_client"] + assert usage == ["stripe_client", "async"] + + @pytest.mark.anyio + @pytest.fixture(params=["aiohttp", "httpx"]) + async def async_http_client(self, request, anyio_backend): + if request.param == "httpx": + return stripe.HTTPXClient() + elif request.param == "aiohttp": + if anyio_backend != "asyncio": + return pytest.skip("aiohttp only works with asyncio") + return stripe.AIOHTTPClient() + else: + raise ValueError(f"Unknown http client name: {request.param}") + + @pytest.fixture + async def set_global_async_http_client(self, async_http_client): + stripe.default_http_client = async_http_client + + async def test_async_success(self, set_global_async_http_client): + class MockServerRequestHandler(MyTestHandler): + default_body = '{"id": "cus_123", "object": "customer"}'.encode( + "utf-8" + ) + pass + + self.setup_mock_server(MockServerRequestHandler) + + stripe.api_base = "http://localhost:%s" % self.mock_server_port + + cus = await stripe.Customer.create_async( + description="My test customer" + ) + + reqs = MockServerRequestHandler.get_requests(1) + req = reqs[0] + + assert req.path == "/v1/customers" + assert req.command == "POST" + assert isinstance(cus, stripe.Customer) + + async def test_async_timeout(self, set_global_async_http_client): + class MockServerRequestHandler(MyTestHandler): + def do_request(self, n): + time.sleep(0.02) + return super().do_request(n) + + self.setup_mock_server(MockServerRequestHandler) + stripe.api_base = "http://localhost:%s" % self.mock_server_port + # If we set HTTPX's generic timeout the test is flaky (sometimes it's a ReadTimeout, sometimes its a ConnectTimeout) + # so we set only the read timeout specifically. + hc = stripe.default_http_client + + expected_message = "" + if isinstance(hc, stripe.HTTPXClient): + hc._timeout = httpx.Timeout(None, read=0.01) + expected_message = "A ReadTimeout was raised" + elif isinstance(hc, stripe.AIOHTTPClient): + hc._timeout = aiohttp.ClientTimeout(sock_read=0.01) + expected_message = "A ServerTimeoutError was raised" + else: + raise ValueError(f"Unknown http client: {hc.name}") + stripe.max_network_retries = 0 + + exception = None + try: + await stripe.Customer.create_async(description="My test customer") + except stripe.APIConnectionError as e: + exception = e + + assert exception is not None + + assert expected_message in str(exception.user_message) + + async def test_async_retries(self, set_global_async_http_client): + class MockServerRequestHandler(MyTestHandler): + def do_request(self, n): + if n == 0: + return ( + 500, + {"Request-Id": "req_1"}, + b'{"error": {"message": "Internal server error"}}', + ) + return (200, None, None) + + pass + + self.setup_mock_server(MockServerRequestHandler) + stripe.api_base = "http://localhost:%s" % self.mock_server_port + + await stripe.Customer.create_async(description="My test customer") + + reqs = MockServerRequestHandler.get_requests(2) + req = reqs[0] + + assert req.path == "/v1/customers" + + async def test_async_unretryable(self, set_global_async_http_client): + class MockServerRequestHandler(MyTestHandler): + def do_request(self, n): + return ( + 401, + {"Request-Id": "req_1"}, + b'{"error": {"message": "Unauthorized"}}', + ) + + pass + + self.setup_mock_server(MockServerRequestHandler) + stripe.api_base = "http://localhost:%s" % self.mock_server_port + + exception = None + try: + await stripe.Customer.create_async(description="My test customer") + except stripe.AuthenticationError as e: + exception = e + + MockServerRequestHandler.get_requests(1) + assert exception is not None + assert "Unauthorized" in str(exception.user_message) + + async def test_async_httpx_stream(self, set_global_async_http_client): + class MockServerRequestHandler(MyTestHandler): + def do_request(self, n): + return (200, None, b"hello") + + self.setup_mock_server(MockServerRequestHandler) + stripe.upload_api_base = "http://localhost:%s" % self.mock_server_port + + result = await stripe.Quote.pdf_async("qt_123") + assert str(await result.read(), "utf-8") == "hello" + + async def test_async_httpx_stream_error( + self, set_global_async_http_client + ): + class MockServerRequestHandler(MyTestHandler): + def do_request(self, n): + return (400, None, b'{"error": {"message": "bad request"}}') + + self.setup_mock_server(MockServerRequestHandler) + stripe.upload_api_base = "http://localhost:%s" % self.mock_server_port + + try: + await stripe.Quote.pdf_async("qt_123") + except stripe.InvalidRequestError as e: + assert "bad request" in str(e.user_message) diff --git a/tests/test_stripe_object.py b/tests/test_stripe_object.py index 94780da14..c75b06548 100644 --- a/tests/test_stripe_object.py +++ b/tests/test_stripe_object.py @@ -7,84 +7,70 @@ import stripe +# We use this because it has a map, "restriction.currency_options" from string -> CurrencyOptions nested class. +SAMPLE_PROMOTION_CODE = json.loads( + """{ + "id": "promo_1NzO4FIFdHa3DensTcbAA0mz", + "object": "promotion_code", + "restrictions": { + "currency_options": { + "gbp": { + "minimum_amount": 10 + }, + "usd": { + "minimum_amount": 5 + } + } + } +} +""" +) SAMPLE_INVOICE = json.loads( - """ -{ - "amount_due": 1305, - "attempt_count": 0, - "attempted": true, - "charge": "ch_wajkQ5aDTzFs5v", - "closed": true, - "customer": "cus_osllUe2f1BzrRT", - "date": 1338238728, - "discount": null, - "ending_balance": 0, - "id": "in_t9mHb2hpK7mml1", - "livemode": false, - "next_payment_attempt": null, + """{ + "id": "in_xyz", "object": "invoice", - "paid": true, - "period_end": 1338238728, - "period_start": 1338238716, - "starting_balance": -8695, - "subtotal": 10000, - "total": 10000, + "automatic_tax": { + "enabled": false, + "status": null + }, + "created": 1694725031, "lines": { "object": "list", "data": [ { - "id": "il_1LSiex2eZvKYlo2CZ5IspTNx", + "id": "sli_xyz", "object": "line_item", - "amount": 2499, - "amount_excluding_tax": 2499, - "currency": "usd", - "description": "My First Invoice Item (created for API docs)", - "discount_amounts": [], - "discountable": true, - "discounts": [], - "invoice_item": "ii_1LSiex2eZvKYlo2C0X4adTLR", - "livemode": false, - "metadata": {}, "period": { - "end": 1659537295, - "start": 1659537295 + "end": 1697316491, + "start": 1694724491 + }, + "plan": { + "id": "price_xyz", + "object": "plan" }, "price": { - "id": "price_1LSicu2eZvKYlo2C4WSIaXEp", + "id": "price_xyz", "object": "price", - "active": true, "billing_scheme": "per_unit", - "created": 1659537168, - "currency": "usd", - "custom_unit_amount": null, - "livemode": false, - "lookup_key": null, - "metadata": {}, - "nickname": null, - "product": "prod_MB4mvosUV5tObf", - "recurring": null, - "tax_behavior": "unspecified", - "tiers_mode": null, - "transform_quantity": null, - "type": "one_time", - "unit_amount": 2499, - "unit_amount_decimal": "2499" - }, - "proration": false, - "proration_details": { - "credited_items": null - }, - "quantity": 1, - "subscription": null, - "tax_amounts": [], - "tax_rates": [], - "type": "invoiceitem", - "unit_amount_excluding_tax": "2499" + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + } + } } ], "has_more": false, - "url": "/v1/invoices/in_t9mHb2hpK7mml1/lines" + "total_count": 1, + "url": "/v1/invoices/in_1NqMb5IFdHa3DenshEllwgEX/lines" + }, + "livemode": false, + "next_payment_attempt": null, + "shipping_cost": { + "taxes": [{"amount": 10, "rate": {"id": "rate_xyz", "object": "tax_rate", "active": false}}] } } """ @@ -182,29 +168,40 @@ def test_passing_nested_refresh(self): assert nested.stripe_account == "acct_foo" def test_refresh_from_nested_object(self): - obj = stripe.stripe_object.StripeObject.construct_from( - SAMPLE_INVOICE, "key" - ) + obj = stripe.Invoice.construct_from(SAMPLE_INVOICE, "key") assert len(obj.lines) == 1 + # Does a list get deserialized to the correct class? assert isinstance(obj.lines, stripe.ListObject) + # Do items within a list get deserialized to the correct class? assert isinstance(obj.lines.data[0], stripe.InvoiceLineItem) - assert isinstance( - obj.lines.data[0].price, stripe.stripe_object.StripeObject - ) + # Do references to other top-level resources get deserialized to the correct class? assert isinstance(obj.lines.data[0].price, stripe.Price) assert obj.lines.data[0].price.billing_scheme == "per_unit" + # Do inner classes on referenced top-level resources get deserialized to the correct inner class. + assert isinstance( + obj.lines.data[0].price.recurring, stripe.Price.Recurring + ) + assert isinstance( + obj.lines.data[0].price.recurring, stripe.Price.Recurring + ) - def test_refresh_from_nested_object_can_be_paged(self): - obj = stripe.stripe_object.StripeObject.construct_from( - SAMPLE_INVOICE, "key" + # Test: do nested objects get deserialized to the correct inner class? + assert isinstance(obj.automatic_tax, stripe.Invoice.AutomaticTax) + assert isinstance(obj.shipping_cost, stripe.Invoice.ShippingCost) + # Test: do nested objects inside lists get deserialized to the correct inner class? + assert isinstance( + obj.shipping_cost.taxes[0], stripe.Invoice.ShippingCost.Tax ) + def test_refresh_from_nested_object_can_be_paged(self): + obj = stripe.Invoice.construct_from(SAMPLE_INVOICE, "key") + assert len(obj.lines) == 1 assert isinstance(obj.lines, stripe.ListObject) seen = [item["id"] for item in obj.lines.auto_paging_iter()] - assert seen == ["il_1LSiex2eZvKYlo2CZ5IspTNx"] + assert seen == ["sli_xyz"] assert isinstance(obj.lines.data[0], stripe.InvoiceLineItem) assert isinstance( @@ -213,6 +210,22 @@ def test_refresh_from_nested_object_can_be_paged(self): assert isinstance(obj.lines.data[0].price, stripe.Price) assert obj.lines.data[0].price.billing_scheme == "per_unit" + def test_refresh_on_map_to_nested_object(self): + obj = stripe.PromotionCode.construct_from(SAMPLE_PROMOTION_CODE, "key") + + assert isinstance( + obj.restrictions.currency_options, + dict, + ) + assert not isinstance( + obj.restrictions.currency_options, + stripe.stripe_object.StripeObject, + ) + assert isinstance( + obj.restrictions.currency_options["gbp"], + stripe.PromotionCode.Restrictions.CurrencyOptions, + ) + def test_to_json(self): obj = stripe.stripe_object.StripeObject.construct_from( SAMPLE_INVOICE, "key" @@ -222,12 +235,12 @@ def test_to_json(self): def check_invoice_data(self, data): # Check rough structure - assert len(list(data.keys())) == 20 - assert len(list(data["lines"]["data"][0].keys())) == 22 + assert len(list(data.keys())) == 8 + assert len(list(data["lines"]["data"][0].keys())) == 5 assert len(data["lines"]["data"]) == 1 # Check various data types - assert data["date"] == 1338238728 + assert data["created"] == 1694725031 assert data["next_payment_attempt"] is None assert data["livemode"] is False assert ( @@ -399,6 +412,18 @@ def test_sends_request_with_api_key(self, http_client_mock): stripe_account=None, ) + @pytest.mark.anyio + async def test_request_async_succeeds(self, http_client_mock): + http_client_mock.stub_request("get", "/foo") + obj = stripe.stripe_object.StripeObject("id", "key") + await obj._request_async( + "get", "/foo", base_address="api", api_mode="V1" + ) + http_client_mock.assert_requested( + api_key="key", + stripe_account=None, + ) + def test_refresh_from_creates_new_requestor(self): obj = stripe.stripe_object.StripeObject.construct_from( {}, key="origkey" From d1730bd5ae596e1e4a776f4204192f7c06934114 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 22:45:22 -0700 Subject: [PATCH 034/179] Bump aiohttp from 3.9.0 to 3.9.2 (#1289) Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.0 to 3.9.2. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiohttp/compare/v3.9.0...v3.9.2) --- updated-dependencies: - dependency-name: aiohttp dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 626cbbb80..efc89509e 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ httpx == 0.22.0; python_version == "3.6" httpx >= 0.24.1; python_version == "3.7" httpx >= 0.27.0; python_version >= "3.8" aiohttp == 3.8.6; python_version <= "3.7" -aiohttp == 3.9.0; python_version > "3.7" +aiohttp == 3.9.2; python_version > "3.7" anyio[trio] == 3.6.2 pytest-cov >= 2.8.1, < 2.11.0 From ccf6aaf2e164044fb214f9c706574bfe32215c2c Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:55:51 -0700 Subject: [PATCH 035/179] Instructions for async in README.md (#1290) --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/README.md b/README.md index 2e24b7c88..6873a18ef 100644 --- a/README.md +++ b/README.md @@ -264,6 +264,54 @@ If your beta feature requires a `Stripe-Version` header to be sent, set the `str stripe.add_beta_version("feature_beta", "v3") ``` +### Async + +Asynchronous versions of request-making methods are available by suffixing the method name +with `_async`. + +```python +# With StripeClient +client = StripeClient("sk_test_...") +customer = await client.customers.retrieve_async("cus_xyz") + +# With global client +stripe.api_key = "sk_test_..." +customer = await stripe.Customer.retrieve_async("cus_xyz") + +# .auto_paging_iter() implements both AsyncIterable and Iterable +async for c in await stripe.Customer.list_async().auto_paging_iter(): + ... +``` + +There is no `.save_async` as `.save` is [deprecated since stripe-python v5](https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v5#deprecated). Please migrate to `.modify_async`. + +The default HTTP client uses `requests` for making synchronous requests but +`httpx` for making async requests. If you're migrating to async, we recommend +you to explicitly initialize your own http client and pass it to StripeClient +or set it as the global default. + +```python +# By default, an explicitly initialized HTTPXClient will raise an exception if you +# attempt to call a sync method. If you intend to only use async, this is useful to +# make sure you don't unintentionally make a synchronous request. +my_http_client = stripe.HTTPXClient() + +# If you want to use httpx to make sync requests, you can disable this +# behavior. +my_http_client = stripe.HTTPXClient(allow_sync_requests=True) + +# aiohttp is also available (does not support sync requests) +my_http_client = stripe.AIOHTTPClient() + +# With StripeClient +client = StripeClient("sk_test_...", http_client=my_http_client) + +# With the global client +stripe.default_http_client = my_http_client +``` + +You can also subclass `stripe.HTTPClient` and provide your own instance. + ## Support New features and bug fixes are released on the latest major version of the Stripe Python library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates. From 5b307f5cd98c2329fe3d04c100ee386475ba6548 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 13:48:08 -0700 Subject: [PATCH 036/179] Update generated code (#1284) * Update generated code for v932 * Update generated code for v932 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 56 ++--- stripe/_account_person_service.py | 12 +- stripe/_account_service.py | 80 ++++---- stripe/_customer.py | 12 +- stripe/_customer_service.py | 12 +- stripe/_discount.py | 4 + stripe/_invoice.py | 72 +++++-- stripe/_invoice_item.py | 12 +- stripe/_invoice_item_service.py | 12 +- stripe/_invoice_line_item.py | 8 +- stripe/_invoice_line_item_service.py | 6 +- stripe/_invoice_service.py | 46 ++++- stripe/_invoice_upcoming_lines_service.py | 24 ++- stripe/_payment_intent.py | 12 +- stripe/_payment_link.py | 8 +- stripe/_payment_link_service.py | 8 +- stripe/_payment_method_configuration.py | 60 ++++++ .../_payment_method_configuration_service.py | 36 ++++ stripe/_quote.py | 48 +++++ stripe/_quote_service.py | 48 +++++ stripe/_setup_attempt.py | 11 + stripe/_setup_intent.py | 32 +++ stripe/_setup_intent_service.py | 27 +++ stripe/_subscription.py | 132 +++++++++++- stripe/_subscription_item.py | 46 +++++ stripe/_subscription_item_service.py | 40 ++++ stripe/_subscription_schedule.py | 191 +++++++++++++++++- stripe/_subscription_schedule_service.py | 128 +++++++++++- stripe/_subscription_service.py | 126 +++++++++++- stripe/_token.py | 18 +- stripe/_token_service.py | 18 +- stripe/billing/_meter_event.py | 2 +- stripe/billing/_meter_event_service.py | 2 +- stripe/billing_portal/_configuration.py | 32 +-- .../billing_portal/_configuration_service.py | 28 +-- stripe/checkout/_session.py | 6 +- stripe/checkout/_session_service.py | 6 +- stripe/identity/_verification_report.py | 74 ++++++- stripe/identity/_verification_session.py | 140 ++++++++++++- .../identity/_verification_session_service.py | 90 ++++++++- stripe/issuing/_card.py | 24 +++ stripe/issuing/_card_service.py | 16 ++ stripe/issuing/_cardholder.py | 24 +++ stripe/issuing/_cardholder_service.py | 16 ++ stripe/terminal/_reader.py | 4 +- stripe/terminal/_reader_service.py | 1 + 47 files changed, 1605 insertions(+), 207 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 7044b5abc..3dfb688b8 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v911 \ No newline at end of file +v932 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 385b6004d..a04dcc138 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -56,7 +56,7 @@ class BusinessProfile(StripeObject): class AnnualRevenue(StripeObject): amount: Optional[int] """ - A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ currency: Optional[str] """ @@ -70,7 +70,7 @@ class AnnualRevenue(StripeObject): class MonthlyEstimatedRevenue(StripeObject): amount: int """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ currency: str """ @@ -1161,7 +1161,7 @@ class CreateParams(RequestOptions): Literal["company", "government_entity", "individual", "non_profit"] ] """ - The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + The business type. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ capabilities: NotRequired["Account.CreateParamsCapabilities"] """ @@ -1169,7 +1169,7 @@ class CreateParams(RequestOptions): """ company: NotRequired["Account.CreateParamsCompany"] """ - Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ country: NotRequired[str] """ @@ -1177,7 +1177,7 @@ class CreateParams(RequestOptions): """ default_currency: NotRequired[str] """ - Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://docs.stripe.com/payouts). """ documents: NotRequired["Account.CreateParamsDocuments"] """ @@ -1195,13 +1195,13 @@ class CreateParams(RequestOptions): "str|Account.CreateParamsBankAccount|Account.CreateParamsCard|Account.CreateParamsCardToken" ] """ - A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. + A card or bank account to attach to the account for receiving [payouts](https://docs.stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://docs.stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://docs.stripe.com/api#account_create_bank_account) creation. - By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://docs.stripe.com/api#account_create_bank_account) or [card creation](https://docs.stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ individual: NotRequired["Account.CreateParamsIndividual"] """ - Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ @@ -1213,7 +1213,7 @@ class CreateParams(RequestOptions): """ tos_acceptance: NotRequired["Account.CreateParamsTosAcceptance"] """ - Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. + Details on the account's acceptance of the [Stripe Services Agreement](https://docs.stripe.com/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. """ type: NotRequired[Literal["custom", "express", "standard"]] """ @@ -1260,7 +1260,7 @@ class CreateParamsBusinessProfile(TypedDict): """ mcc: NotRequired[str] """ - [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. + [The merchant category code for the account](https://docs.stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ monthly_estimated_revenue: NotRequired[ "Account.CreateParamsBusinessProfileMonthlyEstimatedRevenue" @@ -1302,7 +1302,7 @@ class CreateParamsBusinessProfile(TypedDict): class CreateParamsBusinessProfileAnnualRevenue(TypedDict): amount: int """ - A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ currency: str """ @@ -1316,7 +1316,7 @@ class CreateParamsBusinessProfileAnnualRevenue(TypedDict): class CreateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict): amount: int """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ currency: str """ @@ -1867,11 +1867,11 @@ class CreateParamsCompany(TypedDict): """ directors_provided: NotRequired[bool] """ - Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ - Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ @@ -1895,7 +1895,7 @@ class CreateParamsCompany(TypedDict): """ owners_provided: NotRequired[bool] """ - Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "Account.CreateParamsCompanyOwnershipDeclaration" @@ -1915,7 +1915,7 @@ class CreateParamsCompany(TypedDict): "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ - The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. + The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ @@ -2183,11 +2183,11 @@ class CreateParamsIndividual(TypedDict): """ id_number: NotRequired[str] """ - The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ @@ -2479,7 +2479,7 @@ class CreateParamsSettingsCardIssuing(TypedDict): "Account.CreateParamsSettingsCardIssuingTosAcceptance" ] """ - Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). + Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://docs.stripe.com/issuing/connect/tos_acceptance). """ class CreateParamsSettingsCardIssuingTosAcceptance(TypedDict): @@ -2543,11 +2543,11 @@ class CreateParamsSettingsPayments(TypedDict): class CreateParamsSettingsPayouts(TypedDict): debit_negative_balances: NotRequired[bool] """ - A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://docs.stripe.com/connect/account-balances). """ schedule: NotRequired["Account.CreateParamsSettingsPayoutsSchedule"] """ - Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. + Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://docs.stripe.com/connect/bank-transfers#payout-information) documentation. """ statement_descriptor: NotRequired[str] """ @@ -2557,7 +2557,7 @@ class CreateParamsSettingsPayouts(TypedDict): class CreateParamsSettingsPayoutsSchedule(TypedDict): delay_days: NotRequired["Literal['minimum']|int"] """ - The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). + The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://docs.stripe.com/connect/manage-payout-schedule). """ interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] """ @@ -2679,11 +2679,11 @@ class CreatePersonParams(RequestOptions): """ id_number: NotRequired[str] """ - The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ @@ -2711,7 +2711,7 @@ class CreatePersonParams(RequestOptions): """ person_token: NotRequired[str] """ - A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + A [person token](https://docs.stripe.com/connect/account-tokens), used to securely provide details to the person. """ phone: NotRequired[str] """ @@ -3260,11 +3260,11 @@ class ModifyPersonParams(RequestOptions): """ id_number: NotRequired[str] """ - The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ @@ -3292,7 +3292,7 @@ class ModifyPersonParams(RequestOptions): """ person_token: NotRequired[str] """ - A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + A [person token](https://docs.stripe.com/connect/account-tokens), used to securely provide details to the person. """ phone: NotRequired[str] """ diff --git a/stripe/_account_person_service.py b/stripe/_account_person_service.py index 4ec1741f2..363ea0130 100644 --- a/stripe/_account_person_service.py +++ b/stripe/_account_person_service.py @@ -71,11 +71,11 @@ class CreateParams(TypedDict): """ id_number: NotRequired[str] """ - The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ @@ -103,7 +103,7 @@ class CreateParams(TypedDict): """ person_token: NotRequired[str] """ - A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + A [person token](https://docs.stripe.com/connect/account-tokens), used to securely provide details to the person. """ phone: NotRequired[str] """ @@ -500,11 +500,11 @@ class UpdateParams(TypedDict): """ id_number: NotRequired[str] """ - The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ @@ -532,7 +532,7 @@ class UpdateParams(TypedDict): """ person_token: NotRequired[str] """ - A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + A [person token](https://docs.stripe.com/connect/account-tokens), used to securely provide details to the person. """ phone: NotRequired[str] """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 3bc43e433..271acf760 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -38,7 +38,7 @@ class CreateParams(TypedDict): Literal["company", "government_entity", "individual", "non_profit"] ] """ - The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + The business type. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ capabilities: NotRequired["AccountService.CreateParamsCapabilities"] """ @@ -46,7 +46,7 @@ class CreateParams(TypedDict): """ company: NotRequired["AccountService.CreateParamsCompany"] """ - Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ country: NotRequired[str] """ @@ -54,7 +54,7 @@ class CreateParams(TypedDict): """ default_currency: NotRequired[str] """ - Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://docs.stripe.com/payouts). """ documents: NotRequired["AccountService.CreateParamsDocuments"] """ @@ -72,13 +72,13 @@ class CreateParams(TypedDict): "str|AccountService.CreateParamsBankAccount|AccountService.CreateParamsCard|AccountService.CreateParamsCardToken" ] """ - A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. + A card or bank account to attach to the account for receiving [payouts](https://docs.stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://docs.stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://docs.stripe.com/api#account_create_bank_account) creation. - By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://docs.stripe.com/api#account_create_bank_account) or [card creation](https://docs.stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ individual: NotRequired["AccountService.CreateParamsIndividual"] """ - Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ @@ -90,7 +90,7 @@ class CreateParams(TypedDict): """ tos_acceptance: NotRequired["AccountService.CreateParamsTosAcceptance"] """ - Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. + Details on the account's acceptance of the [Stripe Services Agreement](https://docs.stripe.com/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. """ type: NotRequired[Literal["custom", "express", "standard"]] """ @@ -137,7 +137,7 @@ class CreateParamsBusinessProfile(TypedDict): """ mcc: NotRequired[str] """ - [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. + [The merchant category code for the account](https://docs.stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ monthly_estimated_revenue: NotRequired[ "AccountService.CreateParamsBusinessProfileMonthlyEstimatedRevenue" @@ -179,7 +179,7 @@ class CreateParamsBusinessProfile(TypedDict): class CreateParamsBusinessProfileAnnualRevenue(TypedDict): amount: int """ - A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ currency: str """ @@ -193,7 +193,7 @@ class CreateParamsBusinessProfileAnnualRevenue(TypedDict): class CreateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict): amount: int """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ currency: str """ @@ -752,11 +752,11 @@ class CreateParamsCompany(TypedDict): """ directors_provided: NotRequired[bool] """ - Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ - Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ @@ -780,7 +780,7 @@ class CreateParamsCompany(TypedDict): """ owners_provided: NotRequired[bool] """ - Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "AccountService.CreateParamsCompanyOwnershipDeclaration" @@ -800,7 +800,7 @@ class CreateParamsCompany(TypedDict): "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ - The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. + The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ @@ -1074,11 +1074,11 @@ class CreateParamsIndividual(TypedDict): """ id_number: NotRequired[str] """ - The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ @@ -1378,7 +1378,7 @@ class CreateParamsSettingsCardIssuing(TypedDict): "AccountService.CreateParamsSettingsCardIssuingTosAcceptance" ] """ - Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). + Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://docs.stripe.com/issuing/connect/tos_acceptance). """ class CreateParamsSettingsCardIssuingTosAcceptance(TypedDict): @@ -1442,13 +1442,13 @@ class CreateParamsSettingsPayments(TypedDict): class CreateParamsSettingsPayouts(TypedDict): debit_negative_balances: NotRequired[bool] """ - A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://docs.stripe.com/connect/account-balances). """ schedule: NotRequired[ "AccountService.CreateParamsSettingsPayoutsSchedule" ] """ - Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. + Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://docs.stripe.com/connect/bank-transfers#payout-information) documentation. """ statement_descriptor: NotRequired[str] """ @@ -1458,7 +1458,7 @@ class CreateParamsSettingsPayouts(TypedDict): class CreateParamsSettingsPayoutsSchedule(TypedDict): delay_days: NotRequired["Literal['minimum']|int"] """ - The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). + The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://docs.stripe.com/connect/manage-payout-schedule). """ interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] """ @@ -1603,7 +1603,7 @@ class UpdateParams(TypedDict): Literal["company", "government_entity", "individual", "non_profit"] ] """ - The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + The business type. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ capabilities: NotRequired["AccountService.UpdateParamsCapabilities"] """ @@ -1611,11 +1611,11 @@ class UpdateParams(TypedDict): """ company: NotRequired["AccountService.UpdateParamsCompany"] """ - Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ default_currency: NotRequired[str] """ - Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://docs.stripe.com/payouts). """ documents: NotRequired["AccountService.UpdateParamsDocuments"] """ @@ -1633,13 +1633,13 @@ class UpdateParams(TypedDict): "Literal['']|str|AccountService.UpdateParamsBankAccount|AccountService.UpdateParamsCard|AccountService.UpdateParamsCardToken" ] """ - A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. + A card or bank account to attach to the account for receiving [payouts](https://docs.stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://docs.stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://docs.stripe.com/api#account_create_bank_account) creation. - By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://docs.stripe.com/api#account_create_bank_account) or [card creation](https://docs.stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ individual: NotRequired["AccountService.UpdateParamsIndividual"] """ - Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ @@ -1651,7 +1651,7 @@ class UpdateParams(TypedDict): """ tos_acceptance: NotRequired["AccountService.UpdateParamsTosAcceptance"] """ - Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. + Details on the account's acceptance of the [Stripe Services Agreement](https://docs.stripe.com/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. """ class UpdateParamsBankAccount(TypedDict): @@ -1694,7 +1694,7 @@ class UpdateParamsBusinessProfile(TypedDict): """ mcc: NotRequired[str] """ - [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. + [The merchant category code for the account](https://docs.stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ monthly_estimated_revenue: NotRequired[ "AccountService.UpdateParamsBusinessProfileMonthlyEstimatedRevenue" @@ -1736,7 +1736,7 @@ class UpdateParamsBusinessProfile(TypedDict): class UpdateParamsBusinessProfileAnnualRevenue(TypedDict): amount: int """ - A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ currency: str """ @@ -1750,7 +1750,7 @@ class UpdateParamsBusinessProfileAnnualRevenue(TypedDict): class UpdateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict): amount: int """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ currency: str """ @@ -2309,11 +2309,11 @@ class UpdateParamsCompany(TypedDict): """ directors_provided: NotRequired[bool] """ - Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ - Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ @@ -2337,7 +2337,7 @@ class UpdateParamsCompany(TypedDict): """ owners_provided: NotRequired[bool] """ - Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "AccountService.UpdateParamsCompanyOwnershipDeclaration" @@ -2357,7 +2357,7 @@ class UpdateParamsCompany(TypedDict): "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ - The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. + The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ @@ -2631,11 +2631,11 @@ class UpdateParamsIndividual(TypedDict): """ id_number: NotRequired[str] """ - The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ @@ -2939,7 +2939,7 @@ class UpdateParamsSettingsCardIssuing(TypedDict): "AccountService.UpdateParamsSettingsCardIssuingTosAcceptance" ] """ - Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). + Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://docs.stripe.com/issuing/connect/tos_acceptance). """ class UpdateParamsSettingsCardIssuingTosAcceptance(TypedDict): @@ -3009,13 +3009,13 @@ class UpdateParamsSettingsPayments(TypedDict): class UpdateParamsSettingsPayouts(TypedDict): debit_negative_balances: NotRequired[bool] """ - A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://docs.stripe.com/connect/account-balances). """ schedule: NotRequired[ "AccountService.UpdateParamsSettingsPayoutsSchedule" ] """ - Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. + Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://docs.stripe.com/connect/bank-transfers#payout-information) documentation. """ statement_descriptor: NotRequired[str] """ @@ -3025,7 +3025,7 @@ class UpdateParamsSettingsPayouts(TypedDict): class UpdateParamsSettingsPayoutsSchedule(TypedDict): delay_days: NotRequired["Literal['minimum']|int"] """ - The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). + The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://docs.stripe.com/connect/manage-payout-schedule). """ interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] """ diff --git a/stripe/_customer.py b/stripe/_customer.py index 95ea863e0..a0675d953 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -345,7 +345,7 @@ class CreateParams(RequestOptions): """ promotion_code: NotRequired[str] """ - The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. + The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. """ shipping: NotRequired["Literal['']|Customer.CreateParamsShipping"] """ @@ -438,11 +438,11 @@ class CreateParamsInvoiceSettings(TypedDict): class CreateParamsInvoiceSettingsCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class CreateParamsInvoiceSettingsRenderingOptions(TypedDict): @@ -990,7 +990,7 @@ class ModifyParams(RequestOptions): """ promotion_code: NotRequired[str] """ - The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. + The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. """ shipping: NotRequired["Literal['']|Customer.ModifyParamsShipping"] """ @@ -1075,11 +1075,11 @@ class ModifyParamsInvoiceSettings(TypedDict): class ModifyParamsInvoiceSettingsCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class ModifyParamsInvoiceSettingsRenderingOptions(TypedDict): diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 5bc91e415..5329693b9 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -104,7 +104,7 @@ class CreateParams(TypedDict): """ promotion_code: NotRequired[str] """ - The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. + The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. """ shipping: NotRequired[ "Literal['']|CustomerService.CreateParamsShipping" @@ -203,11 +203,11 @@ class CreateParamsInvoiceSettings(TypedDict): class CreateParamsInvoiceSettingsCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class CreateParamsInvoiceSettingsRenderingOptions(TypedDict): @@ -490,7 +490,7 @@ class UpdateParams(TypedDict): """ promotion_code: NotRequired[str] """ - The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. + The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. """ shipping: NotRequired[ "Literal['']|CustomerService.UpdateParamsShipping" @@ -579,11 +579,11 @@ class UpdateParamsInvoiceSettings(TypedDict): class UpdateParamsInvoiceSettingsCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class UpdateParamsInvoiceSettingsRenderingOptions(TypedDict): diff --git a/stripe/_discount.py b/stripe/_discount.py index e2285d63f..f8475423e 100644 --- a/stripe/_discount.py +++ b/stripe/_discount.py @@ -66,6 +66,10 @@ class Discount(StripeObject): """ The subscription that this coupon is applied to, if it is applied to a particular subscription. """ + subscription_item: Optional[str] + """ + The subscription item that this coupon is applied to, if it is applied to a particular subscription item. + """ deleted: Optional[Literal[True]] """ Always true for a deleted object diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 716a04f92..62dfdd4f4 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -1043,7 +1043,7 @@ class CreateParams(RequestOptions): "Literal['']|List[Invoice.CreateParamsDiscount]" ] """ - The coupons to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts. + The coupons and promotion codes to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts. """ due_date: NotRequired[int] """ @@ -1145,11 +1145,11 @@ class CreateParamsAutomaticTaxLiability(TypedDict): class CreateParamsCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class CreateParamsDiscount(TypedDict): @@ -1161,6 +1161,10 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class CreateParamsFromInvoice(TypedDict): action: Literal["revision"] @@ -1838,11 +1842,11 @@ class ModifyParamsAutomaticTaxLiability(TypedDict): class ModifyParamsCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class ModifyParamsDiscount(TypedDict): @@ -1854,6 +1858,10 @@ class ModifyParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class ModifyParamsIssuer(TypedDict): account: NotRequired[str] @@ -2345,7 +2353,7 @@ class UpcomingLinesParams(RequestOptions): """ coupon: NotRequired[str] """ - The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ @@ -2365,7 +2373,7 @@ class UpcomingLinesParams(RequestOptions): "Literal['']|List[Invoice.UpcomingLinesParamsDiscount]" ] """ - The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. + The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ ending_before: NotRequired[str] """ @@ -2821,6 +2829,12 @@ class UpcomingLinesParamsSubscriptionItem(TypedDict): """ A flag that, if set to `true`, will delete the specified item. """ + discounts: NotRequired[ + "Literal['']|List[Invoice.UpcomingLinesParamsSubscriptionItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ id: NotRequired[str] """ Subscription item to update. @@ -2858,6 +2872,20 @@ class UpcomingLinesParamsSubscriptionItemBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class UpcomingLinesParamsSubscriptionItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class UpcomingLinesParamsSubscriptionItemPriceData(TypedDict): currency: str """ @@ -2903,7 +2931,7 @@ class UpcomingParams(RequestOptions): """ coupon: NotRequired[str] """ - The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ @@ -2921,7 +2949,7 @@ class UpcomingParams(RequestOptions): "Literal['']|List[Invoice.UpcomingParamsDiscount]" ] """ - The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. + The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ expand: NotRequired[List[str]] """ @@ -3359,6 +3387,12 @@ class UpcomingParamsSubscriptionItem(TypedDict): """ A flag that, if set to `true`, will delete the specified item. """ + discounts: NotRequired[ + "Literal['']|List[Invoice.UpcomingParamsSubscriptionItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ id: NotRequired[str] """ Subscription item to update. @@ -3396,6 +3430,20 @@ class UpcomingParamsSubscriptionItemBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class UpcomingParamsSubscriptionItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class UpcomingParamsSubscriptionItemPriceData(TypedDict): currency: str """ @@ -3589,7 +3637,7 @@ class VoidInvoiceParams(RequestOptions): """ Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. """ - discounts: Optional[List[ExpandableField["Discount"]]] + discounts: List[ExpandableField["Discount"]] """ The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. """ @@ -4479,7 +4527,7 @@ def upcoming(cls, **params: Unpack["Invoice.UpcomingParams"]) -> "Invoice": Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date on the upcoming invoice resource. + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date value passed in the request. """ return cast( "Invoice", @@ -4499,7 +4547,7 @@ async def upcoming_async( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date on the upcoming invoice resource. + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date value passed in the request. """ return cast( "Invoice", diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index 869e9e793..1155d1aa3 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -86,7 +86,7 @@ class CreateParams(RequestOptions): "Literal['']|List[InvoiceItem.CreateParamsDiscount]" ] """ - The coupons to redeem into discounts for the invoice item or invoice line item. + The coupons and promotion codes to redeem into discounts for the invoice item or invoice line item. """ expand: NotRequired[List[str]] """ @@ -152,6 +152,10 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class CreateParamsPeriod(TypedDict): end: int @@ -259,7 +263,7 @@ class ModifyParams(RequestOptions): "Literal['']|List[InvoiceItem.ModifyParamsDiscount]" ] """ - The coupons & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + The coupons, promotion codes & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ expand: NotRequired[List[str]] """ @@ -317,6 +321,10 @@ class ModifyParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class ModifyParamsPeriod(TypedDict): end: int diff --git a/stripe/_invoice_item_service.py b/stripe/_invoice_item_service.py index 2918a24aa..07631cfb9 100644 --- a/stripe/_invoice_item_service.py +++ b/stripe/_invoice_item_service.py @@ -35,7 +35,7 @@ class CreateParams(TypedDict): "Literal['']|List[InvoiceItemService.CreateParamsDiscount]" ] """ - The coupons to redeem into discounts for the invoice item or invoice line item. + The coupons and promotion codes to redeem into discounts for the invoice item or invoice line item. """ expand: NotRequired[List[str]] """ @@ -101,6 +101,10 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class CreateParamsPeriod(TypedDict): end: int @@ -214,7 +218,7 @@ class UpdateParams(TypedDict): "Literal['']|List[InvoiceItemService.UpdateParamsDiscount]" ] """ - The coupons & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + The coupons, promotion codes & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ expand: NotRequired[List[str]] """ @@ -272,6 +276,10 @@ class UpdateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class UpdateParamsPeriod(TypedDict): end: int diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 7a589d05c..405c55f99 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -121,7 +121,7 @@ class ModifyParams(RequestOptions): "Literal['']|List[InvoiceLineItem.ModifyParamsDiscount]" ] """ - The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ expand: NotRequired[List[str]] """ @@ -167,6 +167,10 @@ class ModifyParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class ModifyParamsPeriod(TypedDict): end: int @@ -320,7 +324,7 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): """ If true, discounts will apply to this line item. Always false for prorations. """ - discounts: Optional[List[ExpandableField["Discount"]]] + discounts: List[ExpandableField["Discount"]] """ The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. """ diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index 3d864fa7d..b7ba96e57 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -45,7 +45,7 @@ class UpdateParams(TypedDict): "Literal['']|List[InvoiceLineItemService.UpdateParamsDiscount]" ] """ - The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ expand: NotRequired[List[str]] """ @@ -91,6 +91,10 @@ class UpdateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class UpdateParamsPeriod(TypedDict): end: int diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index d9e2c3b35..623cd0a74 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -79,7 +79,7 @@ class CreateParams(TypedDict): "Literal['']|List[InvoiceService.CreateParamsDiscount]" ] """ - The coupons to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts. + The coupons and promotion codes to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts. """ due_date: NotRequired[int] """ @@ -187,11 +187,11 @@ class CreateParamsAutomaticTaxLiability(TypedDict): class CreateParamsCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class CreateParamsDiscount(TypedDict): @@ -203,6 +203,10 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class CreateParamsFromInvoice(TypedDict): action: Literal["revision"] @@ -802,7 +806,7 @@ class UpcomingParams(TypedDict): """ coupon: NotRequired[str] """ - The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ @@ -822,7 +826,7 @@ class UpcomingParams(TypedDict): "Literal['']|List[InvoiceService.UpcomingParamsDiscount]" ] """ - The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. + The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ expand: NotRequired[List[str]] """ @@ -1266,6 +1270,12 @@ class UpcomingParamsSubscriptionItem(TypedDict): """ A flag that, if set to `true`, will delete the specified item. """ + discounts: NotRequired[ + "Literal['']|List[InvoiceService.UpcomingParamsSubscriptionItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ id: NotRequired[str] """ Subscription item to update. @@ -1303,6 +1313,20 @@ class UpcomingParamsSubscriptionItemBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class UpcomingParamsSubscriptionItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class UpcomingParamsSubscriptionItemPriceData(TypedDict): currency: str """ @@ -1492,11 +1516,11 @@ class UpdateParamsAutomaticTaxLiability(TypedDict): class UpdateParamsCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class UpdateParamsDiscount(TypedDict): @@ -1508,6 +1532,10 @@ class UpdateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class UpdateParamsIssuer(TypedDict): account: NotRequired[str] @@ -2208,7 +2236,7 @@ def upcoming( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date on the upcoming invoice resource. + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date value passed in the request. """ return cast( Invoice, @@ -2232,7 +2260,7 @@ async def upcoming_async( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date on the upcoming invoice resource. + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date value passed in the request. """ return cast( Invoice, diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index e9bc6a0bf..a6d964731 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -18,7 +18,7 @@ class ListParams(TypedDict): """ coupon: NotRequired[str] """ - The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ @@ -38,7 +38,7 @@ class ListParams(TypedDict): "Literal['']|List[InvoiceUpcomingLinesService.ListParamsDiscount]" ] """ - The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. + The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ ending_before: NotRequired[str] """ @@ -498,6 +498,12 @@ class ListParamsSubscriptionItem(TypedDict): """ A flag that, if set to `true`, will delete the specified item. """ + discounts: NotRequired[ + "Literal['']|List[InvoiceUpcomingLinesService.ListParamsSubscriptionItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ id: NotRequired[str] """ Subscription item to update. @@ -535,6 +541,20 @@ class ListParamsSubscriptionItemBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class ListParamsSubscriptionItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class ListParamsSubscriptionItemPriceData(TypedDict): currency: str """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 34440ea37..2abb98dbe 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -777,28 +777,28 @@ class RedirectToUrl(StripeObject): class SwishHandleRedirectOrDisplayQrCode(StripeObject): class QrCode(StripeObject): - data: Optional[str] + data: str """ The raw data string used to generate QR code, it should be used together with QR code library. """ - image_url_png: Optional[str] + image_url_png: str """ The image_url_png string used to render QR code """ - image_url_svg: Optional[str] + image_url_svg: str """ The image_url_svg string used to render QR code """ - hosted_instructions_url: Optional[str] + hosted_instructions_url: str """ The URL to the hosted Swish instructions page, which allows customers to view the QR code. """ - mobile_auth_url: Optional[str] + mobile_auth_url: str """ The url for mobile redirect based auth (for internal use only and not typically available in standard API requests). """ - qr_code: Optional[QrCode] + qr_code: QrCode _inner_class_types = {"qr_code": QrCode} class VerifyWithMicrodeposits(StripeObject): diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index b8d0ae6f2..8e1e1e132 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -1104,11 +1104,11 @@ class CreateParamsInvoiceCreationInvoiceData(TypedDict): class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class CreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): @@ -1914,11 +1914,11 @@ class ModifyParamsInvoiceCreationInvoiceData(TypedDict): class ModifyParamsInvoiceCreationInvoiceDataCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class ModifyParamsInvoiceCreationInvoiceDataIssuer(TypedDict): diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index cfcea8d8c..924ba0d28 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -458,11 +458,11 @@ class CreateParamsInvoiceCreationInvoiceData(TypedDict): class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class CreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): @@ -1268,11 +1268,11 @@ class UpdateParamsInvoiceCreationInvoiceData(TypedDict): class UpdateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class UpdateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 7bc9677d5..f8fc6707a 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -785,6 +785,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Zip(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 IdBankTransfer(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -1078,6 +1100,10 @@ class CreateParams(RequestOptions): """ WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. """ + zip: NotRequired["PaymentMethodConfiguration.CreateParamsZip"] + """ + Zip gives your customers a way to split purchases over a series of payments. Check this [page](https://stripe.com/docs/payments/zip) for more details like country availability. + """ class CreateParamsAcssDebit(TypedDict): display_preference: NotRequired[ @@ -1569,6 +1595,20 @@ class CreateParamsWechatPayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsZip(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsZipDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsZipDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ListParams(RequestOptions): application: NotRequired["Literal['']|str"] """ @@ -1762,6 +1802,10 @@ class ModifyParams(RequestOptions): """ WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. """ + zip: NotRequired["PaymentMethodConfiguration.ModifyParamsZip"] + """ + Zip gives your customers a way to split purchases over a series of payments. Check this [page](https://stripe.com/docs/payments/zip) for more details like country availability. + """ class ModifyParamsAcssDebit(TypedDict): display_preference: NotRequired[ @@ -2253,6 +2297,20 @@ class ModifyParamsWechatPayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsZip(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsZipDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsZipDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -2325,6 +2383,7 @@ class RetrieveParams(RequestOptions): sofort: Optional[Sofort] us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] + zip: Optional[Zip] id_bank_transfer: Optional[IdBankTransfer] multibanco: Optional[Multibanco] netbanking: Optional[Netbanking] @@ -2504,6 +2563,7 @@ async def retrieve_async( "sofort": Sofort, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, + "zip": Zip, "id_bank_transfer": IdBankTransfer, "multibanco": Multibanco, "netbanking": Netbanking, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index e23604a23..ca855f523 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -217,6 +217,10 @@ class CreateParams(TypedDict): """ WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. """ + zip: NotRequired["PaymentMethodConfigurationService.CreateParamsZip"] + """ + Zip gives your customers a way to split purchases over a series of payments. Check this [page](https://stripe.com/docs/payments/zip) for more details like country availability. + """ class CreateParamsAcssDebit(TypedDict): display_preference: NotRequired[ @@ -708,6 +712,20 @@ class CreateParamsWechatPayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsZip(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsZipDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsZipDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ListParams(TypedDict): application: NotRequired["Literal['']|str"] """ @@ -931,6 +949,10 @@ class UpdateParams(TypedDict): """ WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. """ + zip: NotRequired["PaymentMethodConfigurationService.UpdateParamsZip"] + """ + Zip gives your customers a way to split purchases over a series of payments. Check this [page](https://stripe.com/docs/payments/zip) for more details like country availability. + """ class UpdateParamsAcssDebit(TypedDict): display_preference: NotRequired[ @@ -1422,6 +1444,20 @@ class UpdateParamsWechatPayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsZip(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsZipDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsZipDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + def list( self, params: "PaymentMethodConfigurationService.ListParams" = {}, diff --git a/stripe/_quote.py b/stripe/_quote.py index 4ed8427b4..7f82ad662 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -548,6 +548,10 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class CreateParamsFromQuote(TypedDict): is_revision: NotRequired[bool] @@ -580,6 +584,12 @@ class CreateParamsInvoiceSettingsIssuer(TypedDict): """ class CreateParamsLineItem(TypedDict): + discounts: NotRequired[ + "Literal['']|List[Quote.CreateParamsLineItemDiscount]" + ] + """ + The discounts applied to this line item. + """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. @@ -597,6 +607,20 @@ class CreateParamsLineItem(TypedDict): The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. """ + class CreateParamsLineItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsLineItemPriceData(TypedDict): currency: str """ @@ -852,6 +876,10 @@ class ModifyParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class ModifyParamsInvoiceSettings(TypedDict): days_until_due: NotRequired[int] @@ -874,6 +902,12 @@ class ModifyParamsInvoiceSettingsIssuer(TypedDict): """ class ModifyParamsLineItem(TypedDict): + discounts: NotRequired[ + "Literal['']|List[Quote.ModifyParamsLineItemDiscount]" + ] + """ + The discounts applied to this line item. + """ id: NotRequired[str] """ The ID of an existing line item on the quote. @@ -895,6 +929,20 @@ class ModifyParamsLineItem(TypedDict): The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. """ + class ModifyParamsLineItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class ModifyParamsLineItemPriceData(TypedDict): currency: str """ diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 504d6feb1..d1e256ebf 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -158,6 +158,10 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class CreateParamsFromQuote(TypedDict): is_revision: NotRequired[bool] @@ -190,6 +194,12 @@ class CreateParamsInvoiceSettingsIssuer(TypedDict): """ class CreateParamsLineItem(TypedDict): + discounts: NotRequired[ + "Literal['']|List[QuoteService.CreateParamsLineItemDiscount]" + ] + """ + The discounts applied to this line item. + """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. @@ -207,6 +217,20 @@ class CreateParamsLineItem(TypedDict): The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. """ + class CreateParamsLineItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsLineItemPriceData(TypedDict): currency: str """ @@ -448,6 +472,10 @@ class UpdateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ class UpdateParamsInvoiceSettings(TypedDict): days_until_due: NotRequired[int] @@ -470,6 +498,12 @@ class UpdateParamsInvoiceSettingsIssuer(TypedDict): """ class UpdateParamsLineItem(TypedDict): + discounts: NotRequired[ + "Literal['']|List[QuoteService.UpdateParamsLineItemDiscount]" + ] + """ + The discounts applied to this line item. + """ id: NotRequired[str] """ The ID of an existing line item on the quote. @@ -491,6 +525,20 @@ class UpdateParamsLineItem(TypedDict): The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. """ + class UpdateParamsLineItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class UpdateParamsLineItemPriceData(TypedDict): currency: str """ diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 92e660154..72057e124 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -237,10 +237,21 @@ class GooglePay(StripeObject): } class CardPresent(StripeObject): + class Offline(StripeObject): + stored_at: Optional[int] + """ + Time at which the payment was collected while offline + """ + generated_card: Optional[ExpandableField["PaymentMethod"]] """ The ID of the Card PaymentMethod which was generated by this SetupAttempt. """ + offline: Optional[Offline] + """ + Details about payments collected offline. + """ + _inner_class_types = {"offline": Offline} class Cashapp(StripeObject): pass diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 5c55d7c07..673861f37 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -527,6 +527,9 @@ class MandateOptions(StripeObject): """ _inner_class_types = {"mandate_options": MandateOptions} + class CardPresent(StripeObject): + pass + class Link(StripeObject): persistent_token: Optional[str] """ @@ -591,6 +594,7 @@ class MandateOptions(StripeObject): acss_debit: Optional[AcssDebit] card: Optional[Card] + card_present: Optional[CardPresent] link: Optional[Link] paypal: Optional[Paypal] sepa_debit: Optional[SepaDebit] @@ -598,6 +602,7 @@ class MandateOptions(StripeObject): _inner_class_types = { "acss_debit": AcssDebit, "card": Card, + "card_present": CardPresent, "link": Link, "paypal": Paypal, "sepa_debit": SepaDebit, @@ -1280,6 +1285,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ Configuration for any card setup attempted on this SetupIntent. """ + card_present: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsCardPresent" + ] + """ + If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. + """ link: NotRequired["SetupIntent.ConfirmParamsPaymentMethodOptionsLink"] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. @@ -1434,6 +1445,9 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): Specifies the type of mandates supported. Possible values are `india`. """ + class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): + pass + class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] @@ -2326,6 +2340,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ Configuration for any card setup attempted on this SetupIntent. """ + card_present: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsCardPresent" + ] + """ + If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. + """ link: NotRequired["SetupIntent.CreateParamsPaymentMethodOptionsLink"] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. @@ -2480,6 +2500,9 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): Specifies the type of mandates supported. Possible values are `india`. """ + class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): + pass + class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] @@ -3341,6 +3364,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ Configuration for any card setup attempted on this SetupIntent. """ + card_present: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsCardPresent" + ] + """ + If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. + """ link: NotRequired["SetupIntent.ModifyParamsPaymentMethodOptionsLink"] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. @@ -3495,6 +3524,9 @@ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): Specifies the type of mandates supported. Possible values are `india`. """ + class ModifyParamsPaymentMethodOptionsCardPresent(TypedDict): + pass + class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index a6724ff5f..a1ea273f5 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -724,6 +724,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ Configuration for any card setup attempted on this SetupIntent. """ + card_present: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodOptionsCardPresent" + ] + """ + If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. + """ link: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsLink" ] @@ -880,6 +886,9 @@ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): Specifies the type of mandates supported. Possible values are `india`. """ + class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): + pass + class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] @@ -1800,6 +1809,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ Configuration for any card setup attempted on this SetupIntent. """ + card_present: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodOptionsCardPresent" + ] + """ + If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. + """ link: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsLink" ] @@ -1956,6 +1971,9 @@ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): Specifies the type of mandates supported. Possible values are `india`. """ + class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): + pass + class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] @@ -2855,6 +2873,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ Configuration for any card setup attempted on this SetupIntent. """ + card_present: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodOptionsCardPresent" + ] + """ + If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. + """ link: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsLink" ] @@ -3011,6 +3035,9 @@ class UpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): Specifies the type of mandates supported. Possible values are `india`. """ + class UpdateParamsPaymentMethodOptionsCardPresent(TypedDict): + pass + class UpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] diff --git a/stripe/_subscription.py b/stripe/_subscription.py index eb4f5801e..fa50d9b7a 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -503,7 +503,7 @@ class CreateParams(RequestOptions): """ coupon: NotRequired[str] """ - The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. + The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ @@ -533,6 +533,12 @@ class CreateParams(RequestOptions): """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ + discounts: NotRequired[ + "Literal['']|List[Subscription.CreateParamsDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -594,7 +600,7 @@ class CreateParams(RequestOptions): """ promotion_code: NotRequired[str] """ - The API ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. + The ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] @@ -624,6 +630,12 @@ class CreateParams(RequestOptions): """ class CreateParamsAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List["Subscription.CreateParamsAddInvoiceItemDiscount"] + ] + """ + The coupons to redeem into discounts for the item. + """ price: NotRequired[str] """ The ID of the price object. @@ -643,6 +655,20 @@ class CreateParamsAddInvoiceItem(TypedDict): The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ + class CreateParamsAddInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -721,6 +747,20 @@ class CreateParamsBillingThresholds(TypedDict): Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ + class CreateParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -748,6 +788,12 @@ class CreateParamsItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ + discounts: NotRequired[ + "Literal['']|List[Subscription.CreateParamsItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. @@ -779,6 +825,20 @@ class CreateParamsItemBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class CreateParamsItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsItemPriceData(TypedDict): currency: str """ @@ -1246,7 +1306,7 @@ class ModifyParams(RequestOptions): """ coupon: NotRequired[str] """ - The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. + The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ days_until_due: NotRequired[int] """ @@ -1268,6 +1328,12 @@ class ModifyParams(RequestOptions): """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ + discounts: NotRequired[ + "Literal['']|List[Subscription.ModifyParamsDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -1363,6 +1429,12 @@ class ModifyParams(RequestOptions): """ class ModifyParamsAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List["Subscription.ModifyParamsAddInvoiceItemDiscount"] + ] + """ + The coupons to redeem into discounts for the item. + """ price: NotRequired[str] """ The ID of the price object. @@ -1382,6 +1454,20 @@ class ModifyParamsAddInvoiceItem(TypedDict): The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ + class ModifyParamsAddInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class ModifyParamsAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -1450,6 +1536,20 @@ class ModifyParamsCancellationDetails(TypedDict): The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. """ + class ModifyParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class ModifyParamsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -1485,6 +1585,12 @@ class ModifyParamsItem(TypedDict): """ A flag that, if set to `true`, will delete the specified item. """ + discounts: NotRequired[ + "Literal['']|List[Subscription.ModifyParamsItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ id: NotRequired[str] """ Subscription item to update. @@ -1520,6 +1626,20 @@ class ModifyParamsItemBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class ModifyParamsItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class ModifyParamsItemPriceData(TypedDict): currency: str """ @@ -1947,7 +2067,11 @@ class SearchParams(RequestOptions): """ discount: Optional["Discount"] """ - Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. + Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + """ + discounts: List[ExpandableField["Discount"]] + """ + The discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. """ ended_at: Optional[int] """ diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index 81c246aea..5dd7abec8 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -2,6 +2,7 @@ # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource +from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods @@ -19,6 +20,7 @@ ) if TYPE_CHECKING: + from stripe._discount import Discount from stripe._plan import Plan from stripe._price import Price from stripe._tax_rate import TaxRate @@ -54,6 +56,12 @@ class CreateParams(RequestOptions): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionItem.CreateParamsDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -120,6 +128,20 @@ class CreateParamsBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class CreateParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsPriceData(TypedDict): currency: str """ @@ -239,6 +261,12 @@ class ModifyParams(RequestOptions): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionItem.ModifyParamsDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -305,6 +333,20 @@ class ModifyParamsBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class ModifyParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class ModifyParamsPriceData(TypedDict): currency: str """ @@ -357,6 +399,10 @@ class RetrieveParams(RequestOptions): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + discounts: List[ExpandableField["Discount"]] + """ + The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + """ id: str """ Unique identifier for the object. diff --git a/stripe/_subscription_item_service.py b/stripe/_subscription_item_service.py index 7371dd70a..2e591da78 100644 --- a/stripe/_subscription_item_service.py +++ b/stripe/_subscription_item_service.py @@ -34,6 +34,12 @@ class CreateParams(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionItemService.CreateParamsDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -102,6 +108,20 @@ class CreateParamsBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class CreateParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsPriceData(TypedDict): currency: str """ @@ -191,6 +211,12 @@ class UpdateParams(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionItemService.UpdateParamsDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -259,6 +285,20 @@ class UpdateParamsBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class UpdateParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class UpdateParamsPriceData(TypedDict): currency: str """ diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index 19f34a873..f5a2f1e95 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -22,9 +22,11 @@ from stripe._application import Application from stripe._coupon import Coupon from stripe._customer import Customer + from stripe._discount import Discount as DiscountResource from stripe._payment_method import PaymentMethod from stripe._plan import Plan from stripe._price import Price + from stripe._promotion_code import PromotionCode from stripe._subscription import Subscription from stripe._tax_id import TaxId from stripe._tax_rate import TaxRate @@ -165,6 +167,24 @@ class TransferData(StripeObject): class Phase(StripeObject): class AddInvoiceItem(StripeObject): + class Discount(StripeObject): + coupon: Optional[ExpandableField["Coupon"]] + """ + ID of the coupon to create a new discount for. + """ + discount: Optional[ExpandableField["DiscountResource"]] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + ID of the promotion code to create a new discount for. + """ + + discounts: List[Discount] + """ + The stackable discounts that will be applied to the item. + """ price: ExpandableField["Price"] """ ID of the price used to generate the invoice item. @@ -177,6 +197,7 @@ class AddInvoiceItem(StripeObject): """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ + _inner_class_types = {"discounts": Discount} class AutomaticTax(StripeObject): class Liability(StripeObject): @@ -209,6 +230,20 @@ class BillingThresholds(StripeObject): Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. """ + class Discount(StripeObject): + coupon: Optional[ExpandableField["Coupon"]] + """ + ID of the coupon to create a new discount for. + """ + discount: Optional[ExpandableField["DiscountResource"]] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + ID of the promotion code to create a new discount for. + """ + class InvoiceSettings(StripeObject): class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] @@ -241,10 +276,28 @@ class BillingThresholds(StripeObject): Usage threshold that triggers the subscription to create an invoice """ + class Discount(StripeObject): + coupon: Optional[ExpandableField["Coupon"]] + """ + ID of the coupon to create a new discount for. + """ + discount: Optional[ExpandableField["DiscountResource"]] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + ID of the promotion code to create a new discount for. + """ + billing_thresholds: Optional[BillingThresholds] """ Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period """ + discounts: List[Discount] + """ + The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. @@ -265,7 +318,10 @@ class BillingThresholds(StripeObject): """ The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. """ - _inner_class_types = {"billing_thresholds": BillingThresholds} + _inner_class_types = { + "billing_thresholds": BillingThresholds, + "discounts": Discount, + } class TransferData(StripeObject): amount_percent: Optional[float] @@ -320,6 +376,10 @@ class TransferData(StripeObject): """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ + discounts: List[Discount] + """ + The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts. + """ end_date: int """ The end of this phase of the subscription schedule. @@ -362,6 +422,7 @@ class TransferData(StripeObject): "add_invoice_items": AddInvoiceItem, "automatic_tax": AutomaticTax, "billing_thresholds": BillingThresholds, + "discounts": Discount, "invoice_settings": InvoiceSettings, "items": Item, "transfer_data": TransferData, @@ -574,7 +635,7 @@ class CreateParamsPhase(TypedDict): """ coupon: NotRequired[str] """ - The identifier of the coupon to apply to this phase of the subscription schedule. + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ @@ -592,6 +653,12 @@ class CreateParamsPhase(TypedDict): """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionSchedule.CreateParamsPhaseDiscount]" + ] + """ + The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + """ end_date: NotRequired[int] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. @@ -640,6 +707,14 @@ class CreateParamsPhase(TypedDict): """ class CreateParamsPhaseAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List[ + "SubscriptionSchedule.CreateParamsPhaseAddInvoiceItemDiscount" + ] + ] + """ + The coupons to redeem into discounts for the item. + """ price: NotRequired[str] """ The ID of the price object. @@ -659,6 +734,20 @@ class CreateParamsPhaseAddInvoiceItem(TypedDict): The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ + class CreateParamsPhaseAddInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsPhaseAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -715,6 +804,20 @@ class CreateParamsPhaseBillingThresholds(TypedDict): Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ + class CreateParamsPhaseDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -748,6 +851,12 @@ class CreateParamsPhaseItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionSchedule.CreateParamsPhaseItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. @@ -781,6 +890,20 @@ class CreateParamsPhaseItemBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class CreateParamsPhaseItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsPhaseItemPriceData(TypedDict): currency: str """ @@ -1136,7 +1259,7 @@ class ModifyParamsPhase(TypedDict): """ coupon: NotRequired[str] """ - The identifier of the coupon to apply to this phase of the subscription schedule. + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ @@ -1154,6 +1277,12 @@ class ModifyParamsPhase(TypedDict): """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionSchedule.ModifyParamsPhaseDiscount]" + ] + """ + The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + """ end_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. @@ -1206,6 +1335,14 @@ class ModifyParamsPhase(TypedDict): """ class ModifyParamsPhaseAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List[ + "SubscriptionSchedule.ModifyParamsPhaseAddInvoiceItemDiscount" + ] + ] + """ + The coupons to redeem into discounts for the item. + """ price: NotRequired[str] """ The ID of the price object. @@ -1225,6 +1362,20 @@ class ModifyParamsPhaseAddInvoiceItem(TypedDict): The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ + class ModifyParamsPhaseAddInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class ModifyParamsPhaseAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -1281,6 +1432,20 @@ class ModifyParamsPhaseBillingThresholds(TypedDict): Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ + class ModifyParamsPhaseDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class ModifyParamsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -1314,6 +1479,12 @@ class ModifyParamsPhaseItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionSchedule.ModifyParamsPhaseItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. @@ -1347,6 +1518,20 @@ class ModifyParamsPhaseItemBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class ModifyParamsPhaseItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class ModifyParamsPhaseItemPriceData(TypedDict): currency: str """ diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index 5921d68a3..ca63af91f 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -219,7 +219,7 @@ class CreateParamsPhase(TypedDict): """ coupon: NotRequired[str] """ - The identifier of the coupon to apply to this phase of the subscription schedule. + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ @@ -237,6 +237,12 @@ class CreateParamsPhase(TypedDict): """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionScheduleService.CreateParamsPhaseDiscount]" + ] + """ + The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + """ end_date: NotRequired[int] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. @@ -285,6 +291,14 @@ class CreateParamsPhase(TypedDict): """ class CreateParamsPhaseAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List[ + "SubscriptionScheduleService.CreateParamsPhaseAddInvoiceItemDiscount" + ] + ] + """ + The coupons to redeem into discounts for the item. + """ price: NotRequired[str] """ The ID of the price object. @@ -304,6 +318,20 @@ class CreateParamsPhaseAddInvoiceItem(TypedDict): The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ + class CreateParamsPhaseAddInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsPhaseAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -360,6 +388,20 @@ class CreateParamsPhaseBillingThresholds(TypedDict): Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ + class CreateParamsPhaseDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -393,6 +435,12 @@ class CreateParamsPhaseItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionScheduleService.CreateParamsPhaseItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. @@ -426,6 +474,20 @@ class CreateParamsPhaseItemBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class CreateParamsPhaseItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsPhaseItemPriceData(TypedDict): currency: str """ @@ -801,7 +863,7 @@ class UpdateParamsPhase(TypedDict): """ coupon: NotRequired[str] """ - The identifier of the coupon to apply to this phase of the subscription schedule. + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ @@ -819,6 +881,12 @@ class UpdateParamsPhase(TypedDict): """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionScheduleService.UpdateParamsPhaseDiscount]" + ] + """ + The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + """ end_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. @@ -871,6 +939,14 @@ class UpdateParamsPhase(TypedDict): """ class UpdateParamsPhaseAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List[ + "SubscriptionScheduleService.UpdateParamsPhaseAddInvoiceItemDiscount" + ] + ] + """ + The coupons to redeem into discounts for the item. + """ price: NotRequired[str] """ The ID of the price object. @@ -890,6 +966,20 @@ class UpdateParamsPhaseAddInvoiceItem(TypedDict): The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ + class UpdateParamsPhaseAddInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class UpdateParamsPhaseAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -946,6 +1036,20 @@ class UpdateParamsPhaseBillingThresholds(TypedDict): Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ + class UpdateParamsPhaseDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class UpdateParamsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -979,6 +1083,12 @@ class UpdateParamsPhaseItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionScheduleService.UpdateParamsPhaseItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. @@ -1012,6 +1122,20 @@ class UpdateParamsPhaseItemBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class UpdateParamsPhaseItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class UpdateParamsPhaseItemPriceData(TypedDict): currency: str """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 4bb559fab..36d33712d 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -97,7 +97,7 @@ class CreateParams(TypedDict): """ coupon: NotRequired[str] """ - The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. + The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ @@ -127,6 +127,12 @@ class CreateParams(TypedDict): """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionService.CreateParamsDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -188,7 +194,7 @@ class CreateParams(TypedDict): """ promotion_code: NotRequired[str] """ - The API ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. + The ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] @@ -222,6 +228,12 @@ class CreateParams(TypedDict): """ class CreateParamsAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List["SubscriptionService.CreateParamsAddInvoiceItemDiscount"] + ] + """ + The coupons to redeem into discounts for the item. + """ price: NotRequired[str] """ The ID of the price object. @@ -241,6 +253,20 @@ class CreateParamsAddInvoiceItem(TypedDict): The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ + class CreateParamsAddInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -319,6 +345,20 @@ class CreateParamsBillingThresholds(TypedDict): Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ + class CreateParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -348,6 +388,12 @@ class CreateParamsItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionService.CreateParamsItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. @@ -381,6 +427,20 @@ class CreateParamsItemBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class CreateParamsItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class CreateParamsItemPriceData(TypedDict): currency: str """ @@ -896,7 +956,7 @@ class UpdateParams(TypedDict): """ coupon: NotRequired[str] """ - The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. + The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ days_until_due: NotRequired[int] """ @@ -918,6 +978,12 @@ class UpdateParams(TypedDict): """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionService.UpdateParamsDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -1015,6 +1081,12 @@ class UpdateParams(TypedDict): """ class UpdateParamsAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List["SubscriptionService.UpdateParamsAddInvoiceItemDiscount"] + ] + """ + The coupons to redeem into discounts for the item. + """ price: NotRequired[str] """ The ID of the price object. @@ -1034,6 +1106,20 @@ class UpdateParamsAddInvoiceItem(TypedDict): The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ + class UpdateParamsAddInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class UpdateParamsAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -1102,6 +1188,20 @@ class UpdateParamsCancellationDetails(TypedDict): The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. """ + class UpdateParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class UpdateParamsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -1139,6 +1239,12 @@ class UpdateParamsItem(TypedDict): """ A flag that, if set to `true`, will delete the specified item. """ + discounts: NotRequired[ + "Literal['']|List[SubscriptionService.UpdateParamsItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ id: NotRequired[str] """ Subscription item to update. @@ -1176,6 +1282,20 @@ class UpdateParamsItemBillingThresholds(TypedDict): Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ + class UpdateParamsItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + class UpdateParamsItemPriceData(TypedDict): currency: str """ diff --git a/stripe/_token.py b/stripe/_token.py index 13c9c1244..030021238 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -93,7 +93,7 @@ class CreateParamsAccount(TypedDict): """ tos_shown_and_accepted: NotRequired[bool] """ - Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. + Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://docs.stripe.com/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. """ class CreateParamsAccountCompany(TypedDict): @@ -115,11 +115,11 @@ class CreateParamsAccountCompany(TypedDict): """ directors_provided: NotRequired[bool] """ - Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ - Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ @@ -143,7 +143,7 @@ class CreateParamsAccountCompany(TypedDict): """ owners_provided: NotRequired[bool] """ - Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "Token.CreateParamsAccountCompanyOwnershipDeclaration" @@ -167,7 +167,7 @@ class CreateParamsAccountCompany(TypedDict): "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ - The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. + The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ @@ -353,11 +353,11 @@ class CreateParamsAccountIndividual(TypedDict): """ id_number: NotRequired[str] """ - The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ @@ -751,11 +751,11 @@ class CreateParamsPerson(TypedDict): """ id_number: NotRequired[str] """ - The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 455ab070b..2348e62af 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -60,7 +60,7 @@ class CreateParamsAccount(TypedDict): """ tos_shown_and_accepted: NotRequired[bool] """ - Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. + Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://docs.stripe.com/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. """ class CreateParamsAccountCompany(TypedDict): @@ -82,11 +82,11 @@ class CreateParamsAccountCompany(TypedDict): """ directors_provided: NotRequired[bool] """ - Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ - Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ @@ -110,7 +110,7 @@ class CreateParamsAccountCompany(TypedDict): """ owners_provided: NotRequired[bool] """ - Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "TokenService.CreateParamsAccountCompanyOwnershipDeclaration" @@ -134,7 +134,7 @@ class CreateParamsAccountCompany(TypedDict): "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ - The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. + The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ @@ -324,11 +324,11 @@ class CreateParamsAccountIndividual(TypedDict): """ id_number: NotRequired[str] """ - The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ @@ -724,11 +724,11 @@ class CreateParamsPerson(TypedDict): """ id_number: NotRequired[str] """ - The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ diff --git a/stripe/billing/_meter_event.py b/stripe/billing/_meter_event.py index cba844046..4bc1e75d2 100644 --- a/stripe/billing/_meter_event.py +++ b/stripe/billing/_meter_event.py @@ -27,7 +27,7 @@ class CreateParams(RequestOptions): """ identifier: NotRequired[str] """ - A unique identifier for the event. If not provided, one will be generated. + A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period. """ payload: Dict[str, str] """ diff --git a/stripe/billing/_meter_event_service.py b/stripe/billing/_meter_event_service.py index ab1161a73..26400f9f1 100644 --- a/stripe/billing/_meter_event_service.py +++ b/stripe/billing/_meter_event_service.py @@ -19,7 +19,7 @@ class CreateParams(TypedDict): """ identifier: NotRequired[str] """ - A unique identifier for the event. If not provided, one will be generated. + A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period. """ payload: Dict[str, str] """ diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index 32f695c8c..82e402194 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -157,15 +157,15 @@ class Product(StripeObject): invoice_history: InvoiceHistory payment_method_update: PaymentMethodUpdate subscription_cancel: SubscriptionCancel - subscription_pause: SubscriptionPause subscription_update: SubscriptionUpdate + subscription_pause: SubscriptionPause _inner_class_types = { "customer_update": CustomerUpdate, "invoice_history": InvoiceHistory, "payment_method_update": PaymentMethodUpdate, "subscription_cancel": SubscriptionCancel, - "subscription_pause": SubscriptionPause, "subscription_update": SubscriptionUpdate, + "subscription_pause": SubscriptionPause, } class LoginPage(StripeObject): @@ -245,18 +245,18 @@ class CreateParamsFeatures(TypedDict): """ Information about canceling subscriptions in the portal. """ - subscription_pause: NotRequired[ - "Configuration.CreateParamsFeaturesSubscriptionPause" - ] - """ - Information about pausing subscriptions in the portal. - """ subscription_update: NotRequired[ "Configuration.CreateParamsFeaturesSubscriptionUpdate" ] """ Information about updating subscriptions in the portal. """ + subscription_pause: NotRequired[ + "Configuration.CreateParamsFeaturesSubscriptionPause" + ] + """ + Information about pausing subscriptions in the portal. + """ class CreateParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ @@ -329,7 +329,7 @@ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): """ class CreateParamsFeaturesSubscriptionPause(TypedDict): - enabled: NotRequired[bool] + enabled: bool """ Whether the feature is enabled. """ @@ -474,18 +474,18 @@ class ModifyParamsFeatures(TypedDict): """ Information about canceling subscriptions in the portal. """ - subscription_pause: NotRequired[ - "Configuration.ModifyParamsFeaturesSubscriptionPause" - ] - """ - Information about pausing subscriptions in the portal. - """ subscription_update: NotRequired[ "Configuration.ModifyParamsFeaturesSubscriptionUpdate" ] """ Information about updating subscriptions in the portal. """ + subscription_pause: NotRequired[ + "Configuration.ModifyParamsFeaturesSubscriptionPause" + ] + """ + Information about pausing subscriptions in the portal. + """ class ModifyParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ @@ -546,7 +546,7 @@ class ModifyParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): """ class ModifyParamsFeaturesSubscriptionPause(TypedDict): - enabled: NotRequired[bool] + enabled: bool """ Whether the feature is enabled. """ diff --git a/stripe/billing_portal/_configuration_service.py b/stripe/billing_portal/_configuration_service.py index 61ba49b22..caf7eaec0 100644 --- a/stripe/billing_portal/_configuration_service.py +++ b/stripe/billing_portal/_configuration_service.py @@ -75,18 +75,18 @@ class CreateParamsFeatures(TypedDict): """ Information about canceling subscriptions in the portal. """ - subscription_pause: NotRequired[ - "ConfigurationService.CreateParamsFeaturesSubscriptionPause" - ] - """ - Information about pausing subscriptions in the portal. - """ subscription_update: NotRequired[ "ConfigurationService.CreateParamsFeaturesSubscriptionUpdate" ] """ Information about updating subscriptions in the portal. """ + subscription_pause: NotRequired[ + "ConfigurationService.CreateParamsFeaturesSubscriptionPause" + ] + """ + Information about pausing subscriptions in the portal. + """ class CreateParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ @@ -159,7 +159,7 @@ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): """ class CreateParamsFeaturesSubscriptionPause(TypedDict): - enabled: NotRequired[bool] + enabled: bool """ Whether the feature is enabled. """ @@ -310,18 +310,18 @@ class UpdateParamsFeatures(TypedDict): """ Information about canceling subscriptions in the portal. """ - subscription_pause: NotRequired[ - "ConfigurationService.UpdateParamsFeaturesSubscriptionPause" - ] - """ - Information about pausing subscriptions in the portal. - """ subscription_update: NotRequired[ "ConfigurationService.UpdateParamsFeaturesSubscriptionUpdate" ] """ Information about updating subscriptions in the portal. """ + subscription_pause: NotRequired[ + "ConfigurationService.UpdateParamsFeaturesSubscriptionPause" + ] + """ + Information about pausing subscriptions in the portal. + """ class UpdateParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ @@ -382,7 +382,7 @@ class UpdateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): """ class UpdateParamsFeaturesSubscriptionPause(TypedDict): - enabled: NotRequired[bool] + enabled: bool """ Whether the feature is enabled. """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index eedc2add3..303f95b8d 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -2039,11 +2039,11 @@ class CreateParamsInvoiceCreationInvoiceData(TypedDict): class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class CreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): @@ -2918,7 +2918,7 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): """ class CreateParamsPaymentMethodOptionsSwish(TypedDict): - reference: NotRequired["Literal['']|str"] + reference: NotRequired[str] """ The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent. """ diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index d264045a5..996ee8f18 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -606,11 +606,11 @@ class CreateParamsInvoiceCreationInvoiceData(TypedDict): class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): name: str """ - The name of the custom field. This may be up to 30 characters. + The name of the custom field. This may be up to 40 characters. """ value: str """ - The value of the custom field. This may be up to 30 characters. + The value of the custom field. This may be up to 140 characters. """ class CreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): @@ -1519,7 +1519,7 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): """ class CreateParamsPaymentMethodOptionsSwish(TypedDict): - reference: NotRequired["Literal['']|str"] + reference: NotRequired[str] """ The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent. """ diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index acec47b98..0bbf39b37 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -168,6 +168,35 @@ class IssuedDate(StripeObject): "issued_date": IssuedDate, } + class Email(StripeObject): + class Error(StripeObject): + code: Optional[ + Literal[ + "email_unverified_other", "email_verification_declined" + ] + ] + """ + A short machine-readable string giving the reason for the verification failure. + """ + reason: Optional[str] + """ + A human-readable message giving the reason for the failure. These messages can be shown to your users. + """ + + email: Optional[str] + """ + Email to be verified. + """ + error: Optional[Error] + """ + Details on the verification error. Present when status is `unverified`. + """ + status: Literal["unverified", "verified"] + """ + Status of this `email` check. + """ + _inner_class_types = {"error": Error} + class IdNumber(StripeObject): class Dob(StripeObject): day: Optional[int] @@ -257,6 +286,35 @@ class IdNumber(StripeObject): id_number: Optional[IdNumber] _inner_class_types = {"document": Document, "id_number": IdNumber} + class Phone(StripeObject): + class Error(StripeObject): + code: Optional[ + Literal[ + "phone_unverified_other", "phone_verification_declined" + ] + ] + """ + A short machine-readable string giving the reason for the verification failure. + """ + reason: Optional[str] + """ + A human-readable message giving the reason for the failure. These messages can be shown to your users. + """ + + error: Optional[Error] + """ + Details on the verification error. Present when status is `unverified`. + """ + phone: Optional[str] + """ + Phone to be verified. + """ + status: Literal["unverified", "verified"] + """ + Status of this `phone` check. + """ + _inner_class_types = {"error": Error} + class Selfie(StripeObject): class Error(StripeObject): code: Optional[ @@ -363,6 +421,10 @@ class RetrieveParams(RequestOptions): """ Result from a document check """ + email: Optional[Email] + """ + Result from a email check + """ id: str """ Unique identifier for the object. @@ -380,14 +442,22 @@ class RetrieveParams(RequestOptions): String representing the object's type. Objects of the same type share the same value. """ options: Optional[Options] + phone: Optional[Phone] + """ + Result from a phone check + """ selfie: Optional[Selfie] """ Result from a selfie check """ - type: Literal["document", "id_number"] + type: Literal["document", "id_number", "verification_flow"] """ Type of report. """ + verification_flow: Optional[str] + """ + The configuration token of a Verification Flow from the dashboard. + """ verification_session: Optional[str] """ ID of the VerificationSession that created this report. @@ -459,7 +529,9 @@ async def retrieve_async( _inner_class_types = { "document": Document, + "email": Email, "id_number": IdNumber, "options": Options, + "phone": Phone, "selfie": Selfie, } diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 03d409ac1..85e8fca6a 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -54,9 +54,13 @@ class LastError(StripeObject): "document_expired", "document_type_not_supported", "document_unverified_other", + "email_unverified_other", + "email_verification_declined", "id_number_insufficient_document_data", "id_number_mismatch", "id_number_unverified_other", + "phone_unverified_other", + "phone_verification_declined", "selfie_document_missing_photo", "selfie_face_mismatch", "selfie_manipulated", @@ -93,12 +97,41 @@ class Document(StripeObject): Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ + class Email(StripeObject): + require_verification: Optional[bool] + """ + Request one time password verification of `provided_details.email`. + """ + class IdNumber(StripeObject): pass + class Phone(StripeObject): + require_verification: Optional[bool] + """ + Request one time password verification of `provided_details.phone`. + """ + document: Optional[Document] + email: Optional[Email] id_number: Optional[IdNumber] - _inner_class_types = {"document": Document, "id_number": IdNumber} + phone: Optional[Phone] + _inner_class_types = { + "document": Document, + "email": Email, + "id_number": IdNumber, + "phone": Phone, + } + + class ProvidedDetails(StripeObject): + email: Optional[str] + """ + Email of user being verified + """ + phone: Optional[str] + """ + Phone number of user being verified + """ class Redaction(StripeObject): status: Literal["processing", "redacted"] @@ -155,6 +188,10 @@ class Dob(StripeObject): """ The user's verified date of birth. """ + email: Optional[str] + """ + The user's verified email address + """ first_name: Optional[str] """ The user's verified first name. @@ -171,6 +208,10 @@ class Dob(StripeObject): """ The user's verified last name. """ + phone: Optional[str] + """ + The user's verified phone number + """ _inner_class_types = {"address": Address, "dob": Dob} class CancelParams(RequestOptions): @@ -196,14 +237,24 @@ class CreateParams(RequestOptions): """ A set of options for the session's verification checks. """ + provided_details: NotRequired[ + "VerificationSession.CreateParamsProvidedDetails" + ] + """ + Details provided about the user being verified. These details may be shown to the user. + """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. """ - type: Literal["document", "id_number"] + type: NotRequired[Literal["document", "id_number"]] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. """ + verification_flow: NotRequired[str] + """ + The ID of a Verification Flow from the Dashboard. + """ class CreateParamsOptions(TypedDict): document: NotRequired[ @@ -212,6 +263,18 @@ class CreateParamsOptions(TypedDict): """ Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). """ + email: NotRequired[ + "Literal['']|VerificationSession.CreateParamsOptionsEmail" + ] + """ + Options that apply to the email check. + """ + phone: NotRequired[ + "Literal['']|VerificationSession.CreateParamsOptionsPhone" + ] + """ + Options that apply to the phone check. + """ class CreateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ @@ -233,6 +296,28 @@ class CreateParamsOptionsDocument(TypedDict): Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ + class CreateParamsOptionsEmail(TypedDict): + require_verification: NotRequired[bool] + """ + Request one time password verification of `provided_details.email`. + """ + + class CreateParamsOptionsPhone(TypedDict): + require_verification: NotRequired[bool] + """ + Request one time password verification of `provided_details.phone`. + """ + + class CreateParamsProvidedDetails(TypedDict): + email: NotRequired[str] + """ + Email of user being verified + """ + phone: NotRequired[str] + """ + Phone number of user being verified + """ + class ListParams(RequestOptions): client_reference_id: NotRequired[str] """ @@ -296,6 +381,12 @@ class ModifyParams(RequestOptions): """ A set of options for the session's verification checks. """ + provided_details: NotRequired[ + "VerificationSession.ModifyParamsProvidedDetails" + ] + """ + Details provided about the user being verified. These details may be shown to the user. + """ type: NotRequired[Literal["document", "id_number"]] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. @@ -308,6 +399,18 @@ class ModifyParamsOptions(TypedDict): """ Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). """ + email: NotRequired[ + "Literal['']|VerificationSession.ModifyParamsOptionsEmail" + ] + """ + Options that apply to the email check. + """ + phone: NotRequired[ + "Literal['']|VerificationSession.ModifyParamsOptionsPhone" + ] + """ + Options that apply to the phone check. + """ class ModifyParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ @@ -329,6 +432,28 @@ class ModifyParamsOptionsDocument(TypedDict): Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ + class ModifyParamsOptionsEmail(TypedDict): + require_verification: NotRequired[bool] + """ + Request one time password verification of `provided_details.email`. + """ + + class ModifyParamsOptionsPhone(TypedDict): + require_verification: NotRequired[bool] + """ + Request one time password verification of `provided_details.phone`. + """ + + class ModifyParamsProvidedDetails(TypedDict): + email: NotRequired[str] + """ + Email of user being verified + """ + phone: NotRequired[str] + """ + Phone number of user being verified + """ + class RedactParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -381,6 +506,10 @@ class RetrieveParams(RequestOptions): """ A set of options for the session's verification checks. """ + provided_details: Optional[ProvidedDetails] + """ + Details provided about the user being verified. These details may be shown to the user. + """ redaction: Optional[Redaction] """ Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. @@ -389,7 +518,7 @@ class RetrieveParams(RequestOptions): """ Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). """ - type: Literal["document", "id_number"] + type: Literal["document", "id_number", "verification_flow"] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. """ @@ -397,6 +526,10 @@ class RetrieveParams(RequestOptions): """ The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don't store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on [verifying identity documents](https://stripe.com/docs/identity/verify-identity-documents?platform=web&type=redirect) to learn how to redirect users to Stripe. """ + verification_flow: Optional[str] + """ + The configuration token of a Verification Flow from the dashboard. + """ verified_outputs: Optional[VerifiedOutputs] """ The user's verified data. @@ -939,6 +1072,7 @@ async def retrieve_async( _inner_class_types = { "last_error": LastError, "options": Options, + "provided_details": ProvidedDetails, "redaction": Redaction, "verified_outputs": VerifiedOutputs, } diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index 052d38343..81e30c25c 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -33,14 +33,24 @@ class CreateParams(TypedDict): """ A set of options for the session's verification checks. """ + provided_details: NotRequired[ + "VerificationSessionService.CreateParamsProvidedDetails" + ] + """ + Details provided about the user being verified. These details may be shown to the user. + """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. """ - type: Literal["document", "id_number"] + type: NotRequired[Literal["document", "id_number"]] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. """ + verification_flow: NotRequired[str] + """ + The ID of a Verification Flow from the Dashboard. + """ class CreateParamsOptions(TypedDict): document: NotRequired[ @@ -49,6 +59,18 @@ class CreateParamsOptions(TypedDict): """ Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). """ + email: NotRequired[ + "Literal['']|VerificationSessionService.CreateParamsOptionsEmail" + ] + """ + Options that apply to the email check. + """ + phone: NotRequired[ + "Literal['']|VerificationSessionService.CreateParamsOptionsPhone" + ] + """ + Options that apply to the phone check. + """ class CreateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ @@ -70,6 +92,28 @@ class CreateParamsOptionsDocument(TypedDict): Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ + class CreateParamsOptionsEmail(TypedDict): + require_verification: NotRequired[bool] + """ + Request one time password verification of `provided_details.email`. + """ + + class CreateParamsOptionsPhone(TypedDict): + require_verification: NotRequired[bool] + """ + Request one time password verification of `provided_details.phone`. + """ + + class CreateParamsProvidedDetails(TypedDict): + email: NotRequired[str] + """ + Email of user being verified + """ + phone: NotRequired[str] + """ + Phone number of user being verified + """ + class ListParams(TypedDict): client_reference_id: NotRequired[str] """ @@ -147,6 +191,12 @@ class UpdateParams(TypedDict): """ A set of options for the session's verification checks. """ + provided_details: NotRequired[ + "VerificationSessionService.UpdateParamsProvidedDetails" + ] + """ + Details provided about the user being verified. These details may be shown to the user. + """ type: NotRequired[Literal["document", "id_number"]] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. @@ -159,6 +209,18 @@ class UpdateParamsOptions(TypedDict): """ Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). """ + email: NotRequired[ + "Literal['']|VerificationSessionService.UpdateParamsOptionsEmail" + ] + """ + Options that apply to the email check. + """ + phone: NotRequired[ + "Literal['']|VerificationSessionService.UpdateParamsOptionsPhone" + ] + """ + Options that apply to the phone check. + """ class UpdateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ @@ -180,6 +242,28 @@ class UpdateParamsOptionsDocument(TypedDict): Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ + class UpdateParamsOptionsEmail(TypedDict): + require_verification: NotRequired[bool] + """ + Request one time password verification of `provided_details.email`. + """ + + class UpdateParamsOptionsPhone(TypedDict): + require_verification: NotRequired[bool] + """ + Request one time password verification of `provided_details.phone`. + """ + + class UpdateParamsProvidedDetails(TypedDict): + email: NotRequired[str] + """ + Email of user being verified + """ + phone: NotRequired[str] + """ + Phone number of user being verified + """ + def list( self, params: "VerificationSessionService.ListParams" = {}, @@ -222,7 +306,7 @@ async def list_async( def create( self, - params: "VerificationSessionService.CreateParams", + params: "VerificationSessionService.CreateParams" = {}, options: RequestOptions = {}, ) -> VerificationSession: """ @@ -248,7 +332,7 @@ def create( async def create_async( self, - params: "VerificationSessionService.CreateParams", + params: "VerificationSessionService.CreateParams" = {}, options: RequestOptions = {}, ) -> VerificationSession: """ diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index 5ce50a858..903215bfc 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -750,6 +750,10 @@ class SpendingLimit(StripeObject): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ + allowed_merchant_countries: Optional[List[str]] + """ + Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + """ blocked_categories: Optional[ List[ Literal[ @@ -1054,6 +1058,10 @@ class SpendingLimit(StripeObject): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ + blocked_merchant_countries: Optional[List[str]] + """ + Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + """ spending_limits: Optional[List[SpendingLimit]] """ Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). @@ -1535,6 +1543,10 @@ class CreateParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ + allowed_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + """ blocked_categories: NotRequired[ List[ Literal[ @@ -1839,6 +1851,10 @@ class CreateParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ + blocked_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + """ spending_limits: NotRequired[ List["Card.CreateParamsSpendingControlsSpendingLimit"] ] @@ -2582,6 +2598,10 @@ class ModifyParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ + allowed_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + """ blocked_categories: NotRequired[ List[ Literal[ @@ -2886,6 +2906,10 @@ class ModifyParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ + blocked_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + """ spending_limits: NotRequired[ List["Card.ModifyParamsSpendingControlsSpendingLimit"] ] diff --git a/stripe/issuing/_card_service.py b/stripe/issuing/_card_service.py index 1aa977c30..b823ab070 100644 --- a/stripe/issuing/_card_service.py +++ b/stripe/issuing/_card_service.py @@ -442,6 +442,10 @@ class CreateParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ + allowed_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + """ blocked_categories: NotRequired[ List[ Literal[ @@ -746,6 +750,10 @@ class CreateParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ + blocked_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + """ spending_limits: NotRequired[ List["CardService.CreateParamsSpendingControlsSpendingLimit"] ] @@ -1485,6 +1493,10 @@ class UpdateParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ + allowed_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + """ blocked_categories: NotRequired[ List[ Literal[ @@ -1789,6 +1801,10 @@ class UpdateParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ + blocked_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + """ spending_limits: NotRequired[ List["CardService.UpdateParamsSpendingControlsSpendingLimit"] ] diff --git a/stripe/issuing/_cardholder.py b/stripe/issuing/_cardholder.py index 9bebe54dc..71d21f76f 100644 --- a/stripe/issuing/_cardholder.py +++ b/stripe/issuing/_cardholder.py @@ -806,6 +806,10 @@ class SpendingLimit(StripeObject): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ + allowed_merchant_countries: Optional[List[str]] + """ + Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + """ blocked_categories: Optional[ List[ Literal[ @@ -1110,6 +1114,10 @@ class SpendingLimit(StripeObject): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ + blocked_merchant_countries: Optional[List[str]] + """ + Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + """ spending_limits: Optional[List[SpendingLimit]] """ Limit spending with amount-based rules that apply across this cardholder's cards. @@ -1598,6 +1606,10 @@ class CreateParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ + allowed_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + """ blocked_categories: NotRequired[ List[ Literal[ @@ -1902,6 +1914,10 @@ class CreateParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ + blocked_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + """ spending_limits: NotRequired[ List["Cardholder.CreateParamsSpendingControlsSpendingLimit"] ] @@ -2760,6 +2776,10 @@ class ModifyParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ + allowed_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + """ blocked_categories: NotRequired[ List[ Literal[ @@ -3064,6 +3084,10 @@ class ModifyParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ + blocked_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + """ spending_limits: NotRequired[ List["Cardholder.ModifyParamsSpendingControlsSpendingLimit"] ] diff --git a/stripe/issuing/_cardholder_service.py b/stripe/issuing/_cardholder_service.py index 590e33578..02edd720b 100644 --- a/stripe/issuing/_cardholder_service.py +++ b/stripe/issuing/_cardholder_service.py @@ -488,6 +488,10 @@ class CreateParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ + allowed_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + """ blocked_categories: NotRequired[ List[ Literal[ @@ -792,6 +796,10 @@ class CreateParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ + blocked_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + """ spending_limits: NotRequired[ List["CardholderService.CreateParamsSpendingControlsSpendingLimit"] ] @@ -1656,6 +1664,10 @@ class UpdateParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ + allowed_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + """ blocked_categories: NotRequired[ List[ Literal[ @@ -1960,6 +1972,10 @@ class UpdateParamsSpendingControls(TypedDict): """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ + blocked_merchant_countries: NotRequired[List[str]] + """ + Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + """ spending_limits: NotRequired[ List["CardholderService.UpdateParamsSpendingControlsSpendingLimit"] ] diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index 2003834bb..0faaa43b5 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -268,6 +268,7 @@ class ListParams(RequestOptions): "bbpos_chipper2x", "bbpos_wisepad3", "bbpos_wisepos_e", + "mobile_phone_reader", "simulated_wisepos_e", "stripe_m2", "verifone_P400", @@ -527,12 +528,13 @@ class SetReaderDisplayParamsCartLineItem(TypedDict): "bbpos_chipper2x", "bbpos_wisepad3", "bbpos_wisepos_e", + "mobile_phone_reader", "simulated_wisepos_e", "stripe_m2", "verifone_P400", ] """ - Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, or `simulated_wisepos_e`. + Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, `simulated_wisepos_e`, or `mobile_phone_reader`. """ id: str """ diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 8efeb865e..3019e4843 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -47,6 +47,7 @@ class ListParams(TypedDict): "bbpos_chipper2x", "bbpos_wisepad3", "bbpos_wisepos_e", + "mobile_phone_reader", "simulated_wisepos_e", "stripe_m2", "verifone_P400", From f058b918d87adb2db1226044703ace98f17491e6 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 4 Apr 2024 15:25:57 -0700 Subject: [PATCH 037/179] Bump version to 8.10.0 --- CHANGELOG.md | 114 +++++++++++++++++++++++++++++++-------------- VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 80 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e24495789..9046d2818 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,43 +1,85 @@ +## 8.10.0 - 2024-04-04 + +* **Add async support to stripe-python.** To use it, add an `_async` suffix to any request-making method. + +```diff +- cus = stripe.Customer.create(...) ++ cus = await stripe.Customer.create_async(...) +``` + +See the [README](./README.md#async) for detailed usage instructions. Support is provided out of the box for async requests via the HTTPX (used by default) and aiohttp libraries. For other libraries, you can also provide your own `stripe.HTTPClient` implementation. Please do not hesitate to [open a Github issue](https://github.com/stripe/stripe-python/issues/new/choose) if you have any feedback on this feature. +* [#1284](https://github.com/stripe/stripe-python/pull/1284) Update generated code + * Add support for `subscription_item` on resource `stripe.Discount` + * Add support for `promotion_code` on parameter classes `stripe.Invoice.CreateParamsDiscount`, `stripe.Invoice.ModifyParamsDiscount`, `stripe.InvoiceItem.CreateParamsDiscount`, `stripe.InvoiceItem.ModifyParamsDiscount`, `stripe.InvoiceLineItem.ModifyParamsDiscount`, `stripe.Quote.CreateParamsDiscount`, and `stripe.Quote.ModifyParamsDiscount` + * Add support for `discounts` on parameter classes `stripe.Invoice.UpcomingLinesParamsSubscriptionItem`, `stripe.Invoice.UpcomingParamsSubscriptionItem`, `stripe.Quote.CreateParamsLineItem`, `stripe.Quote.ModifyParamsLineItem`, `stripe.Subscription.CreateParams`, `stripe.Subscription.CreateParamsAddInvoiceItem`, `stripe.Subscription.CreateParamsItem`, `stripe.Subscription.ModifyParams`, `stripe.Subscription.ModifyParamsAddInvoiceItem`, `stripe.Subscription.ModifyParamsItem`, `stripe.SubscriptionItem.CreateParams`, `stripe.SubscriptionItem.ModifyParams`, `stripe.SubscriptionSchedule.CreateParamsPhase`, `stripe.SubscriptionSchedule.CreateParamsPhaseAddInvoiceItem`, `stripe.SubscriptionSchedule.CreateParamsPhaseItem`, `stripe.SubscriptionSchedule.ModifyParamsPhase`, `stripe.SubscriptionSchedule.ModifyParamsPhaseAddInvoiceItem`, and `stripe.SubscriptionSchedule.ModifyParamsPhaseItem`, resources `stripe.Subscription` and `stripe.SubscriptionItem`, and resource classes `stripe.SubscriptionSchedule.Phase.AddInvoiceItem`, `stripe.SubscriptionSchedule.Phase.Item`, and `stripe.SubscriptionSchedule.Phase` + * Add support for `zip` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` + * Add support for `offline` on resource class `stripe.SetupAttempt.PaymentMethodDetails.CardPresent` + * Add support for `card_present` on parameter classes `stripe.SetupIntent.ConfirmParamsPaymentMethodOptions`, `stripe.SetupIntent.CreateParamsPaymentMethodOptions`, and `stripe.SetupIntent.ModifyParamsPaymentMethodOptions` and resource class `stripe.SetupIntent.PaymentMethodOptions` + * Add support for `email` on resource `stripe.identity.VerificationReport`, parameter classes `stripe.identity.VerificationSession.CreateParamsOptions` and `stripe.identity.VerificationSession.ModifyParamsOptions`, and resource classes `stripe.identity.VerificationSession.Options` and `stripe.identity.VerificationSession.VerifiedOutputs` + * Add support for `phone` on resource `stripe.identity.VerificationReport`, parameter classes `stripe.identity.VerificationSession.CreateParamsOptions` and `stripe.identity.VerificationSession.ModifyParamsOptions`, and resource classes `stripe.identity.VerificationSession.Options` and `stripe.identity.VerificationSession.VerifiedOutputs` + * Add support for `verification_flow` on resources `stripe.identity.VerificationReport` and `stripe.identity.VerificationSession` and parameter class `stripe.identity.VerificationSession.CreateParams` + * Add support for `provided_details` on parameter classes `stripe.identity.VerificationSession.CreateParams` and `stripe.identity.VerificationSession.ModifyParams` and resource `stripe.identity.VerificationSession` + * Add support for `allowed_merchant_countries` on parameter classes `stripe.issuing.Card.CreateParamsSpendingControls`, `stripe.issuing.Card.ModifyParamsSpendingControls`, `stripe.issuing.Cardholder.CreateParamsSpendingControls`, and `stripe.issuing.Cardholder.ModifyParamsSpendingControls` and resource classes `stripe.issuing.Card.SpendingControls` and `stripe.issuing.Cardholder.SpendingControls` + * Add support for `blocked_merchant_countries` on parameter classes `stripe.issuing.Card.CreateParamsSpendingControls`, `stripe.issuing.Card.ModifyParamsSpendingControls`, `stripe.issuing.Cardholder.CreateParamsSpendingControls`, and `stripe.issuing.Cardholder.ModifyParamsSpendingControls` and resource classes `stripe.issuing.Card.SpendingControls` and `stripe.issuing.Cardholder.SpendingControls` + * Change type of field `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSwish` from `Literal['']|str` to `str` of `reference` + * Add support for `verification_flow` on enums `stripe.identity.VerificationReport.type` and `stripe.identity.VerificationSession.type` + * Add support for `email_unverified_other` on enum `stripe.identity.VerificationSession.LastError.code` + * Add support for `email_verification_declined` on enum `stripe.identity.VerificationSession.LastError.code` + * Add support for `phone_unverified_other` on enum `stripe.identity.VerificationSession.LastError.code` + * Add support for `phone_verification_declined` on enum `stripe.identity.VerificationSession.LastError.code` + * Add support for `mobile_phone_reader` on enums `stripe.terminal.Reader.device_type` and `stripe.terminal.Reader.ListParams.device_type` + * Change type of field `stripe.identity.VerificationSession.CreateParams` from `Literal['document', 'id_number']` to `NotRequired[Literal['document', 'id_number']]` of `type` + * Change type of fields `stripe.Invoice` and `stripe.InvoiceLineItem` from `Optional[List[ExpandableField[Discount]]]` to `List[ExpandableField[Discount]]` of `discounts` + * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` of `data` + * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` of `image_url_png` + * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` of `image_url_svg` + * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[str]` to `str` of `hosted_instructions_url` + * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[str]` to `str` of `mobile_auth_url` + * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[QrCode]` to `QrCode` of `qr_code` +* [#1290](https://github.com/stripe/stripe-python/pull/1290) Instructions for async in README.md +* [#1289](https://github.com/stripe/stripe-python/pull/1289) Bump aiohttp from 3.9.0 to 3.9.2 +* [#1288](https://github.com/stripe/stripe-python/pull/1288) Port async support from beta to the stable channel + ## 8.9.0 - 2024-03-28 * [#1276](https://github.com/stripe/stripe-python/pull/1276) Update generated code - * Add support for new resources `Billing.MeterEventAdjustment`, `Billing.MeterEvent`, and `Billing.Meter` - * Add support for `create`, `deactivate`, `list`, `modify`, `reactivate`, and `retrieve` methods on resource `Meter` - * Add support for `create` method on resources `MeterEventAdjustment` and `MeterEvent` - * Add support for `amazon_pay_payments` on `Account.Capabilities`, `Account.CreateParamsCapabilities`, `Account.UpdateParamsCapabilities`,`AccountService.CreateParamsCapabilities`, and `AccountService.UpdateParamsCapabilities` - * Add support for new value `verification_failed_representative_authority` on enums `Account.FutureRequirements.Error.code`, `Account.Requirements.Errors.code`, `BankAccount.FutureRequirements.Error.code`, `BankAccount.Requirements.Errors.code`, `Capability.FutureRequirements.Error.code`, `Capability.Requirements.Errors.code`, `Person.FutureRequirements.Error.code`, `Person.Requirements.Errors.code`, - * Add support for `destination_on_behalf_of_charge_management` on `AccountSession.Components.PaymentDetails.Features`, `AccountSession.Components.Payments.Features`, `AccountSession.CreateParamsComponentsPaymentDetailsFeatures`, `AccountSession.CreateParamsComponentsPaymentsFeatures`, `AccountSessionService.CreateParamsComponentsPaymentDetailsFeatures` and `AccountSessionService.CreateParamsComponentsPaymentsFeatures` - * Add support for `meter` on `Plan.CreateParams`, `Plan`, `PlanService.CreateParams`, `Price.Recurring`, `Price.CreateParamsRecurring`, `Price.ListParamsRecurring`, `PriceService.CreateParamsRecurring`, and `PriceService.ListParamsRecurring` - * Add support for `mandate` on `Charge.PaymentMethodDetails.USBankAccount`, `Treasury.InboundTransfer.OriginPaymentMethodDetails.USBankAccount`, `Treasury.OutboundPayment.DestinationPaymentMethodDetails.USBankAccount`, and `Treasury.OutboundTransfer.DestinationPaymentMethodDetails.USBankAccount` - * Add support for `second_line` on `Issuing.Card.CreateParams` + * Add support for new resources `Billing.MeterEventAdjustment`, `Billing.MeterEvent`, and `Billing.Meter` + * Add support for `create`, `deactivate`, `list`, `modify`, `reactivate`, and `retrieve` methods on resource `Meter` + * Add support for `create` method on resources `MeterEventAdjustment` and `MeterEvent` + * Add support for `amazon_pay_payments` on `Account.Capabilities`, `Account.CreateParamsCapabilities`, `Account.UpdateParamsCapabilities`,`AccountService.CreateParamsCapabilities`, and `AccountService.UpdateParamsCapabilities` + * Add support for new value `verification_failed_representative_authority` on enums `Account.FutureRequirements.Error.code`, `Account.Requirements.Errors.code`, `BankAccount.FutureRequirements.Error.code`, `BankAccount.Requirements.Errors.code`, `Capability.FutureRequirements.Error.code`, `Capability.Requirements.Errors.code`, `Person.FutureRequirements.Error.code`, `Person.Requirements.Errors.code`, + * Add support for `destination_on_behalf_of_charge_management` on `AccountSession.Components.PaymentDetails.Features`, `AccountSession.Components.Payments.Features`, `AccountSession.CreateParamsComponentsPaymentDetailsFeatures`, `AccountSession.CreateParamsComponentsPaymentsFeatures`, `AccountSessionService.CreateParamsComponentsPaymentDetailsFeatures` and `AccountSessionService.CreateParamsComponentsPaymentsFeatures` + * Add support for `meter` on `Plan.CreateParams`, `Plan`, `PlanService.CreateParams`, `Price.Recurring`, `Price.CreateParamsRecurring`, `Price.ListParamsRecurring`, `PriceService.CreateParamsRecurring`, and `PriceService.ListParamsRecurring` + * Add support for `mandate` on `Charge.PaymentMethodDetails.USBankAccount`, `Treasury.InboundTransfer.OriginPaymentMethodDetails.USBankAccount`, `Treasury.OutboundPayment.DestinationPaymentMethodDetails.USBankAccount`, and `Treasury.OutboundTransfer.DestinationPaymentMethodDetails.USBankAccount` + * Add support for `second_line` on `Issuing.Card.CreateParams` * [#1278](https://github.com/stripe/stripe-python/pull/1278) Types: remove unnecessary quotes * [#1279](https://github.com/stripe/stripe-python/pull/1279) Update README.md ## 8.8.0 - 2024-03-21 * [#1273](https://github.com/stripe/stripe-python/pull/1273) Update generated code - * Add support for new resources `ConfirmationToken` and `Forwarding.Request` - * Add support for `retrieve` method on resource `ConfirmationToken` - * Add support for `create`, `list`, and `retrieve` methods on resource `Request` - * Add support for `mobilepay_payments` on `Account.Capabilities`, `Account.CreateParamsCapabilities`, and `Account.UpdateParamsCapabilities` - * Add support for new values `forwarding_api_inactive`, `forwarding_api_invalid_parameter`, `forwarding_api_upstream_connection_error`, and `forwarding_api_upstream_connection_timeout` on enums `Invoice.LastFinalizationError.code`, `PaymentIntent.LastPaymentError.code`, `SetupAttempt.SetupError.code`, `SetupIntent.LastSetupError.code`, and `StripeError.code` - * Add support for `payment_reference` on `Charge.PaymentMethodDetails.UsBankAccount` - * Add support for `payout` on `Treasury.ReceivedDebit.LinkedFlows` - * Add support for `name` on `ConfigurationService.CreateParams`, `ConfigurationService.UpdateParams`, and `Configuration` for terminal - * Add support for `confirmation_token` on `PaymentIntentService.ConfirmParams`, `PaymentIntentService.CreateParams`, `SetupIntentService.ConfirmParams`, and `SetupIntentService.CreateParams` - * Add support for new value `mobilepay` on enums `Customer.ListPaymentMethodsParams.type`, `PaymentMethod.CreateParams.type`, and `PaymentMethod.ListParams.type` - * Add support for `mobilepay` on `Charge.PaymentMethodDetails`, `PaymentIntent.PaymentMethodOptions`, `PaymentIntentService.ConfirmParamsPaymentMethodData`, `PaymentIntentService.ConfirmParamsPaymentMethodOptions`, `PaymentIntentService.CreateParamsPaymentMethodData`, `PaymentIntentService.CreateParamsPaymentMethodOptions`, `PaymentIntentService.UpdateParamsPaymentMethodData`, `PaymentIntentService.UpdateParamsPaymentMethodOptions`, `PaymentMethod.CreateParams`, `PaymentMethod`, `SetupIntentService.ConfirmParamsPaymentMethodData`, `SetupIntentService.CreateParamsPaymentMethodData`, and `SetupIntentService.UpdateParamsPaymentMethodData` - * Add support for new value `mobilepay` on enums `PaymentIntentService.ConfirmParamsPaymentMethodData.type`, `PaymentIntentService.CreateParamsPaymentMethodData.type`, `PaymentIntentService.UpdateParamsPaymentMethodData.type`, `SetupIntentService.ConfirmParamsPaymentMethodData.type`, `SetupIntentService.CreateParamsPaymentMethodData.type`, and `SetupIntentService.UpdateParamsPaymentMethodData.type` - * Add support for new value `mobilepay` on enum `PaymentMethod.type` - - + * Add support for new resources `ConfirmationToken` and `Forwarding.Request` + * Add support for `retrieve` method on resource `ConfirmationToken` + * Add support for `create`, `list`, and `retrieve` methods on resource `Request` + * Add support for `mobilepay_payments` on `Account.Capabilities`, `Account.CreateParamsCapabilities`, and `Account.UpdateParamsCapabilities` + * Add support for new values `forwarding_api_inactive`, `forwarding_api_invalid_parameter`, `forwarding_api_upstream_connection_error`, and `forwarding_api_upstream_connection_timeout` on enums `Invoice.LastFinalizationError.code`, `PaymentIntent.LastPaymentError.code`, `SetupAttempt.SetupError.code`, `SetupIntent.LastSetupError.code`, and `StripeError.code` + * Add support for `payment_reference` on `Charge.PaymentMethodDetails.UsBankAccount` + * Add support for `payout` on `Treasury.ReceivedDebit.LinkedFlows` + * Add support for `name` on `ConfigurationService.CreateParams`, `ConfigurationService.UpdateParams`, and `Configuration` for terminal + * Add support for `confirmation_token` on `PaymentIntentService.ConfirmParams`, `PaymentIntentService.CreateParams`, `SetupIntentService.ConfirmParams`, and `SetupIntentService.CreateParams` + * Add support for new value `mobilepay` on enums `Customer.ListPaymentMethodsParams.type`, `PaymentMethod.CreateParams.type`, and `PaymentMethod.ListParams.type` + * Add support for `mobilepay` on `Charge.PaymentMethodDetails`, `PaymentIntent.PaymentMethodOptions`, `PaymentIntentService.ConfirmParamsPaymentMethodData`, `PaymentIntentService.ConfirmParamsPaymentMethodOptions`, `PaymentIntentService.CreateParamsPaymentMethodData`, `PaymentIntentService.CreateParamsPaymentMethodOptions`, `PaymentIntentService.UpdateParamsPaymentMethodData`, `PaymentIntentService.UpdateParamsPaymentMethodOptions`, `PaymentMethod.CreateParams`, `PaymentMethod`, `SetupIntentService.ConfirmParamsPaymentMethodData`, `SetupIntentService.CreateParamsPaymentMethodData`, and `SetupIntentService.UpdateParamsPaymentMethodData` + * Add support for new value `mobilepay` on enums `PaymentIntentService.ConfirmParamsPaymentMethodData.type`, `PaymentIntentService.CreateParamsPaymentMethodData.type`, `PaymentIntentService.UpdateParamsPaymentMethodData.type`, `SetupIntentService.ConfirmParamsPaymentMethodData.type`, `SetupIntentService.CreateParamsPaymentMethodData.type`, and `SetupIntentService.UpdateParamsPaymentMethodData.type` + * Add support for new value `mobilepay` on enum `PaymentMethod.type` + + ## 8.7.0 - 2024-03-14 * [#1269](https://github.com/stripe/stripe-python/pull/1269) Update generated code - * Add support for `personalization_design` on parameter classes `CardService.CreateParams`, `CardService.ListParams`, `CardService.UpdateParams`, `stripe.issuing.Card.CreateParams`, `stripe.issuing.Card.ListParams`, and `stripe.issuing.Card.ModifyParams` and resource `stripe.issuing.Card` - * Add support for `sepa_debit` on parameter classes `SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptions`, `SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptions`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptions`, and `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptions` and resource class `stripe.Subscription.PaymentSettings.PaymentMethodOptions` - * Add support for resource `stripe.issuing.PersonalizationDesign` - * Add support for resource `stripe.issuing.PhysicalBundle` - * Change type from `float` to `Literal['']|float` of `application_fee_percent` on fields `stripe.Subscription.CreateParams`, `stripe.Subscription.ModifyParams`, `SubscriptionService.UpdateParams`, and `SubscriptionService.CreateParams` - + * Add support for `personalization_design` on parameter classes `CardService.CreateParams`, `CardService.ListParams`, `CardService.UpdateParams`, `stripe.issuing.Card.CreateParams`, `stripe.issuing.Card.ListParams`, and `stripe.issuing.Card.ModifyParams` and resource `stripe.issuing.Card` + * Add support for `sepa_debit` on parameter classes `SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptions`, `SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptions`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptions`, and `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptions` and resource class `stripe.Subscription.PaymentSettings.PaymentMethodOptions` + * Add support for resource `stripe.issuing.PersonalizationDesign` + * Add support for resource `stripe.issuing.PhysicalBundle` + * Change type from `float` to `Literal['']|float` of `application_fee_percent` on fields `stripe.Subscription.CreateParams`, `stripe.Subscription.ModifyParams`, `SubscriptionService.UpdateParams`, and `SubscriptionService.CreateParams` + ## 8.6.0 - 2024-03-07 * [#1267](https://github.com/stripe/stripe-python/pull/1267) Update generated code @@ -49,12 +91,12 @@ ## 8.5.0 - 2024-02-29 * [#1255](https://github.com/stripe/stripe-python/pull/1255) Update generated code - * Change `identity.VerificationReport.type` to be required - * Change type of `identity.VerificationSession.type` from `Optional[Literal["document", "id_number"]]` to `Literal["document", "id_number"]` - * Add support for `number` on `Invoice.CreateParams` and `Invoice.ModifyParams` - * Add support for `enable_customer_cancellation` on `terminal.Reader.Action.ProcessPaymentIntent.process_config`, `Terminal.Reader.Action.ProcessSetupIntent.process_config`, `Terminal.Reader.ProcessPaymentIntentParams.process_config`, and `Terminal.Reader.ProcessSetupIntentParams.process_config` - * Add support for `refund_payment_config` on `Terminal.Reader.Action.refund_payment` and `Terminal.Reader.RefundPaymentParams` - * Add support for `payment_method` on `Token.CreateParams.bank_account` + * Change `identity.VerificationReport.type` to be required + * Change type of `identity.VerificationSession.type` from `Optional[Literal["document", "id_number"]]` to `Literal["document", "id_number"]` + * Add support for `number` on `Invoice.CreateParams` and `Invoice.ModifyParams` + * Add support for `enable_customer_cancellation` on `terminal.Reader.Action.ProcessPaymentIntent.process_config`, `Terminal.Reader.Action.ProcessSetupIntent.process_config`, `Terminal.Reader.ProcessPaymentIntentParams.process_config`, and `Terminal.Reader.ProcessSetupIntentParams.process_config` + * Add support for `refund_payment_config` on `Terminal.Reader.Action.refund_payment` and `Terminal.Reader.RefundPaymentParams` + * Add support for `payment_method` on `Token.CreateParams.bank_account` * Add `list_refunds` and `retrieve_refund` methods on resource `Charge`. * [#1260](https://github.com/stripe/stripe-python/pull/1260) Update README to use add_beta_version * [#1250](https://github.com/stripe/stripe-python/pull/1250) Fix type of ErrorObject.code diff --git a/VERSION b/VERSION index e5c15102d..7f6758ef9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.9.0 +8.10.0 diff --git a/stripe/_version.py b/stripe/_version.py index 452d6c1f9..3704869d7 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "8.9.0" +VERSION = "8.10.0" From 7131d7433b530f4c5b82858c285388ba8cd18bbb Mon Sep 17 00:00:00 2001 From: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> Date: Thu, 4 Apr 2024 17:32:09 -0700 Subject: [PATCH 038/179] Tweak changelog for python async note (#1292) * Tweak changelog for python async note * indent --------- Co-authored-by: Richard Marmorstein --- CHANGELOG.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9046d2818..549d7faef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,13 @@ ## 8.10.0 - 2024-04-04 -* **Add async support to stripe-python.** To use it, add an `_async` suffix to any request-making method. +* [#1288](https://github.com/stripe/stripe-python/pull/1288) Port **async support** from beta to the stable channel. To use it, add an `_async` suffix to any request-making method. -```diff -- cus = stripe.Customer.create(...) -+ cus = await stripe.Customer.create_async(...) -``` + ```diff + - cus = stripe.Customer.create(...) + + cus = await stripe.Customer.create_async(...) + ``` -See the [README](./README.md#async) for detailed usage instructions. Support is provided out of the box for async requests via the HTTPX (used by default) and aiohttp libraries. For other libraries, you can also provide your own `stripe.HTTPClient` implementation. Please do not hesitate to [open a Github issue](https://github.com/stripe/stripe-python/issues/new/choose) if you have any feedback on this feature. + See the [README](./README.md#async) for detailed usage instructions. Support is provided out of the box for async requests via the HTTPX (used by default) and aiohttp libraries. For other libraries, you can also provide your own `stripe.HTTPClient` implementation. Please do not hesitate to [open a Github issue](https://github.com/stripe/stripe-python/issues/new/choose) if you have any feedback on this feature. * [#1284](https://github.com/stripe/stripe-python/pull/1284) Update generated code * Add support for `subscription_item` on resource `stripe.Discount` * Add support for `promotion_code` on parameter classes `stripe.Invoice.CreateParamsDiscount`, `stripe.Invoice.ModifyParamsDiscount`, `stripe.InvoiceItem.CreateParamsDiscount`, `stripe.InvoiceItem.ModifyParamsDiscount`, `stripe.InvoiceLineItem.ModifyParamsDiscount`, `stripe.Quote.CreateParamsDiscount`, and `stripe.Quote.ModifyParamsDiscount` @@ -36,9 +36,8 @@ See the [README](./README.md#async) for detailed usage instructions. Support is * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[str]` to `str` of `hosted_instructions_url` * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[str]` to `str` of `mobile_auth_url` * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[QrCode]` to `QrCode` of `qr_code` -* [#1290](https://github.com/stripe/stripe-python/pull/1290) Instructions for async in README.md * [#1289](https://github.com/stripe/stripe-python/pull/1289) Bump aiohttp from 3.9.0 to 3.9.2 -* [#1288](https://github.com/stripe/stripe-python/pull/1288) Port async support from beta to the stable channel + ## 8.9.0 - 2024-03-28 * [#1276](https://github.com/stripe/stripe-python/pull/1276) Update generated code From f14735dfc9c1f00c2d4de0e1fbc3392018fe4a82 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Fri, 5 Apr 2024 15:12:12 -0700 Subject: [PATCH 039/179] Fix README.md (#1299) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6873a18ef..e2bbc4e3d 100644 --- a/README.md +++ b/README.md @@ -298,7 +298,7 @@ my_http_client = stripe.HTTPXClient() # If you want to use httpx to make sync requests, you can disable this # behavior. -my_http_client = stripe.HTTPXClient(allow_sync_requests=True) +my_http_client = stripe.HTTPXClient(allow_sync_methods=True) # aiohttp is also available (does not support sync requests) my_http_client = stripe.AIOHTTPClient() From ec670a1964b7e9e61fa30502f147b068bfeaf4cb Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 20:56:33 +0000 Subject: [PATCH 040/179] Update generated code (#1295) * Update generated code for v934 * Update generated code for v935 * Update generated code for v936 * Update generated code for v937 * Update generated code for v938 * Revert "Update generated code for v937" This reverts commit 4c0b32e36b4586292cdeb342abbf1426ef8e56e2. * Revert "Update generated code for v935" This reverts commit 142b2929d2011c4589a76123d52411df22c2c78b. --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Ramya Rao --- OPENAPI_VERSION | 2 +- stripe/__init__.py | 8 + stripe/_account.py | 79 +++++- stripe/_account_service.py | 42 +++ stripe/_entitlements_service.py | 14 + stripe/_object_classes.py | 3 + stripe/_product.py | 196 ++++++++++++++ stripe/_product_feature.py | 38 +++ stripe/_product_feature_service.py | 240 +++++++++++++++++ stripe/_product_service.py | 5 + stripe/_stripe_client.py | 2 + stripe/api_resources/__init__.py | 2 + stripe/api_resources/entitlements/__init__.py | 22 ++ .../entitlements/active_entitlement.py | 21 ++ stripe/api_resources/entitlements/feature.py | 21 ++ stripe/api_resources/product_feature.py | 21 ++ stripe/billing/_meter_event_adjustment.py | 24 +- .../_meter_event_adjustment_service.py | 6 +- stripe/entitlements/__init__.py | 12 + stripe/entitlements/_active_entitlement.py | 130 ++++++++++ .../_active_entitlement_service.py | 125 +++++++++ stripe/entitlements/_feature.py | 242 ++++++++++++++++++ stripe/entitlements/_feature_service.py | 235 +++++++++++++++++ stripe/tax/_calculation.py | 5 +- stripe/tax/_calculation_service.py | 5 +- 25 files changed, 1494 insertions(+), 6 deletions(-) create mode 100644 stripe/_entitlements_service.py create mode 100644 stripe/_product_feature.py create mode 100644 stripe/_product_feature_service.py create mode 100644 stripe/api_resources/entitlements/__init__.py create mode 100644 stripe/api_resources/entitlements/active_entitlement.py create mode 100644 stripe/api_resources/entitlements/feature.py create mode 100644 stripe/api_resources/product_feature.py create mode 100644 stripe/entitlements/__init__.py create mode 100644 stripe/entitlements/_active_entitlement.py create mode 100644 stripe/entitlements/_active_entitlement_service.py create mode 100644 stripe/entitlements/_feature.py create mode 100644 stripe/entitlements/_feature_service.py diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3dfb688b8..d91517e10 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v932 \ No newline at end of file +v938 diff --git a/stripe/__init__.py b/stripe/__init__.py index ee824207d..e624851bb 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -217,6 +217,7 @@ def __getattr__(name): billing_portal as billing_portal, checkout as checkout, climate as climate, + entitlements as entitlements, financial_connections as financial_connections, forwarding as forwarding, identity as identity, @@ -347,6 +348,9 @@ def __getattr__(name): from stripe._discount import Discount as Discount from stripe._dispute import Dispute as Dispute from stripe._dispute_service import DisputeService as DisputeService +from stripe._entitlements_service import ( + EntitlementsService as EntitlementsService, +) from stripe._ephemeral_key import EphemeralKey as EphemeralKey from stripe._ephemeral_key_service import ( EphemeralKeyService as EphemeralKeyService, @@ -423,6 +427,10 @@ def __getattr__(name): from stripe._price import Price as Price from stripe._price_service import PriceService as PriceService from stripe._product import Product as Product +from stripe._product_feature import ProductFeature as ProductFeature +from stripe._product_feature_service import ( + ProductFeatureService as ProductFeatureService, +) from stripe._product_service import ProductService as ProductService from stripe._promotion_code import PromotionCode as PromotionCode from stripe._promotion_code_service import ( diff --git a/stripe/_account.py b/stripe/_account.py index a04dcc138..b6de1a7f5 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -557,14 +557,49 @@ class Document(StripeObject): } class Controller(StripeObject): + class Fees(StripeObject): + payer: Literal[ + "account", + "application", + "application_custom", + "application_express", + ] + """ + A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this account. + """ + + class Losses(StripeObject): + payments: Literal["application", "stripe"] + """ + A value indicating who is liable when this account can't pay back negative balances from payments. + """ + + class StripeDashboard(StripeObject): + type: Literal["express", "full", "none"] + """ + A value indicating the Stripe dashboard this account has access to independent of the Connect application. + """ + + fees: Optional[Fees] is_controller: Optional[bool] """ `true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://stripe.com/docs/connect/platform-controls-for-standard-accounts). Otherwise, this field is null. """ + losses: Optional[Losses] + requirement_collection: Optional[Literal["application", "stripe"]] + """ + A value indicating responsibility for collecting requirements on this account. Only returned when the Connect application retrieving the resource controls the account. + """ + stripe_dashboard: Optional[StripeDashboard] type: Literal["account", "application"] """ The controller type. Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. """ + _inner_class_types = { + "fees": Fees, + "losses": Losses, + "stripe_dashboard": StripeDashboard, + } class FutureRequirements(StripeObject): class Alternative(StripeObject): @@ -1171,6 +1206,10 @@ class CreateParams(RequestOptions): """ Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ + controller: NotRequired["Account.CreateParamsController"] + """ + A hash of configuration describing the account controller's attributes. + """ country: NotRequired[str] """ The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. @@ -2052,6 +2091,44 @@ class CreateParamsCompanyVerificationDocument(TypedDict): The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ + class CreateParamsController(TypedDict): + fees: NotRequired["Account.CreateParamsControllerFees"] + """ + A hash of configuration for who pays Stripe fees for product usage on this account. + """ + losses: NotRequired["Account.CreateParamsControllerLosses"] + """ + A hash of configuration for products that have negative balance liability, and whether Stripe or a Connect application is responsible for them. + """ + requirement_collection: NotRequired[Literal["application", "stripe"]] + """ + A value indicating responsibility for collecting updated information when requirements on the account are due or change. Defaults to `stripe`. + """ + stripe_dashboard: NotRequired[ + "Account.CreateParamsControllerStripeDashboard" + ] + """ + A hash of configuration for Stripe-hosted dashboards. + """ + + class CreateParamsControllerFees(TypedDict): + payer: NotRequired[Literal["account", "application"]] + """ + A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`. + """ + + class CreateParamsControllerLosses(TypedDict): + payments: NotRequired[Literal["application", "stripe"]] + """ + A value indicating who is liable when this account can't pay back negative balances resulting from payments. Defaults to `stripe`. + """ + + class CreateParamsControllerStripeDashboard(TypedDict): + type: NotRequired[Literal["express", "full", "none"]] + """ + Whether this account should have access to the full Stripe Dashboard (`full`), to the Express Dashboard (`express`), or to no Stripe-hosted dashboard (`none`). Defaults to `full`. + """ + class CreateParamsDocuments(TypedDict): bank_account_ownership_verification: NotRequired[ "Account.CreateParamsDocumentsBankAccountOwnershipVerification" @@ -3710,7 +3787,7 @@ class RetrievePersonParams(RequestOptions): Options for customizing how the account functions within Stripe. """ tos_acceptance: Optional[TosAcceptance] - type: Optional[Literal["custom", "express", "standard"]] + type: Optional[Literal["custom", "express", "none", "standard"]] """ The Stripe account type. Can be `standard`, `express`, or `custom`. """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 271acf760..bb2b92c09 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -48,6 +48,10 @@ class CreateParams(TypedDict): """ Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. """ + controller: NotRequired["AccountService.CreateParamsController"] + """ + A hash of configuration describing the account controller's attributes. + """ country: NotRequired[str] """ The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. @@ -939,6 +943,44 @@ class CreateParamsCompanyVerificationDocument(TypedDict): The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ + class CreateParamsController(TypedDict): + fees: NotRequired["AccountService.CreateParamsControllerFees"] + """ + A hash of configuration for who pays Stripe fees for product usage on this account. + """ + losses: NotRequired["AccountService.CreateParamsControllerLosses"] + """ + A hash of configuration for products that have negative balance liability, and whether Stripe or a Connect application is responsible for them. + """ + requirement_collection: NotRequired[Literal["application", "stripe"]] + """ + A value indicating responsibility for collecting updated information when requirements on the account are due or change. Defaults to `stripe`. + """ + stripe_dashboard: NotRequired[ + "AccountService.CreateParamsControllerStripeDashboard" + ] + """ + A hash of configuration for Stripe-hosted dashboards. + """ + + class CreateParamsControllerFees(TypedDict): + payer: NotRequired[Literal["account", "application"]] + """ + A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`. + """ + + class CreateParamsControllerLosses(TypedDict): + payments: NotRequired[Literal["application", "stripe"]] + """ + A value indicating who is liable when this account can't pay back negative balances resulting from payments. Defaults to `stripe`. + """ + + class CreateParamsControllerStripeDashboard(TypedDict): + type: NotRequired[Literal["express", "full", "none"]] + """ + Whether this account should have access to the full Stripe Dashboard (`full`), to the Express Dashboard (`express`), or to no Stripe-hosted dashboard (`none`). Defaults to `full`. + """ + class CreateParamsDocuments(TypedDict): bank_account_ownership_verification: NotRequired[ "AccountService.CreateParamsDocumentsBankAccountOwnershipVerification" diff --git a/stripe/_entitlements_service.py b/stripe/_entitlements_service.py new file mode 100644 index 000000000..8182faf9f --- /dev/null +++ b/stripe/_entitlements_service.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe.entitlements._active_entitlement_service import ( + ActiveEntitlementService, +) +from stripe.entitlements._feature_service import FeatureService + + +class EntitlementsService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.active_entitlements = ActiveEntitlementService(self._requestor) + self.features = FeatureService(self._requestor) diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 04e364b57..0a5605f3d 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -44,6 +44,8 @@ stripe.CustomerSession.OBJECT_NAME: stripe.CustomerSession, stripe.Discount.OBJECT_NAME: stripe.Discount, stripe.Dispute.OBJECT_NAME: stripe.Dispute, + stripe.entitlements.ActiveEntitlement.OBJECT_NAME: stripe.entitlements.ActiveEntitlement, + stripe.entitlements.Feature.OBJECT_NAME: stripe.entitlements.Feature, stripe.EphemeralKey.OBJECT_NAME: stripe.EphemeralKey, stripe.Event.OBJECT_NAME: stripe.Event, stripe.ExchangeRate.OBJECT_NAME: stripe.ExchangeRate, @@ -83,6 +85,7 @@ stripe.PlatformTaxFee.OBJECT_NAME: stripe.PlatformTaxFee, stripe.Price.OBJECT_NAME: stripe.Price, stripe.Product.OBJECT_NAME: stripe.Product, + stripe.ProductFeature.OBJECT_NAME: stripe.ProductFeature, stripe.PromotionCode.OBJECT_NAME: stripe.PromotionCode, stripe.Quote.OBJECT_NAME: stripe.Quote, stripe.radar.EarlyFraudWarning.OBJECT_NAME: stripe.radar.EarlyFraudWarning, diff --git a/stripe/_product.py b/stripe/_product.py index 4609c2118..8be7ef66d 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -5,6 +5,7 @@ from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource +from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._searchable_api_resource import SearchableAPIResource @@ -32,9 +33,11 @@ if TYPE_CHECKING: from stripe._price import Price + from stripe._product_feature import ProductFeature from stripe._tax_code import TaxCode +@nested_resource_class_methods("feature") class Product( CreateableAPIResource["Product"], DeletableAPIResource["Product"], @@ -79,6 +82,16 @@ class PackageDimensions(StripeObject): Width, in inches. """ + class CreateFeatureParams(RequestOptions): + entitlement_feature: str + """ + The ID of the [Feature](docs/api/entitlements/feature) object attached to this product. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + class CreateParams(RequestOptions): active: NotRequired[bool] """ @@ -284,9 +297,30 @@ class CreateParamsPackageDimensions(TypedDict): Width, in inches. Maximum precision is 2 decimal places. """ + class DeleteFeatureParams(RequestOptions): + pass + class DeleteParams(RequestOptions): pass + class ListFeaturesParams(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. + """ + class ListParams(RequestOptions): active: NotRequired[bool] """ @@ -434,6 +468,12 @@ class ModifyParamsPackageDimensions(TypedDict): Width, in inches. Maximum precision is 2 decimal places. """ + class RetrieveFeatureParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -801,6 +841,162 @@ async def search_auto_paging_iter_async( ) -> AsyncIterator["Product"]: return (await cls.search_async(*args, **kwargs)).auto_paging_iter() + @classmethod + def delete_feature( + cls, + product: str, + id: str, + **params: Unpack["Product.DeleteFeatureParams"] + ) -> "ProductFeature": + """ + Deletes the feature attachment to a product + """ + return cast( + "ProductFeature", + cls._static_request( + "delete", + "/v1/products/{product}/features/{id}".format( + product=sanitize_id(product), id=sanitize_id(id) + ), + params=params, + ), + ) + + @classmethod + async def delete_feature_async( + cls, + product: str, + id: str, + **params: Unpack["Product.DeleteFeatureParams"] + ) -> "ProductFeature": + """ + Deletes the feature attachment to a product + """ + return cast( + "ProductFeature", + await cls._static_request_async( + "delete", + "/v1/products/{product}/features/{id}".format( + product=sanitize_id(product), id=sanitize_id(id) + ), + params=params, + ), + ) + + @classmethod + def list_features( + cls, product: str, **params: Unpack["Product.ListFeaturesParams"] + ) -> ListObject["ProductFeature"]: + """ + Retrieve a list of features for a product + """ + return cast( + ListObject["ProductFeature"], + cls._static_request( + "get", + "/v1/products/{product}/features".format( + product=sanitize_id(product) + ), + params=params, + ), + ) + + @classmethod + async def list_features_async( + cls, product: str, **params: Unpack["Product.ListFeaturesParams"] + ) -> ListObject["ProductFeature"]: + """ + Retrieve a list of features for a product + """ + return cast( + ListObject["ProductFeature"], + await cls._static_request_async( + "get", + "/v1/products/{product}/features".format( + product=sanitize_id(product) + ), + params=params, + ), + ) + + @classmethod + def create_feature( + cls, product: str, **params: Unpack["Product.CreateFeatureParams"] + ) -> "ProductFeature": + """ + Creates a product_feature, which represents a feature attachment to a product + """ + return cast( + "ProductFeature", + cls._static_request( + "post", + "/v1/products/{product}/features".format( + product=sanitize_id(product) + ), + params=params, + ), + ) + + @classmethod + async def create_feature_async( + cls, product: str, **params: Unpack["Product.CreateFeatureParams"] + ) -> "ProductFeature": + """ + Creates a product_feature, which represents a feature attachment to a product + """ + return cast( + "ProductFeature", + await cls._static_request_async( + "post", + "/v1/products/{product}/features".format( + product=sanitize_id(product) + ), + params=params, + ), + ) + + @classmethod + def retrieve_feature( + cls, + product: str, + id: str, + **params: Unpack["Product.RetrieveFeatureParams"] + ) -> "ProductFeature": + """ + Retrieves a product_feature, which represents a feature attachment to a product + """ + return cast( + "ProductFeature", + cls._static_request( + "get", + "/v1/products/{product}/features/{id}".format( + product=sanitize_id(product), id=sanitize_id(id) + ), + params=params, + ), + ) + + @classmethod + async def retrieve_feature_async( + cls, + product: str, + id: str, + **params: Unpack["Product.RetrieveFeatureParams"] + ) -> "ProductFeature": + """ + Retrieves a product_feature, which represents a feature attachment to a product + """ + return cast( + "ProductFeature", + await cls._static_request_async( + "get", + "/v1/products/{product}/features/{id}".format( + product=sanitize_id(product), id=sanitize_id(id) + ), + params=params, + ), + ) + _inner_class_types = { "features": Feature, "package_dimensions": PackageDimensions, diff --git a/stripe/_product_feature.py b/stripe/_product_feature.py new file mode 100644 index 000000000..e17e01a41 --- /dev/null +++ b/stripe/_product_feature.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.entitlements._feature import Feature + + +class ProductFeature(StripeObject): + """ + A product_feature represents an attachment between a feature and a product. + When a product is purchased that has a feature attached, Stripe will create an entitlement to the feature for the purchasing customer. + """ + + OBJECT_NAME: ClassVar[Literal["product_feature"]] = "product_feature" + entitlement_feature: "Feature" + """ + A feature represents a monetizable ability or functionality in your system. + Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["product_feature"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ diff --git a/stripe/_product_feature_service.py b/stripe/_product_feature_service.py new file mode 100644 index 000000000..700cb234c --- /dev/null +++ b/stripe/_product_feature_service.py @@ -0,0 +1,240 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._product_feature import ProductFeature +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class ProductFeatureService(StripeService): + class CreateParams(TypedDict): + entitlement_feature: str + """ + The ID of the [Feature](docs/api/entitlements/feature) object attached to this product. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class DeleteParams(TypedDict): + pass + + class ListParams(TypedDict): + 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. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def delete( + self, + product: str, + id: str, + params: "ProductFeatureService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> ProductFeature: + """ + Deletes the feature attachment to a product + """ + return cast( + ProductFeature, + self._request( + "delete", + "/v1/products/{product}/features/{id}".format( + product=sanitize_id(product), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def delete_async( + self, + product: str, + id: str, + params: "ProductFeatureService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> ProductFeature: + """ + Deletes the feature attachment to a product + """ + return cast( + ProductFeature, + await self._request_async( + "delete", + "/v1/products/{product}/features/{id}".format( + product=sanitize_id(product), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + product: str, + id: str, + params: "ProductFeatureService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ProductFeature: + """ + Retrieves a product_feature, which represents a feature attachment to a product + """ + return cast( + ProductFeature, + self._request( + "get", + "/v1/products/{product}/features/{id}".format( + product=sanitize_id(product), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + product: str, + id: str, + params: "ProductFeatureService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ProductFeature: + """ + Retrieves a product_feature, which represents a feature attachment to a product + """ + return cast( + ProductFeature, + await self._request_async( + "get", + "/v1/products/{product}/features/{id}".format( + product=sanitize_id(product), + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + product: str, + params: "ProductFeatureService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ProductFeature]: + """ + Retrieve a list of features for a product + """ + return cast( + ListObject[ProductFeature], + self._request( + "get", + "/v1/products/{product}/features".format( + product=sanitize_id(product), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + product: str, + params: "ProductFeatureService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ProductFeature]: + """ + Retrieve a list of features for a product + """ + return cast( + ListObject[ProductFeature], + await self._request_async( + "get", + "/v1/products/{product}/features".format( + product=sanitize_id(product), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + product: str, + params: "ProductFeatureService.CreateParams", + options: RequestOptions = {}, + ) -> ProductFeature: + """ + Creates a product_feature, which represents a feature attachment to a product + """ + return cast( + ProductFeature, + self._request( + "post", + "/v1/products/{product}/features".format( + product=sanitize_id(product), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + product: str, + params: "ProductFeatureService.CreateParams", + options: RequestOptions = {}, + ) -> ProductFeature: + """ + Creates a product_feature, which represents a feature attachment to a product + """ + return cast( + ProductFeature, + await self._request_async( + "post", + "/v1/products/{product}/features".format( + product=sanitize_id(product), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_product_service.py b/stripe/_product_service.py index 9f71f245d..79992b568 100644 --- a/stripe/_product_service.py +++ b/stripe/_product_service.py @@ -2,6 +2,7 @@ # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._product import Product +from stripe._product_feature_service import ProductFeatureService from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService @@ -11,6 +12,10 @@ class ProductService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.features = ProductFeatureService(self._requestor) + class CreateParams(TypedDict): active: NotRequired[bool] """ diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 93e1cf943..691797af7 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -49,6 +49,7 @@ from stripe._customer_service import CustomerService from stripe._customer_session_service import CustomerSessionService from stripe._dispute_service import DisputeService +from stripe._entitlements_service import EntitlementsService from stripe._ephemeral_key_service import EphemeralKeyService from stripe._event_service import EventService from stripe._exchange_rate_service import ExchangeRateService @@ -192,6 +193,7 @@ def __init__( self.customers = CustomerService(self._requestor) self.customer_sessions = CustomerSessionService(self._requestor) self.disputes = DisputeService(self._requestor) + self.entitlements = EntitlementsService(self._requestor) self.ephemeral_keys = EphemeralKeyService(self._requestor) self.events = EventService(self._requestor) self.exchange_rates = ExchangeRateService(self._requestor) diff --git a/stripe/api_resources/__init__.py b/stripe/api_resources/__init__.py index 62fb54950..46233b160 100644 --- a/stripe/api_resources/__init__.py +++ b/stripe/api_resources/__init__.py @@ -22,6 +22,7 @@ billing_portal, checkout, climate, + entitlements, financial_connections, forwarding, identity, @@ -94,6 +95,7 @@ from stripe.api_resources.platform_tax_fee import PlatformTaxFee from stripe.api_resources.price import Price from stripe.api_resources.product import Product + from stripe.api_resources.product_feature import ProductFeature from stripe.api_resources.promotion_code import PromotionCode from stripe.api_resources.quote import Quote from stripe.api_resources.refund import Refund diff --git a/stripe/api_resources/entitlements/__init__.py b/stripe/api_resources/entitlements/__init__.py new file mode 100644 index 000000000..8945d7a6c --- /dev/null +++ b/stripe/api_resources/entitlements/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.entitlements package is deprecated, please change your + imports to import from stripe.entitlements directly. + From: + from stripe.api_resources.entitlements import ... + To: + from stripe.entitlements import ... + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.api_resources.entitlements.active_entitlement import ( + ActiveEntitlement, + ) + from stripe.api_resources.entitlements.feature import Feature diff --git a/stripe/api_resources/entitlements/active_entitlement.py b/stripe/api_resources/entitlements/active_entitlement.py new file mode 100644 index 000000000..3e5321bed --- /dev/null +++ b/stripe/api_resources/entitlements/active_entitlement.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.entitlements.active_entitlement package is deprecated, please change your + imports to import from stripe.entitlements directly. + From: + from stripe.api_resources.entitlements.active_entitlement import ActiveEntitlement + To: + from stripe.entitlements import ActiveEntitlement + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.entitlements._active_entitlement import ( # noqa + ActiveEntitlement, + ) diff --git a/stripe/api_resources/entitlements/feature.py b/stripe/api_resources/entitlements/feature.py new file mode 100644 index 000000000..888e561db --- /dev/null +++ b/stripe/api_resources/entitlements/feature.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.entitlements.feature package is deprecated, please change your + imports to import from stripe.entitlements directly. + From: + from stripe.api_resources.entitlements.feature import Feature + To: + from stripe.entitlements import Feature + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.entitlements._feature import ( # noqa + Feature, + ) diff --git a/stripe/api_resources/product_feature.py b/stripe/api_resources/product_feature.py new file mode 100644 index 000000000..e01cf6179 --- /dev/null +++ b/stripe/api_resources/product_feature.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.product_feature package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.product_feature import ProductFeature + To: + from stripe import ProductFeature + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._product_feature import ( # noqa + ProductFeature, + ) diff --git a/stripe/billing/_meter_event_adjustment.py b/stripe/billing/_meter_event_adjustment.py index b4c0d41e5..ca57fd924 100644 --- a/stripe/billing/_meter_event_adjustment.py +++ b/stripe/billing/_meter_event_adjustment.py @@ -2,6 +2,7 @@ # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject from typing import ClassVar, List, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack @@ -15,11 +16,21 @@ class MeterEventAdjustment(CreateableAPIResource["MeterEventAdjustment"]): Literal["billing.meter_event_adjustment"] ] = "billing.meter_event_adjustment" + class Cancel(StripeObject): + identifier: str + """ + Unique identifier for the event. + """ + class CreateParams(RequestOptions): cancel: "MeterEventAdjustment.CreateParamsCancel" """ Specifies which event to cancel. """ + event_name: str + """ + The name of the meter event. Corresponds with the `event_name` field on a meter. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -32,9 +43,14 @@ class CreateParams(RequestOptions): class CreateParamsCancel(TypedDict): identifier: str """ - Unique identifier for the event. + Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. """ + cancel: Cancel + event_name: str + """ + The name of the meter event. Corresponds with the `event_name` field on a meter. + """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. @@ -47,6 +63,10 @@ class CreateParamsCancel(TypedDict): """ The meter event adjustment's status. """ + type: Literal["cancel"] + """ + Specifies whether to cancel a single event or a range of events for a time period. + """ @classmethod def create( @@ -79,3 +99,5 @@ async def create_async( params=params, ), ) + + _inner_class_types = {"cancel": Cancel} diff --git a/stripe/billing/_meter_event_adjustment_service.py b/stripe/billing/_meter_event_adjustment_service.py index 04eeea52e..4dbae5270 100644 --- a/stripe/billing/_meter_event_adjustment_service.py +++ b/stripe/billing/_meter_event_adjustment_service.py @@ -13,6 +13,10 @@ class CreateParams(TypedDict): """ Specifies which event to cancel. """ + event_name: str + """ + The name of the meter event. Corresponds with the `event_name` field on a meter. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -25,7 +29,7 @@ class CreateParams(TypedDict): class CreateParamsCancel(TypedDict): identifier: str """ - Unique identifier for the event. + Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. """ def create( diff --git a/stripe/entitlements/__init__.py b/stripe/entitlements/__init__.py new file mode 100644 index 000000000..7eb2d6f54 --- /dev/null +++ b/stripe/entitlements/__init__.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.entitlements._active_entitlement import ( + ActiveEntitlement as ActiveEntitlement, +) +from stripe.entitlements._active_entitlement_service import ( + ActiveEntitlementService as ActiveEntitlementService, +) +from stripe.entitlements._feature import Feature as Feature +from stripe.entitlements._feature_service import ( + FeatureService as FeatureService, +) diff --git a/stripe/entitlements/_active_entitlement.py b/stripe/entitlements/_active_entitlement.py new file mode 100644 index 000000000..82298a396 --- /dev/null +++ b/stripe/entitlements/_active_entitlement.py @@ -0,0 +1,130 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from typing import ClassVar, List +from typing_extensions import Literal, NotRequired, Unpack + + +class ActiveEntitlement(ListableAPIResource["ActiveEntitlement"]): + """ + An active entitlement describes access to a feature for a customer. + """ + + OBJECT_NAME: ClassVar[ + Literal["entitlements.active_entitlement"] + ] = "entitlements.active_entitlement" + + class ListParams(RequestOptions): + customer: str + """ + The ID of the customer. + """ + 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. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + feature: str + """ + The feature that the customer is entitled to. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + lookup_key: str + """ + A unique key you provide as your own system identifier. This may be up to 80 characters. + """ + object: Literal["entitlements.active_entitlement"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + + @classmethod + def list( + cls, **params: Unpack["ActiveEntitlement.ListParams"] + ) -> ListObject["ActiveEntitlement"]: + """ + Retrieve a list of active entitlements for a customer + """ + 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["ActiveEntitlement.ListParams"] + ) -> ListObject["ActiveEntitlement"]: + """ + Retrieve a list of active entitlements for a customer + """ + 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["ActiveEntitlement.RetrieveParams"] + ) -> "ActiveEntitlement": + """ + Retrieve an active entitlement + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ActiveEntitlement.RetrieveParams"] + ) -> "ActiveEntitlement": + """ + Retrieve an active entitlement + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/entitlements/_active_entitlement_service.py b/stripe/entitlements/_active_entitlement_service.py new file mode 100644 index 000000000..862b41a6d --- /dev/null +++ b/stripe/entitlements/_active_entitlement_service.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.entitlements._active_entitlement import ActiveEntitlement +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class ActiveEntitlementService(StripeService): + class ListParams(TypedDict): + customer: str + """ + The ID of the customer. + """ + 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. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "ActiveEntitlementService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[ActiveEntitlement]: + """ + Retrieve a list of active entitlements for a customer + """ + return cast( + ListObject[ActiveEntitlement], + self._request( + "get", + "/v1/entitlements/active_entitlements", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "ActiveEntitlementService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[ActiveEntitlement]: + """ + Retrieve a list of active entitlements for a customer + """ + return cast( + ListObject[ActiveEntitlement], + await self._request_async( + "get", + "/v1/entitlements/active_entitlements", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "ActiveEntitlementService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ActiveEntitlement: + """ + Retrieve an active entitlement + """ + return cast( + ActiveEntitlement, + self._request( + "get", + "/v1/entitlements/active_entitlements/{id}".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "ActiveEntitlementService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ActiveEntitlement: + """ + Retrieve an active entitlement + """ + return cast( + ActiveEntitlement, + await self._request_async( + "get", + "/v1/entitlements/active_entitlements/{id}".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/entitlements/_feature.py b/stripe/entitlements/_feature.py new file mode 100644 index 000000000..5a1e273da --- /dev/null +++ b/stripe/entitlements/_feature.py @@ -0,0 +1,242 @@ +# -*- 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._request_options import RequestOptions +from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id +from typing import ClassVar, Dict, List, cast +from typing_extensions import Literal, NotRequired, Unpack + + +class Feature( + CreateableAPIResource["Feature"], + ListableAPIResource["Feature"], + UpdateableAPIResource["Feature"], +): + """ + A feature represents a monetizable ability or functionality in your system. + Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. + """ + + OBJECT_NAME: ClassVar[ + Literal["entitlements.feature"] + ] = "entitlements.feature" + + class CreateParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + lookup_key: str + """ + A unique key you provide as your own system identifier. This may be up to 80 characters. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + name: str + """ + The feature's name, for your own purpose, not meant to be displayable to the customer. + """ + + class ListParams(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. + """ + + class ModifyParams(RequestOptions): + active: NotRequired[bool] + """ + Inactive features cannot be attached to new products and will not be returned from the features list endpoint. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + name: NotRequired[str] + """ + The feature's name, for your own purpose, not meant to be displayable to the customer. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + active: bool + """ + Inactive features cannot be attached to new products and will not be returned from the features list endpoint. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + lookup_key: str + """ + A unique key you provide as your own system identifier. This may be up to 80 characters. + """ + metadata: Dict[str, str] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + name: str + """ + The feature's name, for your own purpose, not meant to be displayable to the customer. + """ + object: Literal["entitlements.feature"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + + @classmethod + def create(cls, **params: Unpack["Feature.CreateParams"]) -> "Feature": + """ + Creates a feature + """ + return cast( + "Feature", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["Feature.CreateParams"] + ) -> "Feature": + """ + Creates a feature + """ + return cast( + "Feature", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["Feature.ListParams"] + ) -> ListObject["Feature"]: + """ + Retrieve a list of features + """ + 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["Feature.ListParams"] + ) -> ListObject["Feature"]: + """ + Retrieve a list of features + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + + @classmethod + def modify( + cls, id: str, **params: Unpack["Feature.ModifyParams"] + ) -> "Feature": + """ + Update a feature's metadata or permanently deactivate it. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Feature", + cls._static_request( + "post", + url, + params=params, + ), + ) + + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Feature.ModifyParams"] + ) -> "Feature": + """ + Update a feature's metadata or permanently deactivate it. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Feature", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["Feature.RetrieveParams"] + ) -> "Feature": + """ + Retrieves a feature + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Feature.RetrieveParams"] + ) -> "Feature": + """ + Retrieves a feature + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/entitlements/_feature_service.py b/stripe/entitlements/_feature_service.py new file mode 100644 index 000000000..b1fb5525b --- /dev/null +++ b/stripe/entitlements/_feature_service.py @@ -0,0 +1,235 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.entitlements._feature import Feature +from typing import Dict, List, cast +from typing_extensions import NotRequired, TypedDict + + +class FeatureService(StripeService): + class CreateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + lookup_key: str + """ + A unique key you provide as your own system identifier. This may be up to 80 characters. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + name: str + """ + The feature's name, for your own purpose, not meant to be displayable to the customer. + """ + + class ListParams(TypedDict): + 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. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class UpdateParams(TypedDict): + active: NotRequired[bool] + """ + Inactive features cannot be attached to new products and will not be returned from the features list endpoint. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + name: NotRequired[str] + """ + The feature's name, for your own purpose, not meant to be displayable to the customer. + """ + + def list( + self, + params: "FeatureService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Feature]: + """ + Retrieve a list of features + """ + return cast( + ListObject[Feature], + self._request( + "get", + "/v1/entitlements/features", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "FeatureService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Feature]: + """ + Retrieve a list of features + """ + return cast( + ListObject[Feature], + await self._request_async( + "get", + "/v1/entitlements/features", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "FeatureService.CreateParams", + options: RequestOptions = {}, + ) -> Feature: + """ + Creates a feature + """ + return cast( + Feature, + self._request( + "post", + "/v1/entitlements/features", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "FeatureService.CreateParams", + options: RequestOptions = {}, + ) -> Feature: + """ + Creates a feature + """ + return cast( + Feature, + await self._request_async( + "post", + "/v1/entitlements/features", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "FeatureService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Feature: + """ + Retrieves a feature + """ + return cast( + Feature, + self._request( + "get", + "/v1/entitlements/features/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "FeatureService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Feature: + """ + Retrieves a feature + """ + return cast( + Feature, + await self._request_async( + "get", + "/v1/entitlements/features/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + params: "FeatureService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Feature: + """ + Update a feature's metadata or permanently deactivate it. + """ + return cast( + Feature, + self._request( + "post", + "/v1/entitlements/features/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: "FeatureService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Feature: + """ + Update a feature's metadata or permanently deactivate it. + """ + return cast( + Feature, + await self._request_async( + "post", + "/v1/entitlements/features/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index f15f43fd8..d36bbd92d 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -508,7 +508,10 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): class CreateParamsLineItem(TypedDict): amount: int """ - A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the line item's total price. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. + A positive integer representing the line item's total price in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + The minimum amount is $0.0 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + The amount value supports up to twelve digits (e.g., a value of 999999999999 for a USD charge of $9,999,999,999.99). + If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ product: NotRequired[str] """ diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index 5f649cb9e..be1ac849c 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -184,7 +184,10 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): class CreateParamsLineItem(TypedDict): amount: int """ - A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the line item's total price. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. + A positive integer representing the line item's total price in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + The minimum amount is $0.0 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + The amount value supports up to twelve digits (e.g., a value of 999999999999 for a USD charge of $9,999,999,999.99). + If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ product: NotRequired[str] """ From ef23ca4945e43d76828892ac211cefdd95d52045 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Tue, 9 Apr 2024 14:10:23 -0700 Subject: [PATCH 041/179] Bump version to 8.11.0 --- CHANGELOG.md | 15 +++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 549d7faef..bac507a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## 8.11.0 - 2024-04-09 +* [#1295](https://github.com/stripe/stripe-python/pull/1295) Update generated code + * Add support for `fees`, `losses`, `requirement_collection` & `stripe_dashboard` on resource class `stripe.Account.Controller` + * Add support for `controller` on parameter class `stripe.Account.CreateParams` + * Add support for `create_feature`, `delete_feature`, `list_features`, `retrieve_feature` on resource `stripe.Product` + * Add support for resource `stripe.ProductFeature` + * Add support for `event_name` on parameter class `stripe.billing.MeterEventAdjustment.CreateParams` and resource `stripe.billing.MeterEventAdjustment` + * Add support for `cancel` and `type` on resource `stripe.billing.MeterEventAdjustment` + * Add support for resource `stripe.entitlements.ActiveEntitlement` + * Add support for resource `stripe.entitlements.Feature` + * Add support for `none` on enum `stripe.Account.type` + +* [#1299](https://github.com/stripe/stripe-python/pull/1299) Fix README.md +* [#1292](https://github.com/stripe/stripe-python/pull/1292) Tweak changelog for python async note + ## 8.10.0 - 2024-04-04 * [#1288](https://github.com/stripe/stripe-python/pull/1288) Port **async support** from beta to the stable channel. To use it, add an `_async` suffix to any request-making method. diff --git a/VERSION b/VERSION index 7f6758ef9..db3905bf8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.10.0 +8.11.0 diff --git a/stripe/_version.py b/stripe/_version.py index 3704869d7..db4211e2c 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "8.10.0" +VERSION = "8.11.0" From 5d04ef554f6bcb90f319ce7f19f3ec9c9f34c961 Mon Sep 17 00:00:00 2001 From: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:52:07 -0700 Subject: [PATCH 042/179] Sdk release/next major (#1286) --- OPENAPI_VERSION | 2 +- stripe/_api_version.py | 2 +- stripe/_balance_transaction.py | 4 - stripe/_event.py | 8 - stripe/_invoice.py | 41 +-- stripe/_invoice_line_item.py | 1 - stripe/_invoice_line_item_service.py | 1 - stripe/_invoice_service.py | 30 +-- stripe/_payment_intent.py | 18 -- stripe/_payment_intent_service.py | 18 -- stripe/_payment_method_configuration.py | 120 --------- stripe/_product.py | 36 +-- stripe/_product_service.py | 26 +- stripe/_setup_intent.py | 2 +- stripe/_tax_rate.py | 3 - stripe/_tax_rate_service.py | 2 - stripe/_webhook_endpoint.py | 17 +- stripe/_webhook_endpoint_service.py | 17 +- stripe/billing_portal/_configuration.py | 32 --- .../billing_portal/_configuration_service.py | 24 -- stripe/climate/_supplier.py | 1 - stripe/reporting/_report_run.py | 1 - stripe/reporting/_report_run_service.py | 1 - .../_financial_account_features_service.py | 244 ------------------ tests/test_generated_examples.py | 6 +- 25 files changed, 45 insertions(+), 612 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d91517e10..33b0af258 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v938 +v940 diff --git a/stripe/_api_version.py b/stripe/_api_version.py index b0aa0d18f..000e03f4a 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 = "2023-10-16" + CURRENT = "2024-04-10" diff --git a/stripe/_balance_transaction.py b/stripe/_balance_transaction.py index 71c433385..a08724cc5 100644 --- a/stripe/_balance_transaction.py +++ b/stripe/_balance_transaction.py @@ -251,10 +251,6 @@ class RetrieveParams(RequestOptions): "transfer_cancel", "transfer_failure", "transfer_refund", - "obligation_inbound", - "obligation_payout", - "obligation_payout_failure", - "obligation_reversal_outbound", ] """ Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. diff --git a/stripe/_event.py b/stripe/_event.py index 2cb4f1ca2..ea5437e15 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -382,14 +382,6 @@ class RetrieveParams(RequestOptions): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", - "invoiceitem.updated", - "order.created", - "recipient.created", - "recipient.deleted", - "recipient.updated", - "sku.created", - "sku.deleted", - "sku.updated", ] """ Description of the event (for example, `invoice.created` or `charge.refunded`). diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 62dfdd4f4..a47feeeee 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -763,12 +763,6 @@ class Pdf(StripeObject): """ _inner_class_types = {"pdf": Pdf} - class RenderingOptions(StripeObject): - amount_tax_display: Optional[str] - """ - How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - """ - class ShippingCost(StripeObject): class Tax(StripeObject): amount: int @@ -1086,7 +1080,7 @@ class CreateParams(RequestOptions): Configuration settings for the PaymentIntent that is generated when the invoice is finalized. """ pending_invoice_items_behavior: NotRequired[ - Literal["exclude", "include", "include_and_require"] + Literal["exclude", "include"] ] """ How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted. @@ -1095,12 +1089,6 @@ class CreateParams(RequestOptions): """ The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. """ - rendering_options: NotRequired[ - "Literal['']|Invoice.CreateParamsRenderingOptions" - ] - """ - This is a legacy field that will be removed soon. For details about `rendering_options`, refer to `rendering` instead. Options for invoice PDF rendering. - """ shipping_cost: NotRequired["Invoice.CreateParamsShippingCost"] """ Settings for the cost of shipping for this invoice. @@ -1412,14 +1400,6 @@ class CreateParamsRendering(TypedDict): Invoice pdf rendering options """ - class CreateParamsRenderingOptions(TypedDict): - amount_tax_display: NotRequired[ - "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" - ] - """ - How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - """ - class CreateParamsRenderingPdf(TypedDict): page_size: NotRequired[Literal["a4", "auto", "letter"]] """ @@ -1790,12 +1770,6 @@ class ModifyParams(RequestOptions): """ The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. """ - rendering_options: NotRequired[ - "Literal['']|Invoice.ModifyParamsRenderingOptions" - ] - """ - This is a legacy field that will be removed soon. For details about `rendering_options`, refer to `rendering` instead. Options for invoice PDF rendering. - """ shipping_cost: NotRequired[ "Literal['']|Invoice.ModifyParamsShippingCost" ] @@ -2099,14 +2073,6 @@ class ModifyParamsRendering(TypedDict): Invoice pdf rendering options """ - class ModifyParamsRenderingOptions(TypedDict): - amount_tax_display: NotRequired[ - "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" - ] - """ - How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - """ - class ModifyParamsRenderingPdf(TypedDict): page_size: NotRequired[Literal["a4", "auto", "letter"]] """ @@ -3751,10 +3717,6 @@ class VoidInvoiceParams(RequestOptions): """ The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. """ - rendering_options: Optional[RenderingOptions] - """ - This is a legacy field that will be removed soon. For details about `rendering_options`, refer to `rendering` instead. Options for invoice PDF rendering. - """ shipping_cost: Optional[ShippingCost] """ The details of the cost of shipping, including the ShippingRate applied on the invoice. @@ -4765,7 +4727,6 @@ async def search_auto_paging_iter_async( "last_finalization_error": LastFinalizationError, "payment_settings": PaymentSettings, "rendering": Rendering, - "rendering_options": RenderingOptions, "shipping_cost": ShippingCost, "shipping_details": ShippingDetails, "status_transitions": StatusTransitions, diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 405c55f99..54e82ebfe 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -293,7 +293,6 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): "rst", "sales_tax", "vat", - "service_tax", ] ] """ diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index b7ba96e57..98ce93306 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -217,7 +217,6 @@ class UpdateParamsTaxAmountTaxRateData(TypedDict): "rst", "sales_tax", "vat", - "service_tax", ] ] """ diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 623cd0a74..6f270532a 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -124,7 +124,7 @@ class CreateParams(TypedDict): Configuration settings for the PaymentIntent that is generated when the invoice is finalized. """ pending_invoice_items_behavior: NotRequired[ - Literal["exclude", "include", "include_and_require"] + Literal["exclude", "include"] ] """ How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted. @@ -133,12 +133,6 @@ class CreateParams(TypedDict): """ The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. """ - rendering_options: NotRequired[ - "Literal['']|InvoiceService.CreateParamsRenderingOptions" - ] - """ - This is a legacy field that will be removed soon. For details about `rendering_options`, refer to `rendering` instead. Options for invoice PDF rendering. - """ shipping_cost: NotRequired["InvoiceService.CreateParamsShippingCost"] """ Settings for the cost of shipping for this invoice. @@ -454,14 +448,6 @@ class CreateParamsRendering(TypedDict): Invoice pdf rendering options """ - class CreateParamsRenderingOptions(TypedDict): - amount_tax_display: NotRequired[ - "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" - ] - """ - How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - """ - class CreateParamsRenderingPdf(TypedDict): page_size: NotRequired[Literal["a4", "auto", "letter"]] """ @@ -1462,12 +1448,6 @@ class UpdateParams(TypedDict): """ The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. """ - rendering_options: NotRequired[ - "Literal['']|InvoiceService.UpdateParamsRenderingOptions" - ] - """ - This is a legacy field that will be removed soon. For details about `rendering_options`, refer to `rendering` instead. Options for invoice PDF rendering. - """ shipping_cost: NotRequired[ "Literal['']|InvoiceService.UpdateParamsShippingCost" ] @@ -1773,14 +1753,6 @@ class UpdateParamsRendering(TypedDict): Invoice pdf rendering options """ - class UpdateParamsRenderingOptions(TypedDict): - amount_tax_display: NotRequired[ - "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" - ] - """ - How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - """ - class UpdateParamsRenderingPdf(TypedDict): page_size: NotRequired[Literal["a4", "auto", "letter"]] """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 2abb98dbe..418a8fcaf 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -3231,12 +3231,6 @@ class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ - request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] - ] - """ - This field was released by mistake and will be removed in the next major version - """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ @@ -5372,12 +5366,6 @@ class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ - request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] - ] - """ - This field was released by mistake and will be removed in the next major version - """ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ @@ -7509,12 +7497,6 @@ class ModifyParamsPaymentMethodOptionsCardPresent(TypedDict): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ - request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] - ] - """ - This field was released by mistake and will be removed in the next major version - """ class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index e23dd0236..cf89cb3b1 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -1419,12 +1419,6 @@ class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ - request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] - ] - """ - This field was released by mistake and will be removed in the next major version - """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ @@ -3584,12 +3578,6 @@ class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ - request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] - ] - """ - This field was released by mistake and will be removed in the next major version - """ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ @@ -5773,12 +5761,6 @@ class UpdateParamsPaymentMethodOptionsCardPresent(TypedDict): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ - request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] - ] - """ - This field was released by mistake and will be removed in the next major version - """ class UpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index f8fc6707a..a792854c0 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -807,116 +807,6 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} - class IdBankTransfer(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 Multibanco(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 Netbanking(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 PayByBank(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 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 CreateParams(RequestOptions): acss_debit: NotRequired[ "PaymentMethodConfiguration.CreateParamsAcssDebit" @@ -2384,11 +2274,6 @@ class RetrieveParams(RequestOptions): us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] - id_bank_transfer: Optional[IdBankTransfer] - multibanco: Optional[Multibanco] - netbanking: Optional[Netbanking] - pay_by_bank: Optional[PayByBank] - upi: Optional[Upi] @classmethod def create( @@ -2564,9 +2449,4 @@ async def retrieve_async( "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, - "id_bank_transfer": IdBankTransfer, - "multibanco": Multibanco, - "netbanking": Netbanking, - "pay_by_bank": PayByBank, - "upi": Upi, } diff --git a/stripe/_product.py b/stripe/_product.py index 8be7ef66d..03303e9d7 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -58,7 +58,7 @@ class Product( OBJECT_NAME: ClassVar[Literal["product"]] = "product" - class Feature(StripeObject): + class MarketingFeature(StripeObject): name: Optional[str] """ The marketing feature name. Up to 80 characters long. @@ -109,10 +109,6 @@ class CreateParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - features: NotRequired[List["Product.CreateParamsFeature"]] - """ - A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). - """ id: NotRequired[str] """ An identifier will be randomly generated by Stripe. You can optionally override this ID, but the ID must be unique across all products in your Stripe account. @@ -121,6 +117,12 @@ class CreateParams(RequestOptions): """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ + marketing_features: NotRequired[ + List["Product.CreateParamsMarketingFeature"] + ] + """ + A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. @@ -273,7 +275,7 @@ class CreateParamsDefaultPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ - class CreateParamsFeature(TypedDict): + class CreateParamsMarketingFeature(TypedDict): name: str """ The marketing feature name. Up to 80 characters long. @@ -398,14 +400,16 @@ class ModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - features: NotRequired["Literal['']|List[Product.ModifyParamsFeature]"] - """ - A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). - """ images: NotRequired["Literal['']|List[str]"] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ + marketing_features: NotRequired[ + "Literal['']|List[Product.ModifyParamsMarketingFeature]" + ] + """ + A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/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`. @@ -444,7 +448,7 @@ class ModifyParams(RequestOptions): A URL of a publicly-accessible webpage for this product. """ - class ModifyParamsFeature(TypedDict): + class ModifyParamsMarketingFeature(TypedDict): name: str """ The marketing feature name. Up to 80 characters long. @@ -514,10 +518,6 @@ class SearchParams(RequestOptions): """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ - features: List[Feature] - """ - A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). - """ id: str """ Unique identifier for the object. @@ -530,6 +530,10 @@ class SearchParams(RequestOptions): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ + marketing_features: List[MarketingFeature] + """ + A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. @@ -998,6 +1002,6 @@ async def retrieve_feature_async( ) _inner_class_types = { - "features": Feature, + "marketing_features": MarketingFeature, "package_dimensions": PackageDimensions, } diff --git a/stripe/_product_service.py b/stripe/_product_service.py index 79992b568..90b17ca4a 100644 --- a/stripe/_product_service.py +++ b/stripe/_product_service.py @@ -35,10 +35,6 @@ class CreateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - features: NotRequired[List["ProductService.CreateParamsFeature"]] - """ - A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). - """ id: NotRequired[str] """ An identifier will be randomly generated by Stripe. You can optionally override this ID, but the ID must be unique across all products in your Stripe account. @@ -47,6 +43,12 @@ class CreateParams(TypedDict): """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ + marketing_features: NotRequired[ + List["ProductService.CreateParamsMarketingFeature"] + ] + """ + A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. @@ -206,7 +208,7 @@ class CreateParamsDefaultPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ - class CreateParamsFeature(TypedDict): + class CreateParamsMarketingFeature(TypedDict): name: str """ The marketing feature name. Up to 80 characters long. @@ -334,16 +336,16 @@ class UpdateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - features: NotRequired[ - "Literal['']|List[ProductService.UpdateParamsFeature]" - ] - """ - A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). - """ images: NotRequired["Literal['']|List[str]"] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ + marketing_features: NotRequired[ + "Literal['']|List[ProductService.UpdateParamsMarketingFeature]" + ] + """ + A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/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`. @@ -382,7 +384,7 @@ class UpdateParams(TypedDict): A URL of a publicly-accessible webpage for this product. """ - class UpdateParamsFeature(TypedDict): + class UpdateParamsMarketingFeature(TypedDict): name: str """ The marketing feature name. Up to 80 characters long. diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 673861f37..6928d2f55 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -520,7 +520,7 @@ class MandateOptions(StripeObject): Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time. """ request_three_d_secure: Optional[ - Literal["any", "automatic", "challenge", "challenge_only"] + Literal["any", "automatic", "challenge"] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index 3c7bd7bb3..8ab062194 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -78,7 +78,6 @@ class CreateParams(RequestOptions): "rst", "sales_tax", "vat", - "service_tax", ] ] """ @@ -180,7 +179,6 @@ class ModifyParams(RequestOptions): "rst", "sales_tax", "vat", - "service_tax", ] ] """ @@ -271,7 +269,6 @@ class RetrieveParams(RequestOptions): "rst", "sales_tax", "vat", - "service_tax", ] ] """ diff --git a/stripe/_tax_rate_service.py b/stripe/_tax_rate_service.py index b8d0b0d8d..ffcc6d5ef 100644 --- a/stripe/_tax_rate_service.py +++ b/stripe/_tax_rate_service.py @@ -65,7 +65,6 @@ class CreateParams(TypedDict): "rst", "sales_tax", "vat", - "service_tax", ] ] """ @@ -173,7 +172,6 @@ class UpdateParams(TypedDict): "rst", "sales_tax", "vat", - "service_tax", ] ] """ diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index a27263a70..7a0197197 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -132,6 +132,7 @@ class CreateParams(RequestOptions): "2022-11-15", "2023-08-16", "2023-10-16", + "2024-04-10", ] ] """ @@ -374,14 +375,6 @@ class CreateParams(RequestOptions): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", - "invoiceitem.updated", - "order.created", - "recipient.created", - "recipient.deleted", - "recipient.updated", - "sku.created", - "sku.deleted", - "sku.updated", ] ] """ @@ -660,14 +653,6 @@ class ModifyParams(RequestOptions): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", - "invoiceitem.updated", - "order.created", - "recipient.created", - "recipient.deleted", - "recipient.updated", - "sku.created", - "sku.deleted", - "sku.updated", ] ] ] diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index d4ea213ee..c45bec2e8 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -113,6 +113,7 @@ class CreateParams(TypedDict): "2022-11-15", "2023-08-16", "2023-10-16", + "2024-04-10", ] ] """ @@ -355,14 +356,6 @@ class CreateParams(TypedDict): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", - "invoiceitem.updated", - "order.created", - "recipient.created", - "recipient.deleted", - "recipient.updated", - "sku.created", - "sku.deleted", - "sku.updated", ] ] """ @@ -647,14 +640,6 @@ class UpdateParams(TypedDict): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", - "invoiceitem.updated", - "order.created", - "recipient.created", - "recipient.deleted", - "recipient.updated", - "sku.created", - "sku.deleted", - "sku.updated", ] ] ] diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index 82e402194..39e28a3e6 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -114,12 +114,6 @@ class CancellationReason(StripeObject): """ _inner_class_types = {"cancellation_reason": CancellationReason} - class SubscriptionPause(StripeObject): - enabled: bool - """ - Whether the feature is enabled. - """ - class SubscriptionUpdate(StripeObject): class Product(StripeObject): prices: List[str] @@ -158,14 +152,12 @@ class Product(StripeObject): payment_method_update: PaymentMethodUpdate subscription_cancel: SubscriptionCancel subscription_update: SubscriptionUpdate - subscription_pause: SubscriptionPause _inner_class_types = { "customer_update": CustomerUpdate, "invoice_history": InvoiceHistory, "payment_method_update": PaymentMethodUpdate, "subscription_cancel": SubscriptionCancel, "subscription_update": SubscriptionUpdate, - "subscription_pause": SubscriptionPause, } class LoginPage(StripeObject): @@ -251,12 +243,6 @@ class CreateParamsFeatures(TypedDict): """ Information about updating subscriptions in the portal. """ - subscription_pause: NotRequired[ - "Configuration.CreateParamsFeaturesSubscriptionPause" - ] - """ - Information about pausing subscriptions in the portal. - """ class CreateParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ @@ -328,12 +314,6 @@ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): Which cancellation reasons will be given as options to the customer. """ - class CreateParamsFeaturesSubscriptionPause(TypedDict): - enabled: bool - """ - Whether the feature is enabled. - """ - class CreateParamsFeaturesSubscriptionUpdate(TypedDict): default_allowed_updates: Union[ Literal[""], List[Literal["price", "promotion_code", "quantity"]] @@ -480,12 +460,6 @@ class ModifyParamsFeatures(TypedDict): """ Information about updating subscriptions in the portal. """ - subscription_pause: NotRequired[ - "Configuration.ModifyParamsFeaturesSubscriptionPause" - ] - """ - Information about pausing subscriptions in the portal. - """ class ModifyParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ @@ -545,12 +519,6 @@ class ModifyParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): Which cancellation reasons will be given as options to the customer. """ - class ModifyParamsFeaturesSubscriptionPause(TypedDict): - enabled: bool - """ - Whether the feature is enabled. - """ - class ModifyParamsFeaturesSubscriptionUpdate(TypedDict): default_allowed_updates: NotRequired[ "Literal['']|List[Literal['price', 'promotion_code', 'quantity']]" diff --git a/stripe/billing_portal/_configuration_service.py b/stripe/billing_portal/_configuration_service.py index caf7eaec0..6ccf99723 100644 --- a/stripe/billing_portal/_configuration_service.py +++ b/stripe/billing_portal/_configuration_service.py @@ -81,12 +81,6 @@ class CreateParamsFeatures(TypedDict): """ Information about updating subscriptions in the portal. """ - subscription_pause: NotRequired[ - "ConfigurationService.CreateParamsFeaturesSubscriptionPause" - ] - """ - Information about pausing subscriptions in the portal. - """ class CreateParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ @@ -158,12 +152,6 @@ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): Which cancellation reasons will be given as options to the customer. """ - class CreateParamsFeaturesSubscriptionPause(TypedDict): - enabled: bool - """ - Whether the feature is enabled. - """ - class CreateParamsFeaturesSubscriptionUpdate(TypedDict): default_allowed_updates: Union[ Literal[""], List[Literal["price", "promotion_code", "quantity"]] @@ -316,12 +304,6 @@ class UpdateParamsFeatures(TypedDict): """ Information about updating subscriptions in the portal. """ - subscription_pause: NotRequired[ - "ConfigurationService.UpdateParamsFeaturesSubscriptionPause" - ] - """ - Information about pausing subscriptions in the portal. - """ class UpdateParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ @@ -381,12 +363,6 @@ class UpdateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): Which cancellation reasons will be given as options to the customer. """ - class UpdateParamsFeaturesSubscriptionPause(TypedDict): - enabled: bool - """ - Whether the feature is enabled. - """ - class UpdateParamsFeaturesSubscriptionUpdate(TypedDict): default_allowed_updates: NotRequired[ "Literal['']|List[Literal['price', 'promotion_code', 'quantity']]" diff --git a/stripe/climate/_supplier.py b/stripe/climate/_supplier.py index 74927e9ce..9b4c61f0f 100644 --- a/stripe/climate/_supplier.py +++ b/stripe/climate/_supplier.py @@ -89,7 +89,6 @@ class RetrieveParams(RequestOptions): "biomass_carbon_removal_and_storage", "direct_air_capture", "enhanced_weathering", - "various", ] """ The scientific pathway used for carbon removal. diff --git a/stripe/reporting/_report_run.py b/stripe/reporting/_report_run.py index 9cdbb1754..4ca96087c 100644 --- a/stripe/reporting/_report_run.py +++ b/stripe/reporting/_report_run.py @@ -149,7 +149,6 @@ class CreateParamsParameters(TypedDict): "transfer", "transfer_reversal", "unreconciled_customer_funds", - "obligation", ] ] """ diff --git a/stripe/reporting/_report_run_service.py b/stripe/reporting/_report_run_service.py index dfdc1a0c7..9e8c86dff 100644 --- a/stripe/reporting/_report_run_service.py +++ b/stripe/reporting/_report_run_service.py @@ -88,7 +88,6 @@ class CreateParamsParameters(TypedDict): "transfer", "transfer_reversal", "unreconciled_customer_funds", - "obligation", ] ] """ diff --git a/stripe/treasury/_financial_account_features_service.py b/stripe/treasury/_financial_account_features_service.py index 85f555ac3..a165eb7f7 100644 --- a/stripe/treasury/_financial_account_features_service.py +++ b/stripe/treasury/_financial_account_features_service.py @@ -11,158 +11,6 @@ class FinancialAccountFeaturesService(StripeService): - class CreateParams(TypedDict): - card_issuing: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsCardIssuing" - ] - """ - Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. - """ - deposit_insurance: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsDepositInsurance" - ] - """ - Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. - """ - expand: NotRequired[List[str]] - """ - Specifies which fields in the response should be expanded. - """ - financial_addresses: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsFinancialAddresses" - ] - """ - Contains Features that add FinancialAddresses to the FinancialAccount. - """ - inbound_transfers: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsInboundTransfers" - ] - """ - Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. - """ - intra_stripe_flows: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsIntraStripeFlows" - ] - """ - Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). - """ - outbound_payments: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsOutboundPayments" - ] - """ - Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. - """ - outbound_transfers: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsOutboundTransfers" - ] - """ - Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. - """ - - class CreateParamsCardIssuing(TypedDict): - requested: bool - """ - Whether the FinancialAccount should have the Feature. - """ - - class CreateParamsDepositInsurance(TypedDict): - requested: bool - """ - Whether the FinancialAccount should have the Feature. - """ - - class CreateParamsFinancialAddresses(TypedDict): - aba: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsFinancialAddressesAba" - ] - """ - Adds an ABA FinancialAddress to the FinancialAccount. - """ - - class CreateParamsFinancialAddressesAba(TypedDict): - requested: bool - """ - Whether the FinancialAccount should have the Feature. - """ - - class CreateParamsInboundTransfers(TypedDict): - ach: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsInboundTransfersAch" - ] - """ - Enables ACH Debits via the InboundTransfers API. - """ - - class CreateParamsInboundTransfersAch(TypedDict): - requested: bool - """ - Whether the FinancialAccount should have the Feature. - """ - - class CreateParamsIntraStripeFlows(TypedDict): - requested: bool - """ - Whether the FinancialAccount should have the Feature. - """ - - class CreateParamsOutboundPayments(TypedDict): - ach: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsOutboundPaymentsAch" - ] - """ - Enables ACH transfers via the OutboundPayments API. - """ - us_domestic_wire: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsOutboundPaymentsUsDomesticWire" - ] - """ - Enables US domestic wire transfers via the OutboundPayments API. - """ - - class CreateParamsOutboundPaymentsAch(TypedDict): - requested: bool - """ - Whether the FinancialAccount should have the Feature. - """ - - class CreateParamsOutboundPaymentsUsDomesticWire(TypedDict): - requested: bool - """ - Whether the FinancialAccount should have the Feature. - """ - - class CreateParamsOutboundTransfers(TypedDict): - ach: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsOutboundTransfersAch" - ] - """ - Enables ACH transfers via the OutboundTransfers API. - """ - us_domestic_wire: NotRequired[ - "FinancialAccountFeaturesService.CreateParamsOutboundTransfersUsDomesticWire" - ] - """ - Enables US domestic wire transfers via the OutboundTransfers API. - """ - - class CreateParamsOutboundTransfersAch(TypedDict): - requested: bool - """ - Whether the FinancialAccount should have the Feature. - """ - - class CreateParamsOutboundTransfersUsDomesticWire(TypedDict): - requested: bool - """ - Whether the FinancialAccount should have the Feature. - """ - - class ListParams(TypedDict): - expand: NotRequired[List[str]] - """ - Specifies which fields in the response should be expanded. - """ - class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ @@ -406,95 +254,3 @@ async def retrieve_async( options=options, ), ) - - def list( - self, - financial_account: str, - params: "FinancialAccountFeaturesService.ListParams" = {}, - options: RequestOptions = {}, - ) -> FinancialAccountFeatures: - """ - Retrieves Features information associated with the FinancialAccount. - """ - return cast( - FinancialAccountFeatures, - self._request( - "get", - "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=sanitize_id(financial_account), - ), - api_mode="V1", - base_address="api", - params=params, - options=options, - ), - ) - - async def list_async( - self, - financial_account: str, - params: "FinancialAccountFeaturesService.ListParams" = {}, - options: RequestOptions = {}, - ) -> FinancialAccountFeatures: - """ - Retrieves Features information associated with the FinancialAccount. - """ - return cast( - FinancialAccountFeatures, - await self._request_async( - "get", - "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=sanitize_id(financial_account), - ), - api_mode="V1", - base_address="api", - params=params, - options=options, - ), - ) - - def create( - self, - financial_account: str, - params: "FinancialAccountFeaturesService.CreateParams" = {}, - options: RequestOptions = {}, - ) -> FinancialAccountFeatures: - """ - Updates the Features associated with a FinancialAccount. - """ - return cast( - FinancialAccountFeatures, - self._request( - "post", - "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=sanitize_id(financial_account), - ), - api_mode="V1", - base_address="api", - params=params, - options=options, - ), - ) - - async def create_async( - self, - financial_account: str, - params: "FinancialAccountFeaturesService.CreateParams" = {}, - options: RequestOptions = {}, - ) -> FinancialAccountFeatures: - """ - Updates the Features associated with a FinancialAccount. - """ - return cast( - FinancialAccountFeatures, - await self._request_async( - "post", - "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=sanitize_id(financial_account), - ), - api_mode="V1", - base_address="api", - params=params, - options=options, - ), - ) diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 2f3c97a17..3ea06984c 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -31029,7 +31029,9 @@ def test_treasury_financial_accounts_features_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.financial_accounts.features.list("fa_xxxxxxxxxxxxx") + client.treasury.financial_accounts.features.retrieve( + "fa_xxxxxxxxxxxxx" + ) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", @@ -31063,7 +31065,7 @@ async def test_treasury_financial_accounts_features_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.financial_accounts.features.list_async( + await client.treasury.financial_accounts.features.retrieve_async( "fa_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( From 37874d13893f9bfd4dca9125259f433e36db6c4a Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Wed, 10 Apr 2024 15:59:59 -0700 Subject: [PATCH 043/179] Bump version to 9.0.0 --- CHANGELOG.md | 74 +++++++++++++++++++++++++++++++++++++++------- VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 66 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bac507a47..eb6b07231 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,69 @@ +## 9.0.0 - 2024-04-10 +* [#1286](https://github.com/stripe/stripe-python/pull/1286) + + * This release changes the pinned API version to `2024-04-10`. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-04-10) and carefully review the API changes before upgrading. + + ### ⚠️ Breaking changes + + * Remove `FinancialAccountFeaturesService.CreateParams`, `FinancialAccountFeaturesService.ListParams`, `FinancialAccountFeaturesService.create()`, `FinancialAccountFeaturesService.list()` as Financial account features is a singleton and so should have retrieve and update methods instead of create and list methods. + * Rename `features` to `marketing_features` on parameter classes `stripe.Product.CreateParams` and `stripe.Product.ModifyParams` and resource `stripe.Product`. + + #### ⚠️ Removal of enum values, properties and events that are no longer part of the publicly documented Stripe API + * Remove `.subscription_pause` from the below as the feature to pause subscription on the portal has been deprecated + * `Configuration.Features` + * `ConfigurationService.CreateParamsFeatures` + * `ConfigurationService.UpdateParamsFeatures` + * Remove the below deprecated values for `BalanceTransaction.type` + * `obligation_inbound` + * `obligation_payout` + * `obligation_payout_failure` + * `obligation_reversal_outbound` + * Remove the below deprecated events from `Event.type`, `WebhookEndpoint.CreateParams.enabled_events`, `WebhookEndpoint.ModifyParams.enabled_events`, `WebhookEndpointService.CreateParams.enabled_events`, `WebhookEndpointService.ModifyParams.enabled_events` + * `invoiceitem.updated` + * `order.created` + * `recipient.created` + * `recipient.deleted` + * `recipient.updated` + * `sku.created` + * `sku.deleted` + * `sku.updated` + * Remove the deprecated value `include_and_require` for `Invoice.CreateParams.pending_invoice_items_behavior` and `InvoiceService.CreateParams.pending_invoice_items_behavior` + * Remove the deprecated value `service_tax` for + * `TaxRate.RetrieveParams.tax_type` + * `TaxRate.CreateParams.tax_type` + * `TaxRate.ModifyParams.tax_type` + * `TaxRateService.CreateParams.tax_type` + * `TaxRateService.UpdateParams.tax_type` + * `InvoiceLineItem.ModifyParamsTaxAmountTaxRateData.tax_type` + * `InvoiceLineItemService.UpdateParamsTaxAmountTaxRateData.tax_type` + * Remove `request_incremental_authorization` from + * `PaymentIntent.ConfirmParamsPaymentMethodOptionsCardPresent` + * `PaymentIntent.CreateParamsPaymentMethodOptionsCardPresent` + * `PaymentIntent.ModifyParamsPaymentMethodOptionsCardPresent` + * `PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardPresent` + * `PaymentIntentService.CreateParamsPaymentMethodOptionsCardPresent` + * `PaymentIntentService.ModifyParamsPaymentMethodOptionsCardPresent` + * Remove support for `id_bank_transfer`, `multibanco`, `netbanking`, `pay_by_bank`, and `upi` on `PaymentMethodConfiguration` + * Remove the deprecated value `challenge_only` from `SetupIntent.PaymentMethodOptions.Card.request_three_d_secure` + * Remove deprecated value `various` for `Climate.Supplier.removal_pathway` + * Remove the deprecated value `obligation` for `ReportRun.CreateParamsParameters.reporting_category` and `ReportRunService.CreateParamsParameters.reporting_category` + * Remove the legacy field `rendering_options` on parameter classes `stripe.Invoice.CreateParams` and `stripe.Invoice.ModifyParams` and resource `stripe.Invoice`. Use `rendering` instead. + + + + ## 8.11.0 - 2024-04-09 * [#1295](https://github.com/stripe/stripe-python/pull/1295) Update generated code - * Add support for `fees`, `losses`, `requirement_collection` & `stripe_dashboard` on resource class `stripe.Account.Controller` - * Add support for `controller` on parameter class `stripe.Account.CreateParams` - * Add support for `create_feature`, `delete_feature`, `list_features`, `retrieve_feature` on resource `stripe.Product` - * Add support for resource `stripe.ProductFeature` - * Add support for `event_name` on parameter class `stripe.billing.MeterEventAdjustment.CreateParams` and resource `stripe.billing.MeterEventAdjustment` - * Add support for `cancel` and `type` on resource `stripe.billing.MeterEventAdjustment` - * Add support for resource `stripe.entitlements.ActiveEntitlement` - * Add support for resource `stripe.entitlements.Feature` - * Add support for `none` on enum `stripe.Account.type` - + * Add support for `fees`, `losses`, `requirement_collection` & `stripe_dashboard` on resource class `stripe.Account.Controller` + * Add support for `controller` on parameter class `stripe.Account.CreateParams` + * Add support for `create_feature`, `delete_feature`, `list_features`, `retrieve_feature` on resource `stripe.Product` + * Add support for resource `stripe.ProductFeature` + * Add support for `event_name` on parameter class `stripe.billing.MeterEventAdjustment.CreateParams` and resource `stripe.billing.MeterEventAdjustment` + * Add support for `cancel` and `type` on resource `stripe.billing.MeterEventAdjustment` + * Add support for resource `stripe.entitlements.ActiveEntitlement` + * Add support for resource `stripe.entitlements.Feature` + * Add support for `none` on enum `stripe.Account.type` + * [#1299](https://github.com/stripe/stripe-python/pull/1299) Fix README.md * [#1292](https://github.com/stripe/stripe-python/pull/1292) Tweak changelog for python async note diff --git a/VERSION b/VERSION index db3905bf8..f7ee06693 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.11.0 +9.0.0 diff --git a/stripe/_version.py b/stripe/_version.py index db4211e2c..6039f61e4 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "8.11.0" +VERSION = "9.0.0" From 4346e49ba121e8f3325ee325cef00781d3cf2601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 11 Apr 2024 20:57:18 +0200 Subject: [PATCH 044/179] Use stdlib AsyncMock when available (#1297) --- test-requirements.txt | 2 +- tests/test_http_client.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index efc89509e..843756dad 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,7 +10,7 @@ anyio[trio] == 3.6.2 pytest-cov >= 2.8.1, < 2.11.0 pytest-mock >= 2.0.0 -asyncmock >= 0.4.2 +mock >= 4.0; python_version < "3.8" pytest-xdist >= 1.31.0 pytest >= 6.0.0 coverage >= 4.5.3, < 5 diff --git a/tests/test_http_client.py b/tests/test_http_client.py index 0e04e47f0..3b8292188 100644 --- a/tests/test_http_client.py +++ b/tests/test_http_client.py @@ -3,7 +3,12 @@ from unittest.mock import call import pytest import json -from mock import AsyncMock +import sys + +if sys.version_info >= (3, 8): + from unittest.mock import AsyncMock +else: + from mock import AsyncMock import stripe from stripe import _http_client From b106d48e46e8cc3d7175397946517e1650378318 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 22:57:52 +0000 Subject: [PATCH 045/179] Update generated code (#1300) * Update generated code for v942 * Update generated code for v943 * Update generated code for v944 * Update generated code for v945 * Update generated code for v946 * Update generated code for v947 * Update generated code for v948 * Update generated code for v949 * Update generated code for v950 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 4 +- stripe/_account_session.py | 90 +++++++++++- stripe/_account_session_service.py | 53 ++++++- stripe/_bank_account.py | 4 +- stripe/_capability.py | 4 +- stripe/_charge.py | 13 +- stripe/_charge_service.py | 4 +- stripe/_confirmation_token.py | 16 +++ stripe/_customer.py | 13 +- stripe/_customer_payment_method_service.py | 1 + stripe/_customer_service.py | 6 +- stripe/_customer_tax_id_service.py | 6 +- stripe/_invoice.py | 37 ++++- stripe/_invoice_service.py | 14 +- stripe/_invoice_upcoming_lines_service.py | 6 +- stripe/_payment_intent.py | 136 +++++++++++++++++- stripe/_payment_intent_service.py | 120 +++++++++++++++- stripe/_payment_method.py | 15 ++ stripe/_payment_method_configuration.py | 64 +++++++++ .../_payment_method_configuration_service.py | 40 ++++++ stripe/_payment_method_service.py | 9 ++ stripe/_person.py | 4 +- stripe/_refund.py | 5 + stripe/_reversal.py | 2 +- stripe/_setup_attempt.py | 4 + stripe/_setup_intent.py | 82 ++++++++++- stripe/_setup_intent_service.py | 69 ++++++++- stripe/_subscription.py | 15 +- stripe/_subscription_service.py | 8 +- stripe/_tax_id.py | 12 +- stripe/_tax_id_service.py | 6 +- stripe/_usage_record.py | 2 + stripe/billing/_meter.py | 2 +- stripe/billing/_meter_event_adjustment.py | 21 +-- .../_meter_event_adjustment_service.py | 8 +- stripe/billing_portal/_session.py | 4 +- stripe/billing_portal/_session_service.py | 2 +- stripe/checkout/_session.py | 36 ++++- stripe/checkout/_session_service.py | 21 ++- stripe/financial_connections/_account.py | 4 + stripe/tax/_calculation.py | 12 +- stripe/tax/_calculation_service.py | 6 +- stripe/tax/_transaction.py | 6 +- .../_confirmation_token_service.py | 10 ++ 45 files changed, 916 insertions(+), 82 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 33b0af258..b18a87edc 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v940 +v950 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index b6de1a7f5..a813c1bf7 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -745,7 +745,7 @@ class Error(StripeObject): """ pending_verification: Optional[List[str]] """ - Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. + Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"alternatives": Alternative, "errors": Error} @@ -893,7 +893,7 @@ class Error(StripeObject): """ pending_verification: Optional[List[str]] """ - Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"alternatives": Alternative, "errors": Error} diff --git a/stripe/_account_session.py b/stripe/_account_session.py index 042c43bbb..f5e746ab0 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -21,9 +21,26 @@ class AccountSession(CreateableAPIResource["AccountSession"]): OBJECT_NAME: ClassVar[Literal["account_session"]] = "account_session" class Components(StripeObject): + class AccountManagement(StripeObject): + class Features(StripeObject): + external_account_collection: bool + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + class AccountOnboarding(StripeObject): class Features(StripeObject): - pass + external_account_collection: bool + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ enabled: bool """ @@ -43,6 +60,20 @@ class Features(StripeObject): features: Features _inner_class_types = {"features": Features} + class NotificationBanner(StripeObject): + class Features(StripeObject): + external_account_collection: bool + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + class PaymentDetails(StripeObject): class Features(StripeObject): capture_payments: bool @@ -117,14 +148,18 @@ class Features(StripeObject): features: Features _inner_class_types = {"features": Features} + account_management: AccountManagement account_onboarding: AccountOnboarding documents: Documents + notification_banner: NotificationBanner payment_details: PaymentDetails payments: Payments payouts: Payouts _inner_class_types = { + "account_management": AccountManagement, "account_onboarding": AccountOnboarding, "documents": Documents, + "notification_banner": NotificationBanner, "payment_details": PaymentDetails, "payments": Payments, "payouts": Payouts, @@ -145,6 +180,12 @@ class CreateParams(RequestOptions): """ class CreateParamsComponents(TypedDict): + account_management: NotRequired[ + "AccountSession.CreateParamsComponentsAccountManagement" + ] + """ + Configuration for the account management embedded component. + """ account_onboarding: NotRequired[ "AccountSession.CreateParamsComponentsAccountOnboarding" ] @@ -157,6 +198,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for the documents embedded component. """ + notification_banner: NotRequired[ + "AccountSession.CreateParamsComponentsNotificationBanner" + ] + """ + Configuration for the notification banner embedded component. + """ payment_details: NotRequired[ "AccountSession.CreateParamsComponentsPaymentDetails" ] @@ -172,6 +219,24 @@ class CreateParamsComponents(TypedDict): Configuration for the payouts embedded component. """ + class CreateParamsComponentsAccountManagement(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsAccountManagementFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsAccountManagementFeatures(TypedDict): + external_account_collection: NotRequired[bool] + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ + class CreateParamsComponentsAccountOnboarding(TypedDict): enabled: bool """ @@ -185,7 +250,10 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): """ class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): - pass + external_account_collection: NotRequired[bool] + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ class CreateParamsComponentsDocuments(TypedDict): enabled: bool @@ -202,6 +270,24 @@ class CreateParamsComponentsDocuments(TypedDict): class CreateParamsComponentsDocumentsFeatures(TypedDict): pass + class CreateParamsComponentsNotificationBanner(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsNotificationBannerFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsNotificationBannerFeatures(TypedDict): + external_account_collection: NotRequired[bool] + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ + class CreateParamsComponentsPaymentDetails(TypedDict): enabled: bool """ diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index d3096d4f3..e8bcac6c6 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -23,6 +23,12 @@ class CreateParams(TypedDict): """ class CreateParamsComponents(TypedDict): + account_management: NotRequired[ + "AccountSessionService.CreateParamsComponentsAccountManagement" + ] + """ + Configuration for the account management embedded component. + """ account_onboarding: NotRequired[ "AccountSessionService.CreateParamsComponentsAccountOnboarding" ] @@ -35,6 +41,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for the documents embedded component. """ + notification_banner: NotRequired[ + "AccountSessionService.CreateParamsComponentsNotificationBanner" + ] + """ + Configuration for the notification banner embedded component. + """ payment_details: NotRequired[ "AccountSessionService.CreateParamsComponentsPaymentDetails" ] @@ -54,6 +66,24 @@ class CreateParamsComponents(TypedDict): Configuration for the payouts embedded component. """ + class CreateParamsComponentsAccountManagement(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsAccountManagementFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsAccountManagementFeatures(TypedDict): + external_account_collection: NotRequired[bool] + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ + class CreateParamsComponentsAccountOnboarding(TypedDict): enabled: bool """ @@ -67,7 +97,10 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): """ class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): - pass + external_account_collection: NotRequired[bool] + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ class CreateParamsComponentsDocuments(TypedDict): enabled: bool @@ -84,6 +117,24 @@ class CreateParamsComponentsDocuments(TypedDict): class CreateParamsComponentsDocumentsFeatures(TypedDict): pass + class CreateParamsComponentsNotificationBanner(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsNotificationBannerFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsNotificationBannerFeatures(TypedDict): + external_account_collection: NotRequired[bool] + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ + class CreateParamsComponentsPaymentDetails(TypedDict): enabled: bool """ diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index 049e0859b..39e2d806d 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -152,7 +152,7 @@ class Error(StripeObject): """ pending_verification: Optional[List[str]] """ - Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"errors": Error} @@ -274,7 +274,7 @@ class Error(StripeObject): """ pending_verification: Optional[List[str]] """ - Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"errors": Error} diff --git a/stripe/_capability.py b/stripe/_capability.py index b4846bdfa..8dc7d3185 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -162,7 +162,7 @@ class Error(StripeObject): """ pending_verification: List[str] """ - Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. + Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"alternatives": Alternative, "errors": Error} @@ -316,7 +316,7 @@ class Error(StripeObject): """ pending_verification: List[str] """ - Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"alternatives": Alternative, "errors": Error} diff --git a/stripe/_charge.py b/stripe/_charge.py index ecdd97c3e..ecb49d523 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -279,6 +279,9 @@ class Alipay(StripeObject): Transaction ID of this particular Alipay transaction. """ + class AmazonPay(StripeObject): + pass + class AuBecsDebit(StripeObject): bsb_number: Optional[str] """ @@ -1575,6 +1578,7 @@ class Zip(StripeObject): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] @@ -1624,6 +1628,7 @@ class Zip(StripeObject): "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, @@ -1776,7 +1781,7 @@ class CreateParams(RequestOptions): application_fee: NotRequired[int] application_fee_amount: NotRequired[int] """ - A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). + A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collect-fees). """ capture: NotRequired[bool] """ @@ -1805,7 +1810,7 @@ class CreateParams(RequestOptions): """ on_behalf_of: NotRequired[str] """ - The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). + The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). """ radar_options: NotRequired["Charge.CreateParamsRadarOptions"] """ @@ -2120,11 +2125,11 @@ class SearchParams(RequestOptions): """ application_fee: Optional[ExpandableField["ApplicationFee"]] """ - The application fee (if any) for the charge. [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details. + The application fee (if any) for the charge. [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collect-fees) for details. """ application_fee_amount: Optional[int] """ - The amount of the application fee (if any) requested for the charge. [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details. + The amount of the application fee (if any) requested for the charge. [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collect-fees) for details. """ authorization_code: Optional[str] """ diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index f7ffe65b6..eeb199f83 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -63,7 +63,7 @@ class CreateParams(TypedDict): application_fee: NotRequired[int] application_fee_amount: NotRequired[int] """ - A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). + A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collect-fees). """ capture: NotRequired[bool] """ @@ -92,7 +92,7 @@ class CreateParams(TypedDict): """ on_behalf_of: NotRequired[str] """ - The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). + The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). """ radar_options: NotRequired["ChargeService.CreateParamsRadarOptions"] """ diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index f00c11ace..b569a400f 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -93,6 +93,9 @@ class AfterpayClearpay(StripeObject): class Alipay(StripeObject): pass + class AmazonPay(StripeObject): + pass + class AuBecsDebit(StripeObject): bsb_number: Optional[str] """ @@ -1011,6 +1014,7 @@ class Zip(StripeObject): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] @@ -1046,6 +1050,7 @@ class Zip(StripeObject): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -1090,6 +1095,7 @@ class Zip(StripeObject): "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, @@ -1218,6 +1224,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataAuBecsDebit" ] @@ -1393,6 +1405,7 @@ class CreateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -1466,6 +1479,9 @@ class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class CreateParamsPaymentMethodDataAlipay(TypedDict): pass + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ diff --git a/stripe/_customer.py b/stripe/_customer.py index a0675d953..0d6f32fcc 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -511,6 +511,7 @@ class CreateParamsTaxIdDatum(TypedDict): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -544,14 +545,17 @@ class CreateParamsTaxIdDatum(TypedDict): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -574,7 +578,7 @@ class CreateParamsTaxIdDatum(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -608,6 +612,7 @@ class CreateTaxIdParams(RequestOptions): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -641,14 +646,17 @@ class CreateTaxIdParams(RequestOptions): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -671,7 +679,7 @@ class CreateTaxIdParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -818,6 +826,7 @@ class ListPaymentMethodsParams(RequestOptions): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 0d8741e8c..2391597d0 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -33,6 +33,7 @@ class ListParams(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 5329693b9..c156dc5ae 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -276,6 +276,7 @@ class CreateParamsTaxIdDatum(TypedDict): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -309,14 +310,17 @@ class CreateParamsTaxIdDatum(TypedDict): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -339,7 +343,7 @@ class CreateParamsTaxIdDatum(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index 2b89ca5e1..5a23a05a6 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -22,6 +22,7 @@ class CreateParams(TypedDict): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -55,14 +56,17 @@ class CreateParams(TypedDict): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -85,7 +89,7 @@ class CreateParams(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index a47feeeee..da4dcf7c9 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -212,6 +212,7 @@ class CustomerTaxId(StripeObject): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -245,14 +246,17 @@ class CustomerTaxId(StripeObject): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -276,7 +280,7 @@ class CustomerTaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, or `unknown` """ value: Optional[str] """ @@ -333,6 +337,10 @@ class LastFinalizationError(StripeObject): "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", + "billing_policy_remote_function_response_invalid", + "billing_policy_remote_function_timeout", + "billing_policy_remote_function_unexpected_status_code", + "billing_policy_remote_function_unreachable", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", @@ -638,7 +646,10 @@ class FinancialConnections(StripeObject): permissions: Optional[ List[ Literal[ - "balances", "payment_method", "transactions" + "balances", + "ownership", + "payment_method", + "transactions", ] ] ] @@ -646,7 +657,7 @@ class FinancialConnections(StripeObject): The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ - List[Literal["balances", "transactions"]] + List[Literal["balances", "ownership", "transactions"]] ] """ Data features requested to be retrieved upon account creation. @@ -1383,7 +1394,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -2056,7 +2069,9 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -2566,6 +2581,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -2599,14 +2615,17 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -2629,7 +2648,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -3126,6 +3145,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -3159,14 +3179,17 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -3189,7 +3212,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 6f270532a..d21530752 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -431,7 +431,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -1027,6 +1029,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -1060,14 +1063,17 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -1090,7 +1096,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -1736,7 +1742,9 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index a6d964731..a4e7d4c73 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -267,6 +267,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -300,14 +301,17 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -330,7 +334,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 418a8fcaf..f940285cd 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -118,6 +118,10 @@ class LastPaymentError(StripeObject): "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", + "billing_policy_remote_function_response_invalid", + "billing_policy_remote_function_timeout", + "billing_policy_remote_function_unexpected_status_code", + "billing_policy_remote_function_unreachable", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", @@ -1022,6 +1026,12 @@ class Alipay(StripeObject): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class AmazonPay(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class AuBecsDebit(StripeObject): setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] @@ -1618,7 +1628,9 @@ class FinancialConnections(StripeObject): """ The list of permissions to request. The `payment_method` permission must be included. """ - prefetch: Optional[List[Literal["balances", "transactions"]]] + prefetch: Optional[ + List[Literal["balances", "ownership", "transactions"]] + ] """ Data features requested to be retrieved upon account creation. """ @@ -1694,6 +1706,7 @@ class Zip(StripeObject): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] @@ -1731,6 +1744,7 @@ class Zip(StripeObject): "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, @@ -2077,6 +2091,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataAuBecsDebit" ] @@ -2242,6 +2262,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -2315,6 +2336,9 @@ class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): class ConfirmParamsPaymentMethodDataAlipay(TypedDict): pass + class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ @@ -2661,6 +2685,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ + amazon_pay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + """ au_becs_debit: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAuBecsDebit" ] @@ -2965,6 +2995,26 @@ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -3870,7 +3920,9 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -4212,6 +4264,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataAuBecsDebit" ] @@ -4377,6 +4435,7 @@ class CreateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -4450,6 +4509,9 @@ class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class CreateParamsPaymentMethodDataAlipay(TypedDict): pass + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ @@ -4796,6 +4858,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ + amazon_pay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + """ au_becs_debit: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAuBecsDebit" ] @@ -5100,6 +5168,26 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -6005,7 +6093,9 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -6343,6 +6433,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataAuBecsDebit" ] @@ -6508,6 +6604,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -6581,6 +6678,9 @@ class ModifyParamsPaymentMethodDataAfterpayClearpay(TypedDict): class ModifyParamsPaymentMethodDataAlipay(TypedDict): pass + class ModifyParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class ModifyParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ @@ -6927,6 +7027,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ + amazon_pay: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + """ au_becs_debit: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsAuBecsDebit" ] @@ -7231,6 +7337,26 @@ class ModifyParamsPaymentMethodOptionsAlipay(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class ModifyParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -8136,7 +8262,9 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index cf89cb3b1..264bef1f5 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -245,6 +245,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataAuBecsDebit" ] @@ -428,6 +434,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -503,6 +510,9 @@ class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): class ConfirmParamsPaymentMethodDataAlipay(TypedDict): pass + class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ @@ -849,6 +859,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ + amazon_pay: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + """ au_becs_debit: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAuBecsDebit" ] @@ -1153,6 +1169,26 @@ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -2058,7 +2094,9 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -2404,6 +2442,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataAuBecsDebit" ] @@ -2587,6 +2631,7 @@ class CreateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -2662,6 +2707,9 @@ class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class CreateParamsPaymentMethodDataAlipay(TypedDict): pass + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ @@ -3008,6 +3056,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ + amazon_pay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + """ au_becs_debit: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAuBecsDebit" ] @@ -3312,6 +3366,26 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -4217,7 +4291,9 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -4587,6 +4663,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataAuBecsDebit" ] @@ -4770,6 +4852,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -4845,6 +4928,9 @@ class UpdateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class UpdateParamsPaymentMethodDataAlipay(TypedDict): pass + class UpdateParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class UpdateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ @@ -5191,6 +5277,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ + amazon_pay: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + """ au_becs_debit: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsAuBecsDebit" ] @@ -5495,6 +5587,26 @@ class UpdateParamsPaymentMethodOptionsAlipay(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class UpdateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -6400,7 +6512,9 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 5697697aa..99f07214d 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -69,6 +69,9 @@ class AfterpayClearpay(StripeObject): class Alipay(StripeObject): pass + class AmazonPay(StripeObject): + pass + class AuBecsDebit(StripeObject): bsb_number: Optional[str] """ @@ -1018,6 +1021,10 @@ class CreateParams(RequestOptions): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired["PaymentMethod.CreateParamsAmazonPay"] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired["PaymentMethod.CreateParamsAuBecsDebit"] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. @@ -1166,6 +1173,7 @@ class CreateParams(RequestOptions): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -1237,6 +1245,9 @@ class CreateParamsAfterpayClearpay(TypedDict): class CreateParamsAlipay(TypedDict): pass + class CreateParamsAmazonPay(TypedDict): + pass + class CreateParamsAuBecsDebit(TypedDict): account_number: str """ @@ -1623,6 +1634,7 @@ class ListParams(RequestOptions): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -1778,6 +1790,7 @@ class RetrieveParams(RequestOptions): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] @@ -1841,6 +1854,7 @@ class RetrieveParams(RequestOptions): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -2344,6 +2358,7 @@ async def retrieve_async( "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index a792854c0..f37f61df1 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -125,6 +125,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class AmazonPay(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 ApplePay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -828,6 +850,12 @@ class CreateParams(RequestOptions): """ Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. Check this [page](https://stripe.com/docs/payments/alipay) for more details. """ + amazon_pay: NotRequired[ + "PaymentMethodConfiguration.CreateParamsAmazonPay" + ] + """ + Amazon Pay is a wallet payment method that lets your customers check out the same way as on Amazon. + """ apple_pay: NotRequired[ "PaymentMethodConfiguration.CreateParamsApplePay" ] @@ -1051,6 +1079,20 @@ class CreateParamsAlipayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsAmazonPay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsAmazonPayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsAmazonPayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsApplePay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsApplePayDisplayPreference" @@ -1534,6 +1576,12 @@ class ModifyParams(RequestOptions): """ Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. Check this [page](https://stripe.com/docs/payments/alipay) for more details. """ + amazon_pay: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsAmazonPay" + ] + """ + Amazon Pay is a wallet payment method that lets your customers check out the same way as on Amazon. + """ apple_pay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsApplePay" ] @@ -1753,6 +1801,20 @@ class ModifyParamsAlipayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsAmazonPay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsAmazonPayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsAmazonPayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsApplePay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsApplePayDisplayPreference" @@ -2215,6 +2277,7 @@ class RetrieveParams(RequestOptions): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + amazon_pay: Optional[AmazonPay] apple_pay: Optional[ApplePay] application: Optional[str] """ @@ -2418,6 +2481,7 @@ async def retrieve_async( "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "amazon_pay": AmazonPay, "apple_pay": ApplePay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index ca855f523..874d0bdff 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -35,6 +35,12 @@ class CreateParams(TypedDict): """ Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. Check this [page](https://stripe.com/docs/payments/alipay) for more details. """ + amazon_pay: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsAmazonPay" + ] + """ + Amazon Pay is a wallet payment method that lets your customers check out the same way as on Amazon. + """ apple_pay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsApplePay" ] @@ -278,6 +284,20 @@ class CreateParamsAlipayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsAmazonPay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsAmazonPayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsAmazonPayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsApplePay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsApplePayDisplayPreference" @@ -771,6 +791,12 @@ class UpdateParams(TypedDict): """ Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. Check this [page](https://stripe.com/docs/payments/alipay) for more details. """ + amazon_pay: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsAmazonPay" + ] + """ + Amazon Pay is a wallet payment method that lets your customers check out the same way as on Amazon. + """ apple_pay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsApplePay" ] @@ -1010,6 +1036,20 @@ class UpdateParamsAlipayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsAmazonPay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsAmazonPayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsAmazonPayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsApplePay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsApplePayDisplayPreference" diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 80db60433..94d5cd2e3 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -39,6 +39,10 @@ class CreateParams(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired["PaymentMethodService.CreateParamsAmazonPay"] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "PaymentMethodService.CreateParamsAuBecsDebit" ] @@ -191,6 +195,7 @@ class CreateParams(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -264,6 +269,9 @@ class CreateParamsAfterpayClearpay(TypedDict): class CreateParamsAlipay(TypedDict): pass + class CreateParamsAmazonPay(TypedDict): + pass + class CreateParamsAuBecsDebit(TypedDict): account_number: str """ @@ -650,6 +658,7 @@ class ListParams(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", diff --git a/stripe/_person.py b/stripe/_person.py index 8f8b4031e..666320784 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -278,7 +278,7 @@ class Error(StripeObject): """ pending_verification: List[str] """ - Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. + Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"alternatives": Alternative, "errors": Error} @@ -474,7 +474,7 @@ class Error(StripeObject): """ pending_verification: List[str] """ - Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"alternatives": Alternative, "errors": Error} diff --git a/stripe/_refund.py b/stripe/_refund.py index eb2dd9b5f..1fc7f726c 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -51,6 +51,9 @@ class AfterpayClearpay(StripeObject): class Alipay(StripeObject): pass + class AmazonPay(StripeObject): + pass + class AuBankTransfer(StripeObject): pass @@ -214,6 +217,7 @@ class Zip(StripeObject): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + amazon_pay: Optional[AmazonPay] au_bank_transfer: Optional[AuBankTransfer] blik: Optional[Blik] br_bank_transfer: Optional[BrBankTransfer] @@ -247,6 +251,7 @@ class Zip(StripeObject): "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "amazon_pay": AmazonPay, "au_bank_transfer": AuBankTransfer, "blik": Blik, "br_bank_transfer": BrBankTransfer, diff --git a/stripe/_reversal.py b/stripe/_reversal.py index 3d8258ef4..c59ae1998 100644 --- a/stripe/_reversal.py +++ b/stripe/_reversal.py @@ -26,7 +26,7 @@ class Reversal(UpdateableAPIResource["Reversal"]): transfer only if the destination account has enough balance to cover the reversal. - Related guide: [Reversing transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#reversing-transfers) + Related guide: [Reverse transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#reverse-transfers) """ OBJECT_NAME: ClassVar[Literal["transfer_reversal"]] = "transfer_reversal" diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 72057e124..8a62b2227 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -440,6 +440,10 @@ class SetupError(StripeObject): "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", + "billing_policy_remote_function_response_invalid", + "billing_policy_remote_function_timeout", + "billing_policy_remote_function_unexpected_status_code", + "billing_policy_remote_function_unreachable", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 6928d2f55..dd3ba242e 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -103,6 +103,10 @@ class LastSetupError(StripeObject): "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", + "billing_policy_remote_function_response_invalid", + "billing_policy_remote_function_timeout", + "billing_policy_remote_function_unexpected_status_code", + "billing_policy_remote_function_unreachable", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", @@ -454,6 +458,9 @@ class MandateOptions(StripeObject): """ _inner_class_types = {"mandate_options": MandateOptions} + class AmazonPay(StripeObject): + pass + class Card(StripeObject): class MandateOptions(StripeObject): amount: int @@ -564,7 +571,9 @@ class FinancialConnections(StripeObject): """ The list of permissions to request. The `payment_method` permission must be included. """ - prefetch: Optional[List[Literal["balances", "transactions"]]] + prefetch: Optional[ + List[Literal["balances", "ownership", "transactions"]] + ] """ Data features requested to be retrieved upon account creation. """ @@ -593,6 +602,7 @@ class MandateOptions(StripeObject): } acss_debit: Optional[AcssDebit] + amazon_pay: Optional[AmazonPay] card: Optional[Card] card_present: Optional[CardPresent] link: Optional[Link] @@ -601,6 +611,7 @@ class MandateOptions(StripeObject): us_bank_account: Optional[UsBankAccount] _inner_class_types = { "acss_debit": AcssDebit, + "amazon_pay": AmazonPay, "card": Card, "card_present": CardPresent, "link": Link, @@ -727,6 +738,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataAuBecsDebit" ] @@ -882,6 +899,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -955,6 +973,9 @@ class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): class ConfirmParamsPaymentMethodDataAlipay(TypedDict): pass + class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ @@ -1281,6 +1302,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. """ + amazon_pay: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. + """ card: NotRequired["SetupIntent.ConfirmParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. @@ -1358,6 +1385,9 @@ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): Transaction type of the mandate. """ + class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): + pass + class ConfirmParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsCardMandateOptions" @@ -1586,7 +1616,9 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -1782,6 +1814,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataAuBecsDebit" ] @@ -1937,6 +1975,7 @@ class CreateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -2010,6 +2049,9 @@ class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class CreateParamsPaymentMethodDataAlipay(TypedDict): pass + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ @@ -2336,6 +2378,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. """ + amazon_pay: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. + """ card: NotRequired["SetupIntent.CreateParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. @@ -2413,6 +2461,9 @@ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): Transaction type of the mandate. """ + class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): + pass + class CreateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsCardMandateOptions" @@ -2641,7 +2692,9 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -2806,6 +2859,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataAuBecsDebit" ] @@ -2961,6 +3020,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -3034,6 +3094,9 @@ class ModifyParamsPaymentMethodDataAfterpayClearpay(TypedDict): class ModifyParamsPaymentMethodDataAlipay(TypedDict): pass + class ModifyParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class ModifyParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ @@ -3360,6 +3423,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. """ + amazon_pay: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. + """ card: NotRequired["SetupIntent.ModifyParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. @@ -3437,6 +3506,9 @@ class ModifyParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): Transaction type of the mandate. """ + class ModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): + pass + class ModifyParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsCardMandateOptions" @@ -3665,7 +3737,9 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index a1ea273f5..8c7398cd6 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -132,6 +132,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataAuBecsDebit" ] @@ -315,6 +321,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -390,6 +397,9 @@ class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): class ConfirmParamsPaymentMethodDataAlipay(TypedDict): pass + class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ @@ -718,6 +728,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. """ + amazon_pay: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. + """ card: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsCard" ] @@ -799,6 +815,9 @@ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): Transaction type of the mandate. """ + class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): + pass + class ConfirmParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsCardMandateOptions" @@ -1027,7 +1046,9 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -1227,6 +1248,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataAuBecsDebit" ] @@ -1402,6 +1429,7 @@ class CreateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -1475,6 +1503,9 @@ class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class CreateParamsPaymentMethodDataAlipay(TypedDict): pass + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ @@ -1803,6 +1834,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. """ + amazon_pay: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. + """ card: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsCard" ] @@ -1884,6 +1921,9 @@ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): Transaction type of the mandate. """ + class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): + pass + class CreateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsCardMandateOptions" @@ -2112,7 +2152,9 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -2291,6 +2333,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataAuBecsDebit" ] @@ -2466,6 +2514,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -2539,6 +2588,9 @@ class UpdateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class UpdateParamsPaymentMethodDataAlipay(TypedDict): pass + class UpdateParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class UpdateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ @@ -2867,6 +2919,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. """ + amazon_pay: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. + """ card: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsCard" ] @@ -2948,6 +3006,9 @@ class UpdateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): Transaction type of the mandate. """ + class UpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): + pass + class UpdateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsCardMandateOptions" @@ -3176,7 +3237,9 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ diff --git a/stripe/_subscription.py b/stripe/_subscription.py index fa50d9b7a..933fa2450 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -253,7 +253,10 @@ class FinancialConnections(StripeObject): permissions: Optional[ List[ Literal[ - "balances", "payment_method", "transactions" + "balances", + "ownership", + "payment_method", + "transactions", ] ] ] @@ -261,7 +264,7 @@ class FinancialConnections(StripeObject): The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ - List[Literal["balances", "transactions"]] + List[Literal["balances", "ownership", "transactions"]] ] """ Data features requested to be retrieved upon account creation. @@ -1088,7 +1091,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -1899,7 +1904,9 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 36d33712d..a2b7c45bf 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -690,7 +690,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ @@ -1555,7 +1557,9 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index a220f3d7a..1e481e344 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -85,6 +85,7 @@ class CreateParams(RequestOptions): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -118,14 +119,17 @@ class CreateParams(RequestOptions): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -148,7 +152,7 @@ class CreateParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -249,6 +253,7 @@ class RetrieveParams(RequestOptions): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -282,14 +287,17 @@ class RetrieveParams(RequestOptions): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -313,7 +321,7 @@ class RetrieveParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` """ value: str """ diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py index 237ff8554..9e492e0e0 100644 --- a/stripe/_tax_id_service.py +++ b/stripe/_tax_id_service.py @@ -26,6 +26,7 @@ class CreateParams(TypedDict): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -59,14 +60,17 @@ class CreateParams(TypedDict): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -89,7 +93,7 @@ class CreateParams(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_usage_record.py b/stripe/_usage_record.py index e9d59a621..fdd9cebd4 100644 --- a/stripe/_usage_record.py +++ b/stripe/_usage_record.py @@ -11,6 +11,8 @@ class UsageRecord(CreateableAPIResource["UsageRecord"]): metered billing of subscription prices. Related guide: [Metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) + + This is our legacy usage-based billing API. See the [updated usage-based billing docs](https://docs.stripe.com/billing/subscriptions/usage-based). """ OBJECT_NAME: ClassVar[Literal["usage_record"]] = "usage_record" diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index 198797d8e..bc87cb308 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -28,7 +28,7 @@ class Meter( UpdateableAPIResource["Meter"], ): """ - A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then use the billing meter to charge the user for the number of API calls they make. + A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then attach the billing meter to a price and attach the price to a subscription to charge the user for the number of API calls they make. """ OBJECT_NAME: ClassVar[Literal["billing.meter"]] = "billing.meter" diff --git a/stripe/billing/_meter_event_adjustment.py b/stripe/billing/_meter_event_adjustment.py index ca57fd924..a1199b996 100644 --- a/stripe/billing/_meter_event_adjustment.py +++ b/stripe/billing/_meter_event_adjustment.py @@ -3,13 +3,13 @@ from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from typing import ClassVar, List, cast +from typing import ClassVar, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack class MeterEventAdjustment(CreateableAPIResource["MeterEventAdjustment"]): """ - A billing meter event adjustment represents the status of a meter event adjustment. + A billing meter event adjustment is a resource that allows you to cancel a meter event. For example, you might create a billing meter event adjustment to cancel a meter event that was created in error or attached to the wrong customer. """ OBJECT_NAME: ClassVar[ @@ -17,13 +17,13 @@ class MeterEventAdjustment(CreateableAPIResource["MeterEventAdjustment"]): ] = "billing.meter_event_adjustment" class Cancel(StripeObject): - identifier: str + identifier: Optional[str] """ Unique identifier for the event. """ class CreateParams(RequestOptions): - cancel: "MeterEventAdjustment.CreateParamsCancel" + cancel: NotRequired["MeterEventAdjustment.CreateParamsCancel"] """ Specifies which event to cancel. """ @@ -35,18 +35,21 @@ class CreateParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - type: NotRequired[Literal["cancel"]] + type: Literal["cancel"] """ - Specifies whether to cancel a single event or a range of events for a time period. + Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. """ class CreateParamsCancel(TypedDict): - identifier: str + identifier: NotRequired[str] """ Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. """ - cancel: Cancel + cancel: Optional[Cancel] + """ + Specifies which event to cancel. + """ event_name: str """ The name of the meter event. Corresponds with the `event_name` field on a meter. @@ -65,7 +68,7 @@ class CreateParamsCancel(TypedDict): """ type: Literal["cancel"] """ - Specifies whether to cancel a single event or a range of events for a time period. + Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. """ @classmethod diff --git a/stripe/billing/_meter_event_adjustment_service.py b/stripe/billing/_meter_event_adjustment_service.py index 4dbae5270..038c74cc6 100644 --- a/stripe/billing/_meter_event_adjustment_service.py +++ b/stripe/billing/_meter_event_adjustment_service.py @@ -9,7 +9,7 @@ class MeterEventAdjustmentService(StripeService): class CreateParams(TypedDict): - cancel: "MeterEventAdjustmentService.CreateParamsCancel" + cancel: NotRequired["MeterEventAdjustmentService.CreateParamsCancel"] """ Specifies which event to cancel. """ @@ -21,13 +21,13 @@ class CreateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - type: NotRequired[Literal["cancel"]] + type: Literal["cancel"] """ - Specifies whether to cancel a single event or a range of events for a time period. + Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. """ class CreateParamsCancel(TypedDict): - identifier: str + identifier: NotRequired[str] """ Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. """ diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index 201ac449c..12cacac9d 100644 --- a/stripe/billing_portal/_session.py +++ b/stripe/billing_portal/_session.py @@ -245,7 +245,7 @@ class CreateParams(RequestOptions): """ on_behalf_of: NotRequired[str] """ - The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. + The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. """ return_url: NotRequired[str] """ @@ -481,7 +481,7 @@ class CreateParamsFlowDataSubscriptionUpdateConfirmItem(TypedDict): """ on_behalf_of: Optional[str] """ - The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. + The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. """ return_url: Optional[str] """ diff --git a/stripe/billing_portal/_session_service.py b/stripe/billing_portal/_session_service.py index ef745d0a7..d34247ae0 100644 --- a/stripe/billing_portal/_session_service.py +++ b/stripe/billing_portal/_session_service.py @@ -81,7 +81,7 @@ class CreateParams(TypedDict): """ on_behalf_of: NotRequired[str] """ - The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. + The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. """ return_url: NotRequired[str] """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 303f95b8d..561a67be3 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -329,6 +329,7 @@ class TaxId(StripeObject): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -362,14 +363,17 @@ class TaxId(StripeObject): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -393,7 +397,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, or `unknown` """ value: Optional[str] """ @@ -585,6 +589,9 @@ class Alipay(StripeObject): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class AmazonPay(StripeObject): + pass + class AuBecsDebit(StripeObject): setup_future_usage: Optional[Literal["none"]] """ @@ -925,7 +932,9 @@ class FinancialConnections(StripeObject): """ The list of permissions to request. The `payment_method` permission must be included. """ - prefetch: Optional[List[Literal["balances", "transactions"]]] + prefetch: Optional[ + List[Literal["balances", "ownership", "transactions"]] + ] """ Data features requested to be retrieved upon account creation. """ @@ -957,6 +966,7 @@ class FinancialConnections(StripeObject): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] @@ -987,6 +997,7 @@ class FinancialConnections(StripeObject): "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, @@ -1665,6 +1676,7 @@ class CreateParams(RequestOptions): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -2335,6 +2347,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Alipay payment method options. """ + amazon_pay: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsAmazonPay" + ] + """ + contains details about the AmazonPay payment method options. + """ au_becs_debit: NotRequired[ "Session.CreateParamsPaymentMethodOptionsAuBecsDebit" ] @@ -2540,6 +2558,16 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -2958,7 +2986,9 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 996ee8f18..845bb21e4 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -220,6 +220,7 @@ class CreateParams(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -908,6 +909,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Alipay payment method options. """ + amazon_pay: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsAmazonPay" + ] + """ + contains details about the AmazonPay payment method options. + """ au_becs_debit: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsAuBecsDebit" ] @@ -1141,6 +1148,16 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -1559,7 +1576,9 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ - prefetch: NotRequired[List[Literal["balances", "transactions"]]] + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] """ List of data features that you would like to retrieve upon account creation. """ diff --git a/stripe/financial_connections/_account.py b/stripe/financial_connections/_account.py index ecca2fe22..9ad72758d 100644 --- a/stripe/financial_connections/_account.py +++ b/stripe/financial_connections/_account.py @@ -107,6 +107,10 @@ class OwnershipRefresh(StripeObject): """ The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. """ + next_refresh_available_at: Optional[int] + """ + Time at which the next ownership refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. + """ status: Literal["failed", "pending", "succeeded"] """ The status of the last refresh attempt. diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index d36bbd92d..0de29d22a 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -62,6 +62,7 @@ class TaxId(StripeObject): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -95,14 +96,17 @@ class TaxId(StripeObject): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -126,7 +130,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, or `unknown` """ value: str """ @@ -435,6 +439,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -468,14 +473,17 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -498,7 +506,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index be1ac849c..1f43d8834 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -111,6 +111,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -144,14 +145,17 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -174,7 +178,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index c2aea6e9f..3d9a8fb55 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -62,6 +62,7 @@ class TaxId(StripeObject): "au_abn", "au_arn", "bg_uic", + "bh_vat", "bo_tin", "br_cnpj", "br_cpf", @@ -95,14 +96,17 @@ class TaxId(StripeObject): "jp_trn", "ke_pin", "kr_brn", + "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", + "ng_tin", "no_vat", "no_voec", "nz_gst", + "om_vat", "pe_ruc", "ph_tin", "ro_tin", @@ -126,7 +130,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, or `unknown` """ value: str """ diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index 947094701..d4f38616a 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -63,6 +63,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + amazon_pay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ au_becs_debit: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataAuBecsDebit" ] @@ -246,6 +252,7 @@ class CreateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -321,6 +328,9 @@ class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class CreateParamsPaymentMethodDataAlipay(TypedDict): pass + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): + pass + class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ From c31658479aa2d33b797391d0136cb6470714b9ea Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 11 Apr 2024 16:01:09 -0700 Subject: [PATCH 046/179] Bump version to 9.1.0 --- CHANGELOG.md | 24 ++++++++++++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb6b07231..15d047c40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ +## 9.1.0 - 2024-04-11 +* [#1300](https://github.com/stripe/stripe-python/pull/1300) Update generated code + * Add support for `external_account_collection` on resource class `stripe.AccountSession.Components.AccountOnboarding.Features` and parameter class `stripe.AccountSession.CreateParamsComponentsAccountOnboardingFeatures` + * Add support for `account_management` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `notification_banner` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `amazon_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, `stripe.Refund.DestinationDetails`, `stripe.SetupIntent.PaymentMethodOptions`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptions`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodOptions`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptions`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` + * Add support for `next_refresh_available_at` on resource class `stripe.financial_connections.Account.OwnershipRefresh` + * Change type of field `stripe.billing.MeterEventAdjustment` from `Cancel` to `Optional[Cancel]` of `cancel` + * Change type of field `stripe.billing.MeterEventAdjustment.Cancel` from `str` to `Optional[str]` of `identifier` + * Change type of field `stripe.billing.MeterEventAdjustment.CreateParamsCancel` from `str` to `NotRequired[str]` of `identifier` + * Change type of field `stripe.billing.MeterEventAdjustment.CreateParams` from `MeterEventAdjustment.CreateParamsCancel` to `NotRequired[MeterEventAdjustment.CreateParamsCancel]` of `cancel` + * Change type of field `stripe.billing.MeterEventAdjustment.CreateParams` from `NotRequired[Literal['cancel']]` to `Literal['cancel']` of `type` + * Add support for `bh_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `kz_bin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `ng_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `om_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `ownership` on enums `stripe.checkout.Session.PaymentMethodOptions.UsBankAccount.FinancialConnections.prefetch`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.Invoice.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.permissions`, `stripe.Invoice.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.prefetch`, `stripe.Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.PaymentIntent.PaymentMethodOptions.UsBankAccount.FinancialConnections.prefetch`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.SetupIntent.PaymentMethodOptions.UsBankAccount.FinancialConnections.prefetch`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.Subscription.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.permissions`, `stripe.Subscription.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.prefetch`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, and `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch` + * Add support for `amazon_pay` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `billing_policy_remote_function_response_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Add support for `billing_policy_remote_function_timeout` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Add support for `billing_policy_remote_function_unexpected_status_code` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Add support for `billing_policy_remote_function_unreachable` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` +* [#1297](https://github.com/stripe/stripe-python/pull/1297) Use stdlib AsyncMock when available + ## 9.0.0 - 2024-04-10 * [#1286](https://github.com/stripe/stripe-python/pull/1286) diff --git a/VERSION b/VERSION index f7ee06693..47da986f8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.0.0 +9.1.0 diff --git a/stripe/_version.py b/stripe/_version.py index 6039f61e4..5845a3d39 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.0.0" +VERSION = "9.1.0" From 188abb212aae0737d1956cd182e667e8a898755c Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 23:22:19 -0700 Subject: [PATCH 047/179] Update generated code (#1301) * Update generated code for v951 * Update generated code for v954 * Update generated code for v955 * Update generated code for v956 * Update generated code for v957 * Update generated code for v958 * Update generated code for v960 * Update generated code for v961 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account_session.py | 94 ++++++++++++++++++- stripe/_account_session_service.py | 53 +++++++++++ stripe/_dispute.py | 3 - stripe/_event.py | 1 + stripe/_invoice.py | 8 +- stripe/_object_classes.py | 1 + stripe/_payment_intent.py | 37 +++++++- stripe/_payment_intent_service.py | 24 +++++ stripe/_payment_method_configuration.py | 60 ++++++++++++ .../_payment_method_configuration_service.py | 40 ++++++++ stripe/_setup_attempt.py | 8 +- stripe/_setup_intent.py | 16 ++-- stripe/_webhook_endpoint.py | 2 + stripe/_webhook_endpoint_service.py | 2 + stripe/api_resources/entitlements/__init__.py | 3 + .../active_entitlement_summary.py | 21 +++++ stripe/billing/_meter_event.py | 4 +- stripe/billing/_meter_event_service.py | 4 +- stripe/entitlements/__init__.py | 3 + .../_active_entitlement_summary.py | 35 +++++++ stripe/forwarding/_request.py | 14 +-- stripe/forwarding/_request_service.py | 4 - 23 files changed, 392 insertions(+), 47 deletions(-) create mode 100644 stripe/api_resources/entitlements/active_entitlement_summary.py create mode 100644 stripe/entitlements/_active_entitlement_summary.py diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index b18a87edc..ea2fb0ba1 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v950 \ No newline at end of file +v961 \ No newline at end of file diff --git a/stripe/_account_session.py b/stripe/_account_session.py index f5e746ab0..dee4292d1 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -3,7 +3,7 @@ from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack @@ -49,6 +49,28 @@ class Features(StripeObject): features: Features _inner_class_types = {"features": Features} + class Balances(StripeObject): + class Features(StripeObject): + edit_payout_schedule: bool + """ + Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + """ + instant_payouts: bool + """ + Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + """ + standard_payouts: bool + """ + Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + """ + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + class Documents(StripeObject): class Features(StripeObject): pass @@ -80,7 +102,7 @@ class Features(StripeObject): """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ - destination_on_behalf_of_charge_management: Optional[bool] + destination_on_behalf_of_charge_management: bool """ Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. """ @@ -106,7 +128,7 @@ class Features(StripeObject): """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ - destination_on_behalf_of_charge_management: Optional[bool] + destination_on_behalf_of_charge_management: bool """ Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. """ @@ -148,21 +170,36 @@ class Features(StripeObject): features: Features _inner_class_types = {"features": Features} + class PayoutsList(StripeObject): + class Features(StripeObject): + pass + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + account_management: AccountManagement account_onboarding: AccountOnboarding + balances: Balances documents: Documents notification_banner: NotificationBanner payment_details: PaymentDetails payments: Payments payouts: Payouts + payouts_list: PayoutsList _inner_class_types = { "account_management": AccountManagement, "account_onboarding": AccountOnboarding, + "balances": Balances, "documents": Documents, "notification_banner": NotificationBanner, "payment_details": PaymentDetails, "payments": Payments, "payouts": Payouts, + "payouts_list": PayoutsList, } class CreateParams(RequestOptions): @@ -192,6 +229,10 @@ class CreateParamsComponents(TypedDict): """ Configuration for the account onboarding embedded component. """ + balances: NotRequired["AccountSession.CreateParamsComponentsBalances"] + """ + Configuration for the balances embedded component. + """ documents: NotRequired[ "AccountSession.CreateParamsComponentsDocuments" ] @@ -218,6 +259,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for the payouts embedded component. """ + payouts_list: NotRequired[ + "AccountSession.CreateParamsComponentsPayoutsList" + ] + """ + Configuration for the payouts list embedded component. + """ class CreateParamsComponentsAccountManagement(TypedDict): enabled: bool @@ -255,6 +302,32 @@ class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ + class CreateParamsComponentsBalances(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsBalancesFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsBalancesFeatures(TypedDict): + edit_payout_schedule: NotRequired[bool] + """ + Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + """ + instant_payouts: NotRequired[bool] + """ + Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + """ + standard_payouts: NotRequired[bool] + """ + Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + """ + class CreateParamsComponentsDocuments(TypedDict): enabled: bool """ @@ -374,6 +447,21 @@ class CreateParamsComponentsPayoutsFeatures(TypedDict): Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ + class CreateParamsComponentsPayoutsList(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsPayoutsListFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsPayoutsListFeatures(TypedDict): + pass + account: str """ The ID of the account the AccountSession was created for diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index e8bcac6c6..f30dfb65f 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -35,6 +35,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for the account onboarding embedded component. """ + balances: NotRequired[ + "AccountSessionService.CreateParamsComponentsBalances" + ] + """ + Configuration for the balances embedded component. + """ documents: NotRequired[ "AccountSessionService.CreateParamsComponentsDocuments" ] @@ -65,6 +71,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for the payouts embedded component. """ + payouts_list: NotRequired[ + "AccountSessionService.CreateParamsComponentsPayoutsList" + ] + """ + Configuration for the payouts list embedded component. + """ class CreateParamsComponentsAccountManagement(TypedDict): enabled: bool @@ -102,6 +114,32 @@ class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ + class CreateParamsComponentsBalances(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsBalancesFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsBalancesFeatures(TypedDict): + edit_payout_schedule: NotRequired[bool] + """ + Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + """ + instant_payouts: NotRequired[bool] + """ + Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + """ + standard_payouts: NotRequired[bool] + """ + Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + """ + class CreateParamsComponentsDocuments(TypedDict): enabled: bool """ @@ -221,6 +259,21 @@ class CreateParamsComponentsPayoutsFeatures(TypedDict): Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ + class CreateParamsComponentsPayoutsList(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsPayoutsListFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsPayoutsListFeatures(TypedDict): + pass + def create( self, params: "AccountSessionService.CreateParams", diff --git a/stripe/_dispute.py b/stripe/_dispute.py index bf0b246b5..e0d5ec0d6 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -176,9 +176,6 @@ class Card(StripeObject): """ card: Optional[Card] - """ - Card specific dispute details. - """ type: Literal["card"] """ Payment method type. diff --git a/stripe/_event.py b/stripe/_event.py index ea5437e15..ea1575245 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -223,6 +223,7 @@ class RetrieveParams(RequestOptions): "customer.tax_id.updated", "customer.updated", "customer_cash_balance_transaction.created", + "entitlements.active_entitlement_summary.updated", "file.created", "financial_connections.account.created", "financial_connections.account.deactivated", diff --git a/stripe/_invoice.py b/stripe/_invoice.py index da4dcf7c9..b47293b23 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -544,13 +544,13 @@ class LastFinalizationError(StripeObject): Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. - The SetupIntent transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides + The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through - [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) during payment method collection - to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). + [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on @@ -558,7 +558,7 @@ class LastFinalizationError(StripeObject): By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. - Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents) + Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) """ source: Optional[ Union["Account", "BankAccount", "CardResource", "Source"] diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 0a5605f3d..5ae5ac434 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -45,6 +45,7 @@ stripe.Discount.OBJECT_NAME: stripe.Discount, stripe.Dispute.OBJECT_NAME: stripe.Dispute, stripe.entitlements.ActiveEntitlement.OBJECT_NAME: stripe.entitlements.ActiveEntitlement, + stripe.entitlements.ActiveEntitlementSummary.OBJECT_NAME: stripe.entitlements.ActiveEntitlementSummary, stripe.entitlements.Feature.OBJECT_NAME: stripe.entitlements.Feature, stripe.EphemeralKey.OBJECT_NAME: stripe.EphemeralKey, stripe.Event.OBJECT_NAME: stripe.Event, diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index f940285cd..f3fdb865a 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -325,13 +325,13 @@ class LastPaymentError(StripeObject): Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. - The SetupIntent transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides + The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through - [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) during payment method collection - to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). + [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on @@ -339,7 +339,7 @@ class LastPaymentError(StripeObject): By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. - Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents) + Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) """ source: Optional[ Union["Account", "BankAccount", "CardResource", "Source"] @@ -1564,7 +1564,10 @@ class Promptpay(StripeObject): """ class RevolutPay(StripeObject): - pass + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ class SepaDebit(StripeObject): class MandateOptions(StripeObject): @@ -3793,6 +3796,14 @@ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): """ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] @@ -5966,6 +5977,14 @@ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): """ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] @@ -8135,6 +8154,14 @@ class ModifyParamsPaymentMethodOptionsPromptpay(TypedDict): """ class ModifyParamsPaymentMethodOptionsRevolutPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 264bef1f5..abd8e1e92 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -1967,6 +1967,14 @@ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): """ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] @@ -4164,6 +4172,14 @@ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): """ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] @@ -6385,6 +6401,14 @@ class UpdateParamsPaymentMethodOptionsPromptpay(TypedDict): """ class UpdateParamsPaymentMethodOptionsRevolutPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + + If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index f37f61df1..3101ac39d 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -763,6 +763,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Swish(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] @@ -1006,6 +1028,10 @@ class CreateParams(RequestOptions): """ Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. Check this [page](https://stripe.com/docs/payments/sofort) for more details. """ + swish: NotRequired["PaymentMethodConfiguration.CreateParamsSwish"] + """ + Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. Check this [page](https://stripe.com/docs/payments/swish) for more details. + """ us_bank_account: NotRequired[ "PaymentMethodConfiguration.CreateParamsUsBankAccount" ] @@ -1499,6 +1525,20 @@ class CreateParamsSofortDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsSwish(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsSwishDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsSwishDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsUsBankAccountDisplayPreference" @@ -1728,6 +1768,10 @@ class ModifyParams(RequestOptions): """ Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. Check this [page](https://stripe.com/docs/payments/sofort) for more details. """ + swish: NotRequired["PaymentMethodConfiguration.ModifyParamsSwish"] + """ + Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. Check this [page](https://stripe.com/docs/payments/swish) for more details. + """ us_bank_account: NotRequired[ "PaymentMethodConfiguration.ModifyParamsUsBankAccount" ] @@ -2221,6 +2265,20 @@ class ModifyParamsSofortDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsSwish(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsSwishDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsSwishDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsUsBankAccountDisplayPreference" @@ -2334,6 +2392,7 @@ class RetrieveParams(RequestOptions): revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] + swish: Optional[Swish] us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] @@ -2510,6 +2569,7 @@ async def retrieve_async( "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "sofort": Sofort, + "swish": Swish, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index 874d0bdff..31de308a0 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -211,6 +211,12 @@ class CreateParams(TypedDict): """ Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. Check this [page](https://stripe.com/docs/payments/sofort) for more details. """ + swish: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsSwish" + ] + """ + Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. Check this [page](https://stripe.com/docs/payments/swish) for more details. + """ us_bank_account: NotRequired[ "PaymentMethodConfigurationService.CreateParamsUsBankAccount" ] @@ -704,6 +710,20 @@ class CreateParamsSofortDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsSwish(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsSwishDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsSwishDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsUsBankAccountDisplayPreference" @@ -963,6 +983,12 @@ class UpdateParams(TypedDict): """ Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. Check this [page](https://stripe.com/docs/payments/sofort) for more details. """ + swish: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsSwish" + ] + """ + Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. Check this [page](https://stripe.com/docs/payments/swish) for more details. + """ us_bank_account: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsUsBankAccount" ] @@ -1456,6 +1482,20 @@ class UpdateParamsSofortDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsSwish(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsSwishDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsSwishDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsUsBankAccountDisplayPreference" diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 8a62b2227..8e5f78172 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -647,13 +647,13 @@ class SetupError(StripeObject): Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. - The SetupIntent transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides + The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through - [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) during payment method collection - to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). + [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on @@ -661,7 +661,7 @@ class SetupError(StripeObject): By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. - Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents) + Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) """ source: Optional[ Union["Account", "BankAccount", "CardResource", "Source"] diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index dd3ba242e..a58826d35 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -42,13 +42,13 @@ class SetupIntent( Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. - The SetupIntent transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides + The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through - [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) during payment method collection - to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). + [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on @@ -56,7 +56,7 @@ class SetupIntent( By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. - Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents) + Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) """ OBJECT_NAME: ClassVar[Literal["setup_intent"]] = "setup_intent" @@ -310,13 +310,13 @@ class LastSetupError(StripeObject): Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. - The SetupIntent transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides + The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through - [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) during payment method collection - to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). + [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on @@ -324,7 +324,7 @@ class LastSetupError(StripeObject): By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. - Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents) + Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) """ source: Optional[ Union["Account", "BankAccount", "CardResource", "Source"] diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 7a0197197..c242f485e 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -216,6 +216,7 @@ class CreateParams(RequestOptions): "customer.tax_id.updated", "customer.updated", "customer_cash_balance_transaction.created", + "entitlements.active_entitlement_summary.updated", "file.created", "financial_connections.account.created", "financial_connections.account.deactivated", @@ -494,6 +495,7 @@ class ModifyParams(RequestOptions): "customer.tax_id.updated", "customer.updated", "customer_cash_balance_transaction.created", + "entitlements.active_entitlement_summary.updated", "file.created", "financial_connections.account.created", "financial_connections.account.deactivated", diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index c45bec2e8..a45d35338 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -197,6 +197,7 @@ class CreateParams(TypedDict): "customer.tax_id.updated", "customer.updated", "customer_cash_balance_transaction.created", + "entitlements.active_entitlement_summary.updated", "file.created", "financial_connections.account.created", "financial_connections.account.deactivated", @@ -481,6 +482,7 @@ class UpdateParams(TypedDict): "customer.tax_id.updated", "customer.updated", "customer_cash_balance_transaction.created", + "entitlements.active_entitlement_summary.updated", "file.created", "financial_connections.account.created", "financial_connections.account.deactivated", diff --git a/stripe/api_resources/entitlements/__init__.py b/stripe/api_resources/entitlements/__init__.py index 8945d7a6c..133ae14dd 100644 --- a/stripe/api_resources/entitlements/__init__.py +++ b/stripe/api_resources/entitlements/__init__.py @@ -19,4 +19,7 @@ from stripe.api_resources.entitlements.active_entitlement import ( ActiveEntitlement, ) + from stripe.api_resources.entitlements.active_entitlement_summary import ( + ActiveEntitlementSummary, + ) from stripe.api_resources.entitlements.feature import Feature diff --git a/stripe/api_resources/entitlements/active_entitlement_summary.py b/stripe/api_resources/entitlements/active_entitlement_summary.py new file mode 100644 index 000000000..ad981e565 --- /dev/null +++ b/stripe/api_resources/entitlements/active_entitlement_summary.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.entitlements.active_entitlement_summary package is deprecated, please change your + imports to import from stripe.entitlements directly. + From: + from stripe.api_resources.entitlements.active_entitlement_summary import ActiveEntitlementSummary + To: + from stripe.entitlements import ActiveEntitlementSummary + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.entitlements._active_entitlement_summary import ( # noqa + ActiveEntitlementSummary, + ) diff --git a/stripe/billing/_meter_event.py b/stripe/billing/_meter_event.py index 4bc1e75d2..c25d4ec67 100644 --- a/stripe/billing/_meter_event.py +++ b/stripe/billing/_meter_event.py @@ -33,9 +33,9 @@ class CreateParams(RequestOptions): """ The payload of the event. This must contain a field with the event's numerical value and a field to map the event to a customer. """ - timestamp: int + timestamp: NotRequired[int] """ - The time of the event. Measured in seconds since the Unix epoch. + The time of the event. Measured in seconds since the Unix epoch. Defaults to current timestamp if not specified. """ created: int diff --git a/stripe/billing/_meter_event_service.py b/stripe/billing/_meter_event_service.py index 26400f9f1..e2d06b5aa 100644 --- a/stripe/billing/_meter_event_service.py +++ b/stripe/billing/_meter_event_service.py @@ -25,9 +25,9 @@ class CreateParams(TypedDict): """ The payload of the event. This must contain a field with the event's numerical value and a field to map the event to a customer. """ - timestamp: int + timestamp: NotRequired[int] """ - The time of the event. Measured in seconds since the Unix epoch. + The time of the event. Measured in seconds since the Unix epoch. Defaults to current timestamp if not specified. """ def create( diff --git a/stripe/entitlements/__init__.py b/stripe/entitlements/__init__.py index 7eb2d6f54..b12ba67be 100644 --- a/stripe/entitlements/__init__.py +++ b/stripe/entitlements/__init__.py @@ -6,6 +6,9 @@ from stripe.entitlements._active_entitlement_service import ( ActiveEntitlementService as ActiveEntitlementService, ) +from stripe.entitlements._active_entitlement_summary import ( + ActiveEntitlementSummary as ActiveEntitlementSummary, +) from stripe.entitlements._feature import Feature as Feature from stripe.entitlements._feature_service import ( FeatureService as FeatureService, diff --git a/stripe/entitlements/_active_entitlement_summary.py b/stripe/entitlements/_active_entitlement_summary.py new file mode 100644 index 000000000..d6eb62bad --- /dev/null +++ b/stripe/entitlements/_active_entitlement_summary.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._stripe_object import StripeObject +from typing import ClassVar +from typing_extensions import Literal, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.entitlements._active_entitlement import ActiveEntitlement + + +class ActiveEntitlementSummary(StripeObject): + """ + A summary of a customer's active entitlements. + """ + + OBJECT_NAME: ClassVar[ + Literal["entitlements.active_entitlement_summary"] + ] = "entitlements.active_entitlement_summary" + customer: str + """ + The customer that is entitled to this feature. + """ + entitlements: ListObject["ActiveEntitlement"] + """ + The list of entitlements this customer has. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["entitlements.active_entitlement_summary"] + """ + String representing the object's type. Objects of the same type share the same value. + """ diff --git a/stripe/forwarding/_request.py b/stripe/forwarding/_request.py index b8ac3d350..084c647cb 100644 --- a/stripe/forwarding/_request.py +++ b/stripe/forwarding/_request.py @@ -13,9 +13,9 @@ class Request( CreateableAPIResource["Request"], ListableAPIResource["Request"] ): """ - Instructs Stripe to make a request on your behalf using the destination URL and HTTP method in the config. - A config is set up for each destination URL by Stripe at the time of onboarding. Stripe verifies requests with - your credentials in the config, and injects card details from the payment_method into the request. + Instructs Stripe to make a request on your behalf using the destination URL. The destination URL + is activated by Stripe at the time of onboarding. Stripe verifies requests with your credentials + provided during onboarding, and injects card details from the payment_method into the request. Stripe redacts all sensitive fields and headers, including authentication credentials and card numbers, before storing the request and response data in the forwarding Request object, which are subject to a @@ -94,10 +94,6 @@ class Header(StripeObject): _inner_class_types = {"headers": Header} class CreateParams(RequestOptions): - config: str - """ - The Forwarding Config used when making the forwarded request. The config specifes the HTTP method, merchant credentials, connection settings, and supported destination URLs. - """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -189,10 +185,6 @@ class RetrieveParams(RequestOptions): Specifies which fields in the response should be expanded. """ - config: str - """ - The Forwarding Config used when making the forwarded request. The config specifes the HTTP method, merchant credentials, connection settings, and supported destination URLs. - """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. diff --git a/stripe/forwarding/_request_service.py b/stripe/forwarding/_request_service.py index d3e37ff6e..d8e1dffc5 100644 --- a/stripe/forwarding/_request_service.py +++ b/stripe/forwarding/_request_service.py @@ -11,10 +11,6 @@ class RequestService(StripeService): class CreateParams(TypedDict): - config: str - """ - The Forwarding Config used when making the forwarded request. The config specifes the HTTP method, merchant credentials, connection settings, and supported destination URLs. - """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. From f09836328bbc8dad95cffc6b09e440ab68f422fe Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Tue, 16 Apr 2024 08:58:55 -0700 Subject: [PATCH 048/179] Bump version to 9.2.0 --- CHANGELOG.md | 12 ++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15d047c40..df07bcfc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 9.2.0 - 2024-04-16 +* [#1301](https://github.com/stripe/stripe-python/pull/1301) Update generated code + * Add support for `balances` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `payouts_list` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `capture_method` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsRevolutPay`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsRevolutPay`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsRevolutPay` and resource class `stripe.PaymentIntent.PaymentMethodOptions.RevolutPay` + * Add support for `swish` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` + * Add support for resource `stripe.entitlements.ActiveEntitlementSummary` + * Remove support for `config` on parameter class `stripe.forwarding.Request.CreateParams` and resource `stripe.forwarding.Request`. This field is no longer used by the Forwarding Request API. + * Change type of fields `stripe.AccountSession.Components.PaymentDetails.Features` and `stripe.AccountSession.Components.Payments.Features` from `Optional[bool]` to `bool` of `destination_on_behalf_of_charge_management` + * Change type of field `stripe.billing.MeterEvent.CreateParams` from `int` to `NotRequired[int]` of `timestamp` + * Add support for `entitlements.active_entitlement_summary.updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + ## 9.1.0 - 2024-04-11 * [#1300](https://github.com/stripe/stripe-python/pull/1300) Update generated code * Add support for `external_account_collection` on resource class `stripe.AccountSession.Components.AccountOnboarding.Features` and parameter class `stripe.AccountSession.CreateParamsComponentsAccountOnboardingFeatures` diff --git a/VERSION b/VERSION index 47da986f8..deeb3d66e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.1.0 +9.2.0 diff --git a/stripe/_version.py b/stripe/_version.py index 5845a3d39..cb44d32ab 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.1.0" +VERSION = "9.2.0" From 48fbc6f6a235c9891c583e660ba825b0dce10840 Mon Sep 17 00:00:00 2001 From: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:57:55 -0400 Subject: [PATCH 049/179] Stripe deprecate param util for adding a decoractor (#1304) * Added test for stripe deprecate param * implement stripe_deprecate_param * wip * Implemented stripe_deprecate_parameter as decorator * Fixed tests for deprecated parameters warnings * Fix Linting * Formatted file --------- Co-authored-by: Richard Marmorstein --- stripe/_util.py | 33 +++++++++++++++++++++++++++++ tests/test_util.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/stripe/_util.py b/stripe/_util.py index 0c14b2a10..05fd622d0 100644 --- a/stripe/_util.py +++ b/stripe/_util.py @@ -433,3 +433,36 @@ def _wrapper(*args, **kwargs): return class_method(*args, **kwargs) return _wrapper + + +def stripe_deprecate_param_inner(params: Mapping[str, Any], parts: List[str]): + cur = params + for i, part in enumerate(parts[:-1]): + if type(cur[part]) is list: + for item in cur[part]: + new_i = i + 1 + stripe_deprecate_param_inner(item, parts[new_i:]) + if part not in cur: + return + + cur = cur[part] + + deprecated_param = parts[-1] + if deprecated_param in cur: + warnings.warn( + f"The {deprecated_param} parameter is deprecated and will be removed in a future version. " + "Please refer to the changelog for more information.", + DeprecationWarning, + stacklevel=2, + ) + + +def stripe_deprecate_parameter(key): + def stripe_deprecate_param_decorator(original_function): + def stripe_deprecate_param(params, *args, **kwargs): + stripe_deprecate_param_inner(params, key.split(".")) + return original_function(params=params, *args, **kwargs) + + return stripe_deprecate_param + + return stripe_deprecate_param_decorator diff --git a/tests/test_util.py b/tests/test_util.py index df045a749..8b9880d16 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -3,6 +3,8 @@ import stripe from stripe import util +import pytest +import warnings LogTestCase = namedtuple("LogTestCase", "env flag should_output") FmtTestCase = namedtuple("FmtTestCase", "props expected") @@ -150,3 +152,53 @@ def test_convert_to_stripe_object_and_back(self): def test_sanitize_id(self): sanitized_id = util.sanitize_id("cu %x 123") assert sanitized_id == "cu++%25x+123" + + def test_stripe_deprecate_parameter(self): + @util.stripe_deprecate_parameter("foo") + def to_be_decorated(**params): + pass + + with warnings.catch_warnings(): + warnings.simplefilter("error") + to_be_decorated(params={}) + + # assert that warnings.warn was called appropriately + with pytest.warns(DeprecationWarning): + to_be_decorated(params={"foo": True}) + + with warnings.catch_warnings(): + warnings.simplefilter("error") + to_be_decorated(params={}) + + @util.stripe_deprecate_parameter("bar") + def to_be_decorated_non_existant_key(**params): + pass + + with warnings.catch_warnings(): + warnings.simplefilter("error") + to_be_decorated_non_existant_key(params={"foo": True}) + + @util.stripe_deprecate_parameter("") + def to_be_decorated_empty_key(**params): + pass + + with warnings.catch_warnings(): + warnings.simplefilter("error") + to_be_decorated_empty_key(params={"foo": True}) + + def test_stripe_deprecate_param_nested(self): + @util.stripe_deprecate_parameter("foo.bar") + def to_be_decorated_foo_bar(**params): + pass + + with pytest.warns(DeprecationWarning): + to_be_decorated_foo_bar(params={"foo": {"bar": True}}) + + @util.stripe_deprecate_parameter("custom_fields.name") + def to_be_decorated_custom_fields_name(**params): + pass + + with pytest.warns(DeprecationWarning): + to_be_decorated_custom_fields_name( + params={"custom_fields": [{"name": "blah"}]} + ) From 2a87fb459d98632754fda8a8b248b6c19b3cf76e Mon Sep 17 00:00:00 2001 From: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:37:10 -0400 Subject: [PATCH 050/179] Fix: Quote PDF retrieve base_address set to files (#1306) --- stripe/_quote.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stripe/_quote.py b/stripe/_quote.py index 7f82ad662..d4f5d71e2 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -1835,6 +1835,7 @@ def pdf( # pyright: ignore[reportGeneralTypeIssues] quote=sanitize_id(self.get("id")) ), params=params, + base_address="files", ), ) @@ -1887,6 +1888,7 @@ async def pdf_async( # pyright: ignore[reportGeneralTypeIssues] quote=sanitize_id(self.get("id")) ), params=params, + base_address="files", ), ) From dc577065b0bb47a1b9a01491ebfd7cfdcf8e15d2 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:17:57 -0700 Subject: [PATCH 051/179] Update generated code (#1305) * Update generated code for v963 * Update generated code for v964 * Update generated code for v966 * Update generated code for v967 * Update generated code for v967 * Update generated code for v968 * Update generated code for v969 * Update generated code for v971 * Update generated code for v972 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_confirmation_token.py | 6 + stripe/_customer.py | 6 + stripe/_customer_payment_method_service.py | 6 + stripe/_invoice.py | 3764 +++++++++++++---- stripe/_invoice_service.py | 2260 ++++++++-- stripe/_invoice_upcoming_lines_service.py | 574 ++- stripe/_payment_intent.py | 18 + stripe/_payment_intent_service.py | 18 + stripe/_payment_method.py | 12 + stripe/_payment_method_service.py | 12 + stripe/_setup_intent.py | 18 + stripe/_setup_intent_service.py | 18 + stripe/billing/_meter.py | 20 +- stripe/billing/_meter_event.py | 6 +- stripe/billing/_meter_event_service.py | 4 +- stripe/billing/_meter_event_summary.py | 8 +- .../billing/_meter_event_summary_service.py | 4 +- stripe/billing/_meter_service.py | 8 +- stripe/checkout/_session.py | 78 + stripe/checkout/_session_service.py | 49 + stripe/issuing/_authorization.py | 4 +- stripe/issuing/_transaction.py | 10 +- .../_confirmation_token_service.py | 6 + .../issuing/_authorization_service.py | 4 +- .../issuing/_transaction_service.py | 8 +- 26 files changed, 5706 insertions(+), 1217 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ea2fb0ba1..e0b273508 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v961 \ No newline at end of file +v972 \ No newline at end of file diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index b569a400f..42a2e924f 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -1224,6 +1224,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataAmazonPay" ] diff --git a/stripe/_customer.py b/stripe/_customer.py index 0d6f32fcc..f3da232c0 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -804,6 +804,12 @@ class ListParamsCreated(TypedDict): """ class ListPaymentMethodsParams(RequestOptions): + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ 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. diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 2391597d0..21a8870d0 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -11,6 +11,12 @@ class CustomerPaymentMethodService(StripeService): class ListParams(TypedDict): + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ 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. diff --git a/stripe/_invoice.py b/stripe/_invoice.py index b47293b23..ff6018a11 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -1590,233 +1590,2412 @@ class CreateParamsTransferData(TypedDict): ID of an existing, connected Stripe account. """ - class DeleteParams(RequestOptions): - pass - - class FinalizeInvoiceParams(RequestOptions): - auto_advance: NotRequired[bool] + class CreatePreviewParams(RequestOptions): + automatic_tax: NotRequired["Invoice.CreatePreviewParamsAutomaticTax"] """ - Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. + Settings for automatic tax lookup for this invoice preview. + """ + coupon: NotRequired[str] + """ + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + """ + currency: NotRequired[str] + """ + The currency to preview this invoice in. Defaults to that of `customer` if not specified. + """ + customer: NotRequired[str] + """ + The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + """ + customer_details: NotRequired[ + "Invoice.CreatePreviewParamsCustomerDetails" + ] + """ + Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + """ + discounts: NotRequired[ + "Literal['']|List[Invoice.CreatePreviewParamsDiscount]" + ] + """ + The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ + invoice_items: NotRequired[ + List["Invoice.CreatePreviewParamsInvoiceItem"] + ] + """ + List of invoice items to add or update in the upcoming invoice preview. + """ + issuer: NotRequired["Invoice.CreatePreviewParamsIssuer"] + """ + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + """ + on_behalf_of: NotRequired["Literal['']|str"] + """ + The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + """ + schedule: NotRequired[str] + """ + The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. + """ + schedule_details: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetails" + ] + """ + The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. + """ + subscription: NotRequired[str] + """ + The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + """ + subscription_details: NotRequired[ + "Invoice.CreatePreviewParamsSubscriptionDetails" + ] + """ + The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. + """ - class ListParams(RequestOptions): - collection_method: NotRequired[ - Literal["charge_automatically", "send_invoice"] + class CreatePreviewParamsAutomaticTax(TypedDict): + enabled: bool + """ + Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + """ + liability: NotRequired[ + "Invoice.CreatePreviewParamsAutomaticTaxLiability" ] """ - The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ - created: NotRequired["Invoice.ListParamsCreated|int"] + + class CreatePreviewParamsAutomaticTaxLiability(TypedDict): + account: NotRequired[str] """ - Only return invoices that were created during the given date interval. + The connected account being referenced when `type` is `account`. """ - customer: NotRequired[str] + type: Literal["account", "self"] """ - Only return invoices for the customer specified by this customer ID. + Type of the account referenced in the request. """ - due_date: NotRequired["Invoice.ListParamsDueDate|int"] - ending_before: NotRequired[str] + + class CreatePreviewParamsCustomerDetails(TypedDict): + address: NotRequired[ + "Literal['']|Invoice.CreatePreviewParamsCustomerDetailsAddress" + ] """ - 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. + The customer's address. """ - expand: NotRequired[List[str]] + shipping: NotRequired[ + "Literal['']|Invoice.CreatePreviewParamsCustomerDetailsShipping" + ] """ - Specifies which fields in the response should be expanded. + The customer's shipping information. Appears on invoices emailed to this customer. """ - limit: NotRequired[int] + tax: NotRequired["Invoice.CreatePreviewParamsCustomerDetailsTax"] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + Tax details about the customer. """ - starting_after: NotRequired[str] + tax_exempt: NotRequired[ + "Literal['']|Literal['exempt', 'none', 'reverse']" + ] """ - 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. + The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ - status: NotRequired[ - Literal["draft", "open", "paid", "uncollectible", "void"] + tax_ids: NotRequired[ + List["Invoice.CreatePreviewParamsCustomerDetailsTaxId"] ] """ - The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) + The customer's tax IDs. """ - subscription: NotRequired[str] + + class CreatePreviewParamsCustomerDetailsAddress(TypedDict): + city: NotRequired[str] """ - Only return invoices for the subscription specified by this subscription ID. + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - class ListParamsCreated(TypedDict): - gt: NotRequired[int] + class CreatePreviewParamsCustomerDetailsShipping(TypedDict): + address: "Invoice.CreatePreviewParamsCustomerDetailsShippingAddress" """ - Minimum value to filter by (exclusive) + Customer shipping address. """ - gte: NotRequired[int] + name: str """ - Minimum value to filter by (inclusive) + Customer name. """ - lt: NotRequired[int] + phone: NotRequired[str] """ - Maximum value to filter by (exclusive) + Customer phone (including extension). """ - lte: NotRequired[int] + + class CreatePreviewParamsCustomerDetailsShippingAddress(TypedDict): + city: NotRequired[str] """ - Maximum value to filter by (inclusive) + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - class ListParamsDueDate(TypedDict): - gt: NotRequired[int] + class CreatePreviewParamsCustomerDetailsTax(TypedDict): + ip_address: NotRequired["Literal['']|str"] """ - Minimum value to filter by (exclusive) + A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ - gte: NotRequired[int] + + class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): + type: Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "au_abn", + "au_arn", + "bg_uic", + "bh_vat", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "kz_bin", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] """ - Minimum value to filter by (inclusive) + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ - lt: NotRequired[int] + value: str """ - Maximum value to filter by (exclusive) + Value of the tax ID. """ - lte: NotRequired[int] + + class CreatePreviewParamsDiscount(TypedDict): + coupon: NotRequired[str] """ - Maximum value to filter by (inclusive) + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsInvoiceItem(TypedDict): + amount: NotRequired[int] + """ + The integer amount in cents (or local equivalent) of previewed invoice item. + """ + currency: NotRequired[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). Only applicable to new invoice items. + """ + description: NotRequired[str] + """ + An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + """ + discountable: NotRequired[bool] + """ + Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. + """ + discounts: NotRequired[ + "Literal['']|List[Invoice.CreatePreviewParamsInvoiceItemDiscount]" + ] + """ + The coupons to redeem into discounts for the invoice item in the preview. + """ + invoiceitem: NotRequired[str] + """ + The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + period: NotRequired["Invoice.CreatePreviewParamsInvoiceItemPeriod"] + """ + The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + """ + price: NotRequired[str] + """ + The ID of the price object. + """ + price_data: NotRequired[ + "Invoice.CreatePreviewParamsInvoiceItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Non-negative integer. The quantity of units for the invoice item. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + tax_code: NotRequired["Literal['']|str"] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. + """ + unit_amount: NotRequired[int] + """ + The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreatePreviewParamsInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsInvoiceItemPeriod(TypedDict): + end: int + """ + The end of the period, which must be greater than or equal to the start. This value is inclusive. + """ + start: int + """ + The start of the period. This value is inclusive. + """ + + class CreatePreviewParamsInvoiceItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreatePreviewParamsIssuer(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class CreatePreviewParamsScheduleDetails(TypedDict): + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + """ + phases: NotRequired[ + List["Invoice.CreatePreviewParamsScheduleDetailsPhase"] + ] + """ + List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. + """ + + class CreatePreviewParamsScheduleDetailsPhase(TypedDict): + add_invoice_items: NotRequired[ + List[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem" + ] + ] + """ + A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + """ + application_fee_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + """ + automatic_tax: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseAutomaticTax" + ] + """ + Automatic tax settings for this phase. + """ + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] + """ + Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + """ + billing_thresholds: NotRequired[ + "Literal['']|Invoice.CreatePreviewParamsScheduleDetailsPhaseBillingThresholds" + ] + """ + 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. + """ + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] + """ + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + """ + coupon: NotRequired[str] + """ + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + """ + currency: NotRequired[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). + """ + default_payment_method: NotRequired[str] + """ + ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + """ + default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + """ + description: NotRequired["Literal['']|str"] + """ + Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + discounts: NotRequired[ + "Literal['']|List[Invoice.CreatePreviewParamsScheduleDetailsPhaseDiscount]" + ] + """ + The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + """ + end_date: NotRequired["int|Literal['now']"] + """ + The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. + """ + invoice_settings: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings" + ] + """ + All invoices will be billed using the specified settings. + """ + items: List["Invoice.CreatePreviewParamsScheduleDetailsPhaseItem"] + """ + List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + """ + iterations: NotRequired[int] + """ + Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + """ + on_behalf_of: NotRequired[str] + """ + The account on behalf of which to charge, for each of the associated subscription's invoices. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. + """ + start_date: NotRequired["int|Literal['now']"] + """ + The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. + """ + transfer_data: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseTransferData" + ] + """ + The data with which to automatically create a Transfer for each of the associated subscription's invoices. + """ + trial: NotRequired[bool] + """ + If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + """ + trial_end: NotRequired["int|Literal['now']"] + """ + Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + """ + + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount" + ] + ] + """ + The coupons to redeem into discounts for the item. + """ + price: NotRequired[str] + """ + The ID of the price object. + """ + price_data: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Quantity for this item. Defaults to 1. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount( + TypedDict, + ): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData( + TypedDict, + ): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAutomaticTax(TypedDict): + enabled: bool + """ + Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + """ + liability: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability" + ] + """ + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability( + TypedDict, + ): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class CreatePreviewParamsScheduleDetailsPhaseBillingThresholds(TypedDict): + amount_gte: NotRequired[int] + """ + Monetary threshold that triggers the subscription to advance to a new billing period + """ + reset_billing_cycle_anchor: NotRequired[bool] + """ + Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + """ + + class CreatePreviewParamsScheduleDetailsPhaseDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + """ + days_until_due: NotRequired[int] + """ + Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + """ + issuer: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer" + ] + """ + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + """ + + class CreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer( + TypedDict, + ): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class CreatePreviewParamsScheduleDetailsPhaseItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|Invoice.CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds" + ] + """ + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + """ + discounts: NotRequired[ + "Literal['']|List[Invoice.CreatePreviewParamsScheduleDetailsPhaseItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. + """ + plan: NotRequired[str] + """ + The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. + """ + price: NotRequired[str] + """ + The ID of the price object. + """ + price_data: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + """ + + class CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds( + TypedDict, + ): + usage_gte: int + """ + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + """ + + class CreatePreviewParamsScheduleDetailsPhaseItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsScheduleDetailsPhaseItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + recurring: "Invoice.CreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring" + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies billing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + """ + + class CreatePreviewParamsScheduleDetailsPhaseTransferData(TypedDict): + amount_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + """ + destination: str + """ + ID of an existing, connected Stripe account. + """ + + class CreatePreviewParamsSubscriptionDetails(TypedDict): + billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] + """ + For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. + """ + cancel_at: NotRequired["Literal['']|int"] + """ + A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. + """ + cancel_at_period_end: NotRequired[bool] + """ + Boolean indicating whether this subscription should cancel at the end of the current period. + """ + cancel_now: NotRequired[bool] + """ + This simulates the subscription being canceled or expired immediately. + """ + default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. + """ + items: NotRequired[ + List["Invoice.CreatePreviewParamsSubscriptionDetailsItem"] + ] + """ + A list of up to 20 subscription items, each with an attached price. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + """ + proration_date: NotRequired[int] + """ + If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. + """ + resume_at: NotRequired[Literal["now"]] + """ + For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + """ + start_date: NotRequired[int] + """ + Date a subscription is intended to start (can be future or past). + """ + trial_end: NotRequired["Literal['now']|int"] + """ + If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. + """ + + class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|Invoice.CreatePreviewParamsSubscriptionDetailsItemBillingThresholds" + ] + """ + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + """ + clear_usage: NotRequired[bool] + """ + Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + """ + deleted: NotRequired[bool] + """ + A flag that, if set to `true`, will delete the specified item. + """ + discounts: NotRequired[ + "Literal['']|List[Invoice.CreatePreviewParamsSubscriptionDetailsItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ + id: NotRequired[str] + """ + Subscription item to update. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + plan: NotRequired[str] + """ + Plan ID for this item, as a string. + """ + price: NotRequired[str] + """ + The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + """ + price_data: NotRequired[ + "Invoice.CreatePreviewParamsSubscriptionDetailsItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Quantity for this item. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + """ + + class CreatePreviewParamsSubscriptionDetailsItemBillingThresholds( + TypedDict, + ): + usage_gte: int + """ + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + """ + + class CreatePreviewParamsSubscriptionDetailsItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsSubscriptionDetailsItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + recurring: "Invoice.CreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring" + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies billing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + """ + + class DeleteParams(RequestOptions): + pass + + class FinalizeInvoiceParams(RequestOptions): + auto_advance: NotRequired[bool] + """ + Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ListParams(RequestOptions): + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] + """ + The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. + """ + created: NotRequired["Invoice.ListParamsCreated|int"] + """ + Only return invoices that were created during the given date interval. + """ + customer: NotRequired[str] + """ + Only return invoices for the customer specified by this customer ID. + """ + due_date: NotRequired["Invoice.ListParamsDueDate|int"] + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[ + Literal["draft", "open", "paid", "uncollectible", "void"] + ] + """ + The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) + """ + subscription: NotRequired[str] + """ + Only return invoices for the subscription specified by this subscription ID. + """ + + class ListParamsCreated(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ + + class ListParamsDueDate(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ + + class MarkUncollectibleParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ModifyParams(RequestOptions): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + """ + application_fee_amount: NotRequired[int] + """ + A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). + """ + auto_advance: NotRequired[bool] + """ + Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. + """ + automatic_tax: NotRequired["Invoice.ModifyParamsAutomaticTax"] + """ + Settings for automatic tax lookup for this invoice. + """ + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] + """ + Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices. + """ + custom_fields: NotRequired[ + "Literal['']|List[Invoice.ModifyParamsCustomField]" + ] + """ + A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields. + """ + days_until_due: NotRequired[int] + """ + The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. + """ + default_payment_method: NotRequired[str] + """ + ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + """ + default_source: NotRequired["Literal['']|str"] + """ + ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + """ + default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates that will apply to any line item that does not have `tax_rates` set. Pass an empty string to remove previously-defined tax rates. + """ + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. + """ + discounts: NotRequired[ + "Literal['']|List[Invoice.ModifyParamsDiscount]" + ] + """ + The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts. + """ + due_date: NotRequired[int] + """ + The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. + """ + effective_at: NotRequired["Literal['']|int"] + """ + The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + footer: NotRequired[str] + """ + Footer to be displayed on the invoice. + """ + issuer: NotRequired["Invoice.ModifyParamsIssuer"] + """ + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + number: NotRequired["Literal['']|str"] + """ + Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. + """ + on_behalf_of: NotRequired["Literal['']|str"] + """ + The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + """ + payment_settings: NotRequired["Invoice.ModifyParamsPaymentSettings"] + """ + Configuration settings for the PaymentIntent that is generated when the invoice is finalized. + """ + rendering: NotRequired["Invoice.ModifyParamsRendering"] + """ + The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + """ + shipping_cost: NotRequired[ + "Literal['']|Invoice.ModifyParamsShippingCost" + ] + """ + Settings for the cost of shipping for this invoice. + """ + shipping_details: NotRequired[ + "Literal['']|Invoice.ModifyParamsShippingDetails" + ] + """ + Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + """ + statement_descriptor: NotRequired[str] + """ + Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. + """ + transfer_data: NotRequired[ + "Literal['']|Invoice.ModifyParamsTransferData" + ] + """ + If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value. + """ + + class ModifyParamsAutomaticTax(TypedDict): + enabled: bool + """ + Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + """ + liability: NotRequired["Invoice.ModifyParamsAutomaticTaxLiability"] + """ + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + """ + + class ModifyParamsAutomaticTaxLiability(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class ModifyParamsCustomField(TypedDict): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. + """ + + class ModifyParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class ModifyParamsIssuer(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class ModifyParamsPaymentSettings(TypedDict): + default_mandate: NotRequired["Literal['']|str"] + """ + ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + """ + payment_method_options: NotRequired[ + "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptions" + ] + """ + Payment-method-specific configuration to provide to the invoice's PaymentIntent. + """ + payment_method_types: NotRequired[ + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + ] + """ + The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): + acss_debit: NotRequired[ + "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit" + ] + """ + If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. + """ + bancontact: NotRequired[ + "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsBancontact" + ] + """ + If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. + """ + card: NotRequired[ + "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCard" + ] + """ + If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. + """ + customer_balance: NotRequired[ + "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" + ] + """ + If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. + """ + konbini: NotRequired[ + "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini" + ] + """ + If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. + """ + sepa_debit: NotRequired[ + "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. + """ + us_bank_account: NotRequired[ + "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" + ] + """ + If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): + mandate_options: NotRequired[ + "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Verification method for the intent + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( + TypedDict, + ): + transaction_type: NotRequired[Literal["business", "personal"]] + """ + Transaction type of the mandate. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + """ + Preferred language of the Bancontact authorization page that the customer is redirected to. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): + installments: NotRequired[ + "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallments" + ] + """ + Installment configuration for payments attempted on this invoice (Mexico Only). + + For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + """ + request_three_d_secure: NotRequired[ + Literal["any", "automatic", "challenge"] + ] + """ + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallments( + TypedDict, + ): + enabled: NotRequired[bool] + """ + Setting to true enables installments for this invoice. + Setting to false will prevent any selected plan from applying to a payment. + """ + plan: NotRequired[ + "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan" + ] + """ + The selected installment plan to use for this invoice. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( + TypedDict, + ): + count: int + """ + For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + """ + interval: Literal["month"] + """ + For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + One of `month`. + """ + type: Literal["fixed_count"] + """ + Type of installment plan, one of `fixed_count`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( + TypedDict, + ): + bank_transfer: NotRequired[ + "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" + ] + """ + Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + """ + funding_type: NotRequired[str] + """ + The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( + TypedDict, + ): + eu_bank_transfer: NotRequired[ + "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" + ] + """ + Configuration for eu_bank_transfer funding type. + """ + type: NotRequired[str] + """ + The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( + TypedDict, + ): + country: str + """ + The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): + pass + + class ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + pass + + class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( + TypedDict, + ): + financial_connections: NotRequired[ + "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections" + ] + """ + Additional fields for Financial Connections Session creation + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Verification method for the intent + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( + TypedDict, + ): + permissions: NotRequired[ + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] + ] + """ + The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + """ + prefetch: NotRequired[ + List[Literal["balances", "ownership", "transactions"]] + ] + """ + List of data features that you would like to retrieve upon account creation. + """ + + class ModifyParamsRendering(TypedDict): + amount_tax_display: NotRequired[ + "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" + ] + """ + How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + """ + pdf: NotRequired["Invoice.ModifyParamsRenderingPdf"] + """ + Invoice pdf rendering options + """ + + class ModifyParamsRenderingPdf(TypedDict): + page_size: NotRequired[Literal["a4", "auto", "letter"]] + """ + Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. + If set to `auto`, invoice PDF page size defaults to `a4` for customers with + Japanese locale and `letter` for customers with other locales. + """ + + class ModifyParamsShippingCost(TypedDict): + shipping_rate: NotRequired[str] + """ + The ID of the shipping rate to use for this order. + """ + shipping_rate_data: NotRequired[ + "Invoice.ModifyParamsShippingCostShippingRateData" + ] + """ + Parameters to create a new ad-hoc shipping rate for this order. + """ + + class ModifyParamsShippingCostShippingRateData(TypedDict): + delivery_estimate: NotRequired[ + "Invoice.ModifyParamsShippingCostShippingRateDataDeliveryEstimate" + ] + """ + The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + display_name: str + """ + The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + fixed_amount: NotRequired[ + "Invoice.ModifyParamsShippingCostShippingRateDataFixedAmount" + ] + """ + Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + """ + type: NotRequired[Literal["fixed_amount"]] + """ + The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + """ + + class ModifyParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): + maximum: NotRequired[ + "Invoice.ModifyParamsShippingCostShippingRateDataDeliveryEstimateMaximum" + ] + """ + The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + """ + minimum: NotRequired[ + "Invoice.ModifyParamsShippingCostShippingRateDataDeliveryEstimateMinimum" + ] + """ + The lower bound of the estimated range. If empty, represents no lower bound. + """ + + class ModifyParamsShippingCostShippingRateDataDeliveryEstimateMaximum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class ModifyParamsShippingCostShippingRateDataDeliveryEstimateMinimum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class ModifyParamsShippingCostShippingRateDataFixedAmount(TypedDict): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + 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). + """ + currency_options: NotRequired[ + Dict[ + str, + "Invoice.ModifyParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", + ] + ] + """ + Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + """ + + class ModifyParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( + TypedDict, + ): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + + class ModifyParamsShippingDetails(TypedDict): + address: "Invoice.ModifyParamsShippingDetailsAddress" + """ + Shipping address + """ + name: str + """ + Recipient name. + """ + phone: NotRequired["Literal['']|str"] + """ + Recipient phone (including extension) + """ + + class ModifyParamsShippingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class ModifyParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. + """ + destination: str + """ + ID of an existing, connected Stripe account. + """ + + class PayParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + forgive: NotRequired[bool] + """ + In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. + + Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`. + """ + mandate: NotRequired["Literal['']|str"] + """ + ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. + """ + off_session: NotRequired[bool] + """ + Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). + """ + paid_out_of_band: NotRequired[bool] + """ + Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. + """ + payment_method: NotRequired[str] + """ + A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. + """ + source: NotRequired[str] + """ + A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class SearchParams(RequestOptions): + 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. + """ + page: NotRequired[str] + """ + A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + """ + query: str + """ + The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices). + """ + + class SendInvoiceParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class UpcomingLinesParams(RequestOptions): + automatic_tax: NotRequired["Invoice.UpcomingLinesParamsAutomaticTax"] + """ + Settings for automatic tax lookup for this invoice preview. + """ + coupon: NotRequired[str] + """ + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + """ + currency: NotRequired[str] + """ + The currency to preview this invoice in. Defaults to that of `customer` if not specified. + """ + customer: NotRequired[str] + """ + The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + """ + customer_details: NotRequired[ + "Invoice.UpcomingLinesParamsCustomerDetails" + ] + """ + Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + """ + discounts: NotRequired[ + "Literal['']|List[Invoice.UpcomingLinesParamsDiscount]" + ] + """ + The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. + """ + 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. + """ + invoice_items: NotRequired[ + List["Invoice.UpcomingLinesParamsInvoiceItem"] + ] + """ + List of invoice items to add or update in the upcoming invoice preview. + """ + issuer: NotRequired["Invoice.UpcomingLinesParamsIssuer"] + """ + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + """ + 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. + """ + on_behalf_of: NotRequired["Literal['']|str"] + """ + The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + """ + schedule: NotRequired[str] + """ + The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. + """ + schedule_details: NotRequired[ + "Invoice.UpcomingLinesParamsScheduleDetails" + ] + """ + The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. + """ + 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. + """ + subscription: NotRequired[str] + """ + The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + """ + subscription_billing_cycle_anchor: NotRequired[ + "Literal['now', 'unchanged']|int" + ] + """ + For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. + """ + subscription_cancel_at: NotRequired["Literal['']|int"] + """ + A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. + """ + subscription_cancel_at_period_end: NotRequired[bool] + """ + Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. + """ + subscription_cancel_now: NotRequired[bool] + """ + This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. + """ + subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. + """ + subscription_details: NotRequired[ + "Invoice.UpcomingLinesParamsSubscriptionDetails" + ] + """ + The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. + """ + subscription_items: NotRequired[ + List["Invoice.UpcomingLinesParamsSubscriptionItem"] + ] + """ + A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. + """ + subscription_proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. + """ + subscription_proration_date: NotRequired[int] + """ + If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. + """ + subscription_resume_at: NotRequired[Literal["now"]] + """ + For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. + """ + subscription_start_date: NotRequired[int] + """ + Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. + """ + subscription_trial_end: NotRequired["Literal['now']|int"] + """ + If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. + """ + subscription_trial_from_plan: NotRequired[bool] + """ + Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + """ + + class UpcomingLinesParamsAutomaticTax(TypedDict): + enabled: bool + """ + Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + """ + liability: NotRequired[ + "Invoice.UpcomingLinesParamsAutomaticTaxLiability" + ] + """ + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + """ + + class UpcomingLinesParamsAutomaticTaxLiability(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class UpcomingLinesParamsCustomerDetails(TypedDict): + address: NotRequired[ + "Literal['']|Invoice.UpcomingLinesParamsCustomerDetailsAddress" + ] + """ + The customer's address. + """ + shipping: NotRequired[ + "Literal['']|Invoice.UpcomingLinesParamsCustomerDetailsShipping" + ] + """ + The customer's shipping information. Appears on invoices emailed to this customer. + """ + tax: NotRequired["Invoice.UpcomingLinesParamsCustomerDetailsTax"] + """ + Tax details about the customer. + """ + tax_exempt: NotRequired[ + "Literal['']|Literal['exempt', 'none', 'reverse']" + ] + """ + The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + """ + tax_ids: NotRequired[ + List["Invoice.UpcomingLinesParamsCustomerDetailsTaxId"] + ] + """ + The customer's tax IDs. + """ + + class UpcomingLinesParamsCustomerDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class UpcomingLinesParamsCustomerDetailsShipping(TypedDict): + address: "Invoice.UpcomingLinesParamsCustomerDetailsShippingAddress" + """ + Customer shipping address. + """ + name: str + """ + Customer name. + """ + phone: NotRequired[str] + """ + Customer phone (including extension). + """ + + class UpcomingLinesParamsCustomerDetailsShippingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class UpcomingLinesParamsCustomerDetailsTax(TypedDict): + ip_address: NotRequired["Literal['']|str"] + """ + A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + """ + + class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): + type: Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "au_abn", + "au_arn", + "bg_uic", + "bh_vat", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "kz_bin", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + """ + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + """ + value: str + """ + Value of the tax ID. + """ + + class UpcomingLinesParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class UpcomingLinesParamsInvoiceItem(TypedDict): + amount: NotRequired[int] + """ + The integer amount in cents (or local equivalent) of previewed invoice item. + """ + currency: NotRequired[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). Only applicable to new invoice items. + """ + description: NotRequired[str] + """ + An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + """ + discountable: NotRequired[bool] + """ + Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. + """ + discounts: NotRequired[ + "Literal['']|List[Invoice.UpcomingLinesParamsInvoiceItemDiscount]" + ] + """ + The coupons to redeem into discounts for the invoice item in the preview. + """ + invoiceitem: NotRequired[str] + """ + The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + period: NotRequired["Invoice.UpcomingLinesParamsInvoiceItemPeriod"] + """ + The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + """ + price: NotRequired[str] + """ + The ID of the price object. + """ + price_data: NotRequired[ + "Invoice.UpcomingLinesParamsInvoiceItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Non-negative integer. The quantity of units for the invoice item. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + tax_code: NotRequired["Literal['']|str"] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. + """ + unit_amount: NotRequired[int] + """ + The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class UpcomingLinesParamsInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class UpcomingLinesParamsInvoiceItemPeriod(TypedDict): + end: int + """ + The end of the period, which must be greater than or equal to the start. This value is inclusive. + """ + start: int + """ + The start of the period. This value is inclusive. + """ + + class UpcomingLinesParamsInvoiceItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class UpcomingLinesParamsIssuer(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class UpcomingLinesParamsScheduleDetails(TypedDict): + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + """ + phases: NotRequired[ + List["Invoice.UpcomingLinesParamsScheduleDetailsPhase"] + ] + """ + List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. + """ + + class UpcomingLinesParamsScheduleDetailsPhase(TypedDict): + add_invoice_items: NotRequired[ + List[ + "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItem" + ] + ] + """ + A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + """ + application_fee_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + """ + automatic_tax: NotRequired[ + "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAutomaticTax" + ] + """ + Automatic tax settings for this phase. + """ + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] + """ + Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + """ + billing_thresholds: NotRequired[ + "Literal['']|Invoice.UpcomingLinesParamsScheduleDetailsPhaseBillingThresholds" + ] + """ + 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. + """ + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] + """ + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + """ + coupon: NotRequired[str] + """ + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + """ + currency: NotRequired[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 MarkUncollectibleParams(RequestOptions): - expand: NotRequired[List[str]] + default_payment_method: NotRequired[str] """ - Specifies which fields in the response should be expanded. + ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ - - class ModifyParams(RequestOptions): - account_tax_ids: NotRequired["Literal['']|List[str]"] + default_tax_rates: NotRequired["Literal['']|List[str]"] """ - The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ - application_fee_amount: NotRequired[int] + description: NotRequired["Literal['']|str"] """ - A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). + Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ - auto_advance: NotRequired[bool] + discounts: NotRequired[ + "Literal['']|List[Invoice.UpcomingLinesParamsScheduleDetailsPhaseDiscount]" + ] """ - Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. + The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ - automatic_tax: NotRequired["Invoice.ModifyParamsAutomaticTax"] + end_date: NotRequired["int|Literal['now']"] """ - Settings for automatic tax lookup for this invoice. + The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ - collection_method: NotRequired[ - Literal["charge_automatically", "send_invoice"] + invoice_settings: NotRequired[ + "Invoice.UpcomingLinesParamsScheduleDetailsPhaseInvoiceSettings" ] """ - Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices. + All invoices will be billed using the specified settings. """ - custom_fields: NotRequired[ - "Literal['']|List[Invoice.ModifyParamsCustomField]" - ] + items: List["Invoice.UpcomingLinesParamsScheduleDetailsPhaseItem"] """ - A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields. + List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ - days_until_due: NotRequired[int] + iterations: NotRequired[int] """ - The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. + Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ - default_payment_method: NotRequired[str] + metadata: NotRequired[Dict[str, str]] """ - ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ - default_source: NotRequired["Literal['']|str"] + on_behalf_of: NotRequired[str] """ - ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + The account on behalf of which to charge, for each of the associated subscription's invoices. """ - default_tax_rates: NotRequired["Literal['']|List[str]"] + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] """ - The tax rates that will apply to any line item that does not have `tax_rates` set. Pass an empty string to remove previously-defined tax rates. + Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ - description: NotRequired[str] + start_date: NotRequired["int|Literal['now']"] """ - An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. + The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. """ - discounts: NotRequired[ - "Literal['']|List[Invoice.ModifyParamsDiscount]" + transfer_data: NotRequired[ + "Invoice.UpcomingLinesParamsScheduleDetailsPhaseTransferData" ] """ - The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts. + The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ - due_date: NotRequired[int] + trial: NotRequired[bool] """ - The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. + If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ - effective_at: NotRequired["Literal['']|int"] + trial_end: NotRequired["int|Literal['now']"] """ - The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ - expand: NotRequired[List[str]] + + class UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List[ + "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemDiscount" + ] + ] """ - Specifies which fields in the response should be expanded. + The coupons to redeem into discounts for the item. """ - footer: NotRequired[str] + price: NotRequired[str] """ - Footer to be displayed on the invoice. + The ID of the price object. """ - issuer: NotRequired["Invoice.ModifyParamsIssuer"] + price_data: NotRequired[ + "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemPriceData" + ] """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - metadata: NotRequired["Literal['']|Dict[str, str]"] + quantity: NotRequired[int] """ - Set of [key-value pairs](https://stripe.com/docs/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 for this item. Defaults to 1. """ - number: NotRequired["Literal['']|str"] + tax_rates: NotRequired["Literal['']|List[str]"] """ - Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. + The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ - on_behalf_of: NotRequired["Literal['']|str"] + + class UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemDiscount( + TypedDict, + ): + coupon: NotRequired[str] """ - The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + ID of the coupon to create a new discount for. """ - payment_settings: NotRequired["Invoice.ModifyParamsPaymentSettings"] + discount: NotRequired[str] """ - Configuration settings for the PaymentIntent that is generated when the invoice is finalized. + ID of an existing discount on the object (or one of its ancestors) to reuse. """ - rendering: NotRequired["Invoice.ModifyParamsRendering"] + promotion_code: NotRequired[str] """ - The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + ID of the promotion code to create a new discount for. """ - shipping_cost: NotRequired[ - "Literal['']|Invoice.ModifyParamsShippingCost" - ] + + class UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemPriceData( + TypedDict, + ): + currency: str """ - Settings for the cost of shipping for this invoice. + 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). """ - shipping_details: NotRequired[ - "Literal['']|Invoice.ModifyParamsShippingDetails" + product: str + """ + The ID of the product that this price will belong to. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] ] """ - Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - statement_descriptor: NotRequired[str] + unit_amount: NotRequired[int] """ - Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - transfer_data: NotRequired[ - "Literal['']|Invoice.ModifyParamsTransferData" - ] + unit_amount_decimal: NotRequired[str] """ - If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value. + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - class ModifyParamsAutomaticTax(TypedDict): + class UpcomingLinesParamsScheduleDetailsPhaseAutomaticTax(TypedDict): enabled: bool """ - Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ - liability: NotRequired["Invoice.ModifyParamsAutomaticTaxLiability"] + liability: NotRequired[ + "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAutomaticTaxLiability" + ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ - class ModifyParamsAutomaticTaxLiability(TypedDict): + class UpcomingLinesParamsScheduleDetailsPhaseAutomaticTaxLiability( + TypedDict, + ): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. @@ -1826,17 +4005,17 @@ class ModifyParamsAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class ModifyParamsCustomField(TypedDict): - name: str + class UpcomingLinesParamsScheduleDetailsPhaseBillingThresholds(TypedDict): + amount_gte: NotRequired[int] """ - The name of the custom field. This may be up to 40 characters. + Monetary threshold that triggers the subscription to advance to a new billing period """ - value: str + reset_billing_cycle_anchor: NotRequired[bool] """ - The value of the custom field. This may be up to 140 characters. + Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ - class ModifyParamsDiscount(TypedDict): + class UpcomingLinesParamsScheduleDetailsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. @@ -1850,485 +4029,422 @@ class ModifyParamsDiscount(TypedDict): ID of the promotion code to create a new discount for. """ - class ModifyParamsIssuer(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] + class UpcomingLinesParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] """ - Type of the account referenced in the request. + The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ - - class ModifyParamsPaymentSettings(TypedDict): - default_mandate: NotRequired["Literal['']|str"] + days_until_due: NotRequired[int] """ - ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ - payment_method_options: NotRequired[ - "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptions" + issuer: NotRequired[ + "Invoice.UpcomingLinesParamsScheduleDetailsPhaseInvoiceSettingsIssuer" ] """ - Payment-method-specific configuration to provide to the invoice's PaymentIntent. + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ - payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" - ] + + class UpcomingLinesParamsScheduleDetailsPhaseInvoiceSettingsIssuer( + TypedDict, + ): + account: NotRequired[str] """ - The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + The connected account being referenced when `type` is `account`. """ - - class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): - acss_debit: NotRequired[ - "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit" - ] + type: Literal["account", "self"] """ - If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. + Type of the account referenced in the request. """ - bancontact: NotRequired[ - "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsBancontact" + + class UpcomingLinesParamsScheduleDetailsPhaseItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|Invoice.UpcomingLinesParamsScheduleDetailsPhaseItemBillingThresholds" ] """ - If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - card: NotRequired[ - "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCard" + discounts: NotRequired[ + "Literal['']|List[Invoice.UpcomingLinesParamsScheduleDetailsPhaseItemDiscount]" ] """ - If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. + The coupons to redeem into discounts for the subscription item. """ - customer_balance: NotRequired[ - "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" - ] + metadata: NotRequired[Dict[str, str]] """ - If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ - konbini: NotRequired[ - "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini" - ] + plan: NotRequired[str] """ - If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. + The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ - sepa_debit: NotRequired[ - "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit" - ] + price: NotRequired[str] """ - If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. + The ID of the price object. """ - us_bank_account: NotRequired[ - "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" + price_data: NotRequired[ + "Invoice.UpcomingLinesParamsScheduleDetailsPhaseItemPriceData" ] """ - If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - - class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): - mandate_options: NotRequired[ - "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" - ] + quantity: NotRequired[int] """ - Additional fields for Mandate creation + Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ - verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] - ] + tax_rates: NotRequired["Literal['']|List[str]"] """ - Verification method for the intent + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( + class UpcomingLinesParamsScheduleDetailsPhaseItemBillingThresholds( TypedDict, ): - transaction_type: NotRequired[Literal["business", "personal"]] + usage_gte: int """ - Transaction type of the mandate. + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ - class ModifyParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + class UpcomingLinesParamsScheduleDetailsPhaseItemDiscount(TypedDict): + coupon: NotRequired[str] """ - Preferred language of the Bancontact authorization page that the customer is redirected to. + ID of the coupon to create a new discount for. """ - - class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): - installments: NotRequired[ - "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallments" - ] + discount: NotRequired[str] """ - Installment configuration for payments attempted on this invoice (Mexico Only). - - For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + ID of an existing discount on the object (or one of its ancestors) to reuse. """ - request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] - ] + promotion_code: NotRequired[str] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + ID of the promotion code to create a new discount for. """ - class ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallments( - TypedDict, - ): - enabled: NotRequired[bool] + class UpcomingLinesParamsScheduleDetailsPhaseItemPriceData(TypedDict): + currency: str """ - Setting to true enables installments for this invoice. - Setting to false will prevent any selected plan from applying to a payment. + 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). """ - plan: NotRequired[ - "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan" - ] + product: str """ - The selected installment plan to use for this invoice. + The ID of the product that this price will belong to. """ - - class ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( - TypedDict, - ): - count: int + recurring: "Invoice.UpcomingLinesParamsScheduleDetailsPhaseItemPriceDataRecurring" + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] """ - For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - interval: Literal["month"] + unit_amount: NotRequired[int] """ - For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - One of `month`. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - type: Literal["fixed_count"] + unit_amount_decimal: NotRequired[str] """ - Type of installment plan, one of `fixed_count`. + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( + class UpcomingLinesParamsScheduleDetailsPhaseItemPriceDataRecurring( TypedDict, ): - bank_transfer: NotRequired[ - "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" - ] + interval: Literal["day", "month", "week", "year"] """ - Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - funding_type: NotRequired[str] + interval_count: NotRequired[int] """ - The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ - class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( - TypedDict, - ): - eu_bank_transfer: NotRequired[ - "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" - ] + class UpcomingLinesParamsScheduleDetailsPhaseTransferData(TypedDict): + amount_percent: NotRequired[float] """ - Configuration for eu_bank_transfer funding type. + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ - type: NotRequired[str] + destination: str """ - The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + ID of an existing, connected Stripe account. """ - class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( - TypedDict, - ): - country: str + class UpcomingLinesParamsSubscriptionDetails(TypedDict): + billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] """ - The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ - - class ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): - pass - - class ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): - pass - - class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( - TypedDict, - ): - financial_connections: NotRequired[ - "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections" - ] + cancel_at: NotRequired["Literal['']|int"] """ - Additional fields for Financial Connections Session creation + A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ - verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] - ] + cancel_at_period_end: NotRequired[bool] """ - Verification method for the intent + Boolean indicating whether this subscription should cancel at the end of the current period. """ - - class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( - TypedDict, - ): - permissions: NotRequired[ - List[ - Literal[ - "balances", "ownership", "payment_method", "transactions" - ] - ] - ] + cancel_now: NotRequired[bool] """ - The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + This simulates the subscription being canceled or expired immediately. """ - prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. + """ + items: NotRequired[ + List["Invoice.UpcomingLinesParamsSubscriptionDetailsItem"] ] """ - List of data features that you would like to retrieve upon account creation. + A list of up to 20 subscription items, each with an attached price. """ - - class ModifyParamsRendering(TypedDict): - amount_tax_display: NotRequired[ - "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] ] """ - How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - pdf: NotRequired["Invoice.ModifyParamsRenderingPdf"] + proration_date: NotRequired[int] """ - Invoice pdf rendering options + If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. """ - - class ModifyParamsRenderingPdf(TypedDict): - page_size: NotRequired[Literal["a4", "auto", "letter"]] + resume_at: NotRequired[Literal["now"]] """ - Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. - If set to `auto`, invoice PDF page size defaults to `a4` for customers with - Japanese locale and `letter` for customers with other locales. + For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ - - class ModifyParamsShippingCost(TypedDict): - shipping_rate: NotRequired[str] + start_date: NotRequired[int] """ - The ID of the shipping rate to use for this order. + Date a subscription is intended to start (can be future or past). """ - shipping_rate_data: NotRequired[ - "Invoice.ModifyParamsShippingCostShippingRateData" - ] + trial_end: NotRequired["Literal['now']|int"] """ - Parameters to create a new ad-hoc shipping rate for this order. + If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ - class ModifyParamsShippingCostShippingRateData(TypedDict): - delivery_estimate: NotRequired[ - "Invoice.ModifyParamsShippingCostShippingRateDataDeliveryEstimate" + class UpcomingLinesParamsSubscriptionDetailsItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|Invoice.UpcomingLinesParamsSubscriptionDetailsItemBillingThresholds" ] """ - The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - display_name: str + clear_usage: NotRequired[bool] """ - The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ - fixed_amount: NotRequired[ - "Invoice.ModifyParamsShippingCostShippingRateDataFixedAmount" - ] + deleted: NotRequired[bool] """ - Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + A flag that, if set to `true`, will delete the specified item. """ - metadata: NotRequired[Dict[str, str]] + discounts: NotRequired[ + "Literal['']|List[Invoice.UpcomingLinesParamsSubscriptionDetailsItemDiscount]" + ] """ - Set of [key-value pairs](https://stripe.com/docs/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`. + The coupons to redeem into discounts for the subscription item. """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] + id: NotRequired[str] """ - Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + Subscription item to update. """ - tax_code: NotRequired[str] + metadata: NotRequired["Literal['']|Dict[str, str]"] """ - A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + Set of [key-value pairs](https://stripe.com/docs/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`. """ - type: NotRequired[Literal["fixed_amount"]] + plan: NotRequired[str] """ - The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + Plan ID for this item, as a string. """ - - class ModifyParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): - maximum: NotRequired[ - "Invoice.ModifyParamsShippingCostShippingRateDataDeliveryEstimateMaximum" - ] + price: NotRequired[str] """ - The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ - minimum: NotRequired[ - "Invoice.ModifyParamsShippingCostShippingRateDataDeliveryEstimateMinimum" + price_data: NotRequired[ + "Invoice.UpcomingLinesParamsSubscriptionDetailsItemPriceData" ] """ - The lower bound of the estimated range. If empty, represents no lower bound. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - - class ModifyParamsShippingCostShippingRateDataDeliveryEstimateMaximum( - TypedDict, - ): - unit: Literal["business_day", "day", "hour", "month", "week"] + quantity: NotRequired[int] """ - A unit of time. + Quantity for this item. """ - value: int + tax_rates: NotRequired["Literal['']|List[str]"] """ - Must be greater than 0. + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class ModifyParamsShippingCostShippingRateDataDeliveryEstimateMinimum( + class UpcomingLinesParamsSubscriptionDetailsItemBillingThresholds( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + usage_gte: int """ - A unit of time. + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ - value: int + + class UpcomingLinesParamsSubscriptionDetailsItemDiscount(TypedDict): + coupon: NotRequired[str] """ - Must be greater than 0. + ID of the coupon to create a new discount for. """ - - class ModifyParamsShippingCostShippingRateDataFixedAmount(TypedDict): - amount: int + discount: NotRequired[str] """ - A non-negative integer in cents representing how much to charge. + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. """ + + class UpcomingLinesParamsSubscriptionDetailsItemPriceData(TypedDict): 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). """ - currency_options: NotRequired[ - Dict[ - str, - "Invoice.ModifyParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", - ] + product: str + """ + The ID of the product that this price will belong to. + """ + recurring: "Invoice.UpcomingLinesParamsSubscriptionDetailsItemPriceDataRecurring" + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] ] """ - Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - class ModifyParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( + class UpcomingLinesParamsSubscriptionDetailsItemPriceDataRecurring( TypedDict, ): - amount: int + interval: Literal["day", "month", "week", "year"] """ - A non-negative integer in cents representing how much to charge. + Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] + interval_count: NotRequired[int] """ - Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ - class ModifyParamsShippingDetails(TypedDict): - address: "Invoice.ModifyParamsShippingDetailsAddress" + class UpcomingLinesParamsSubscriptionItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|Invoice.UpcomingLinesParamsSubscriptionItemBillingThresholds" + ] """ - Shipping address + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - name: str + clear_usage: NotRequired[bool] """ - Recipient name. + Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ - phone: NotRequired["Literal['']|str"] + deleted: NotRequired[bool] """ - Recipient phone (including extension) + A flag that, if set to `true`, will delete the specified item. """ - - class ModifyParamsShippingDetailsAddress(TypedDict): - city: NotRequired[str] + discounts: NotRequired[ + "Literal['']|List[Invoice.UpcomingLinesParamsSubscriptionItemDiscount]" + ] """ - City, district, suburb, town, or village. + The coupons to redeem into discounts for the subscription item. """ - country: NotRequired[str] + id: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + Subscription item to update. """ - line1: NotRequired[str] + metadata: NotRequired["Literal['']|Dict[str, str]"] """ - Address line 1 (e.g., street, PO Box, or company name). + Set of [key-value pairs](https://stripe.com/docs/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`. """ - line2: NotRequired[str] + plan: NotRequired[str] """ - Address line 2 (e.g., apartment, suite, unit, or building). + Plan ID for this item, as a string. """ - postal_code: NotRequired[str] + price: NotRequired[str] """ - ZIP or postal code. + The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ - state: NotRequired[str] + price_data: NotRequired[ + "Invoice.UpcomingLinesParamsSubscriptionItemPriceData" + ] """ - State, county, province, or region. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - - class ModifyParamsTransferData(TypedDict): - amount: NotRequired[int] + quantity: NotRequired[int] """ - The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. + Quantity for this item. """ - destination: str + tax_rates: NotRequired["Literal['']|List[str]"] """ - ID of an existing, connected Stripe account. + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class PayParams(RequestOptions): - expand: NotRequired[List[str]] - """ - Specifies which fields in the response should be expanded. + class UpcomingLinesParamsSubscriptionItemBillingThresholds(TypedDict): + usage_gte: int """ - forgive: NotRequired[bool] + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ - In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. - Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`. - """ - mandate: NotRequired["Literal['']|str"] + class UpcomingLinesParamsSubscriptionItemDiscount(TypedDict): + coupon: NotRequired[str] """ - ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. + ID of the coupon to create a new discount for. """ - off_session: NotRequired[bool] + discount: NotRequired[str] """ - Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). + ID of an existing discount on the object (or one of its ancestors) to reuse. """ - paid_out_of_band: NotRequired[bool] + promotion_code: NotRequired[str] """ - Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. + ID of the promotion code to create a new discount for. """ - payment_method: NotRequired[str] + + class UpcomingLinesParamsSubscriptionItemPriceData(TypedDict): + currency: str """ - A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. + 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: NotRequired[str] + product: str """ - A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. + The ID of the product that this price will belong to. """ - - class RetrieveParams(RequestOptions): - expand: NotRequired[List[str]] + recurring: "Invoice.UpcomingLinesParamsSubscriptionItemPriceDataRecurring" """ - Specifies which fields in the response should be expanded. + The recurring components of a price such as `interval` and `interval_count`. """ - - class SearchParams(RequestOptions): - expand: NotRequired[List[str]] + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] """ - Specifies which fields in the response should be expanded. + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - limit: NotRequired[int] + unit_amount: NotRequired[int] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - page: NotRequired[str] + unit_amount_decimal: NotRequired[str] """ - A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - query: str + + class UpcomingLinesParamsSubscriptionItemPriceDataRecurring(TypedDict): + interval: Literal["day", "month", "week", "year"] """ - The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices). + Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - - class SendInvoiceParams(RequestOptions): - expand: NotRequired[List[str]] + interval_count: NotRequired[int] """ - Specifies which fields in the response should be expanded. + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ - class UpcomingLinesParams(RequestOptions): - automatic_tax: NotRequired["Invoice.UpcomingLinesParamsAutomaticTax"] + class UpcomingParams(RequestOptions): + automatic_tax: NotRequired["Invoice.UpcomingParamsAutomaticTax"] """ Settings for automatic tax lookup for this invoice preview. """ @@ -2344,40 +4460,28 @@ class UpcomingLinesParams(RequestOptions): """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ - customer_details: NotRequired[ - "Invoice.UpcomingLinesParamsCustomerDetails" - ] + customer_details: NotRequired["Invoice.UpcomingParamsCustomerDetails"] """ Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingLinesParamsDiscount]" + "Literal['']|List[Invoice.UpcomingParamsDiscount]" ] """ The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ - 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. """ - invoice_items: NotRequired[ - List["Invoice.UpcomingLinesParamsInvoiceItem"] - ] + invoice_items: NotRequired[List["Invoice.UpcomingParamsInvoiceItem"]] """ List of invoice items to add or update in the upcoming invoice preview. """ - issuer: NotRequired["Invoice.UpcomingLinesParamsIssuer"] + issuer: NotRequired["Invoice.UpcomingParamsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ - 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. - """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. @@ -2386,9 +4490,9 @@ class UpcomingLinesParams(RequestOptions): """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. """ - starting_after: NotRequired[str] + schedule_details: NotRequired["Invoice.UpcomingParamsScheduleDetails"] """ - 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. + The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. """ subscription: NotRequired[str] """ @@ -2398,70 +4502,74 @@ class UpcomingLinesParams(RequestOptions): "Literal['now', 'unchanged']|int" ] """ - For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. + For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. """ subscription_cancel_at: NotRequired["Literal['']|int"] """ - A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. + A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. """ subscription_cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. + Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. """ subscription_cancel_now: NotRequired[bool] """ - This simulates the subscription being canceled or expired immediately. + This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. """ subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] """ - If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. + If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. + """ + subscription_details: NotRequired[ + "Invoice.UpcomingParamsSubscriptionDetails" + ] + """ + The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. """ subscription_items: NotRequired[ - List["Invoice.UpcomingLinesParamsSubscriptionItem"] + List["Invoice.UpcomingParamsSubscriptionItem"] ] """ - A list of up to 20 subscription items, each with an attached price. + A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. """ subscription_proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ - Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. """ subscription_proration_date: NotRequired[int] """ - If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. + If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. """ subscription_resume_at: NotRequired[Literal["now"]] """ - For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. """ subscription_start_date: NotRequired[int] """ - Date a subscription is intended to start (can be future or past). + Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. """ subscription_trial_end: NotRequired["Literal['now']|int"] """ - If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. + If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. """ subscription_trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ - class UpcomingLinesParamsAutomaticTax(TypedDict): + class UpcomingParamsAutomaticTax(TypedDict): enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. """ - liability: NotRequired[ - "Invoice.UpcomingLinesParamsAutomaticTaxLiability" - ] + liability: NotRequired["Invoice.UpcomingParamsAutomaticTaxLiability"] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ - class UpcomingLinesParamsAutomaticTaxLiability(TypedDict): + class UpcomingParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. @@ -2471,20 +4579,20 @@ class UpcomingLinesParamsAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class UpcomingLinesParamsCustomerDetails(TypedDict): + class UpcomingParamsCustomerDetails(TypedDict): address: NotRequired[ - "Literal['']|Invoice.UpcomingLinesParamsCustomerDetailsAddress" + "Literal['']|Invoice.UpcomingParamsCustomerDetailsAddress" ] """ The customer's address. """ shipping: NotRequired[ - "Literal['']|Invoice.UpcomingLinesParamsCustomerDetailsShipping" + "Literal['']|Invoice.UpcomingParamsCustomerDetailsShipping" ] """ The customer's shipping information. Appears on invoices emailed to this customer. """ - tax: NotRequired["Invoice.UpcomingLinesParamsCustomerDetailsTax"] + tax: NotRequired["Invoice.UpcomingParamsCustomerDetailsTax"] """ Tax details about the customer. """ @@ -2495,13 +4603,13 @@ class UpcomingLinesParamsCustomerDetails(TypedDict): The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_ids: NotRequired[ - List["Invoice.UpcomingLinesParamsCustomerDetailsTaxId"] + List["Invoice.UpcomingParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. """ - class UpcomingLinesParamsCustomerDetailsAddress(TypedDict): + class UpcomingParamsCustomerDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. @@ -2527,8 +4635,8 @@ class UpcomingLinesParamsCustomerDetailsAddress(TypedDict): State, county, province, or region. """ - class UpcomingLinesParamsCustomerDetailsShipping(TypedDict): - address: "Invoice.UpcomingLinesParamsCustomerDetailsShippingAddress" + class UpcomingParamsCustomerDetailsShipping(TypedDict): + address: "Invoice.UpcomingParamsCustomerDetailsShippingAddress" """ Customer shipping address. """ @@ -2541,7 +4649,7 @@ class UpcomingLinesParamsCustomerDetailsShipping(TypedDict): Customer phone (including extension). """ - class UpcomingLinesParamsCustomerDetailsShippingAddress(TypedDict): + class UpcomingParamsCustomerDetailsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. @@ -2567,13 +4675,13 @@ class UpcomingLinesParamsCustomerDetailsShippingAddress(TypedDict): State, county, province, or region. """ - class UpcomingLinesParamsCustomerDetailsTax(TypedDict): + class UpcomingParamsCustomerDetailsTax(TypedDict): ip_address: NotRequired["Literal['']|str"] """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ - class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): + class UpcomingParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", @@ -2655,7 +4763,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): Value of the tax ID. """ - class UpcomingLinesParamsDiscount(TypedDict): + class UpcomingParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. @@ -2669,7 +4777,7 @@ class UpcomingLinesParamsDiscount(TypedDict): ID of the promotion code to create a new discount for. """ - class UpcomingLinesParamsInvoiceItem(TypedDict): + class UpcomingParamsInvoiceItem(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of previewed invoice item. @@ -2687,7 +4795,7 @@ class UpcomingLinesParamsInvoiceItem(TypedDict): Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. """ discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingLinesParamsInvoiceItemDiscount]" + "Literal['']|List[Invoice.UpcomingParamsInvoiceItemDiscount]" ] """ The coupons to redeem into discounts for the invoice item in the preview. @@ -2700,7 +4808,7 @@ class UpcomingLinesParamsInvoiceItem(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - period: NotRequired["Invoice.UpcomingLinesParamsInvoiceItemPeriod"] + period: NotRequired["Invoice.UpcomingParamsInvoiceItemPeriod"] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ @@ -2708,9 +4816,7 @@ class UpcomingLinesParamsInvoiceItem(TypedDict): """ The ID of the price object. """ - price_data: NotRequired[ - "Invoice.UpcomingLinesParamsInvoiceItemPriceData" - ] + price_data: NotRequired["Invoice.UpcomingParamsInvoiceItemPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ @@ -2736,128 +4842,224 @@ class UpcomingLinesParamsInvoiceItem(TypedDict): """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class UpcomingParamsInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class UpcomingParamsInvoiceItemPeriod(TypedDict): + end: int + """ + The end of the period, which must be greater than or equal to the start. This value is inclusive. + """ + start: int + """ + The start of the period. This value is inclusive. + """ + + class UpcomingParamsInvoiceItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class UpcomingParamsIssuer(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class UpcomingParamsScheduleDetails(TypedDict): + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + """ + phases: NotRequired[List["Invoice.UpcomingParamsScheduleDetailsPhase"]] + """ + List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. + """ + + class UpcomingParamsScheduleDetailsPhase(TypedDict): + add_invoice_items: NotRequired[ + List["Invoice.UpcomingParamsScheduleDetailsPhaseAddInvoiceItem"] + ] + """ + A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + """ + application_fee_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + """ + automatic_tax: NotRequired[ + "Invoice.UpcomingParamsScheduleDetailsPhaseAutomaticTax" + ] + """ + Automatic tax settings for this phase. + """ + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] + """ + Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + """ + billing_thresholds: NotRequired[ + "Literal['']|Invoice.UpcomingParamsScheduleDetailsPhaseBillingThresholds" + ] + """ + 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. + """ + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - - class UpcomingLinesParamsInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ - ID of the coupon to create a new discount for. + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ - discount: NotRequired[str] + currency: NotRequired[str] """ - ID of an existing discount on the object (or one of its ancestors) to reuse. + 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). """ - promotion_code: NotRequired[str] + default_payment_method: NotRequired[str] """ - ID of the promotion code to create a new discount for. + ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ - - class UpcomingLinesParamsInvoiceItemPeriod(TypedDict): - end: int + default_tax_rates: NotRequired["Literal['']|List[str]"] """ - The end of the period, which must be greater than or equal to the start. This value is inclusive. + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ - start: int + description: NotRequired["Literal['']|str"] """ - The start of the period. This value is inclusive. + Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ - - class UpcomingLinesParamsInvoiceItemPriceData(TypedDict): - currency: str + discounts: NotRequired[ + "Literal['']|List[Invoice.UpcomingParamsScheduleDetailsPhaseDiscount]" + ] """ - 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). + The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ - product: str + end_date: NotRequired["int|Literal['now']"] """ - The ID of the product that this price will belong to. + The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] + invoice_settings: NotRequired[ + "Invoice.UpcomingParamsScheduleDetailsPhaseInvoiceSettings" ] """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + All invoices will be billed using the specified settings. """ - unit_amount: NotRequired[int] + items: List["Invoice.UpcomingParamsScheduleDetailsPhaseItem"] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ - unit_amount_decimal: NotRequired[str] + iterations: NotRequired[int] """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ - - class UpcomingLinesParamsIssuer(TypedDict): - account: NotRequired[str] + metadata: NotRequired[Dict[str, str]] """ - The connected account being referenced when `type` is `account`. + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ - type: Literal["account", "self"] + on_behalf_of: NotRequired[str] """ - Type of the account referenced in the request. + The account on behalf of which to charge, for each of the associated subscription's invoices. """ - - class UpcomingLinesParamsSubscriptionItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|Invoice.UpcomingLinesParamsSubscriptionItemBillingThresholds" + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] ] """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - clear_usage: NotRequired[bool] - """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ - deleted: NotRequired[bool] + start_date: NotRequired["int|Literal['now']"] """ - A flag that, if set to `true`, will delete the specified item. + The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingLinesParamsSubscriptionItemDiscount]" + transfer_data: NotRequired[ + "Invoice.UpcomingParamsScheduleDetailsPhaseTransferData" ] """ - The coupons to redeem into discounts for the subscription item. + The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ - id: NotRequired[str] + trial: NotRequired[bool] """ - Subscription item to update. + If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ - metadata: NotRequired["Literal['']|Dict[str, str]"] + trial_end: NotRequired["int|Literal['now']"] """ - Set of [key-value pairs](https://stripe.com/docs/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`. + Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ - plan: NotRequired[str] + + class UpcomingParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List[ + "Invoice.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemDiscount" + ] + ] """ - Plan ID for this item, as a string. + The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. """ price_data: NotRequired[ - "Invoice.UpcomingLinesParamsSubscriptionItemPriceData" + "Invoice.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ - Quantity for this item. + Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class UpcomingLinesParamsSubscriptionItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ - class UpcomingLinesParamsSubscriptionItemDiscount(TypedDict): + class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. @@ -2871,7 +5073,7 @@ class UpcomingLinesParamsSubscriptionItemDiscount(TypedDict): ID of the promotion code to create a new discount for. """ - class UpcomingLinesParamsSubscriptionItemPriceData(TypedDict): + class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData(TypedDict): 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). @@ -2880,10 +5082,6 @@ class UpcomingLinesParamsSubscriptionItemPriceData(TypedDict): """ The ID of the product that this price will belong to. """ - recurring: "Invoice.UpcomingLinesParamsSubscriptionItemPriceDataRecurring" - """ - The recurring components of a price such as `interval` and `interval_count`. - """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] @@ -2899,411 +5097,295 @@ class UpcomingLinesParamsSubscriptionItemPriceData(TypedDict): Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - class UpcomingLinesParamsSubscriptionItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] + class UpcomingParamsScheduleDetailsPhaseAutomaticTax(TypedDict): + enabled: bool """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. + Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ - interval_count: NotRequired[int] + liability: NotRequired[ + "Invoice.UpcomingParamsScheduleDetailsPhaseAutomaticTaxLiability" + ] """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ - class UpcomingParams(RequestOptions): - automatic_tax: NotRequired["Invoice.UpcomingParamsAutomaticTax"] - """ - Settings for automatic tax lookup for this invoice preview. - """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ - currency: NotRequired[str] - """ - The currency to preview this invoice in. Defaults to that of `customer` if not specified. - """ - customer: NotRequired[str] + class UpcomingParamsScheduleDetailsPhaseAutomaticTaxLiability(TypedDict): + account: NotRequired[str] """ - The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + The connected account being referenced when `type` is `account`. """ - customer_details: NotRequired["Invoice.UpcomingParamsCustomerDetails"] + type: Literal["account", "self"] """ - Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + Type of the account referenced in the request. """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingParamsDiscount]" - ] + + class UpcomingParamsScheduleDetailsPhaseBillingThresholds(TypedDict): + amount_gte: NotRequired[int] """ - The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. + Monetary threshold that triggers the subscription to advance to a new billing period """ - expand: NotRequired[List[str]] + reset_billing_cycle_anchor: NotRequired[bool] """ - Specifies which fields in the response should be expanded. + Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ - invoice_items: NotRequired[List["Invoice.UpcomingParamsInvoiceItem"]] + + class UpcomingParamsScheduleDetailsPhaseDiscount(TypedDict): + coupon: NotRequired[str] """ - List of invoice items to add or update in the upcoming invoice preview. + ID of the coupon to create a new discount for. """ - issuer: NotRequired["Invoice.UpcomingParamsIssuer"] + discount: NotRequired[str] """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + ID of an existing discount on the object (or one of its ancestors) to reuse. """ - on_behalf_of: NotRequired["Literal['']|str"] + promotion_code: NotRequired[str] """ - The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + ID of the promotion code to create a new discount for. """ - schedule: NotRequired[str] + + class UpcomingParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] """ - The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. + The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ - subscription: NotRequired[str] + days_until_due: NotRequired[int] """ - The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ - subscription_billing_cycle_anchor: NotRequired[ - "Literal['now', 'unchanged']|int" + issuer: NotRequired[ + "Invoice.UpcomingParamsScheduleDetailsPhaseInvoiceSettingsIssuer" ] """ - For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. - """ - subscription_cancel_at: NotRequired["Literal['']|int"] - """ - A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. - """ - subscription_cancel_at_period_end: NotRequired[bool] - """ - Boolean indicating whether this subscription should cancel at the end of the current period. + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ - subscription_cancel_now: NotRequired[bool] + + class UpcomingParamsScheduleDetailsPhaseInvoiceSettingsIssuer(TypedDict): + account: NotRequired[str] """ - This simulates the subscription being canceled or expired immediately. + The connected account being referenced when `type` is `account`. """ - subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] + type: Literal["account", "self"] """ - If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. + Type of the account referenced in the request. """ - subscription_items: NotRequired[ - List["Invoice.UpcomingParamsSubscriptionItem"] + + class UpcomingParamsScheduleDetailsPhaseItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|Invoice.UpcomingParamsScheduleDetailsPhaseItemBillingThresholds" ] """ - A list of up to 20 subscription items, each with an attached price. + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - subscription_proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + discounts: NotRequired[ + "Literal['']|List[Invoice.UpcomingParamsScheduleDetailsPhaseItemDiscount]" ] """ - Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. - """ - subscription_proration_date: NotRequired[int] - """ - If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. + The coupons to redeem into discounts for the subscription item. """ - subscription_resume_at: NotRequired[Literal["now"]] + metadata: NotRequired[Dict[str, str]] """ - For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ - subscription_start_date: NotRequired[int] + plan: NotRequired[str] """ - Date a subscription is intended to start (can be future or past). + The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ - subscription_trial_end: NotRequired["Literal['now']|int"] + price: NotRequired[str] """ - If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. + The ID of the price object. """ - subscription_trial_from_plan: NotRequired[bool] + price_data: NotRequired[ + "Invoice.UpcomingParamsScheduleDetailsPhaseItemPriceData" + ] """ - Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - - class UpcomingParamsAutomaticTax(TypedDict): - enabled: bool + quantity: NotRequired[int] """ - Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ - liability: NotRequired["Invoice.UpcomingParamsAutomaticTaxLiability"] + tax_rates: NotRequired["Literal['']|List[str]"] """ - The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class UpcomingParamsAutomaticTaxLiability(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] + class UpcomingParamsScheduleDetailsPhaseItemBillingThresholds(TypedDict): + usage_gte: int """ - Type of the account referenced in the request. + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ - class UpcomingParamsCustomerDetails(TypedDict): - address: NotRequired[ - "Literal['']|Invoice.UpcomingParamsCustomerDetailsAddress" - ] - """ - The customer's address. - """ - shipping: NotRequired[ - "Literal['']|Invoice.UpcomingParamsCustomerDetailsShipping" - ] - """ - The customer's shipping information. Appears on invoices emailed to this customer. - """ - tax: NotRequired["Invoice.UpcomingParamsCustomerDetailsTax"] + class UpcomingParamsScheduleDetailsPhaseItemDiscount(TypedDict): + coupon: NotRequired[str] """ - Tax details about the customer. + ID of the coupon to create a new discount for. """ - tax_exempt: NotRequired[ - "Literal['']|Literal['exempt', 'none', 'reverse']" - ] + discount: NotRequired[str] """ - The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + ID of an existing discount on the object (or one of its ancestors) to reuse. """ - tax_ids: NotRequired[ - List["Invoice.UpcomingParamsCustomerDetailsTaxId"] - ] + promotion_code: NotRequired[str] """ - The customer's tax IDs. + ID of the promotion code to create a new discount for. """ - class UpcomingParamsCustomerDetailsAddress(TypedDict): - city: NotRequired[str] - """ - City, district, suburb, town, or village. - """ - country: NotRequired[str] + class UpcomingParamsScheduleDetailsPhaseItemPriceData(TypedDict): + currency: str """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + 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). """ - line1: NotRequired[str] + product: str """ - Address line 1 (e.g., street, PO Box, or company name). + The ID of the product that this price will belong to. """ - line2: NotRequired[str] + recurring: "Invoice.UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring" """ - Address line 2 (e.g., apartment, suite, unit, or building). + The recurring components of a price such as `interval` and `interval_count`. """ - postal_code: NotRequired[str] + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] """ - ZIP or postal code. + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - state: NotRequired[str] + unit_amount: NotRequired[int] """ - State, county, province, or region. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - - class UpcomingParamsCustomerDetailsShipping(TypedDict): - address: "Invoice.UpcomingParamsCustomerDetailsShippingAddress" + unit_amount_decimal: NotRequired[str] """ - Customer shipping address. + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - name: str + + class UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring(TypedDict): + interval: Literal["day", "month", "week", "year"] """ - Customer name. + Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - phone: NotRequired[str] + interval_count: NotRequired[int] """ - Customer phone (including extension). + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ - class UpcomingParamsCustomerDetailsShippingAddress(TypedDict): - city: NotRequired[str] + class UpcomingParamsScheduleDetailsPhaseTransferData(TypedDict): + amount_percent: NotRequired[float] """ - City, district, suburb, town, or village. + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ - country: NotRequired[str] + destination: str """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + ID of an existing, connected Stripe account. """ - line1: NotRequired[str] + + class UpcomingParamsSubscriptionDetails(TypedDict): + billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] """ - Address line 1 (e.g., street, PO Box, or company name). + For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ - line2: NotRequired[str] + cancel_at: NotRequired["Literal['']|int"] """ - Address line 2 (e.g., apartment, suite, unit, or building). + A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ - postal_code: NotRequired[str] + cancel_at_period_end: NotRequired[bool] """ - ZIP or postal code. + Boolean indicating whether this subscription should cancel at the end of the current period. """ - state: NotRequired[str] + cancel_now: NotRequired[bool] """ - State, county, province, or region. + This simulates the subscription being canceled or expired immediately. """ - - class UpcomingParamsCustomerDetailsTax(TypedDict): - ip_address: NotRequired["Literal['']|str"] + default_tax_rates: NotRequired["Literal['']|List[str]"] """ - A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. """ - - class UpcomingParamsCustomerDetailsTaxId(TypedDict): - type: Literal[ - "ad_nrt", - "ae_trn", - "ar_cuit", - "au_abn", - "au_arn", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "eu_vat", - "gb_vat", - "ge_vat", - "hk_br", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kr_brn", - "kz_bin", - "li_uid", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sv_nit", - "th_vat", - "tr_tin", - "tw_vat", - "ua_vat", - "us_ein", - "uy_ruc", - "ve_rif", - "vn_tin", - "za_vat", + items: NotRequired[ + List["Invoice.UpcomingParamsSubscriptionDetailsItem"] ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + A list of up to 20 subscription items, each with an attached price. """ - value: str + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] """ - Value of the tax ID. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - - class UpcomingParamsDiscount(TypedDict): - coupon: NotRequired[str] + proration_date: NotRequired[int] """ - ID of the coupon to create a new discount for. + If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. """ - discount: NotRequired[str] + resume_at: NotRequired[Literal["now"]] """ - ID of an existing discount on the object (or one of its ancestors) to reuse. + For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ - promotion_code: NotRequired[str] + start_date: NotRequired[int] """ - ID of the promotion code to create a new discount for. + Date a subscription is intended to start (can be future or past). """ - - class UpcomingParamsInvoiceItem(TypedDict): - amount: NotRequired[int] + trial_end: NotRequired["Literal['now']|int"] """ - The integer amount in cents (or local equivalent) of previewed invoice item. + If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ - currency: NotRequired[str] + + class UpcomingParamsSubscriptionDetailsItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|Invoice.UpcomingParamsSubscriptionDetailsItemBillingThresholds" + ] """ - 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). Only applicable to new invoice items. + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - description: NotRequired[str] + clear_usage: NotRequired[bool] """ - An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ - discountable: NotRequired[bool] + deleted: NotRequired[bool] """ - Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. + A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingParamsInvoiceItemDiscount]" + "Literal['']|List[Invoice.UpcomingParamsSubscriptionDetailsItemDiscount]" ] """ - The coupons to redeem into discounts for the invoice item in the preview. + The coupons to redeem into discounts for the subscription item. """ - invoiceitem: NotRequired[str] + id: NotRequired[str] """ - The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. + Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - period: NotRequired["Invoice.UpcomingParamsInvoiceItemPeriod"] + plan: NotRequired[str] """ - The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + Plan ID for this item, as a string. """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ - price_data: NotRequired["Invoice.UpcomingParamsInvoiceItemPriceData"] + price_data: NotRequired[ + "Invoice.UpcomingParamsSubscriptionDetailsItemPriceData" + ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ - Non-negative integer. The quantity of units for the invoice item. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - tax_code: NotRequired["Literal['']|str"] - """ - A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ - The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. - """ - unit_amount: NotRequired[int] - """ - The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - unit_amount_decimal: NotRequired[str] + + class UpcomingParamsSubscriptionDetailsItemBillingThresholds(TypedDict): + usage_gte: int """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ - class UpcomingParamsInvoiceItemDiscount(TypedDict): + class UpcomingParamsSubscriptionDetailsItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. @@ -3317,17 +5399,7 @@ class UpcomingParamsInvoiceItemDiscount(TypedDict): ID of the promotion code to create a new discount for. """ - class UpcomingParamsInvoiceItemPeriod(TypedDict): - end: int - """ - The end of the period, which must be greater than or equal to the start. This value is inclusive. - """ - start: int - """ - The start of the period. This value is inclusive. - """ - - class UpcomingParamsInvoiceItemPriceData(TypedDict): + class UpcomingParamsSubscriptionDetailsItemPriceData(TypedDict): 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). @@ -3336,6 +5408,10 @@ class UpcomingParamsInvoiceItemPriceData(TypedDict): """ The ID of the product that this price will belong to. """ + recurring: "Invoice.UpcomingParamsSubscriptionDetailsItemPriceDataRecurring" + """ + The recurring components of a price such as `interval` and `interval_count`. + """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] @@ -3351,14 +5427,14 @@ class UpcomingParamsInvoiceItemPriceData(TypedDict): Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - class UpcomingParamsIssuer(TypedDict): - account: NotRequired[str] + class UpcomingParamsSubscriptionDetailsItemPriceDataRecurring(TypedDict): + interval: Literal["day", "month", "week", "year"] """ - The connected account being referenced when `type` is `account`. + Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - type: Literal["account", "self"] + interval_count: NotRequired[int] """ - Type of the account referenced in the request. + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpcomingParamsSubscriptionItem(TypedDict): @@ -3849,6 +5925,46 @@ async def create_async( ), ) + @classmethod + def create_preview( + cls, **params: Unpack["Invoice.CreatePreviewParams"] + ) -> "Invoice": + """ + At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. + + Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. + + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + """ + return cast( + "Invoice", + cls._static_request( + "post", + "/v1/invoices/create_preview", + params=params, + ), + ) + + @classmethod + async def create_preview_async( + cls, **params: Unpack["Invoice.CreatePreviewParams"] + ) -> "Invoice": + """ + At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. + + Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. + + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + """ + return cast( + "Invoice", + await cls._static_request_async( + "post", + "/v1/invoices/create_preview", + params=params, + ), + ) + @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Invoice.DeleteParams"] diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index d21530752..4f076c612 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -627,289 +627,1875 @@ class CreateParamsTransferData(TypedDict): ID of an existing, connected Stripe account. """ - class DeleteParams(TypedDict): - pass - - class FinalizeInvoiceParams(TypedDict): - auto_advance: NotRequired[bool] + class CreatePreviewParams(TypedDict): + automatic_tax: NotRequired[ + "InvoiceService.CreatePreviewParamsAutomaticTax" + ] """ - Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. + Settings for automatic tax lookup for this invoice preview. + """ + coupon: NotRequired[str] + """ + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + """ + currency: NotRequired[str] + """ + The currency to preview this invoice in. Defaults to that of `customer` if not specified. + """ + customer: NotRequired[str] + """ + The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + """ + customer_details: NotRequired[ + "InvoiceService.CreatePreviewParamsCustomerDetails" + ] + """ + Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceService.CreatePreviewParamsDiscount]" + ] + """ + The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ + invoice_items: NotRequired[ + List["InvoiceService.CreatePreviewParamsInvoiceItem"] + ] + """ + List of invoice items to add or update in the upcoming invoice preview. + """ + issuer: NotRequired["InvoiceService.CreatePreviewParamsIssuer"] + """ + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + """ + on_behalf_of: NotRequired["Literal['']|str"] + """ + The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + """ + schedule: NotRequired[str] + """ + The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. + """ + schedule_details: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetails" + ] + """ + The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. + """ + subscription: NotRequired[str] + """ + The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + """ + subscription_details: NotRequired[ + "InvoiceService.CreatePreviewParamsSubscriptionDetails" + ] + """ + The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. + """ - class ListParams(TypedDict): - collection_method: NotRequired[ - Literal["charge_automatically", "send_invoice"] + class CreatePreviewParamsAutomaticTax(TypedDict): + enabled: bool + """ + Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + """ + liability: NotRequired[ + "InvoiceService.CreatePreviewParamsAutomaticTaxLiability" ] """ - The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ - created: NotRequired["InvoiceService.ListParamsCreated|int"] + + class CreatePreviewParamsAutomaticTaxLiability(TypedDict): + account: NotRequired[str] """ - Only return invoices that were created during the given date interval. + The connected account being referenced when `type` is `account`. """ - customer: NotRequired[str] + type: Literal["account", "self"] """ - Only return invoices for the customer specified by this customer ID. + Type of the account referenced in the request. """ - due_date: NotRequired["InvoiceService.ListParamsDueDate|int"] - ending_before: NotRequired[str] + + class CreatePreviewParamsCustomerDetails(TypedDict): + address: NotRequired[ + "Literal['']|InvoiceService.CreatePreviewParamsCustomerDetailsAddress" + ] """ - 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. + The customer's address. """ - expand: NotRequired[List[str]] + shipping: NotRequired[ + "Literal['']|InvoiceService.CreatePreviewParamsCustomerDetailsShipping" + ] """ - Specifies which fields in the response should be expanded. + The customer's shipping information. Appears on invoices emailed to this customer. """ - limit: NotRequired[int] + tax: NotRequired[ + "InvoiceService.CreatePreviewParamsCustomerDetailsTax" + ] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + Tax details about the customer. """ - starting_after: NotRequired[str] + tax_exempt: NotRequired[ + "Literal['']|Literal['exempt', 'none', 'reverse']" + ] """ - 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. + The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ - status: NotRequired[ - Literal["draft", "open", "paid", "uncollectible", "void"] + tax_ids: NotRequired[ + List["InvoiceService.CreatePreviewParamsCustomerDetailsTaxId"] ] """ - The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) + The customer's tax IDs. """ - subscription: NotRequired[str] + + class CreatePreviewParamsCustomerDetailsAddress(TypedDict): + city: NotRequired[str] """ - Only return invoices for the subscription specified by this subscription ID. + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - class ListParamsCreated(TypedDict): - gt: NotRequired[int] + class CreatePreviewParamsCustomerDetailsShipping(TypedDict): + address: "InvoiceService.CreatePreviewParamsCustomerDetailsShippingAddress" """ - Minimum value to filter by (exclusive) + Customer shipping address. """ - gte: NotRequired[int] + name: str """ - Minimum value to filter by (inclusive) + Customer name. """ - lt: NotRequired[int] + phone: NotRequired[str] """ - Maximum value to filter by (exclusive) + Customer phone (including extension). """ - lte: NotRequired[int] + + class CreatePreviewParamsCustomerDetailsShippingAddress(TypedDict): + city: NotRequired[str] """ - Maximum value to filter by (inclusive) + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - class ListParamsDueDate(TypedDict): - gt: NotRequired[int] + class CreatePreviewParamsCustomerDetailsTax(TypedDict): + ip_address: NotRequired["Literal['']|str"] + """ + A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + """ + + class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): + type: Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "au_abn", + "au_arn", + "bg_uic", + "bh_vat", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "kz_bin", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + """ + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + """ + value: str + """ + Value of the tax ID. + """ + + class CreatePreviewParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsInvoiceItem(TypedDict): + amount: NotRequired[int] + """ + The integer amount in cents (or local equivalent) of previewed invoice item. + """ + currency: NotRequired[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). Only applicable to new invoice items. + """ + description: NotRequired[str] + """ + An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + """ + discountable: NotRequired[bool] + """ + Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceService.CreatePreviewParamsInvoiceItemDiscount]" + ] + """ + The coupons to redeem into discounts for the invoice item in the preview. + """ + invoiceitem: NotRequired[str] + """ + The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + period: NotRequired[ + "InvoiceService.CreatePreviewParamsInvoiceItemPeriod" + ] + """ + The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + """ + price: NotRequired[str] + """ + The ID of the price object. + """ + price_data: NotRequired[ + "InvoiceService.CreatePreviewParamsInvoiceItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Non-negative integer. The quantity of units for the invoice item. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + tax_code: NotRequired["Literal['']|str"] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. + """ + unit_amount: NotRequired[int] + """ + The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreatePreviewParamsInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsInvoiceItemPeriod(TypedDict): + end: int + """ + The end of the period, which must be greater than or equal to the start. This value is inclusive. + """ + start: int + """ + The start of the period. This value is inclusive. + """ + + class CreatePreviewParamsInvoiceItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreatePreviewParamsIssuer(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class CreatePreviewParamsScheduleDetails(TypedDict): + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + """ + phases: NotRequired[ + List["InvoiceService.CreatePreviewParamsScheduleDetailsPhase"] + ] + """ + List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. + """ + + class CreatePreviewParamsScheduleDetailsPhase(TypedDict): + add_invoice_items: NotRequired[ + List[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem" + ] + ] + """ + A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + """ + application_fee_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + """ + automatic_tax: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAutomaticTax" + ] + """ + Automatic tax settings for this phase. + """ + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] + """ + Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + """ + billing_thresholds: NotRequired[ + "Literal['']|InvoiceService.CreatePreviewParamsScheduleDetailsPhaseBillingThresholds" + ] + """ + 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. + """ + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] + """ + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + """ + coupon: NotRequired[str] + """ + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + """ + currency: NotRequired[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). + """ + default_payment_method: NotRequired[str] + """ + ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + """ + default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + """ + description: NotRequired["Literal['']|str"] + """ + Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceService.CreatePreviewParamsScheduleDetailsPhaseDiscount]" + ] + """ + The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + """ + end_date: NotRequired["int|Literal['now']"] + """ + The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. + """ + invoice_settings: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings" + ] + """ + All invoices will be billed using the specified settings. + """ + items: List[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItem" + ] + """ + List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + """ + iterations: NotRequired[int] + """ + Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + """ + on_behalf_of: NotRequired[str] + """ + The account on behalf of which to charge, for each of the associated subscription's invoices. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. + """ + start_date: NotRequired["int|Literal['now']"] + """ + The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. + """ + transfer_data: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseTransferData" + ] + """ + The data with which to automatically create a Transfer for each of the associated subscription's invoices. + """ + trial: NotRequired[bool] + """ + If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + """ + trial_end: NotRequired["int|Literal['now']"] + """ + Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + """ + + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount" + ] + ] + """ + The coupons to redeem into discounts for the item. + """ + price: NotRequired[str] + """ + The ID of the price object. + """ + price_data: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Quantity for this item. Defaults to 1. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount( + TypedDict, + ): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData( + TypedDict, + ): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAutomaticTax(TypedDict): + enabled: bool + """ + Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + """ + liability: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability" + ] + """ + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability( + TypedDict, + ): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class CreatePreviewParamsScheduleDetailsPhaseBillingThresholds(TypedDict): + amount_gte: NotRequired[int] + """ + Monetary threshold that triggers the subscription to advance to a new billing period + """ + reset_billing_cycle_anchor: NotRequired[bool] + """ + Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + """ + + class CreatePreviewParamsScheduleDetailsPhaseDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + """ + days_until_due: NotRequired[int] + """ + Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + """ + issuer: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer" + ] + """ + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + """ + + class CreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer( + TypedDict, + ): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class CreatePreviewParamsScheduleDetailsPhaseItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds" + ] + """ + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. + """ + plan: NotRequired[str] + """ + The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. + """ + price: NotRequired[str] + """ + The ID of the price object. + """ + price_data: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + """ + + class CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds( + TypedDict, + ): + usage_gte: int + """ + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + """ + + class CreatePreviewParamsScheduleDetailsPhaseItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsScheduleDetailsPhaseItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + recurring: "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring" + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies billing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + """ + + class CreatePreviewParamsScheduleDetailsPhaseTransferData(TypedDict): + amount_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + """ + destination: str + """ + ID of an existing, connected Stripe account. + """ + + class CreatePreviewParamsSubscriptionDetails(TypedDict): + billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] + """ + For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. + """ + cancel_at: NotRequired["Literal['']|int"] + """ + A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. + """ + cancel_at_period_end: NotRequired[bool] + """ + Boolean indicating whether this subscription should cancel at the end of the current period. + """ + cancel_now: NotRequired[bool] + """ + This simulates the subscription being canceled or expired immediately. + """ + default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. + """ + items: NotRequired[ + List["InvoiceService.CreatePreviewParamsSubscriptionDetailsItem"] + ] + """ + A list of up to 20 subscription items, each with an attached price. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + """ + proration_date: NotRequired[int] + """ + If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. + """ + resume_at: NotRequired[Literal["now"]] + """ + For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + """ + start_date: NotRequired[int] + """ + Date a subscription is intended to start (can be future or past). + """ + trial_end: NotRequired["Literal['now']|int"] + """ + If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. + """ + + class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|InvoiceService.CreatePreviewParamsSubscriptionDetailsItemBillingThresholds" + ] + """ + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + """ + clear_usage: NotRequired[bool] + """ + Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + """ + deleted: NotRequired[bool] + """ + A flag that, if set to `true`, will delete the specified item. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceService.CreatePreviewParamsSubscriptionDetailsItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ + id: NotRequired[str] + """ + Subscription item to update. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + plan: NotRequired[str] + """ + Plan ID for this item, as a string. + """ + price: NotRequired[str] + """ + The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + """ + price_data: NotRequired[ + "InvoiceService.CreatePreviewParamsSubscriptionDetailsItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Quantity for this item. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + """ + + class CreatePreviewParamsSubscriptionDetailsItemBillingThresholds( + TypedDict, + ): + usage_gte: int + """ + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + """ + + class CreatePreviewParamsSubscriptionDetailsItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsSubscriptionDetailsItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + recurring: "InvoiceService.CreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring" + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies billing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + """ + + class DeleteParams(TypedDict): + pass + + class FinalizeInvoiceParams(TypedDict): + auto_advance: NotRequired[bool] + """ + Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ListParams(TypedDict): + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] + """ + The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. + """ + created: NotRequired["InvoiceService.ListParamsCreated|int"] + """ + Only return invoices that were created during the given date interval. + """ + customer: NotRequired[str] + """ + Only return invoices for the customer specified by this customer ID. + """ + due_date: NotRequired["InvoiceService.ListParamsDueDate|int"] + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[ + Literal["draft", "open", "paid", "uncollectible", "void"] + ] + """ + The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) + """ + subscription: NotRequired[str] + """ + Only return invoices for the subscription specified by this subscription ID. + """ + + class ListParamsCreated(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ + + class ListParamsDueDate(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ + + class MarkUncollectibleParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class PayParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + forgive: NotRequired[bool] + """ + In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. + + Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`. + """ + mandate: NotRequired["Literal['']|str"] + """ + ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. + """ + off_session: NotRequired[bool] + """ + Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). + """ + paid_out_of_band: NotRequired[bool] + """ + Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. + """ + payment_method: NotRequired[str] + """ + A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. + """ + source: NotRequired[str] + """ + A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class SearchParams(TypedDict): + 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. + """ + page: NotRequired[str] + """ + A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + """ + query: str + """ + The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices). + """ + + class SendInvoiceParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class UpcomingParams(TypedDict): + automatic_tax: NotRequired["InvoiceService.UpcomingParamsAutomaticTax"] + """ + Settings for automatic tax lookup for this invoice preview. + """ + coupon: NotRequired[str] + """ + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + """ + currency: NotRequired[str] + """ + The currency to preview this invoice in. Defaults to that of `customer` if not specified. + """ + customer: NotRequired[str] + """ + The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + """ + customer_details: NotRequired[ + "InvoiceService.UpcomingParamsCustomerDetails" + ] + """ + Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceService.UpcomingParamsDiscount]" + ] + """ + The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + invoice_items: NotRequired[ + List["InvoiceService.UpcomingParamsInvoiceItem"] + ] + """ + List of invoice items to add or update in the upcoming invoice preview. + """ + issuer: NotRequired["InvoiceService.UpcomingParamsIssuer"] + """ + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + """ + on_behalf_of: NotRequired["Literal['']|str"] + """ + The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + """ + schedule: NotRequired[str] + """ + The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. + """ + schedule_details: NotRequired[ + "InvoiceService.UpcomingParamsScheduleDetails" + ] + """ + The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. + """ + subscription: NotRequired[str] + """ + The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + """ + subscription_billing_cycle_anchor: NotRequired[ + "Literal['now', 'unchanged']|int" + ] + """ + For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. + """ + subscription_cancel_at: NotRequired["Literal['']|int"] + """ + A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. + """ + subscription_cancel_at_period_end: NotRequired[bool] + """ + Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. + """ + subscription_cancel_now: NotRequired[bool] + """ + This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. + """ + subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. + """ + subscription_details: NotRequired[ + "InvoiceService.UpcomingParamsSubscriptionDetails" + ] + """ + The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. + """ + subscription_items: NotRequired[ + List["InvoiceService.UpcomingParamsSubscriptionItem"] + ] + """ + A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. + """ + subscription_proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. + """ + subscription_proration_date: NotRequired[int] + """ + If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. + """ + subscription_resume_at: NotRequired[Literal["now"]] + """ + For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. + """ + subscription_start_date: NotRequired[int] + """ + Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. + """ + subscription_trial_end: NotRequired["Literal['now']|int"] + """ + If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. + """ + subscription_trial_from_plan: NotRequired[bool] + """ + Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + """ + + class UpcomingParamsAutomaticTax(TypedDict): + enabled: bool + """ + Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + """ + liability: NotRequired[ + "InvoiceService.UpcomingParamsAutomaticTaxLiability" + ] + """ + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + """ + + class UpcomingParamsAutomaticTaxLiability(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class UpcomingParamsCustomerDetails(TypedDict): + address: NotRequired[ + "Literal['']|InvoiceService.UpcomingParamsCustomerDetailsAddress" + ] + """ + The customer's address. + """ + shipping: NotRequired[ + "Literal['']|InvoiceService.UpcomingParamsCustomerDetailsShipping" + ] + """ + The customer's shipping information. Appears on invoices emailed to this customer. + """ + tax: NotRequired["InvoiceService.UpcomingParamsCustomerDetailsTax"] + """ + Tax details about the customer. + """ + tax_exempt: NotRequired[ + "Literal['']|Literal['exempt', 'none', 'reverse']" + ] + """ + The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + """ + tax_ids: NotRequired[ + List["InvoiceService.UpcomingParamsCustomerDetailsTaxId"] + ] + """ + The customer's tax IDs. + """ + + class UpcomingParamsCustomerDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class UpcomingParamsCustomerDetailsShipping(TypedDict): + address: "InvoiceService.UpcomingParamsCustomerDetailsShippingAddress" + """ + Customer shipping address. + """ + name: str + """ + Customer name. + """ + phone: NotRequired[str] + """ + Customer phone (including extension). + """ + + class UpcomingParamsCustomerDetailsShippingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class UpcomingParamsCustomerDetailsTax(TypedDict): + ip_address: NotRequired["Literal['']|str"] + """ + A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + """ + + class UpcomingParamsCustomerDetailsTaxId(TypedDict): + type: Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "au_abn", + "au_arn", + "bg_uic", + "bh_vat", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "kz_bin", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + """ + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + """ + value: str + """ + Value of the tax ID. + """ + + class UpcomingParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class UpcomingParamsInvoiceItem(TypedDict): + amount: NotRequired[int] + """ + The integer amount in cents (or local equivalent) of previewed invoice item. + """ + currency: NotRequired[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). Only applicable to new invoice items. + """ + description: NotRequired[str] + """ + An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + """ + discountable: NotRequired[bool] + """ + Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceService.UpcomingParamsInvoiceItemDiscount]" + ] + """ + The coupons to redeem into discounts for the invoice item in the preview. + """ + invoiceitem: NotRequired[str] + """ + The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + period: NotRequired["InvoiceService.UpcomingParamsInvoiceItemPeriod"] + """ + The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + """ + price: NotRequired[str] + """ + The ID of the price object. + """ + price_data: NotRequired[ + "InvoiceService.UpcomingParamsInvoiceItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Non-negative integer. The quantity of units for the invoice item. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + tax_code: NotRequired["Literal['']|str"] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. + """ + unit_amount: NotRequired[int] + """ + The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class UpcomingParamsInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class UpcomingParamsInvoiceItemPeriod(TypedDict): + end: int + """ + The end of the period, which must be greater than or equal to the start. This value is inclusive. + """ + start: int + """ + The start of the period. This value is inclusive. + """ + + class UpcomingParamsInvoiceItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class UpcomingParamsIssuer(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class UpcomingParamsScheduleDetails(TypedDict): + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + """ + phases: NotRequired[ + List["InvoiceService.UpcomingParamsScheduleDetailsPhase"] + ] + """ + List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. + """ + + class UpcomingParamsScheduleDetailsPhase(TypedDict): + add_invoice_items: NotRequired[ + List[ + "InvoiceService.UpcomingParamsScheduleDetailsPhaseAddInvoiceItem" + ] + ] """ - Minimum value to filter by (exclusive) + A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ - gte: NotRequired[int] + application_fee_percent: NotRequired[float] """ - Minimum value to filter by (inclusive) + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ - lt: NotRequired[int] + automatic_tax: NotRequired[ + "InvoiceService.UpcomingParamsScheduleDetailsPhaseAutomaticTax" + ] """ - Maximum value to filter by (exclusive) + Automatic tax settings for this phase. """ - lte: NotRequired[int] + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ - Maximum value to filter by (inclusive) + Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - - class MarkUncollectibleParams(TypedDict): - expand: NotRequired[List[str]] + billing_thresholds: NotRequired[ + "Literal['']|InvoiceService.UpcomingParamsScheduleDetailsPhaseBillingThresholds" + ] """ - Specifies which fields in the response should be expanded. + 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. """ - - class PayParams(TypedDict): - expand: NotRequired[List[str]] + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] """ - Specifies which fields in the response should be expanded. + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - forgive: NotRequired[bool] + coupon: NotRequired[str] """ - In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. - - Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`. + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ - mandate: NotRequired["Literal['']|str"] + currency: NotRequired[str] """ - ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. + 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). """ - off_session: NotRequired[bool] + default_payment_method: NotRequired[str] """ - Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). + ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ - paid_out_of_band: NotRequired[bool] + default_tax_rates: NotRequired["Literal['']|List[str]"] """ - Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ - payment_method: NotRequired[str] + description: NotRequired["Literal['']|str"] """ - A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. + Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ - source: NotRequired[str] + discounts: NotRequired[ + "Literal['']|List[InvoiceService.UpcomingParamsScheduleDetailsPhaseDiscount]" + ] """ - A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. + The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ - - class RetrieveParams(TypedDict): - expand: NotRequired[List[str]] + end_date: NotRequired["int|Literal['now']"] """ - Specifies which fields in the response should be expanded. + The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ - - class SearchParams(TypedDict): - expand: NotRequired[List[str]] + invoice_settings: NotRequired[ + "InvoiceService.UpcomingParamsScheduleDetailsPhaseInvoiceSettings" + ] """ - Specifies which fields in the response should be expanded. + All invoices will be billed using the specified settings. """ - limit: NotRequired[int] + items: List["InvoiceService.UpcomingParamsScheduleDetailsPhaseItem"] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ - page: NotRequired[str] + iterations: NotRequired[int] """ - A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ - query: str + metadata: NotRequired[Dict[str, str]] """ - The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices). + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ - - class SendInvoiceParams(TypedDict): - expand: NotRequired[List[str]] + on_behalf_of: NotRequired[str] """ - Specifies which fields in the response should be expanded. + The account on behalf of which to charge, for each of the associated subscription's invoices. """ - - class UpcomingParams(TypedDict): - automatic_tax: NotRequired["InvoiceService.UpcomingParamsAutomaticTax"] + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] """ - Settings for automatic tax lookup for this invoice preview. + Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ - coupon: NotRequired[str] + start_date: NotRequired["int|Literal['now']"] """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. """ - currency: NotRequired[str] + transfer_data: NotRequired[ + "InvoiceService.UpcomingParamsScheduleDetailsPhaseTransferData" + ] """ - The currency to preview this invoice in. Defaults to that of `customer` if not specified. + The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ - customer: NotRequired[str] + trial: NotRequired[bool] """ - The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ - customer_details: NotRequired[ - "InvoiceService.UpcomingParamsCustomerDetails" - ] + trial_end: NotRequired["int|Literal['now']"] """ - Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ + + class UpcomingParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ - "Literal['']|List[InvoiceService.UpcomingParamsDiscount]" + List[ + "InvoiceService.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemDiscount" + ] ] """ - The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. + The coupons to redeem into discounts for the item. """ - expand: NotRequired[List[str]] + price: NotRequired[str] """ - Specifies which fields in the response should be expanded. + The ID of the price object. """ - invoice_items: NotRequired[ - List["InvoiceService.UpcomingParamsInvoiceItem"] + price_data: NotRequired[ + "InvoiceService.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ - List of invoice items to add or update in the upcoming invoice preview. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - issuer: NotRequired["InvoiceService.UpcomingParamsIssuer"] + quantity: NotRequired[int] """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Quantity for this item. Defaults to 1. """ - on_behalf_of: NotRequired["Literal['']|str"] + tax_rates: NotRequired["Literal['']|List[str]"] """ - The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ - schedule: NotRequired[str] + + class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] """ - The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. + ID of the coupon to create a new discount for. """ - subscription: NotRequired[str] + discount: NotRequired[str] """ - The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + ID of an existing discount on the object (or one of its ancestors) to reuse. """ - subscription_billing_cycle_anchor: NotRequired[ - "Literal['now', 'unchanged']|int" - ] + promotion_code: NotRequired[str] """ - For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. + ID of the promotion code to create a new discount for. """ - subscription_cancel_at: NotRequired["Literal['']|int"] + + class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData(TypedDict): + currency: str """ - A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. + 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). """ - subscription_cancel_at_period_end: NotRequired[bool] + product: str """ - Boolean indicating whether this subscription should cancel at the end of the current period. + The ID of the product that this price will belong to. """ - subscription_cancel_now: NotRequired[bool] + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] """ - This simulates the subscription being canceled or expired immediately. + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] + unit_amount: NotRequired[int] """ - If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - subscription_items: NotRequired[ - List["InvoiceService.UpcomingParamsSubscriptionItem"] - ] + unit_amount_decimal: NotRequired[str] """ - A list of up to 20 subscription items, each with an attached price. + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - subscription_proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + + class UpcomingParamsScheduleDetailsPhaseAutomaticTax(TypedDict): + enabled: bool + """ + Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + """ + liability: NotRequired[ + "InvoiceService.UpcomingParamsScheduleDetailsPhaseAutomaticTaxLiability" ] """ - Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ - subscription_proration_date: NotRequired[int] + + class UpcomingParamsScheduleDetailsPhaseAutomaticTaxLiability(TypedDict): + account: NotRequired[str] """ - If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. + The connected account being referenced when `type` is `account`. """ - subscription_resume_at: NotRequired[Literal["now"]] + type: Literal["account", "self"] """ - For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + Type of the account referenced in the request. """ - subscription_start_date: NotRequired[int] + + class UpcomingParamsScheduleDetailsPhaseBillingThresholds(TypedDict): + amount_gte: NotRequired[int] """ - Date a subscription is intended to start (can be future or past). + Monetary threshold that triggers the subscription to advance to a new billing period """ - subscription_trial_end: NotRequired["Literal['now']|int"] + reset_billing_cycle_anchor: NotRequired[bool] """ - If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. + Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ - subscription_trial_from_plan: NotRequired[bool] + + class UpcomingParamsScheduleDetailsPhaseDiscount(TypedDict): + coupon: NotRequired[str] """ - Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. """ - class UpcomingParamsAutomaticTax(TypedDict): - enabled: bool + class UpcomingParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] """ - Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ - liability: NotRequired[ - "InvoiceService.UpcomingParamsAutomaticTaxLiability" + days_until_due: NotRequired[int] + """ + Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + """ + issuer: NotRequired[ + "InvoiceService.UpcomingParamsScheduleDetailsPhaseInvoiceSettingsIssuer" ] """ - The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ - class UpcomingParamsAutomaticTaxLiability(TypedDict): + class UpcomingParamsScheduleDetailsPhaseInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. @@ -919,277 +2505,223 @@ class UpcomingParamsAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class UpcomingParamsCustomerDetails(TypedDict): - address: NotRequired[ - "Literal['']|InvoiceService.UpcomingParamsCustomerDetailsAddress" + class UpcomingParamsScheduleDetailsPhaseItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|InvoiceService.UpcomingParamsScheduleDetailsPhaseItemBillingThresholds" ] """ - The customer's address. + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - shipping: NotRequired[ - "Literal['']|InvoiceService.UpcomingParamsCustomerDetailsShipping" + discounts: NotRequired[ + "Literal['']|List[InvoiceService.UpcomingParamsScheduleDetailsPhaseItemDiscount]" ] """ - The customer's shipping information. Appears on invoices emailed to this customer. + The coupons to redeem into discounts for the subscription item. """ - tax: NotRequired["InvoiceService.UpcomingParamsCustomerDetailsTax"] + metadata: NotRequired[Dict[str, str]] """ - Tax details about the customer. + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ - tax_exempt: NotRequired[ - "Literal['']|Literal['exempt', 'none', 'reverse']" - ] + plan: NotRequired[str] """ - The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ - tax_ids: NotRequired[ - List["InvoiceService.UpcomingParamsCustomerDetailsTaxId"] + price: NotRequired[str] + """ + The ID of the price object. + """ + price_data: NotRequired[ + "InvoiceService.UpcomingParamsScheduleDetailsPhaseItemPriceData" ] """ - The customer's tax IDs. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class UpcomingParamsCustomerDetailsAddress(TypedDict): - city: NotRequired[str] + class UpcomingParamsScheduleDetailsPhaseItemBillingThresholds(TypedDict): + usage_gte: int """ - City, district, suburb, town, or village. + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ - country: NotRequired[str] + + class UpcomingParamsScheduleDetailsPhaseItemDiscount(TypedDict): + coupon: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + ID of the coupon to create a new discount for. """ - line1: NotRequired[str] + discount: NotRequired[str] """ - Address line 1 (e.g., street, PO Box, or company name). + ID of an existing discount on the object (or one of its ancestors) to reuse. """ - line2: NotRequired[str] + promotion_code: NotRequired[str] """ - Address line 2 (e.g., apartment, suite, unit, or building). + ID of the promotion code to create a new discount for. """ - postal_code: NotRequired[str] + + class UpcomingParamsScheduleDetailsPhaseItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + recurring: "InvoiceService.UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring" + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] """ - ZIP or postal code. + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - state: NotRequired[str] + unit_amount: NotRequired[int] """ - State, county, province, or region. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - - class UpcomingParamsCustomerDetailsShipping(TypedDict): - address: "InvoiceService.UpcomingParamsCustomerDetailsShippingAddress" + unit_amount_decimal: NotRequired[str] """ - Customer shipping address. + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - name: str + + class UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring(TypedDict): + interval: Literal["day", "month", "week", "year"] """ - Customer name. + Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - phone: NotRequired[str] + interval_count: NotRequired[int] """ - Customer phone (including extension). + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ - class UpcomingParamsCustomerDetailsShippingAddress(TypedDict): - city: NotRequired[str] + class UpcomingParamsScheduleDetailsPhaseTransferData(TypedDict): + amount_percent: NotRequired[float] """ - City, district, suburb, town, or village. + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ - country: NotRequired[str] + destination: str """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + ID of an existing, connected Stripe account. """ - line1: NotRequired[str] + + class UpcomingParamsSubscriptionDetails(TypedDict): + billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] """ - Address line 1 (e.g., street, PO Box, or company name). + For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ - line2: NotRequired[str] + cancel_at: NotRequired["Literal['']|int"] """ - Address line 2 (e.g., apartment, suite, unit, or building). + A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ - postal_code: NotRequired[str] + cancel_at_period_end: NotRequired[bool] """ - ZIP or postal code. + Boolean indicating whether this subscription should cancel at the end of the current period. """ - state: NotRequired[str] + cancel_now: NotRequired[bool] """ - State, county, province, or region. + This simulates the subscription being canceled or expired immediately. """ - - class UpcomingParamsCustomerDetailsTax(TypedDict): - ip_address: NotRequired["Literal['']|str"] + default_tax_rates: NotRequired["Literal['']|List[str]"] """ - A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. """ - - class UpcomingParamsCustomerDetailsTaxId(TypedDict): - type: Literal[ - "ad_nrt", - "ae_trn", - "ar_cuit", - "au_abn", - "au_arn", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "eu_vat", - "gb_vat", - "ge_vat", - "hk_br", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kr_brn", - "kz_bin", - "li_uid", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sv_nit", - "th_vat", - "tr_tin", - "tw_vat", - "ua_vat", - "us_ein", - "uy_ruc", - "ve_rif", - "vn_tin", - "za_vat", + items: NotRequired[ + List["InvoiceService.UpcomingParamsSubscriptionDetailsItem"] ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + A list of up to 20 subscription items, each with an attached price. """ - value: str + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] """ - Value of the tax ID. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ - - class UpcomingParamsDiscount(TypedDict): - coupon: NotRequired[str] + proration_date: NotRequired[int] """ - ID of the coupon to create a new discount for. + If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. """ - discount: NotRequired[str] + resume_at: NotRequired[Literal["now"]] """ - ID of an existing discount on the object (or one of its ancestors) to reuse. + For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ - promotion_code: NotRequired[str] + start_date: NotRequired[int] """ - ID of the promotion code to create a new discount for. + Date a subscription is intended to start (can be future or past). """ - - class UpcomingParamsInvoiceItem(TypedDict): - amount: NotRequired[int] + trial_end: NotRequired["Literal['now']|int"] """ - The integer amount in cents (or local equivalent) of previewed invoice item. + If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ - currency: NotRequired[str] + + class UpcomingParamsSubscriptionDetailsItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|InvoiceService.UpcomingParamsSubscriptionDetailsItemBillingThresholds" + ] """ - 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). Only applicable to new invoice items. + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - description: NotRequired[str] + clear_usage: NotRequired[bool] """ - An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ - discountable: NotRequired[bool] + deleted: NotRequired[bool] """ - Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. + A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ - "Literal['']|List[InvoiceService.UpcomingParamsInvoiceItemDiscount]" + "Literal['']|List[InvoiceService.UpcomingParamsSubscriptionDetailsItemDiscount]" ] """ - The coupons to redeem into discounts for the invoice item in the preview. + The coupons to redeem into discounts for the subscription item. """ - invoiceitem: NotRequired[str] + id: NotRequired[str] """ - The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. + Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - period: NotRequired["InvoiceService.UpcomingParamsInvoiceItemPeriod"] + plan: NotRequired[str] """ - The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + Plan ID for this item, as a string. """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ - "InvoiceService.UpcomingParamsInvoiceItemPriceData" + "InvoiceService.UpcomingParamsSubscriptionDetailsItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ - Non-negative integer. The quantity of units for the invoice item. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - tax_code: NotRequired["Literal['']|str"] - """ - A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ - The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. - """ - unit_amount: NotRequired[int] - """ - The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - unit_amount_decimal: NotRequired[str] + + class UpcomingParamsSubscriptionDetailsItemBillingThresholds(TypedDict): + usage_gte: int """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ - class UpcomingParamsInvoiceItemDiscount(TypedDict): + class UpcomingParamsSubscriptionDetailsItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. @@ -1203,17 +2735,7 @@ class UpcomingParamsInvoiceItemDiscount(TypedDict): ID of the promotion code to create a new discount for. """ - class UpcomingParamsInvoiceItemPeriod(TypedDict): - end: int - """ - The end of the period, which must be greater than or equal to the start. This value is inclusive. - """ - start: int - """ - The start of the period. This value is inclusive. - """ - - class UpcomingParamsInvoiceItemPriceData(TypedDict): + class UpcomingParamsSubscriptionDetailsItemPriceData(TypedDict): 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). @@ -1222,6 +2744,10 @@ class UpcomingParamsInvoiceItemPriceData(TypedDict): """ The ID of the product that this price will belong to. """ + recurring: "InvoiceService.UpcomingParamsSubscriptionDetailsItemPriceDataRecurring" + """ + The recurring components of a price such as `interval` and `interval_count`. + """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] @@ -1237,14 +2763,14 @@ class UpcomingParamsInvoiceItemPriceData(TypedDict): Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - class UpcomingParamsIssuer(TypedDict): - account: NotRequired[str] + class UpcomingParamsSubscriptionDetailsItemPriceDataRecurring(TypedDict): + interval: Literal["day", "month", "week", "year"] """ - The connected account being referenced when `type` is `account`. + Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ - type: Literal["account", "self"] + interval_count: NotRequired[int] """ - Type of the account referenced in the request. + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpcomingParamsSubscriptionItem(TypedDict): @@ -2491,3 +4017,51 @@ async def void_invoice_async( options=options, ), ) + + def create_preview( + self, + params: "InvoiceService.CreatePreviewParams" = {}, + options: RequestOptions = {}, + ) -> Invoice: + """ + At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. + + Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. + + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + """ + return cast( + Invoice, + self._request( + "post", + "/v1/invoices/create_preview", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_preview_async( + self, + params: "InvoiceService.CreatePreviewParams" = {}, + options: RequestOptions = {}, + ) -> Invoice: + """ + At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. + + Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. + + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + """ + return cast( + Invoice, + await self._request_async( + "post", + "/v1/invoices/create_preview", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index a4e7d4c73..bd9ef2048 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -70,6 +70,12 @@ class ListParams(TypedDict): """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. """ + schedule_details: NotRequired[ + "InvoiceUpcomingLinesService.ListParamsScheduleDetails" + ] + """ + The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. + """ 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. @@ -82,51 +88,57 @@ class ListParams(TypedDict): "Literal['now', 'unchanged']|int" ] """ - For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. + For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. """ subscription_cancel_at: NotRequired["Literal['']|int"] """ - A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. + A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. """ subscription_cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. + Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. """ subscription_cancel_now: NotRequired[bool] """ - This simulates the subscription being canceled or expired immediately. + This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. """ subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] """ - If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. + If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. + """ + subscription_details: NotRequired[ + "InvoiceUpcomingLinesService.ListParamsSubscriptionDetails" + ] + """ + The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. """ subscription_items: NotRequired[ List["InvoiceUpcomingLinesService.ListParamsSubscriptionItem"] ] """ - A list of up to 20 subscription items, each with an attached price. + A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. """ subscription_proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ - Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. """ subscription_proration_date: NotRequired[int] """ - If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. + If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. """ subscription_resume_at: NotRequired[Literal["now"]] """ - For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. """ subscription_start_date: NotRequired[int] """ - Date a subscription is intended to start (can be future or past). + Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. """ subscription_trial_end: NotRequired["Literal['now']|int"] """ - If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. + If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. """ subscription_trial_from_plan: NotRequired[bool] """ @@ -487,6 +499,546 @@ class ListParamsIssuer(TypedDict): Type of the account referenced in the request. """ + class ListParamsScheduleDetails(TypedDict): + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + """ + phases: NotRequired[ + List["InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhase"] + ] + """ + List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. + """ + + class ListParamsScheduleDetailsPhase(TypedDict): + add_invoice_items: NotRequired[ + List[ + "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAddInvoiceItem" + ] + ] + """ + A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + """ + application_fee_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + """ + automatic_tax: NotRequired[ + "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAutomaticTax" + ] + """ + Automatic tax settings for this phase. + """ + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] + """ + Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + """ + billing_thresholds: NotRequired[ + "Literal['']|InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseBillingThresholds" + ] + """ + 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. + """ + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] + """ + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + """ + coupon: NotRequired[str] + """ + The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + """ + currency: NotRequired[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). + """ + default_payment_method: NotRequired[str] + """ + ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + """ + default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + """ + description: NotRequired["Literal['']|str"] + """ + Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseDiscount]" + ] + """ + The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + """ + end_date: NotRequired["int|Literal['now']"] + """ + The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. + """ + invoice_settings: NotRequired[ + "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseInvoiceSettings" + ] + """ + All invoices will be billed using the specified settings. + """ + items: List[ + "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItem" + ] + """ + List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + """ + iterations: NotRequired[int] + """ + Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + """ + on_behalf_of: NotRequired[str] + """ + The account on behalf of which to charge, for each of the associated subscription's invoices. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. + """ + start_date: NotRequired["int|Literal['now']"] + """ + The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. + """ + transfer_data: NotRequired[ + "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseTransferData" + ] + """ + The data with which to automatically create a Transfer for each of the associated subscription's invoices. + """ + trial: NotRequired[bool] + """ + If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + """ + trial_end: NotRequired["int|Literal['now']"] + """ + Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + """ + + class ListParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List[ + "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAddInvoiceItemDiscount" + ] + ] + """ + The coupons to redeem into discounts for the item. + """ + price: NotRequired[str] + """ + The ID of the price object. + """ + price_data: NotRequired[ + "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAddInvoiceItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Quantity for this item. Defaults to 1. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + """ + + class ListParamsScheduleDetailsPhaseAddInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class ListParamsScheduleDetailsPhaseAddInvoiceItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class ListParamsScheduleDetailsPhaseAutomaticTax(TypedDict): + enabled: bool + """ + Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + """ + liability: NotRequired[ + "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAutomaticTaxLiability" + ] + """ + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + """ + + class ListParamsScheduleDetailsPhaseAutomaticTaxLiability(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class ListParamsScheduleDetailsPhaseBillingThresholds(TypedDict): + amount_gte: NotRequired[int] + """ + Monetary threshold that triggers the subscription to advance to a new billing period + """ + reset_billing_cycle_anchor: NotRequired[bool] + """ + Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + """ + + class ListParamsScheduleDetailsPhaseDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class ListParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): + account_tax_ids: NotRequired["Literal['']|List[str]"] + """ + The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + """ + days_until_due: NotRequired[int] + """ + Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + """ + issuer: NotRequired[ + "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseInvoiceSettingsIssuer" + ] + """ + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + """ + + class ListParamsScheduleDetailsPhaseInvoiceSettingsIssuer(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class ListParamsScheduleDetailsPhaseItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItemBillingThresholds" + ] + """ + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. + """ + plan: NotRequired[str] + """ + The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. + """ + price: NotRequired[str] + """ + The ID of the price object. + """ + price_data: NotRequired[ + "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + """ + + class ListParamsScheduleDetailsPhaseItemBillingThresholds(TypedDict): + usage_gte: int + """ + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + """ + + class ListParamsScheduleDetailsPhaseItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class ListParamsScheduleDetailsPhaseItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + recurring: "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItemPriceDataRecurring" + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class ListParamsScheduleDetailsPhaseItemPriceDataRecurring(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies billing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + """ + + class ListParamsScheduleDetailsPhaseTransferData(TypedDict): + amount_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + """ + destination: str + """ + ID of an existing, connected Stripe account. + """ + + class ListParamsSubscriptionDetails(TypedDict): + billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] + """ + For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. + """ + cancel_at: NotRequired["Literal['']|int"] + """ + A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. + """ + cancel_at_period_end: NotRequired[bool] + """ + Boolean indicating whether this subscription should cancel at the end of the current period. + """ + cancel_now: NotRequired[bool] + """ + This simulates the subscription being canceled or expired immediately. + """ + default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. + """ + items: NotRequired[ + List[ + "InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItem" + ] + ] + """ + A list of up to 20 subscription items, each with an attached price. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + """ + proration_date: NotRequired[int] + """ + If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. + """ + resume_at: NotRequired[Literal["now"]] + """ + For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + """ + start_date: NotRequired[int] + """ + Date a subscription is intended to start (can be future or past). + """ + trial_end: NotRequired["Literal['now']|int"] + """ + If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. + """ + + class ListParamsSubscriptionDetailsItem(TypedDict): + billing_thresholds: NotRequired[ + "Literal['']|InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemBillingThresholds" + ] + """ + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + """ + clear_usage: NotRequired[bool] + """ + Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + """ + deleted: NotRequired[bool] + """ + A flag that, if set to `true`, will delete the specified item. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemDiscount]" + ] + """ + The coupons to redeem into discounts for the subscription item. + """ + id: NotRequired[str] + """ + Subscription item to update. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + plan: NotRequired[str] + """ + Plan ID for this item, as a string. + """ + price: NotRequired[str] + """ + The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + """ + price_data: NotRequired[ + "InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + """ + quantity: NotRequired[int] + """ + Quantity for this item. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + """ + + class ListParamsSubscriptionDetailsItemBillingThresholds(TypedDict): + usage_gte: int + """ + Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + """ + + class ListParamsSubscriptionDetailsItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class ListParamsSubscriptionDetailsItemPriceData(TypedDict): + 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). + """ + product: str + """ + The ID of the product that this price will belong to. + """ + recurring: "InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemPriceDataRecurring" + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class ListParamsSubscriptionDetailsItemPriceDataRecurring(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies billing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + """ + class ListParamsSubscriptionItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|InvoiceUpcomingLinesService.ListParamsSubscriptionItemBillingThresholds" diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index f3fdb865a..7f3731fbc 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -2094,6 +2094,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataAmazonPay" ] @@ -4275,6 +4281,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataAmazonPay" ] @@ -6452,6 +6464,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataAmazonPay" ] diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index abd8e1e92..d6235fedd 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -245,6 +245,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataAmazonPay" ] @@ -2450,6 +2456,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataAmazonPay" ] @@ -4679,6 +4691,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataAmazonPay" ] diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 99f07214d..c4d96a23e 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -1021,6 +1021,12 @@ class CreateParams(RequestOptions): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired["PaymentMethod.CreateParamsAmazonPay"] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. @@ -1672,6 +1678,12 @@ class ListParams(RequestOptions): """ class ModifyParams(RequestOptions): + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ billing_details: NotRequired[ "PaymentMethod.ModifyParamsBillingDetails" ] diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 94d5cd2e3..86893c555 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -39,6 +39,12 @@ class CreateParams(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired["PaymentMethodService.CreateParamsAmazonPay"] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. @@ -702,6 +708,12 @@ class RetrieveParams(TypedDict): """ class UpdateParams(TypedDict): + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ billing_details: NotRequired[ "PaymentMethodService.UpdateParamsBillingDetails" ] diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index a58826d35..e8ff9cb0c 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -738,6 +738,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataAmazonPay" ] @@ -1814,6 +1820,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataAmazonPay" ] @@ -2859,6 +2871,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataAmazonPay" ] diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 8c7398cd6..af9f2421f 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -132,6 +132,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataAmazonPay" ] @@ -1248,6 +1254,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataAmazonPay" ] @@ -2333,6 +2345,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataAmazonPay" ] diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index bc87cb308..a6d0221b6 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -36,7 +36,7 @@ class Meter( class CustomerMapping(StripeObject): event_payload_key: str """ - The key in the usage event payload to use for mapping the event to a customer. + The key in the meter event payload to use for mapping the event to a customer. """ type: Literal["by_id"] """ @@ -58,7 +58,7 @@ class StatusTransitions(StripeObject): class ValueSettings(StripeObject): event_payload_key: str """ - The key in the usage event payload to use as the value for this meter. + The key in the meter event payload to use as the value for this meter. """ class CreateParams(RequestOptions): @@ -76,11 +76,11 @@ class CreateParams(RequestOptions): """ event_name: str """ - The name of the usage event to record usage for. Corresponds with the `event_name` field on usage events. + The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events. """ event_time_window: NotRequired[Literal["day", "hour"]] """ - The time window to pre-aggregate usage events for, if any. + The time window to pre-aggregate meter events for, if any. """ expand: NotRequired[List[str]] """ @@ -88,7 +88,7 @@ class CreateParams(RequestOptions): """ value_settings: NotRequired["Meter.CreateParamsValueSettings"] """ - Fields that specify how to calculate a usage event's value. + Fields that specify how to calculate a meter event's value. """ class CreateParamsCustomerMapping(TypedDict): @@ -104,7 +104,7 @@ class CreateParamsCustomerMapping(TypedDict): class CreateParamsDefaultAggregation(TypedDict): formula: Literal["count", "sum"] """ - Specifies how events are aggregated. Allowed values are `count` to count the number of events, `sum` to sum each event's value, or `last` to use the last event's value. + Specifies how events are aggregated. Allowed values are `count` to count the number of events and `sum` to sum each event's value. """ class CreateParamsValueSettings(TypedDict): @@ -126,7 +126,7 @@ class ListEventSummariesParams(RequestOptions): """ end_time: int """ - The timestamp from when to stop aggregating usage events (exclusive). + The timestamp from when to stop aggregating meter events (exclusive). """ ending_before: NotRequired[str] """ @@ -142,7 +142,7 @@ class ListEventSummariesParams(RequestOptions): """ start_time: int """ - The timestamp from when to start aggregating usage events (inclusive). + The timestamp from when to start aggregating meter events (inclusive). """ starting_after: NotRequired[str] """ @@ -209,11 +209,11 @@ class RetrieveParams(RequestOptions): """ event_name: str """ - The name of the usage event to record usage for. Corresponds with the `event_name` field on usage events. + The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events. """ event_time_window: Optional[Literal["day", "hour"]] """ - The time window to pre-aggregate usage events for, if any. + The time window to pre-aggregate meter events for, if any. """ id: str """ diff --git a/stripe/billing/_meter_event.py b/stripe/billing/_meter_event.py index c25d4ec67..aa247a91a 100644 --- a/stripe/billing/_meter_event.py +++ b/stripe/billing/_meter_event.py @@ -31,11 +31,11 @@ class CreateParams(RequestOptions): """ payload: Dict[str, str] """ - The payload of the event. This must contain a field with the event's numerical value and a field to map the event to a customer. + The payload of the event. This must contain the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). """ timestamp: NotRequired[int] """ - The time of the event. Measured in seconds since the Unix epoch. Defaults to current timestamp if not specified. + The time of the event. Measured in seconds since the Unix epoch. Must be within the past 35 calendar days or up to 5 minutes in the future. Defaults to current timestamp if not specified. """ created: int @@ -60,7 +60,7 @@ class CreateParams(RequestOptions): """ payload: Dict[str, str] """ - The payload of the event. + The payload of the event. This contains the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://stripe.com/docs/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). """ timestamp: int """ diff --git a/stripe/billing/_meter_event_service.py b/stripe/billing/_meter_event_service.py index e2d06b5aa..a8ad2beba 100644 --- a/stripe/billing/_meter_event_service.py +++ b/stripe/billing/_meter_event_service.py @@ -23,11 +23,11 @@ class CreateParams(TypedDict): """ payload: Dict[str, str] """ - The payload of the event. This must contain a field with the event's numerical value and a field to map the event to a customer. + The payload of the event. This must contain the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). """ timestamp: NotRequired[int] """ - The time of the event. Measured in seconds since the Unix epoch. Defaults to current timestamp if not specified. + The time of the event. Measured in seconds since the Unix epoch. Must be within the past 35 calendar days or up to 5 minutes in the future. Defaults to current timestamp if not specified. """ def create( diff --git a/stripe/billing/_meter_event_summary.py b/stripe/billing/_meter_event_summary.py index e3fe6cc3a..5b6fc0700 100644 --- a/stripe/billing/_meter_event_summary.py +++ b/stripe/billing/_meter_event_summary.py @@ -16,11 +16,11 @@ class MeterEventSummary(StripeObject): ] = "billing.meter_event_summary" aggregated_value: float """ - Aggregated value of all the events within start_time (inclusive) and end_time (inclusive). The aggregation strategy is defined on meter via `default_aggregation``. + Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). The aggregation strategy is defined on meter via `default_aggregation`. """ end_time: int """ - End timestamp for this usage summary (inclusive). + End timestamp for this event summary (inclusive). """ id: str """ @@ -32,7 +32,7 @@ class MeterEventSummary(StripeObject): """ meter: str """ - The meter associated with this usage summary. + The meter associated with this event summary. """ object: Literal["billing.meter_event_summary"] """ @@ -40,5 +40,5 @@ class MeterEventSummary(StripeObject): """ start_time: int """ - Start timestamp for this usage summary (inclusive). + Start timestamp for this event summary (inclusive). """ diff --git a/stripe/billing/_meter_event_summary_service.py b/stripe/billing/_meter_event_summary_service.py index df51cd62f..73096be0e 100644 --- a/stripe/billing/_meter_event_summary_service.py +++ b/stripe/billing/_meter_event_summary_service.py @@ -17,7 +17,7 @@ class ListParams(TypedDict): """ end_time: int """ - The timestamp from when to stop aggregating usage events (exclusive). + The timestamp from when to stop aggregating meter events (exclusive). """ ending_before: NotRequired[str] """ @@ -33,7 +33,7 @@ class ListParams(TypedDict): """ start_time: int """ - The timestamp from when to start aggregating usage events (inclusive). + The timestamp from when to start aggregating meter events (inclusive). """ starting_after: NotRequired[str] """ diff --git a/stripe/billing/_meter_service.py b/stripe/billing/_meter_service.py index ca27d84d6..a2e78e36a 100644 --- a/stripe/billing/_meter_service.py +++ b/stripe/billing/_meter_service.py @@ -34,11 +34,11 @@ class CreateParams(TypedDict): """ event_name: str """ - The name of the usage event to record usage for. Corresponds with the `event_name` field on usage events. + The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events. """ event_time_window: NotRequired[Literal["day", "hour"]] """ - The time window to pre-aggregate usage events for, if any. + The time window to pre-aggregate meter events for, if any. """ expand: NotRequired[List[str]] """ @@ -46,7 +46,7 @@ class CreateParams(TypedDict): """ value_settings: NotRequired["MeterService.CreateParamsValueSettings"] """ - Fields that specify how to calculate a usage event's value. + Fields that specify how to calculate a meter event's value. """ class CreateParamsCustomerMapping(TypedDict): @@ -62,7 +62,7 @@ class CreateParamsCustomerMapping(TypedDict): class CreateParamsDefaultAggregation(TypedDict): formula: Literal["count", "sum"] """ - Specifies how events are aggregated. Allowed values are `count` to count the number of events, `sum` to sum each event's value, or `last` to use the last event's value. + Specifies how events are aggregated. Allowed values are `count` to count the number of events and `sum` to sum each event's value. """ class CreateParamsValueSettings(TypedDict): diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 561a67be3..f4a958c37 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -824,6 +824,16 @@ class Link(StripeObject): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class Mobilepay(StripeObject): + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class Oxxo(StripeObject): expires_after_days: int """ @@ -982,6 +992,7 @@ class FinancialConnections(StripeObject): klarna: Optional[Klarna] konbini: Optional[Konbini] link: Optional[Link] + mobilepay: Optional[Mobilepay] oxxo: Optional[Oxxo] p24: Optional[P24] paynow: Optional[Paynow] @@ -1013,6 +1024,7 @@ class FinancialConnections(StripeObject): "klarna": Klarna, "konbini": Konbini, "link": Link, + "mobilepay": Mobilepay, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, @@ -1031,6 +1043,18 @@ class PhoneNumberCollection(StripeObject): Indicates whether phone number collection is enabled for the session """ + class SavedPaymentMethodOptions(StripeObject): + allow_redisplay_filters: Optional[ + List[Literal["always", "limited", "unspecified"]] + ] + """ + Controls which payment methods are eligible to be redisplayed to returning customers. Corresponds to `allow_redisplay` on the payment method. + """ + payment_method_save: Optional[Literal["disabled", "enabled"]] + """ + Enable customers to choose if they wish to save their payment method for future use. + """ + class ShippingAddressCollection(StripeObject): allowed_countries: List[ Literal[ @@ -1663,6 +1687,12 @@ class CreateParams(RequestOptions): """ The ID of the payment method configuration to use with this Checkout session. """ + payment_method_data: NotRequired[ + "Session.CreateParamsPaymentMethodData" + ] + """ + This parameter allows you to set some attributes on the payment method created during a Checkout session. + """ payment_method_options: NotRequired[ "Session.CreateParamsPaymentMethodOptions" ] @@ -1693,6 +1723,7 @@ class CreateParams(RequestOptions): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -1743,6 +1774,12 @@ class CreateParams(RequestOptions): payment method's app or site. This parameter is required if ui_mode is `embedded` and redirect-based payment methods are enabled on the session. """ + saved_payment_method_options: NotRequired[ + "Session.CreateParamsSavedPaymentMethodOptions" + ] + """ + Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode. + """ setup_intent_data: NotRequired["Session.CreateParamsSetupIntentData"] """ A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. @@ -2326,6 +2363,14 @@ class CreateParamsPaymentIntentDataTransferData(TypedDict): returned on the successful charge's `transfer` field. """ + class CreateParamsPaymentMethodData(TypedDict): + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + Allow redisplay will be set on the payment method on confirmation and indicates whether this payment method can be shown again to the customer in a checkout flow. Only set this field if you wish to override the allow_redisplay value determined by Checkout. + """ + class CreateParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Session.CreateParamsPaymentMethodOptionsAcssDebit" @@ -2421,6 +2466,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Link payment method options. """ + mobilepay: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsMobilepay" + ] + """ + contains details about the Mobilepay payment method options. + """ oxxo: NotRequired["Session.CreateParamsPaymentMethodOptionsOxxo"] """ contains details about the OXXO payment method options. @@ -2815,6 +2866,16 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -3017,6 +3078,18 @@ class CreateParamsPhoneNumberCollection(TypedDict): Set to `true` to enable phone number collection. """ + class CreateParamsSavedPaymentMethodOptions(TypedDict): + allow_redisplay_filters: NotRequired[ + List[Literal["always", "limited", "unspecified"]] + ] + """ + Controls which payment methods are eligible to be redisplayed to returning customers. Corresponds to `allow_redisplay` on the payment method. + """ + payment_method_save: NotRequired[Literal["disabled", "enabled"]] + """ + Enable customers to choose if they wish to save their payment method for future use. + """ + class CreateParamsSetupIntentData(TypedDict): description: NotRequired[str] """ @@ -3821,6 +3894,10 @@ class RetrieveParams(RequestOptions): """ Applies to Checkout Sessions with `ui_mode: embedded`. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. """ + saved_payment_method_options: Optional[SavedPaymentMethodOptions] + """ + Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode. + """ setup_intent: Optional[ExpandableField["SetupIntent"]] """ The ID of the SetupIntent for Checkout Sessions in `setup` mode. @@ -4216,6 +4293,7 @@ async def retrieve_async( "payment_method_configuration_details": PaymentMethodConfigurationDetails, "payment_method_options": PaymentMethodOptions, "phone_number_collection": PhoneNumberCollection, + "saved_payment_method_options": SavedPaymentMethodOptions, "shipping_address_collection": ShippingAddressCollection, "shipping_cost": ShippingCost, "shipping_details": ShippingDetails, diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 845bb21e4..38e2d1460 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -207,6 +207,12 @@ class CreateParams(TypedDict): """ The ID of the payment method configuration to use with this Checkout session. """ + payment_method_data: NotRequired[ + "SessionService.CreateParamsPaymentMethodData" + ] + """ + This parameter allows you to set some attributes on the payment method created during a Checkout session. + """ payment_method_options: NotRequired[ "SessionService.CreateParamsPaymentMethodOptions" ] @@ -237,6 +243,7 @@ class CreateParams(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -287,6 +294,12 @@ class CreateParams(TypedDict): payment method's app or site. This parameter is required if ui_mode is `embedded` and redirect-based payment methods are enabled on the session. """ + saved_payment_method_options: NotRequired[ + "SessionService.CreateParamsSavedPaymentMethodOptions" + ] + """ + Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode. + """ setup_intent_data: NotRequired[ "SessionService.CreateParamsSetupIntentData" ] @@ -884,6 +897,14 @@ class CreateParamsPaymentIntentDataTransferData(TypedDict): returned on the successful charge's `transfer` field. """ + class CreateParamsPaymentMethodData(TypedDict): + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + Allow redisplay will be set on the payment method on confirmation and indicates whether this payment method can be shown again to the customer in a checkout flow. Only set this field if you wish to override the allow_redisplay value determined by Checkout. + """ + class CreateParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsAcssDebit" @@ -1001,6 +1022,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Link payment method options. """ + mobilepay: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsMobilepay" + ] + """ + contains details about the Mobilepay payment method options. + """ oxxo: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsOxxo" ] @@ -1405,6 +1432,16 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -1607,6 +1644,18 @@ class CreateParamsPhoneNumberCollection(TypedDict): Set to `true` to enable phone number collection. """ + class CreateParamsSavedPaymentMethodOptions(TypedDict): + allow_redisplay_filters: NotRequired[ + List[Literal["always", "limited", "unspecified"]] + ] + """ + Controls which payment methods are eligible to be redisplayed to returning customers. Corresponds to `allow_redisplay` on the payment method. + """ + payment_method_save: NotRequired[Literal["disabled", "enabled"]] + """ + Enable customers to choose if they wish to save their payment method for future use. + """ + class CreateParamsSetupIntentData(TypedDict): description: NotRequired[str] """ diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index 491baa895..529120e10 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -416,9 +416,9 @@ class CaptureParamsPurchaseDetailsFuel(TypedDict): """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired[Literal["liter", "us_gallon"]] + unit: NotRequired[Literal["liter", "other", "us_gallon"]] """ - The units for `volume_decimal`. One of `us_gallon` or `liter`. + The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index 7746593dc..8609f87de 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -166,7 +166,7 @@ class Fuel(StripeObject): """ unit: str """ - The units for `volume_decimal`. One of `us_gallon` or `liter`. + The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. """ unit_cost_decimal: str """ @@ -702,9 +702,9 @@ class CreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired[Literal["liter", "us_gallon"]] + unit: NotRequired[Literal["liter", "other", "us_gallon"]] """ - The units for `volume_decimal`. One of `us_gallon` or `liter`. + The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ @@ -1193,9 +1193,9 @@ class CreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired[Literal["liter", "us_gallon"]] + unit: NotRequired[Literal["liter", "other", "us_gallon"]] """ - The units for `volume_decimal`. One of `us_gallon` or `liter`. + The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index d4f38616a..7a0333220 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -63,6 +63,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ amazon_pay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataAmazonPay" ] diff --git a/stripe/test_helpers/issuing/_authorization_service.py b/stripe/test_helpers/issuing/_authorization_service.py index 438942ee4..bf41b79b8 100644 --- a/stripe/test_helpers/issuing/_authorization_service.py +++ b/stripe/test_helpers/issuing/_authorization_service.py @@ -124,9 +124,9 @@ class CaptureParamsPurchaseDetailsFuel(TypedDict): """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired[Literal["liter", "us_gallon"]] + unit: NotRequired[Literal["liter", "other", "us_gallon"]] """ - The units for `volume_decimal`. One of `us_gallon` or `liter`. + The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ diff --git a/stripe/test_helpers/issuing/_transaction_service.py b/stripe/test_helpers/issuing/_transaction_service.py index 218470270..2f93fce32 100644 --- a/stripe/test_helpers/issuing/_transaction_service.py +++ b/stripe/test_helpers/issuing/_transaction_service.py @@ -471,9 +471,9 @@ class CreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired[Literal["liter", "us_gallon"]] + unit: NotRequired[Literal["liter", "other", "us_gallon"]] """ - The units for `volume_decimal`. One of `us_gallon` or `liter`. + The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ @@ -962,9 +962,9 @@ class CreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired[Literal["liter", "us_gallon"]] + unit: NotRequired[Literal["liter", "other", "us_gallon"]] """ - The units for `volume_decimal`. One of `us_gallon` or `liter`. + The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ From 40e7e587d70fb145ed2ade87c3178f14701546d3 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 18 Apr 2024 14:29:49 -0700 Subject: [PATCH 052/179] Bump version to 9.3.0 --- CHANGELOG.md | 31 ++++++++++++++++++++++--------- VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df07bcfc6..51b2495b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,27 @@ +## 9.3.0 - 2024-04-18 +* [#1305](https://github.com/stripe/stripe-python/pull/1305) Update generated code + * Add support for `allow_redisplay` on parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.Customer.ListPaymentMethodsParams`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData` + * Add support for `schedule_details` on parameter classes `stripe.Invoice.UpcomingLinesParams` and `stripe.Invoice.UpcomingParams` + * Add support for `subscription_details` on parameter classes `stripe.Invoice.UpcomingLinesParams` and `stripe.Invoice.UpcomingParams` + * Add support for `create_preview` on resource `stripe.Invoice` + * Add support for `payment_method_data` on parameter class `stripe.checkout.Session.CreateParams` + * Add support for `saved_payment_method_options` on parameter class `stripe.checkout.Session.CreateParams` and resource `stripe.checkout.Session` + * Add support for `mobilepay` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptions` and resource class `stripe.checkout.Session.PaymentMethodOptions` + * Add support for `mobilepay` on enum `stripe.checkout.Session.CreateParams.payment_method_types` + * Add support for `other` on enums `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel.unit`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel.unit`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel.unit` +* [#1306](https://github.com/stripe/stripe-python/pull/1306) Update `Quote.pdf()` to use the right base address i.e. files.stripe.com instead of api.stripe.com. Fixes [#1303](https://github.com/stripe/stripe-python/issues/1303) + ## 9.2.0 - 2024-04-16 * [#1301](https://github.com/stripe/stripe-python/pull/1301) Update generated code - * Add support for `balances` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` - * Add support for `payouts_list` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` - * Add support for `capture_method` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsRevolutPay`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsRevolutPay`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsRevolutPay` and resource class `stripe.PaymentIntent.PaymentMethodOptions.RevolutPay` - * Add support for `swish` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` - * Add support for resource `stripe.entitlements.ActiveEntitlementSummary` - * Remove support for `config` on parameter class `stripe.forwarding.Request.CreateParams` and resource `stripe.forwarding.Request`. This field is no longer used by the Forwarding Request API. - * Change type of fields `stripe.AccountSession.Components.PaymentDetails.Features` and `stripe.AccountSession.Components.Payments.Features` from `Optional[bool]` to `bool` of `destination_on_behalf_of_charge_management` - * Change type of field `stripe.billing.MeterEvent.CreateParams` from `int` to `NotRequired[int]` of `timestamp` - * Add support for `entitlements.active_entitlement_summary.updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `balances` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `payouts_list` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `capture_method` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsRevolutPay`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsRevolutPay`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsRevolutPay` and resource class `stripe.PaymentIntent.PaymentMethodOptions.RevolutPay` + * Add support for `swish` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` + * Add support for resource `stripe.entitlements.ActiveEntitlementSummary` + * Remove support for `config` on parameter class `stripe.forwarding.Request.CreateParams` and resource `stripe.forwarding.Request`. This field is no longer used by the Forwarding Request API. + * Change type of fields `stripe.AccountSession.Components.PaymentDetails.Features` and `stripe.AccountSession.Components.Payments.Features` from `Optional[bool]` to `bool` of `destination_on_behalf_of_charge_management` + * Change type of field `stripe.billing.MeterEvent.CreateParams` from `int` to `NotRequired[int]` of `timestamp` + * Add support for `entitlements.active_entitlement_summary.updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` ## 9.1.0 - 2024-04-11 * [#1300](https://github.com/stripe/stripe-python/pull/1300) Update generated code diff --git a/VERSION b/VERSION index deeb3d66e..b13d146a7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.2.0 +9.3.0 diff --git a/stripe/_version.py b/stripe/_version.py index cb44d32ab..057c95a46 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.2.0" +VERSION = "9.3.0" From 7cce7568f24029dd209ecb17993ce700f421a3fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 18:04:39 +0000 Subject: [PATCH 053/179] Bump aiohttp from 3.9.2 to 3.9.4 (#1307) Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.2 to 3.9.4. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiohttp/compare/v3.9.2...v3.9.4) --- updated-dependencies: - dependency-name: aiohttp dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 843756dad..f2e9a43ba 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ httpx == 0.22.0; python_version == "3.6" httpx >= 0.24.1; python_version == "3.7" httpx >= 0.27.0; python_version >= "3.8" aiohttp == 3.8.6; python_version <= "3.7" -aiohttp == 3.9.2; python_version > "3.7" +aiohttp == 3.9.4; python_version > "3.7" anyio[trio] == 3.6.2 pytest-cov >= 2.8.1, < 2.11.0 From b28a836f229ddcca9265b37da6f448f0be485030 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 20:20:55 +0000 Subject: [PATCH 054/179] Update generated code (#1316) * Update generated code for v974 * Update generated code for v975 * Update generated code for v976 * Update generated code for v977 * Update generated code for v979 * Update generated code for v982 * Update generated code for v983 * Update generated code for v985 * Update generated code for v987 * Update generated code for v988 * Update generated code for v989 * Update generated code for v990 * Update generated code for v991 * Update generated code for v992 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 157 +++++++++++------- stripe/_account_external_account_service.py | 18 +- stripe/_account_login_link_service.py | 8 +- stripe/_account_service.py | 92 ++++++---- stripe/_balance.py | 2 +- stripe/_bank_account.py | 7 +- stripe/_capability.py | 8 +- stripe/_card.py | 6 +- stripe/_confirmation_token.py | 2 +- stripe/_event.py | 8 +- stripe/_event_service.py | 4 +- stripe/_invoice.py | 10 +- stripe/_invoice_line_item.py | 4 +- stripe/_invoice_line_item_service.py | 2 +- stripe/_invoice_service.py | 8 +- stripe/_login_link.py | 2 +- stripe/_mandate.py | 10 ++ stripe/_payment_intent.py | 16 ++ stripe/_payment_method_configuration.py | 76 +++++++++ .../_payment_method_configuration_service.py | 52 ++++++ stripe/_person.py | 5 +- stripe/_price.py | 2 +- stripe/_price_service.py | 2 +- stripe/_product.py | 2 +- stripe/_product_feature_service.py | 2 +- stripe/_setup_attempt.py | 10 ++ stripe/_subscription.py | 6 +- stripe/_subscription_service.py | 4 +- stripe/_token.py | 13 +- stripe/_token_service.py | 4 +- stripe/_webhook_endpoint.py | 6 +- stripe/checkout/_session.py | 18 +- stripe/entitlements/_active_entitlement.py | 10 +- stripe/identity/_verification_session.py | 52 +----- .../identity/_verification_session_service.py | 52 +----- 36 files changed, 423 insertions(+), 259 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e0b273508..6eb80deb2 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v972 \ No newline at end of file +v992 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index a813c1bf7..431dfc556 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -45,9 +45,14 @@ class Account( properties on the account like its current requirements or if the account is enabled to make live charges or receive payouts. - For Custom accounts, the properties below are always returned. For other accounts, some properties are returned until that - account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), - some properties are only returned for Custom accounts. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts). + For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + is `application`, which includes Custom accounts, the properties below are always + returned. + + For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + is `stripe`, which includes Standard and Express accounts, some properties are only returned + until you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions) + to start Connect Onboarding. Learn about the [differences between accounts](https://stripe.com/connect/accounts). """ OBJECT_NAME: ClassVar[Literal["account"]] = "account" @@ -565,7 +570,7 @@ class Fees(StripeObject): "application_express", ] """ - A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this account. + A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this account. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). """ class Losses(StripeObject): @@ -1029,7 +1034,7 @@ class Schedule(StripeObject): debit_negative_balances: bool """ - A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. See our [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances) documentation for details. Default value is `false` for Custom accounts, otherwise `true`. + A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. See [Understanding Connect account balances](https://stripe.com/connect/account-balances) for details. The default value is `false` when [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, otherwise `true`. """ schedule: Schedule statement_descriptor: Optional[str] @@ -1196,15 +1201,22 @@ class CreateParams(RequestOptions): Literal["company", "government_entity", "individual", "non_profit"] ] """ - The business type. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + The business type. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ capabilities: NotRequired["Account.CreateParamsCapabilities"] """ - Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. + Each key of the dictionary represents a capability, and each capability + maps to its settings (for example, whether it has been requested or not). Each + capability is inactive until you have provided its specific + requirements and Stripe has verified them. An account might have some + of its requested capabilities be active and some be inactive. + + Required when [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/create#create_account-controller-dashboard-type) + is `none`, which includes Custom accounts. """ company: NotRequired["Account.CreateParamsCompany"] """ - Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ controller: NotRequired["Account.CreateParamsController"] """ @@ -1224,7 +1236,7 @@ class CreateParams(RequestOptions): """ email: NotRequired[str] """ - The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. + The email address of the account holder. This is only to make the account easier to identify to you. If [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, Stripe doesn't email the account without your consent. """ expand: NotRequired[List[str]] """ @@ -1234,13 +1246,13 @@ class CreateParams(RequestOptions): "str|Account.CreateParamsBankAccount|Account.CreateParamsCard|Account.CreateParamsCardToken" ] """ - A card or bank account to attach to the account for receiving [payouts](https://docs.stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://docs.stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://docs.stripe.com/api#account_create_bank_account) creation. + A card or bank account to attach to the account for receiving [payouts](https://stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/api#account_create_bank_account) creation. - By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://docs.stripe.com/api#account_create_bank_account) or [card creation](https://docs.stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/api#account_create_bank_account) or [card creation](https://stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ individual: NotRequired["Account.CreateParamsIndividual"] """ - Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ @@ -1252,7 +1264,7 @@ class CreateParams(RequestOptions): """ tos_acceptance: NotRequired["Account.CreateParamsTosAcceptance"] """ - Details on the account's acceptance of the [Stripe Services Agreement](https://docs.stripe.com/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. + Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ type: NotRequired[Literal["custom", "express", "standard"]] """ @@ -2114,7 +2126,7 @@ class CreateParamsController(TypedDict): class CreateParamsControllerFees(TypedDict): payer: NotRequired[Literal["account", "application"]] """ - A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`. + A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). """ class CreateParamsControllerLosses(TypedDict): @@ -3722,7 +3734,7 @@ class RetrievePersonParams(RequestOptions): Literal["company", "government_entity", "individual", "non_profit"] ] """ - The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property is only returned for Custom accounts. + The business type. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property is only returned for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ capabilities: Optional[Capabilities] charges_enabled: Optional[bool] @@ -3745,7 +3757,7 @@ class RetrievePersonParams(RequestOptions): """ details_submitted: Optional[bool] """ - Whether account details have been submitted. Standard accounts cannot receive payouts before this is true. + Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. """ email: Optional[str] """ @@ -3764,10 +3776,9 @@ class RetrievePersonParams(RequestOptions): """ This is an object representing a person associated with a Stripe account. - A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. - See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps. + A platform cannot access a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. - Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/handling-api-verification#person-information) + See the [Standard onboarding](https://stripe.com/connect/standard-accounts) or [Express onboarding](https://stripe.com/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](https://stripe.com/connect/handling-api-verification#person-information). """ metadata: Optional[Dict[str, str]] """ @@ -3789,7 +3800,7 @@ class RetrievePersonParams(RequestOptions): tos_acceptance: Optional[TosAcceptance] type: Optional[Literal["custom", "express", "none", "standard"]] """ - The Stripe account type. Can be `standard`, `express`, or `custom`. + The Stripe account type. Can be `standard`, `express`, `custom`, or `none`. """ deleted: Optional[Literal[True]] """ @@ -3841,9 +3852,11 @@ def _cls_delete( cls, sid: str, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + With [Connect](https://stripe.com/connect), you can delete accounts you manage. + + Test-mode accounts can be deleted at any time. - Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -3863,9 +3876,11 @@ def delete( sid: str, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + With [Connect](https://stripe.com/connect), you can delete accounts you manage. + + Test-mode accounts can be deleted at any time. - Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -3874,9 +3889,11 @@ def delete( @overload def delete(self, **params: Unpack["Account.DeleteParams"]) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + With [Connect](https://stripe.com/connect), you can delete accounts you manage. - Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + Test-mode accounts can be deleted at any time. + + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -3887,9 +3904,11 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + With [Connect](https://stripe.com/connect), you can delete accounts you manage. + + Test-mode accounts can be deleted at any time. - Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -3904,9 +3923,11 @@ async def _cls_delete_async( cls, sid: str, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + With [Connect](https://stripe.com/connect), you can delete accounts you manage. + + Test-mode accounts can be deleted at any time. - Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -3926,9 +3947,11 @@ async def delete_async( sid: str, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + With [Connect](https://stripe.com/connect), you can delete accounts you manage. - Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + Test-mode accounts can be deleted at any time. + + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -3939,9 +3962,11 @@ async def delete_async( self, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + With [Connect](https://stripe.com/connect), you can delete accounts you manage. + + Test-mode accounts can be deleted at any time. - Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -3952,9 +3977,11 @@ async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + With [Connect](https://stripe.com/connect), you can delete accounts you manage. + + Test-mode accounts can be deleted at any time. - Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -4121,9 +4148,9 @@ def _cls_reject( cls, account: str, **params: Unpack["Account.RejectParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ return cast( "Account", @@ -4142,18 +4169,18 @@ def reject( account: str, **params: Unpack["Account.RejectParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ ... @overload def reject(self, **params: Unpack["Account.RejectParams"]) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ ... @@ -4162,9 +4189,9 @@ def reject( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.RejectParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ return cast( "Account", @@ -4182,9 +4209,9 @@ async def _cls_reject_async( cls, account: str, **params: Unpack["Account.RejectParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ return cast( "Account", @@ -4203,9 +4230,9 @@ async def reject_async( account: str, **params: Unpack["Account.RejectParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ ... @@ -4214,9 +4241,9 @@ async def reject_async( self, **params: Unpack["Account.RejectParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ ... @@ -4225,9 +4252,9 @@ async def reject_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.RejectParams"] ) -> "Account": """ - With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ return cast( "Account", @@ -4504,9 +4531,14 @@ def modify_external_account( **params: Unpack["Account.ModifyExternalAccountParams"] ) -> Union["BankAccount", "Card"]: """ - Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. Other bank account details are not editable by design. + Updates the metadata, account holder name, account holder type of a bank account belonging to + a connected account and optionally sets it as the default for its currency. Other bank account + details are not editable by design. - You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). + + You can re-enable a disabled bank account by performing an update call without providing any + arguments or changes. """ return cast( Union["BankAccount", "Card"], @@ -4527,9 +4559,14 @@ async def modify_external_account_async( **params: Unpack["Account.ModifyExternalAccountParams"] ) -> Union["BankAccount", "Card"]: """ - Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. Other bank account details are not editable by design. + Updates the metadata, account holder name, account holder type of a bank account belonging to + a connected account and optionally sets it as the default for its currency. Other bank account + details are not editable by design. + + You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). - You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + You can re-enable a disabled bank account by performing an update call without providing any + arguments or changes. """ return cast( Union["BankAccount", "Card"], @@ -4629,9 +4666,9 @@ def create_login_link( cls, account: str, **params: Unpack["Account.CreateLoginLinkParams"] ) -> "LoginLink": """ - Creates a single-use login link for an Express account to access their Stripe dashboard. + Creates a single-use login link for a connected account to access the Express Dashboard. - You may only create login links for [Express accounts](https://stripe.com/docs/connect/express-accounts) connected to your platform. + You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ return cast( "LoginLink", @@ -4649,9 +4686,9 @@ async def create_login_link_async( cls, account: str, **params: Unpack["Account.CreateLoginLinkParams"] ) -> "LoginLink": """ - Creates a single-use login link for an Express account to access their Stripe dashboard. + Creates a single-use login link for a connected account to access the Express Dashboard. - You may only create login links for [Express accounts](https://stripe.com/docs/connect/express-accounts) connected to your platform. + You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ return cast( "LoginLink", diff --git a/stripe/_account_external_account_service.py b/stripe/_account_external_account_service.py index 139a4dab0..06a2b7e77 100644 --- a/stripe/_account_external_account_service.py +++ b/stripe/_account_external_account_service.py @@ -310,9 +310,14 @@ def update( options: RequestOptions = {}, ) -> Union[BankAccount, Card]: """ - Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. Other bank account details are not editable by design. + Updates the metadata, account holder name, account holder type of a bank account belonging to + a connected account and optionally sets it as the default for its currency. Other bank account + details are not editable by design. - You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). + + You can re-enable a disabled bank account by performing an update call without providing any + arguments or changes. """ return cast( Union[BankAccount, Card], @@ -337,9 +342,14 @@ async def update_async( options: RequestOptions = {}, ) -> Union[BankAccount, Card]: """ - Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. Other bank account details are not editable by design. + Updates the metadata, account holder name, account holder type of a bank account belonging to + a connected account and optionally sets it as the default for its currency. Other bank account + details are not editable by design. + + You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). - You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + You can re-enable a disabled bank account by performing an update call without providing any + arguments or changes. """ return cast( Union[BankAccount, Card], diff --git a/stripe/_account_login_link_service.py b/stripe/_account_login_link_service.py index 21a66ca38..d46d42165 100644 --- a/stripe/_account_login_link_service.py +++ b/stripe/_account_login_link_service.py @@ -22,9 +22,9 @@ def create( options: RequestOptions = {}, ) -> LoginLink: """ - Creates a single-use login link for an Express account to access their Stripe dashboard. + Creates a single-use login link for a connected account to access the Express Dashboard. - You may only create login links for [Express accounts](https://stripe.com/docs/connect/express-accounts) connected to your platform. + You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ return cast( LoginLink, @@ -47,9 +47,9 @@ async def create_async( options: RequestOptions = {}, ) -> LoginLink: """ - Creates a single-use login link for an Express account to access their Stripe dashboard. + Creates a single-use login link for a connected account to access the Express Dashboard. - You may only create login links for [Express accounts](https://stripe.com/docs/connect/express-accounts) connected to your platform. + You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ return cast( LoginLink, diff --git a/stripe/_account_service.py b/stripe/_account_service.py index bb2b92c09..2c483cf5c 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -38,15 +38,22 @@ class CreateParams(TypedDict): Literal["company", "government_entity", "individual", "non_profit"] ] """ - The business type. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + The business type. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ capabilities: NotRequired["AccountService.CreateParamsCapabilities"] """ - Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. + Each key of the dictionary represents a capability, and each capability + maps to its settings (for example, whether it has been requested or not). Each + capability is inactive until you have provided its specific + requirements and Stripe has verified them. An account might have some + of its requested capabilities be active and some be inactive. + + Required when [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/create#create_account-controller-dashboard-type) + is `none`, which includes Custom accounts. """ company: NotRequired["AccountService.CreateParamsCompany"] """ - Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ controller: NotRequired["AccountService.CreateParamsController"] """ @@ -66,7 +73,7 @@ class CreateParams(TypedDict): """ email: NotRequired[str] """ - The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. + The email address of the account holder. This is only to make the account easier to identify to you. If [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, Stripe doesn't email the account without your consent. """ expand: NotRequired[List[str]] """ @@ -76,13 +83,13 @@ class CreateParams(TypedDict): "str|AccountService.CreateParamsBankAccount|AccountService.CreateParamsCard|AccountService.CreateParamsCardToken" ] """ - A card or bank account to attach to the account for receiving [payouts](https://docs.stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://docs.stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://docs.stripe.com/api#account_create_bank_account) creation. + A card or bank account to attach to the account for receiving [payouts](https://stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/api#account_create_bank_account) creation. - By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://docs.stripe.com/api#account_create_bank_account) or [card creation](https://docs.stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/api#account_create_bank_account) or [card creation](https://stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ individual: NotRequired["AccountService.CreateParamsIndividual"] """ - Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ @@ -94,7 +101,7 @@ class CreateParams(TypedDict): """ tos_acceptance: NotRequired["AccountService.CreateParamsTosAcceptance"] """ - Details on the account's acceptance of the [Stripe Services Agreement](https://docs.stripe.com/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. + Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ type: NotRequired[Literal["custom", "express", "standard"]] """ @@ -966,7 +973,7 @@ class CreateParamsController(TypedDict): class CreateParamsControllerFees(TypedDict): payer: NotRequired[Literal["account", "application"]] """ - A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`. + A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). """ class CreateParamsControllerLosses(TypedDict): @@ -1645,15 +1652,22 @@ class UpdateParams(TypedDict): Literal["company", "government_entity", "individual", "non_profit"] ] """ - The business type. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + The business type. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ capabilities: NotRequired["AccountService.UpdateParamsCapabilities"] """ - Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. + Each key of the dictionary represents a capability, and each capability + maps to its settings (for example, whether it has been requested or not). Each + capability is inactive until you have provided its specific + requirements and Stripe has verified them. An account might have some + of its requested capabilities be active and some be inactive. + + Required when [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/create#create_account-controller-dashboard-type) + is `none`, which includes Custom accounts. """ company: NotRequired["AccountService.UpdateParamsCompany"] """ - Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ default_currency: NotRequired[str] """ @@ -1665,7 +1679,7 @@ class UpdateParams(TypedDict): """ email: NotRequired[str] """ - The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. + The email address of the account holder. This is only to make the account easier to identify to you. If [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, Stripe doesn't email the account without your consent. """ expand: NotRequired[List[str]] """ @@ -1675,13 +1689,13 @@ class UpdateParams(TypedDict): "Literal['']|str|AccountService.UpdateParamsBankAccount|AccountService.UpdateParamsCard|AccountService.UpdateParamsCardToken" ] """ - A card or bank account to attach to the account for receiving [payouts](https://docs.stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://docs.stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://docs.stripe.com/api#account_create_bank_account) creation. + A card or bank account to attach to the account for receiving [payouts](https://stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/api#account_create_bank_account) creation. - By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://docs.stripe.com/api#account_create_bank_account) or [card creation](https://docs.stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/api#account_create_bank_account) or [card creation](https://stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ individual: NotRequired["AccountService.UpdateParamsIndividual"] """ - Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ @@ -1693,7 +1707,7 @@ class UpdateParams(TypedDict): """ tos_acceptance: NotRequired["AccountService.UpdateParamsTosAcceptance"] """ - Details on the account's acceptance of the [Stripe Services Agreement](https://docs.stripe.com/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. + Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ class UpdateParamsBankAccount(TypedDict): @@ -3139,9 +3153,11 @@ def delete( options: RequestOptions = {}, ) -> Account: """ - With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + With [Connect](https://stripe.com/connect), you can delete accounts you manage. + + Test-mode accounts can be deleted at any time. - Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -3164,9 +3180,11 @@ async def delete_async( options: RequestOptions = {}, ) -> Account: """ - With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + With [Connect](https://stripe.com/connect), you can delete accounts you manage. - Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + Test-mode accounts can be deleted at any time. + + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -3231,12 +3249,16 @@ def update( options: RequestOptions = {}, ) -> Account: """ - Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are + Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are left unchanged. - For Custom accounts, you can update any information on the account. For other accounts, you can update all information until that - account has started to go through Connect Onboarding. Once you create an [Account Link or Account Session](https://stripe.com/docs/api/account_links), - some properties can only be changed or updated for Custom accounts. + For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + is application, which includes Custom accounts, you can update any information on the account. + + For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + is stripe, which includes Standard and Express accounts, you can update all information until you create + an [Account Link or Account Session](https://stripe.com/api/account_links) to start Connect onboarding, + after which some properties can no longer be updated. To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. @@ -3260,12 +3282,16 @@ async def update_async( options: RequestOptions = {}, ) -> Account: """ - Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are + Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are left unchanged. - For Custom accounts, you can update any information on the account. For other accounts, you can update all information until that - account has started to go through Connect Onboarding. Once you create an [Account Link or Account Session](https://stripe.com/docs/api/account_links), - some properties can only be changed or updated for Custom accounts. + For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + is application, which includes Custom accounts, you can update any information on the account. + + For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + is stripe, which includes Standard and Express accounts, you can update all information until you create + an [Account Link or Account Session](https://stripe.com/api/account_links) to start Connect onboarding, + after which some properties can no longer be updated. To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. @@ -3419,9 +3445,9 @@ def reject( options: RequestOptions = {}, ) -> Account: """ - With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ return cast( Account, @@ -3444,9 +3470,9 @@ async def reject_async( options: RequestOptions = {}, ) -> Account: """ - With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ return cast( Account, diff --git a/stripe/_balance.py b/stripe/_balance.py index 50b24f8e2..1cbc6312e 100644 --- a/stripe/_balance.py +++ b/stripe/_balance.py @@ -173,7 +173,7 @@ class RetrieveParams(RequestOptions): """ connect_reserved: Optional[List[ConnectReserved]] """ - Funds held due to negative balances on connected Custom accounts. You can find the connect reserve balance for each currency and payment type in the `source_types` property. + Funds held due to negative balances on connected accounts where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. You can find the connect reserve balance for each currency and payment type in the `source_types` property. """ instant_available: Optional[List[InstantAvailable]] """ diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index 39e2d806d..c74515d33 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -25,11 +25,12 @@ class BankAccount( """ These bank accounts are payment methods on `Customer` objects. - On the other hand [External Accounts](https://stripe.com/docs/api#external_accounts) are transfer - destinations on `Account` objects for [Custom accounts](https://stripe.com/docs/connect/custom-accounts). + On the other hand [External Accounts](https://stripe.com/api#external_accounts) are transfer + destinations on `Account` objects for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + is `application`, which includes [Custom accounts](https://stripe.com/connect/custom-accounts). They can be bank accounts or debit cards as well, and are documented in the links above. - Related guide: [Bank debits and transfers](https://stripe.com/docs/payments/bank-debits-transfers) + Related guide: [Bank debits and transfers](https://stripe.com/payments/bank-debits-transfers) """ OBJECT_NAME: ClassVar[Literal["bank_account"]] = "bank_account" diff --git a/stripe/_capability.py b/stripe/_capability.py index 8dc7d3185..d365fc781 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -294,13 +294,13 @@ class Error(StripeObject): """ disabled_reason: Optional[str] """ - If the capability is disabled, this string describes why. Can be `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.listed`, `rejected.terms_of_service`, `rejected.other`, `under_review`, or `other`. + If the capability is disabled, this string describes why. Can be `requirements.fields_needed`, `pending.onboarding`, `pending.review`, `rejected.fraud`, `rejected.other`, `platform_paused`, `action_required.requested_capabilities`, `rejected.inactivty`, or `rejected.unsupported_business`. - `rejected.unsupported_business` means that the account's business is not supported by the capability. For example, payment methods may restrict the businesses they support in their terms of service: + `rejected.unsupported_business` means that the account's business is not supported by the capability. For example, payment methods may restrict the businesses they support in their terms of service, such as in [Afterpay Clearpay's terms of service](https://stripe.com/afterpay-clearpay/legal#restricted-businesses). - - [Afterpay Clearpay's terms of service](https://stripe.com/afterpay-clearpay/legal#restricted-businesses) + `rejected.inactivity` means that the capability has been paused for inactivity. This disabled reason currently only applies to the Issuing capability. See [Issuing: Managing Inactive Connects](https://support.stripe.com/questions/issuing-managing-inactive-connect-accounts) for more details. - If you believe that the rejection is in error, please contact support at https://support.stripe.com/contact/ for assistance. + If you believe that a rejection is in error, please contact support at https://support.stripe.com/contact/ for assistance. """ errors: List[Error] """ diff --git a/stripe/_card.py b/stripe/_card.py index a83c74af9..434bad80a 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -38,7 +38,7 @@ class DeleteParams(RequestOptions): account: Optional[ExpandableField["Account"]] """ - The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. + The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ address_city: Optional[str] """ @@ -86,7 +86,7 @@ class DeleteParams(RequestOptions): """ currency: Optional[str] """ - Three-letter [ISO code for currency](https://stripe.com/docs/payouts). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. + Three-letter [ISO code for currency](https://stripe.com/docs/payouts). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ customer: Optional[ExpandableField["Customer"]] """ @@ -98,7 +98,7 @@ class DeleteParams(RequestOptions): """ default_for_currency: Optional[bool] """ - Whether this card is the default external account for its currency. + Whether this card is the default external account for its currency. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ description: Optional[str] """ diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 42a2e924f..10e6c25f6 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -1861,7 +1861,7 @@ class RetrieveParams(RequestOptions): """ expires_at: Optional[int] """ - Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. This is set to null once this ConfirmationToken has been used. + Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. """ id: str """ diff --git a/stripe/_event.py b/stripe/_event.py index ea1575245..53297eb5e 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -31,10 +31,10 @@ class Event(ListableAPIResource["Event"]): `Event` objects directly to an endpoint on your server. You can manage webhooks in your [account settings](https://dashboard.stripe.com/account/webhooks). Learn how - to [listen for events](https://stripe.com/docs/webhooks) + to [listen for events](https://docs.stripe.com/webhooks) so that your integration can automatically trigger reactions. - When using [Connect](https://stripe.com/docs/connect), you can also receive event notifications + When using [Connect](https://docs.stripe.com/connect), you can also receive event notifications that occur in connected accounts. For these events, there's an additional `account` attribute in the received `Event` object. @@ -391,7 +391,7 @@ class RetrieveParams(RequestOptions): @classmethod def list(cls, **params: Unpack["Event.ListParams"]) -> ListObject["Event"]: """ - List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). + List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). """ result = cls._static_request( "get", @@ -412,7 +412,7 @@ async def list_async( cls, **params: Unpack["Event.ListParams"] ) -> ListObject["Event"]: """ - List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). + List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). """ result = await cls._static_request_async( "get", diff --git a/stripe/_event_service.py b/stripe/_event_service.py index bb816594f..2cdaf6709 100644 --- a/stripe/_event_service.py +++ b/stripe/_event_service.py @@ -74,7 +74,7 @@ def list( options: RequestOptions = {}, ) -> ListObject[Event]: """ - List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). + List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). """ return cast( ListObject[Event], @@ -94,7 +94,7 @@ async def list_async( options: RequestOptions = {}, ) -> ListObject[Event]: """ - List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). + List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). """ return cast( ListObject[Event], diff --git a/stripe/_invoice.py b/stripe/_invoice.py index ff6018a11..b8ddbecb1 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -726,6 +726,7 @@ class FinancialConnections(StripeObject): "ach_credit_transfer", "ach_debit", "acss_debit", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -744,6 +745,7 @@ class FinancialConnections(StripeObject): "paynow", "paypal", "promptpay", + "revolut_pay", "sepa_credit_transfer", "sepa_debit", "sofort", @@ -1197,7 +1199,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -2842,7 +2844,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -6628,7 +6630,7 @@ def upcoming(cls, **params: Unpack["Invoice.UpcomingParams"]) -> "Invoice": Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date value passed in the request. + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. """ return cast( "Invoice", @@ -6648,7 +6650,7 @@ async def upcoming_async( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date value passed in the request. + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. """ return cast( "Invoice", diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 54e82ebfe..837e0b337 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -129,7 +129,7 @@ class ModifyParams(RequestOptions): """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ - Set of [key-value pairs](https://stripe.com/docs/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`. + Set of [key-value pairs](https://stripe.com/docs/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=recurring` line items, the incoming metadata specified on the request is directly used to set this value, in contrast to `type=invoiceitem` line items, where any existing metadata on the invoice line is merged with the incoming data. """ period: NotRequired["InvoiceLineItem.ModifyParamsPeriod"] """ @@ -345,7 +345,7 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): """ metadata: Dict[str, str] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with `type=subscription` this will reflect the metadata of the subscription that caused the line item to be created. + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation. """ object: Literal["line_item"] """ diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index 98ce93306..5c0733d1c 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -53,7 +53,7 @@ class UpdateParams(TypedDict): """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ - Set of [key-value pairs](https://stripe.com/docs/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`. + Set of [key-value pairs](https://stripe.com/docs/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=recurring` line items, the incoming metadata specified on the request is directly used to set this value, in contrast to `type=invoiceitem` line items, where any existing metadata on the invoice line is merged with the incoming data. """ period: NotRequired["InvoiceLineItemService.UpdateParamsPeriod"] """ diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 4f076c612..059dc0fc6 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -234,7 +234,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -3071,7 +3071,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -3742,7 +3742,7 @@ def upcoming( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date value passed in the request. + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. """ return cast( Invoice, @@ -3766,7 +3766,7 @@ async def upcoming_async( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date value passed in the request. + You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. """ return cast( Invoice, diff --git a/stripe/_login_link.py b/stripe/_login_link.py index dae7a85e6..0b6cdd24a 100644 --- a/stripe/_login_link.py +++ b/stripe/_login_link.py @@ -7,7 +7,7 @@ class LoginLink(StripeObject): """ - Login Links are single-use login link for an Express account to access their Stripe dashboard. + Login Links are single-use URLs for a connected account to access the Express Dashboard. The connected account's [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/object#account_object-controller-stripe_dashboard-type) must be `express` to have access to the Express Dashboard. """ OBJECT_NAME: ClassVar[Literal["login_link"]] = "login_link" diff --git a/stripe/_mandate.py b/stripe/_mandate.py index 84e56fb05..e93bf7b68 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -66,6 +66,9 @@ class AcssDebit(StripeObject): Transaction type of the mandate. """ + class AmazonPay(StripeObject): + pass + class AuBecsDebit(StripeObject): url: str """ @@ -119,6 +122,9 @@ class Paypal(StripeObject): PayPal account PayerID. This identifier uniquely identifies the PayPal customer. """ + class RevolutPay(StripeObject): + pass + class SepaDebit(StripeObject): reference: str """ @@ -136,12 +142,14 @@ class UsBankAccount(StripeObject): """ acss_debit: Optional[AcssDebit] + amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] card: Optional[Card] cashapp: Optional[Cashapp] link: Optional[Link] paypal: Optional[Paypal] + revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] type: str """ @@ -150,12 +158,14 @@ class UsBankAccount(StripeObject): us_bank_account: Optional[UsBankAccount] _inner_class_types = { "acss_debit": AcssDebit, + "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "card": Card, "cashapp": Cashapp, "link": Link, "paypal": Paypal, + "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, } diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 7f3731fbc..ddb8229c1 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1031,6 +1031,14 @@ class AmazonPay(StripeObject): """ Controls when the funds will be captured from the customer's account. """ + setup_future_usage: Optional[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ class AuBecsDebit(StripeObject): setup_future_usage: Optional[ @@ -1568,6 +1576,14 @@ class RevolutPay(StripeObject): """ Controls when the funds will be captured from the customer's account. """ + setup_future_usage: Optional[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ class SepaDebit(StripeObject): class MandateOptions(StripeObject): diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 3101ac39d..7670d57dc 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -587,6 +587,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Mobilepay(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 Oxxo(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -982,6 +1004,12 @@ class CreateParams(RequestOptions): """ [Link](https://stripe.com/docs/payments/link) is a payment method network. With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. """ + mobilepay: NotRequired[ + "PaymentMethodConfiguration.CreateParamsMobilepay" + ] + """ + MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. + """ name: NotRequired[str] """ Configuration name. @@ -1413,6 +1441,20 @@ class CreateParamsLinkDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsMobilepay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsMobilepayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsMobilepayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsOxxoDisplayPreference" @@ -1586,10 +1628,22 @@ class ListParams(RequestOptions): """ The Connect application to filter by. """ + 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. + """ class ModifyParams(RequestOptions): acss_debit: NotRequired[ @@ -1726,6 +1780,12 @@ class ModifyParams(RequestOptions): """ [Link](https://stripe.com/docs/payments/link) is a payment method network. With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. """ + mobilepay: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsMobilepay" + ] + """ + MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. + """ name: NotRequired[str] """ Configuration name. @@ -2153,6 +2213,20 @@ class ModifyParamsLinkDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsMobilepay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsMobilepayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsMobilepayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsOxxoDisplayPreference" @@ -2372,6 +2446,7 @@ class RetrieveParams(RequestOptions): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ + mobilepay: Optional[Mobilepay] name: str """ The configuration's name. @@ -2561,6 +2636,7 @@ async def retrieve_async( "klarna": Klarna, "konbini": Konbini, "link": Link, + "mobilepay": Mobilepay, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index 31de308a0..49b1ce3f7 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -159,6 +159,12 @@ class CreateParams(TypedDict): """ [Link](https://stripe.com/docs/payments/link) is a payment method network. With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. """ + mobilepay: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsMobilepay" + ] + """ + MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. + """ name: NotRequired[str] """ Configuration name. @@ -598,6 +604,20 @@ class CreateParamsLinkDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsMobilepay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsMobilepayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsMobilepayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsOxxoDisplayPreference" @@ -771,10 +791,22 @@ class ListParams(TypedDict): """ The Connect application to filter by. """ + 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. + """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] @@ -935,6 +967,12 @@ class UpdateParams(TypedDict): """ [Link](https://stripe.com/docs/payments/link) is a payment method network. With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. """ + mobilepay: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsMobilepay" + ] + """ + MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. + """ name: NotRequired[str] """ Configuration name. @@ -1370,6 +1408,20 @@ class UpdateParamsLinkDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsMobilepay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsMobilepayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsMobilepayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsOxxoDisplayPreference" diff --git a/stripe/_person.py b/stripe/_person.py index 666320784..d3461e966 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -16,10 +16,9 @@ class Person(UpdateableAPIResource["Person"]): """ This is an object representing a person associated with a Stripe account. - A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. - See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps. + A platform cannot access a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. - Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/handling-api-verification#person-information) + See the [Standard onboarding](https://stripe.com/connect/standard-accounts) or [Express onboarding](https://stripe.com/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](https://stripe.com/connect/handling-api-verification#person-information). """ OBJECT_NAME: ClassVar[Literal["person"]] = "person" diff --git a/stripe/_price.py b/stripe/_price.py index 955c35396..4539ee5d8 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -262,7 +262,7 @@ class CreateParams(RequestOptions): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required, unless `billing_scheme=tiered`. """ unit_amount_decimal: NotRequired[str] """ diff --git a/stripe/_price_service.py b/stripe/_price_service.py index ce990af5f..f43af4019 100644 --- a/stripe/_price_service.py +++ b/stripe/_price_service.py @@ -90,7 +90,7 @@ class CreateParams(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required, unless `billing_scheme=tiered`. """ unit_amount_decimal: NotRequired[str] """ diff --git a/stripe/_product.py b/stripe/_product.py index 03303e9d7..52acddacf 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -85,7 +85,7 @@ class PackageDimensions(StripeObject): class CreateFeatureParams(RequestOptions): entitlement_feature: str """ - The ID of the [Feature](docs/api/entitlements/feature) object attached to this product. + The ID of the [Feature](https://stripe.com/docs/api/entitlements/feature) object attached to this product. """ expand: NotRequired[List[str]] """ diff --git a/stripe/_product_feature_service.py b/stripe/_product_feature_service.py index 700cb234c..dfda8ed8f 100644 --- a/stripe/_product_feature_service.py +++ b/stripe/_product_feature_service.py @@ -13,7 +13,7 @@ class ProductFeatureService(StripeService): class CreateParams(TypedDict): entitlement_feature: str """ - The ID of the [Feature](docs/api/entitlements/feature) object attached to this product. + The ID of the [Feature](https://stripe.com/docs/api/entitlements/feature) object attached to this product. """ expand: NotRequired[List[str]] """ diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 8e5f78172..7a36f1d9f 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -41,6 +41,9 @@ class PaymentMethodDetails(StripeObject): class AcssDebit(StripeObject): pass + class AmazonPay(StripeObject): + pass + class AuBecsDebit(StripeObject): pass @@ -331,6 +334,9 @@ class Link(StripeObject): class Paypal(StripeObject): pass + class RevolutPay(StripeObject): + pass + class SepaDebit(StripeObject): pass @@ -374,6 +380,7 @@ class UsBankAccount(StripeObject): pass acss_debit: Optional[AcssDebit] + amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] @@ -385,6 +392,7 @@ class UsBankAccount(StripeObject): klarna: Optional[Klarna] link: Optional[Link] paypal: Optional[Paypal] + revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] type: str @@ -394,6 +402,7 @@ class UsBankAccount(StripeObject): us_bank_account: Optional[UsBankAccount] _inner_class_types = { "acss_debit": AcssDebit, + "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, @@ -405,6 +414,7 @@ class UsBankAccount(StripeObject): "klarna": Klarna, "link": Link, "paypal": Paypal, + "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "sofort": Sofort, "us_bank_account": UsBankAccount, diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 933fa2450..f2ec1273e 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -329,6 +329,7 @@ class FinancialConnections(StripeObject): "ach_credit_transfer", "ach_debit", "acss_debit", + "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", @@ -347,6 +348,7 @@ class FinancialConnections(StripeObject): "paynow", "paypal", "promptpay", + "revolut_pay", "sepa_credit_transfer", "sepa_debit", "sofort", @@ -888,7 +890,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -1701,7 +1703,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index a2b7c45bf..d36ad3315 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -487,7 +487,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -1354,7 +1354,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/_token.py b/stripe/_token.py index 030021238..8da78239c 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -35,7 +35,7 @@ class Token(CreateableAPIResource["Token"]): You can't store or use tokens more than once. To store card or bank account information for later use, create [Customer](https://stripe.com/docs/api#customers) - objects or [Custom accounts](https://stripe.com/docs/api#external_accounts). + objects or [External accounts](https://stripe.com/api#external_accounts). [Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection, performs best with integrations that use client-side tokenization. """ @@ -1068,11 +1068,12 @@ class RetrieveParams(RequestOptions): """ These bank accounts are payment methods on `Customer` objects. - On the other hand [External Accounts](https://stripe.com/docs/api#external_accounts) are transfer - destinations on `Account` objects for [Custom accounts](https://stripe.com/docs/connect/custom-accounts). + On the other hand [External Accounts](https://stripe.com/api#external_accounts) are transfer + destinations on `Account` objects for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + is `application`, which includes [Custom accounts](https://stripe.com/connect/custom-accounts). They can be bank accounts or debit cards as well, and are documented in the links above. - Related guide: [Bank debits and transfers](https://stripe.com/docs/payments/bank-debits-transfers) + Related guide: [Bank debits and transfers](https://stripe.com/payments/bank-debits-transfers) """ card: Optional["Card"] """ @@ -1115,7 +1116,7 @@ class RetrieveParams(RequestOptions): def create(cls, **params: Unpack["Token.CreateParams"]) -> "Token": """ Creates a single-use token that represents a bank account's details. - You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [Custom account](https://stripe.com/docs/api#accounts). + You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. """ return cast( "Token", @@ -1132,7 +1133,7 @@ async def create_async( ) -> "Token": """ Creates a single-use token that represents a bank account's details. - You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [Custom account](https://stripe.com/docs/api#accounts). + You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. """ return cast( "Token", diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 2348e62af..445eeb773 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -1094,7 +1094,7 @@ def create( ) -> Token: """ Creates a single-use token that represents a bank account's details. - You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [Custom account](https://stripe.com/docs/api#accounts). + You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. """ return cast( Token, @@ -1115,7 +1115,7 @@ async def create_async( ) -> Token: """ Creates a single-use token that represents a bank account's details. - You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [Custom account](https://stripe.com/docs/api#accounts). + You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. """ return cast( Token, diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index c242f485e..59d21d78f 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -18,13 +18,13 @@ class WebhookEndpoint( UpdateableAPIResource["WebhookEndpoint"], ): """ - You can configure [webhook endpoints](https://stripe.com/docs/webhooks/) via the API to be + You can configure [webhook endpoints](https://docs.stripe.com/webhooks/) via the API to be notified about events that happen in your Stripe account or connected accounts. Most users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints. - Related guide: [Setting up webhooks](https://stripe.com/docs/webhooks/configure) + Related guide: [Setting up webhooks](https://docs.stripe.com/webhooks/configure) """ OBJECT_NAME: ClassVar[Literal["webhook_endpoint"]] = "webhook_endpoint" @@ -718,7 +718,7 @@ class RetrieveParams(RequestOptions): """ secret: Optional[str] """ - The endpoint's secret, used to generate [webhook signatures](https://stripe.com/docs/webhooks/signatures). Only returned at creation. + The endpoint's secret, used to generate [webhook signatures](https://docs.stripe.com/webhooks/signatures). Only returned at creation. """ status: str """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index f4a958c37..0c4afc0b3 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -590,7 +590,14 @@ class Alipay(StripeObject): """ class AmazonPay(StripeObject): - pass + setup_future_usage: Optional[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ class AuBecsDebit(StripeObject): setup_future_usage: Optional[Literal["none"]] @@ -897,7 +904,14 @@ class Pix(StripeObject): """ class RevolutPay(StripeObject): - pass + setup_future_usage: Optional[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ class SepaDebit(StripeObject): setup_future_usage: Optional[ diff --git a/stripe/entitlements/_active_entitlement.py b/stripe/entitlements/_active_entitlement.py index 82298a396..7fa4f76f8 100644 --- a/stripe/entitlements/_active_entitlement.py +++ b/stripe/entitlements/_active_entitlement.py @@ -1,10 +1,14 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from typing import ClassVar, List -from typing_extensions import Literal, NotRequired, Unpack +from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.entitlements._feature import Feature class ActiveEntitlement(ListableAPIResource["ActiveEntitlement"]): @@ -44,9 +48,9 @@ class RetrieveParams(RequestOptions): Specifies which fields in the response should be expanded. """ - feature: str + feature: ExpandableField["Feature"] """ - The feature that the customer is entitled to. + The [Feature](https://stripe.com/docs/api/entitlements/feature) that the customer is entitled to. """ id: str """ diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 85e8fca6a..333126995 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -249,11 +249,11 @@ class CreateParams(RequestOptions): """ type: NotRequired[Literal["document", "id_number"]] """ - The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. You must provide a `type` if not passing `verification_flow`. """ verification_flow: NotRequired[str] """ - The ID of a Verification Flow from the Dashboard. + The ID of a Verification Flow from the Dashboard. See https://docs.stripe.com/identity/verification-flows. """ class CreateParamsOptions(TypedDict): @@ -263,18 +263,6 @@ class CreateParamsOptions(TypedDict): """ Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). """ - email: NotRequired[ - "Literal['']|VerificationSession.CreateParamsOptionsEmail" - ] - """ - Options that apply to the email check. - """ - phone: NotRequired[ - "Literal['']|VerificationSession.CreateParamsOptionsPhone" - ] - """ - Options that apply to the phone check. - """ class CreateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ @@ -296,18 +284,6 @@ class CreateParamsOptionsDocument(TypedDict): Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ - class CreateParamsOptionsEmail(TypedDict): - require_verification: NotRequired[bool] - """ - Request one time password verification of `provided_details.email`. - """ - - class CreateParamsOptionsPhone(TypedDict): - require_verification: NotRequired[bool] - """ - Request one time password verification of `provided_details.phone`. - """ - class CreateParamsProvidedDetails(TypedDict): email: NotRequired[str] """ @@ -399,18 +375,6 @@ class ModifyParamsOptions(TypedDict): """ Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). """ - email: NotRequired[ - "Literal['']|VerificationSession.ModifyParamsOptionsEmail" - ] - """ - Options that apply to the email check. - """ - phone: NotRequired[ - "Literal['']|VerificationSession.ModifyParamsOptionsPhone" - ] - """ - Options that apply to the phone check. - """ class ModifyParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ @@ -432,18 +396,6 @@ class ModifyParamsOptionsDocument(TypedDict): Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ - class ModifyParamsOptionsEmail(TypedDict): - require_verification: NotRequired[bool] - """ - Request one time password verification of `provided_details.email`. - """ - - class ModifyParamsOptionsPhone(TypedDict): - require_verification: NotRequired[bool] - """ - Request one time password verification of `provided_details.phone`. - """ - class ModifyParamsProvidedDetails(TypedDict): email: NotRequired[str] """ diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index 81e30c25c..f615b461e 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -45,11 +45,11 @@ class CreateParams(TypedDict): """ type: NotRequired[Literal["document", "id_number"]] """ - The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. You must provide a `type` if not passing `verification_flow`. """ verification_flow: NotRequired[str] """ - The ID of a Verification Flow from the Dashboard. + The ID of a Verification Flow from the Dashboard. See https://docs.stripe.com/identity/verification-flows. """ class CreateParamsOptions(TypedDict): @@ -59,18 +59,6 @@ class CreateParamsOptions(TypedDict): """ Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). """ - email: NotRequired[ - "Literal['']|VerificationSessionService.CreateParamsOptionsEmail" - ] - """ - Options that apply to the email check. - """ - phone: NotRequired[ - "Literal['']|VerificationSessionService.CreateParamsOptionsPhone" - ] - """ - Options that apply to the phone check. - """ class CreateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ @@ -92,18 +80,6 @@ class CreateParamsOptionsDocument(TypedDict): Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ - class CreateParamsOptionsEmail(TypedDict): - require_verification: NotRequired[bool] - """ - Request one time password verification of `provided_details.email`. - """ - - class CreateParamsOptionsPhone(TypedDict): - require_verification: NotRequired[bool] - """ - Request one time password verification of `provided_details.phone`. - """ - class CreateParamsProvidedDetails(TypedDict): email: NotRequired[str] """ @@ -209,18 +185,6 @@ class UpdateParamsOptions(TypedDict): """ Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). """ - email: NotRequired[ - "Literal['']|VerificationSessionService.UpdateParamsOptionsEmail" - ] - """ - Options that apply to the email check. - """ - phone: NotRequired[ - "Literal['']|VerificationSessionService.UpdateParamsOptionsPhone" - ] - """ - Options that apply to the phone check. - """ class UpdateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ @@ -242,18 +206,6 @@ class UpdateParamsOptionsDocument(TypedDict): Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ - class UpdateParamsOptionsEmail(TypedDict): - require_verification: NotRequired[bool] - """ - Request one time password verification of `provided_details.email`. - """ - - class UpdateParamsOptionsPhone(TypedDict): - require_verification: NotRequired[bool] - """ - Request one time password verification of `provided_details.phone`. - """ - class UpdateParamsProvidedDetails(TypedDict): email: NotRequired[str] """ From 4d866e986e30dd64adcbaff61c2ff7ae2881a510 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 25 Apr 2024 13:38:07 -0700 Subject: [PATCH 055/179] Bump version to 9.4.0 --- CHANGELOG.md | 15 +++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51b2495b0..f00ad3f1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## 9.4.0 - 2024-04-25 +* [#1316](https://github.com/stripe/stripe-python/pull/1316) Update generated code + * Add support for `amazon_pay` on resource classes `stripe.Mandate.PaymentMethodDetails` and `stripe.SetupAttempt.PaymentMethodDetails` + * Add support for `revolut_pay` on resource classes `stripe.Mandate.PaymentMethodDetails` and `stripe.SetupAttempt.PaymentMethodDetails` + * Add support for `setup_future_usage` on resource classes `stripe.PaymentIntent.PaymentMethodOptions.AmazonPay`, `stripe.PaymentIntent.PaymentMethodOptions.RevolutPay`, `stripe.checkout.Session.PaymentMethodOptions.AmazonPay`, and `stripe.checkout.Session.PaymentMethodOptions.RevolutPay` + * Add support for `mobilepay` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` + * Add support for `ending_before` on parameter class `stripe.PaymentMethodConfiguration.ListParams` + * Add support for `limit` on parameter class `stripe.PaymentMethodConfiguration.ListParams` + * Add support for `starting_after` on parameter class `stripe.PaymentMethodConfiguration.ListParams` + * Change type of `feature` on `stripe.entitlements.ActiveEntitlement` from `str` to `ExpandableField[Feature]` + * Add support for `amazon_pay` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Add support for `revolut_pay` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Remove support for inadvertently released identity verification features `email` and `phone` on parameter classes `stripe.identity.VerificationSession.CreateParamsOptions` and `stripe.identity.VerificationSession.ModifyParamsOptions` +* [#1307](https://github.com/stripe/stripe-python/pull/1307) Bump aiohttp from 3.9.2 to 3.9.4 + ## 9.3.0 - 2024-04-18 * [#1305](https://github.com/stripe/stripe-python/pull/1305) Update generated code * Add support for `allow_redisplay` on parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.Customer.ListPaymentMethodsParams`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData` diff --git a/VERSION b/VERSION index b13d146a7..8148c5594 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.3.0 +9.4.0 diff --git a/stripe/_version.py b/stripe/_version.py index 057c95a46..e48f227b3 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.3.0" +VERSION = "9.4.0" From 22bd3924db44cb5d281c799015bb4f3687e7a9cb Mon Sep 17 00:00:00 2001 From: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:00:37 -0700 Subject: [PATCH 056/179] Fix type change entries in Python Changelog (#1319) --- CHANGELOG.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f00ad3f1d..4ae3a6a3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,8 +34,8 @@ * Add support for `swish` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` * Add support for resource `stripe.entitlements.ActiveEntitlementSummary` * Remove support for `config` on parameter class `stripe.forwarding.Request.CreateParams` and resource `stripe.forwarding.Request`. This field is no longer used by the Forwarding Request API. - * Change type of fields `stripe.AccountSession.Components.PaymentDetails.Features` and `stripe.AccountSession.Components.Payments.Features` from `Optional[bool]` to `bool` of `destination_on_behalf_of_charge_management` - * Change type of field `stripe.billing.MeterEvent.CreateParams` from `int` to `NotRequired[int]` of `timestamp` + * Change type of `destination_on_behalf_of_charge_management` on `stripe.AccountSession.Components.PaymentDetails.Features` and `stripe.AccountSession.Components.Payments.Features` from `Optional[bool]` to `bool` + * Change type of `timestamp` on `stripe.billing.MeterEvent.CreateParams` from `int` to `NotRequired[int]` * Add support for `entitlements.active_entitlement_summary.updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` ## 9.1.0 - 2024-04-11 @@ -45,11 +45,11 @@ * Add support for `notification_banner` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` * Add support for `amazon_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, `stripe.Refund.DestinationDetails`, `stripe.SetupIntent.PaymentMethodOptions`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptions`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodOptions`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptions`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` * Add support for `next_refresh_available_at` on resource class `stripe.financial_connections.Account.OwnershipRefresh` - * Change type of field `stripe.billing.MeterEventAdjustment` from `Cancel` to `Optional[Cancel]` of `cancel` - * Change type of field `stripe.billing.MeterEventAdjustment.Cancel` from `str` to `Optional[str]` of `identifier` - * Change type of field `stripe.billing.MeterEventAdjustment.CreateParamsCancel` from `str` to `NotRequired[str]` of `identifier` - * Change type of field `stripe.billing.MeterEventAdjustment.CreateParams` from `MeterEventAdjustment.CreateParamsCancel` to `NotRequired[MeterEventAdjustment.CreateParamsCancel]` of `cancel` - * Change type of field `stripe.billing.MeterEventAdjustment.CreateParams` from `NotRequired[Literal['cancel']]` to `Literal['cancel']` of `type` + * Change type of `cancel` on `stripe.billing.MeterEventAdjustment` from `Cancel` to `Optional[Cancel]` + * Change type of `identifier` on `stripe.billing.MeterEventAdjustment.Cancel` from `str` to `Optional[str]` + * Change type of `identifier` on `stripe.billing.MeterEventAdjustment.CreateParamsCancel` from `str` to `NotRequired[str]` + * Change type of `cancel` on `stripe.billing.MeterEventAdjustment.CreateParams` from `MeterEventAdjustment.CreateParamsCancel` to `NotRequired[MeterEventAdjustment.CreateParamsCancel]` + * Change type of `type` on `stripe.billing.MeterEventAdjustment.CreateParams` from `NotRequired[Literal['cancel']]` to `Literal['cancel']` * Add support for `bh_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` * Add support for `kz_bin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` * Add support for `ng_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` @@ -154,21 +154,21 @@ * Add support for `provided_details` on parameter classes `stripe.identity.VerificationSession.CreateParams` and `stripe.identity.VerificationSession.ModifyParams` and resource `stripe.identity.VerificationSession` * Add support for `allowed_merchant_countries` on parameter classes `stripe.issuing.Card.CreateParamsSpendingControls`, `stripe.issuing.Card.ModifyParamsSpendingControls`, `stripe.issuing.Cardholder.CreateParamsSpendingControls`, and `stripe.issuing.Cardholder.ModifyParamsSpendingControls` and resource classes `stripe.issuing.Card.SpendingControls` and `stripe.issuing.Cardholder.SpendingControls` * Add support for `blocked_merchant_countries` on parameter classes `stripe.issuing.Card.CreateParamsSpendingControls`, `stripe.issuing.Card.ModifyParamsSpendingControls`, `stripe.issuing.Cardholder.CreateParamsSpendingControls`, and `stripe.issuing.Cardholder.ModifyParamsSpendingControls` and resource classes `stripe.issuing.Card.SpendingControls` and `stripe.issuing.Cardholder.SpendingControls` - * Change type of field `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSwish` from `Literal['']|str` to `str` of `reference` + * Change type of `reference` on `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSwish` from `Literal['']|str` to `str` * Add support for `verification_flow` on enums `stripe.identity.VerificationReport.type` and `stripe.identity.VerificationSession.type` * Add support for `email_unverified_other` on enum `stripe.identity.VerificationSession.LastError.code` * Add support for `email_verification_declined` on enum `stripe.identity.VerificationSession.LastError.code` * Add support for `phone_unverified_other` on enum `stripe.identity.VerificationSession.LastError.code` * Add support for `phone_verification_declined` on enum `stripe.identity.VerificationSession.LastError.code` * Add support for `mobile_phone_reader` on enums `stripe.terminal.Reader.device_type` and `stripe.terminal.Reader.ListParams.device_type` - * Change type of field `stripe.identity.VerificationSession.CreateParams` from `Literal['document', 'id_number']` to `NotRequired[Literal['document', 'id_number']]` of `type` - * Change type of fields `stripe.Invoice` and `stripe.InvoiceLineItem` from `Optional[List[ExpandableField[Discount]]]` to `List[ExpandableField[Discount]]` of `discounts` - * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` of `data` - * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` of `image_url_png` - * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` of `image_url_svg` - * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[str]` to `str` of `hosted_instructions_url` - * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[str]` to `str` of `mobile_auth_url` - * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[QrCode]` to `QrCode` of `qr_code` + * Change type of `type` on `stripe.identity.VerificationSession.CreateParams` from `Literal['document', 'id_number']` to `NotRequired[Literal['document', 'id_number']]` + * Change type of `discounts` on `stripe.Invoice` and `stripe.InvoiceLineItem` from `Optional[List[ExpandableField[Discount]]]` to `List[ExpandableField[Discount]]` + * Change type of `data` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` + * Change type of `image_url_png` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` + * Change type of `image_url_svg` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` + * Change type of `hosted_instructions_url` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[str]` to `str` + * Change type of `mobile_auth_url` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[str]` to `str` + * Change type of `qr_code` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[QrCode]` to `QrCode` * [#1289](https://github.com/stripe/stripe-python/pull/1289) Bump aiohttp from 3.9.0 to 3.9.2 From df4e67b8080afb75efe347c750cdd2a809f33c22 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 20:22:24 +0000 Subject: [PATCH 057/179] Update generated code (#1317) * Update generated code for v994 * Update generated code for v996 * Update generated code for v997 * Update generated code for v1000 * Update generated code for v1002 * Update generated code for v1003 * Update generated code for v1004 * Update generated code for v1005 * Update generated code for v1007 * Update generated code for v1008 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_charge.py | 3 + stripe/_dispute.py | 15 ++- stripe/_invoice.py | 13 ++- stripe/_invoice_service.py | 8 ++ stripe/_payment_intent.py | 5 + stripe/_payment_intent_service.py | 4 + stripe/_setup_attempt.py | 1 + stripe/_setup_intent.py | 1 + stripe/entitlements/_feature.py | 2 +- stripe/entitlements/_feature_service.py | 4 +- stripe/tax/_calculation.py | 73 ++++++++++++++ stripe/tax/_calculation_service.py | 38 +++++++ stripe/tax/_registration.py | 126 ++++++++++++++++++++++++ stripe/tax/_registration_service.py | 70 +++++++++++++ stripe/tax/_transaction.py | 35 +++++++ 16 files changed, 392 insertions(+), 8 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 6eb80deb2..cb70129c3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v992 \ No newline at end of file +v1008 \ No newline at end of file diff --git a/stripe/_charge.py b/stripe/_charge.py index ecb49d523..eafe8c1dd 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1300,6 +1300,9 @@ class Card(StripeObject): """ card: Optional[Card] + """ + Internal card details + """ _inner_class_types = {"card": Card} class Multibanco(StripeObject): diff --git a/stripe/_dispute.py b/stripe/_dispute.py index e0d5ec0d6..07729b273 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -175,12 +175,23 @@ class Card(StripeObject): The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network. """ + class Paypal(StripeObject): + case_id: Optional[str] + """ + The ID of the dispute in PayPal. + """ + reason_code: Optional[str] + """ + The reason for the dispute as defined by PayPal + """ + card: Optional[Card] - type: Literal["card"] + paypal: Optional[Paypal] + type: Literal["card", "paypal"] """ Payment method type. """ - _inner_class_types = {"card": Card} + _inner_class_types = {"card": Card, "paypal": Paypal} class CloseParams(RequestOptions): expand: NotRequired[List[str]] diff --git a/stripe/_invoice.py b/stripe/_invoice.py index b8ddbecb1..e7878e018 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -465,6 +465,7 @@ class LastFinalizationError(StripeObject): "setup_intent_mandate_invalid", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", + "shipping_address_invalid", "shipping_calculation_failed", "sku_inactive", "state_unsupported", @@ -5792,11 +5793,11 @@ class VoidInvoiceParams(RequestOptions): payment_settings: PaymentSettings period_end: int """ - End of the usage period during which invoice items were added to this invoice. + End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. """ period_start: int """ - Start of the usage period during which invoice items were added to this invoice. + Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. """ post_payment_credit_notes_amount: int """ @@ -5937,6 +5938,8 @@ def create_preview( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + + Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( "Invoice", @@ -5957,6 +5960,8 @@ async def create_preview_async( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + + Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( "Invoice", @@ -6631,6 +6636,8 @@ def upcoming(cls, **params: Unpack["Invoice.UpcomingParams"]) -> "Invoice": Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + + Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( "Invoice", @@ -6651,6 +6658,8 @@ async def upcoming_async( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + + Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( "Invoice", diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 059dc0fc6..ad307742d 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -3743,6 +3743,8 @@ def upcoming( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + + Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( Invoice, @@ -3767,6 +3769,8 @@ async def upcoming_async( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + + Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( Invoice, @@ -4029,6 +4033,8 @@ def create_preview( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + + Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( Invoice, @@ -4053,6 +4059,8 @@ async def create_preview_async( Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + + Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( Invoice, diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index ddb8229c1..eccda247a 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -246,6 +246,7 @@ class LastPaymentError(StripeObject): "setup_intent_mandate_invalid", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", + "shipping_address_invalid", "shipping_calculation_failed", "sku_inactive", "state_unsupported", @@ -2005,6 +2006,10 @@ class ConfirmParams(RequestOptions): """ Payment method-specific configuration for this PaymentIntent. """ + payment_method_types: NotRequired[List[str]] + """ + The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + """ radar_options: NotRequired["PaymentIntent.ConfirmParamsRadarOptions"] """ Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index d6235fedd..273eb3838 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -138,6 +138,10 @@ class ConfirmParams(TypedDict): """ Payment method-specific configuration for this PaymentIntent. """ + payment_method_types: NotRequired[List[str]] + """ + The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + """ radar_options: NotRequired[ "PaymentIntentService.ConfirmParamsRadarOptions" ] diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 7a36f1d9f..58c53bd74 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -578,6 +578,7 @@ class SetupError(StripeObject): "setup_intent_mandate_invalid", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", + "shipping_address_invalid", "shipping_calculation_failed", "sku_inactive", "state_unsupported", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index e8ff9cb0c..79ea36afc 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -231,6 +231,7 @@ class LastSetupError(StripeObject): "setup_intent_mandate_invalid", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", + "shipping_address_invalid", "shipping_calculation_failed", "sku_inactive", "state_unsupported", diff --git a/stripe/entitlements/_feature.py b/stripe/entitlements/_feature.py index 5a1e273da..3c6249681 100644 --- a/stripe/entitlements/_feature.py +++ b/stripe/entitlements/_feature.py @@ -69,7 +69,7 @@ class ModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired[Dict[str, str]] + metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ diff --git a/stripe/entitlements/_feature_service.py b/stripe/entitlements/_feature_service.py index b1fb5525b..d9b480b8b 100644 --- a/stripe/entitlements/_feature_service.py +++ b/stripe/entitlements/_feature_service.py @@ -6,7 +6,7 @@ from stripe._util import sanitize_id from stripe.entitlements._feature import Feature from typing import Dict, List, cast -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Literal, NotRequired, TypedDict class FeatureService(StripeService): @@ -61,7 +61,7 @@ class UpdateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - metadata: NotRequired[Dict[str, str]] + metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 0de29d22a..acdddf026 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -161,6 +161,36 @@ class TaxId(StripeObject): """ _inner_class_types = {"address": Address, "tax_ids": TaxId} + class ShipFromDetails(StripeObject): + class Address(StripeObject): + city: Optional[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: Optional[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + """ + + address: Address + _inner_class_types = {"address": Address} + class ShippingCost(StripeObject): class TaxBreakdown(StripeObject): class Jurisdiction(StripeObject): @@ -370,6 +400,12 @@ class CreateParams(RequestOptions): """ A list of items the customer is purchasing. """ + ship_from_details: NotRequired[ + "Calculation.CreateParamsShipFromDetails" + ] + """ + Details about the address from which the goods are being shipped. + """ shipping_cost: NotRequired["Calculation.CreateParamsShippingCost"] """ Shipping cost details to be used for the calculation. @@ -542,6 +578,38 @@ class CreateParamsLineItem(TypedDict): A [tax code](https://stripe.com/docs/tax/tax-categories) ID to use for this line item. If not provided, we will use the tax code from the provided `product` param. If neither `tax_code` nor `product` is provided, we will use the default tax code from your Tax Settings. """ + class CreateParamsShipFromDetails(TypedDict): + address: "Calculation.CreateParamsShipFromDetailsAddress" + """ + The address from which the goods are being shipped from. + """ + + class CreateParamsShipFromDetailsAddress(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 (e.g., street, PO Box, or company name). + """ + line2: NotRequired["Literal['']|str"] + """ + Address line 2 (e.g., 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. Example: "NY" or "TX". + """ + class CreateParamsShippingCost(TypedDict): amount: NotRequired[int] """ @@ -611,6 +679,10 @@ class ListLineItemsParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ + ship_from_details: Optional[ShipFromDetails] + """ + The details of the ship from location, such as the address. + """ shipping_cost: Optional[ShippingCost] """ The shipping cost details for the calculation. @@ -780,6 +852,7 @@ async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] _inner_class_types = { "customer_details": CustomerDetails, + "ship_from_details": ShipFromDetails, "shipping_cost": ShippingCost, "tax_breakdown": TaxBreakdown, } diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index 1f43d8834..f974eea7b 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -38,6 +38,12 @@ class CreateParams(TypedDict): """ A list of items the customer is purchasing. """ + ship_from_details: NotRequired[ + "CalculationService.CreateParamsShipFromDetails" + ] + """ + Details about the address from which the goods are being shipped. + """ shipping_cost: NotRequired[ "CalculationService.CreateParamsShippingCost" ] @@ -214,6 +220,38 @@ class CreateParamsLineItem(TypedDict): A [tax code](https://stripe.com/docs/tax/tax-categories) ID to use for this line item. If not provided, we will use the tax code from the provided `product` param. If neither `tax_code` nor `product` is provided, we will use the default tax code from your Tax Settings. """ + class CreateParamsShipFromDetails(TypedDict): + address: "CalculationService.CreateParamsShipFromDetailsAddress" + """ + The address from which the goods are being shipped from. + """ + + class CreateParamsShipFromDetailsAddress(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 (e.g., street, PO Box, or company name). + """ + line2: NotRequired["Literal['']|str"] + """ + Address line 2 (e.g., 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. Example: "NY" or "TX". + """ + class CreateParamsShippingCost(TypedDict): amount: NotRequired[int] """ diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index b6c707f05..d4e243bae 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -81,6 +81,12 @@ class Standard(StripeObject): """ _inner_class_types = {"standard": Standard} + class Bh(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + class Ca(StripeObject): class ProvinceStandard(StripeObject): province: str @@ -183,6 +189,12 @@ class Standard(StripeObject): """ _inner_class_types = {"standard": Standard} + class Eg(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Es(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -231,6 +243,12 @@ class Gb(StripeObject): Type of registration in `country`. """ + class Ge(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Gr(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -319,12 +337,24 @@ class Jp(StripeObject): Type of registration in `country`. """ + class Ke(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Kr(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ + class Kz(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Lt(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -393,6 +423,12 @@ class My(StripeObject): Type of registration in `country`. """ + class Ng(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Nl(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -419,6 +455,12 @@ class Nz(StripeObject): Type of registration in `country`. """ + class Om(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + class Pl(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -577,6 +619,7 @@ class Za(StripeObject): au: Optional[Au] be: Optional[Be] bg: Optional[Bg] + bh: Optional[Bh] ca: Optional[Ca] ch: Optional[Ch] cl: Optional[Cl] @@ -586,10 +629,12 @@ class Za(StripeObject): de: Optional[De] dk: Optional[Dk] ee: Optional[Ee] + eg: Optional[Eg] es: Optional[Es] fi: Optional[Fi] fr: Optional[Fr] gb: Optional[Gb] + ge: Optional[Ge] gr: Optional[Gr] hr: Optional[Hr] hu: Optional[Hu] @@ -598,16 +643,20 @@ class Za(StripeObject): is_: Optional[Is] it: Optional[It] jp: Optional[Jp] + ke: Optional[Ke] kr: Optional[Kr] + kz: Optional[Kz] lt: Optional[Lt] lu: Optional[Lu] lv: Optional[Lv] mt: Optional[Mt] mx: Optional[Mx] my: Optional[My] + ng: Optional[Ng] nl: Optional[Nl] no: Optional[No] nz: Optional[Nz] + om: Optional[Om] pl: Optional[Pl] pt: Optional[Pt] ro: Optional[Ro] @@ -627,6 +676,7 @@ class Za(StripeObject): "au": Au, "be": Be, "bg": Bg, + "bh": Bh, "ca": Ca, "ch": Ch, "cl": Cl, @@ -636,10 +686,12 @@ class Za(StripeObject): "de": De, "dk": Dk, "ee": Ee, + "eg": Eg, "es": Es, "fi": Fi, "fr": Fr, "gb": Gb, + "ge": Ge, "gr": Gr, "hr": Hr, "hu": Hu, @@ -648,16 +700,20 @@ class Za(StripeObject): "is": Is, "it": It, "jp": Jp, + "ke": Ke, "kr": Kr, + "kz": Kz, "lt": Lt, "lu": Lu, "lv": Lv, "mt": Mt, "mx": Mx, "my": My, + "ng": Ng, "nl": Nl, "no": No, "nz": Nz, + "om": Om, "pl": Pl, "pt": Pt, "ro": Ro, @@ -722,6 +778,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in BG. """ + bh: NotRequired["Registration.CreateParamsCountryOptionsBh"] + """ + Options for the registration in BH. + """ ca: NotRequired["Registration.CreateParamsCountryOptionsCa"] """ Options for the registration in CA. @@ -758,6 +818,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in EE. """ + eg: NotRequired["Registration.CreateParamsCountryOptionsEg"] + """ + Options for the registration in EG. + """ es: NotRequired["Registration.CreateParamsCountryOptionsEs"] """ Options for the registration in ES. @@ -774,6 +838,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in GB. """ + ge: NotRequired["Registration.CreateParamsCountryOptionsGe"] + """ + Options for the registration in GE. + """ gr: NotRequired["Registration.CreateParamsCountryOptionsGr"] """ Options for the registration in GR. @@ -802,10 +870,18 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in JP. """ + ke: NotRequired["Registration.CreateParamsCountryOptionsKe"] + """ + Options for the registration in KE. + """ kr: NotRequired["Registration.CreateParamsCountryOptionsKr"] """ Options for the registration in KR. """ + kz: NotRequired["Registration.CreateParamsCountryOptionsKz"] + """ + Options for the registration in KZ. + """ lt: NotRequired["Registration.CreateParamsCountryOptionsLt"] """ Options for the registration in LT. @@ -830,6 +906,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in MY. """ + ng: NotRequired["Registration.CreateParamsCountryOptionsNg"] + """ + Options for the registration in NG. + """ nl: NotRequired["Registration.CreateParamsCountryOptionsNl"] """ Options for the registration in NL. @@ -842,6 +922,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in NZ. """ + om: NotRequired["Registration.CreateParamsCountryOptionsOm"] + """ + Options for the registration in OM. + """ pl: NotRequired["Registration.CreateParamsCountryOptionsPl"] """ Options for the registration in PL. @@ -961,6 +1045,12 @@ class CreateParamsCountryOptionsBgStandard(TypedDict): Place of supply scheme used in an EU standard registration. """ + class CreateParamsCountryOptionsBh(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsCa(TypedDict): province_standard: NotRequired[ "Registration.CreateParamsCountryOptionsCaProvinceStandard" @@ -1087,6 +1177,12 @@ class CreateParamsCountryOptionsEeStandard(TypedDict): Place of supply scheme used in an EU standard registration. """ + class CreateParamsCountryOptionsEg(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsEs(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsEsStandard" @@ -1147,6 +1243,12 @@ class CreateParamsCountryOptionsGb(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsGe(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsGr(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsGrStandard" @@ -1255,12 +1357,24 @@ class CreateParamsCountryOptionsJp(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsKe(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsKr(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsKz(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsLt(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsLtStandard" @@ -1345,6 +1459,12 @@ class CreateParamsCountryOptionsMy(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsNg(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsNl(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsNlStandard" @@ -1375,6 +1495,12 @@ class CreateParamsCountryOptionsNz(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsOm(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsPl(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsPlStandard" diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index f9429be5f..538f57e8f 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -62,6 +62,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in BG. """ + bh: NotRequired["RegistrationService.CreateParamsCountryOptionsBh"] + """ + Options for the registration in BH. + """ ca: NotRequired["RegistrationService.CreateParamsCountryOptionsCa"] """ Options for the registration in CA. @@ -98,6 +102,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in EE. """ + eg: NotRequired["RegistrationService.CreateParamsCountryOptionsEg"] + """ + Options for the registration in EG. + """ es: NotRequired["RegistrationService.CreateParamsCountryOptionsEs"] """ Options for the registration in ES. @@ -114,6 +122,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in GB. """ + ge: NotRequired["RegistrationService.CreateParamsCountryOptionsGe"] + """ + Options for the registration in GE. + """ gr: NotRequired["RegistrationService.CreateParamsCountryOptionsGr"] """ Options for the registration in GR. @@ -142,10 +154,18 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in JP. """ + ke: NotRequired["RegistrationService.CreateParamsCountryOptionsKe"] + """ + Options for the registration in KE. + """ kr: NotRequired["RegistrationService.CreateParamsCountryOptionsKr"] """ Options for the registration in KR. """ + kz: NotRequired["RegistrationService.CreateParamsCountryOptionsKz"] + """ + Options for the registration in KZ. + """ lt: NotRequired["RegistrationService.CreateParamsCountryOptionsLt"] """ Options for the registration in LT. @@ -170,6 +190,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in MY. """ + ng: NotRequired["RegistrationService.CreateParamsCountryOptionsNg"] + """ + Options for the registration in NG. + """ nl: NotRequired["RegistrationService.CreateParamsCountryOptionsNl"] """ Options for the registration in NL. @@ -182,6 +206,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in NZ. """ + om: NotRequired["RegistrationService.CreateParamsCountryOptionsOm"] + """ + Options for the registration in OM. + """ pl: NotRequired["RegistrationService.CreateParamsCountryOptionsPl"] """ Options for the registration in PL. @@ -301,6 +329,12 @@ class CreateParamsCountryOptionsBgStandard(TypedDict): Place of supply scheme used in an EU standard registration. """ + class CreateParamsCountryOptionsBh(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsCa(TypedDict): province_standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsCaProvinceStandard" @@ -427,6 +461,12 @@ class CreateParamsCountryOptionsEeStandard(TypedDict): Place of supply scheme used in an EU standard registration. """ + class CreateParamsCountryOptionsEg(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsEs(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsEsStandard" @@ -487,6 +527,12 @@ class CreateParamsCountryOptionsGb(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsGe(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsGr(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsGrStandard" @@ -595,12 +641,24 @@ class CreateParamsCountryOptionsJp(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsKe(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsKr(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsKz(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsLt(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsLtStandard" @@ -685,6 +743,12 @@ class CreateParamsCountryOptionsMy(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsNg(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsNl(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsNlStandard" @@ -715,6 +779,12 @@ class CreateParamsCountryOptionsNz(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsOm(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsPl(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsPlStandard" diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index 3d9a8fb55..de586844c 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -167,6 +167,36 @@ class Reversal(StripeObject): The `id` of the reversed `Transaction` object. """ + class ShipFromDetails(StripeObject): + class Address(StripeObject): + city: Optional[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: Optional[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + """ + + address: Address + _inner_class_types = {"address": Address} + class ShippingCost(StripeObject): class TaxBreakdown(StripeObject): class Jurisdiction(StripeObject): @@ -441,6 +471,10 @@ class RetrieveParams(RequestOptions): """ If `type=reversal`, contains information about what was reversed. """ + ship_from_details: Optional[ShipFromDetails] + """ + The details of the ship from location, such as the address. + """ shipping_cost: Optional[ShippingCost] """ The shipping cost details for the transaction. @@ -657,5 +691,6 @@ async def retrieve_async( _inner_class_types = { "customer_details": CustomerDetails, "reversal": Reversal, + "ship_from_details": ShipFromDetails, "shipping_cost": ShippingCost, } From 7e563c565d1772a1be0b7d0df6dcc889f3fd5663 Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Thu, 2 May 2024 13:56:44 -0700 Subject: [PATCH 058/179] Bump version to 9.5.0 --- CHANGELOG.md | 11 +++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ae3a6a3c..c572d710c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## 9.5.0 - 2024-05-02 +* [#1317](https://github.com/stripe/stripe-python/pull/1317) Update generated code + * Add support for `paypal` on resource class `stripe.Dispute.PaymentMethodDetails` + * Add support for `payment_method_types` on parameter class `stripe.PaymentIntent.ConfirmParams` + * Add support for `ship_from_details` on parameter class `stripe.tax.Calculation.CreateParams` and resources `stripe.tax.Calculation` and `stripe.tax.Transaction` + * Add support for `bh`, `eg`, `ge`, `ke`, `kz`, `ng`, `om` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `paypal` on enum `stripe.Dispute.PaymentMethodDetails.type` + * Add support for `shipping_address_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Change type of `metadata` on `stripe.entitlements.Feature.ModifyParams` from `Dict[str, str]` to `Literal['']|Dict[str, str]` +* [#1319](https://github.com/stripe/stripe-python/pull/1319) Fix type change entries in Python Changelog + ## 9.4.0 - 2024-04-25 * [#1316](https://github.com/stripe/stripe-python/pull/1316) Update generated code * Add support for `amazon_pay` on resource classes `stripe.Mandate.PaymentMethodDetails` and `stripe.SetupAttempt.PaymentMethodDetails` diff --git a/VERSION b/VERSION index 8148c5594..d223b4510 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.4.0 +9.5.0 diff --git a/stripe/_version.py b/stripe/_version.py index e48f227b3..3a497b358 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.4.0" +VERSION = "9.5.0" From 71cf69eb5285b46f55f4ad6466cdb6e7b79ca884 Mon Sep 17 00:00:00 2001 From: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> Date: Thu, 9 May 2024 11:56:15 -0400 Subject: [PATCH 059/179] Removed deprecated parameter util (#1325) --- stripe/_util.py | 33 ----------------------------- tests/test_util.py | 52 ---------------------------------------------- 2 files changed, 85 deletions(-) diff --git a/stripe/_util.py b/stripe/_util.py index 05fd622d0..0c14b2a10 100644 --- a/stripe/_util.py +++ b/stripe/_util.py @@ -433,36 +433,3 @@ def _wrapper(*args, **kwargs): return class_method(*args, **kwargs) return _wrapper - - -def stripe_deprecate_param_inner(params: Mapping[str, Any], parts: List[str]): - cur = params - for i, part in enumerate(parts[:-1]): - if type(cur[part]) is list: - for item in cur[part]: - new_i = i + 1 - stripe_deprecate_param_inner(item, parts[new_i:]) - if part not in cur: - return - - cur = cur[part] - - deprecated_param = parts[-1] - if deprecated_param in cur: - warnings.warn( - f"The {deprecated_param} parameter is deprecated and will be removed in a future version. " - "Please refer to the changelog for more information.", - DeprecationWarning, - stacklevel=2, - ) - - -def stripe_deprecate_parameter(key): - def stripe_deprecate_param_decorator(original_function): - def stripe_deprecate_param(params, *args, **kwargs): - stripe_deprecate_param_inner(params, key.split(".")) - return original_function(params=params, *args, **kwargs) - - return stripe_deprecate_param - - return stripe_deprecate_param_decorator diff --git a/tests/test_util.py b/tests/test_util.py index 8b9880d16..df045a749 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -3,8 +3,6 @@ import stripe from stripe import util -import pytest -import warnings LogTestCase = namedtuple("LogTestCase", "env flag should_output") FmtTestCase = namedtuple("FmtTestCase", "props expected") @@ -152,53 +150,3 @@ def test_convert_to_stripe_object_and_back(self): def test_sanitize_id(self): sanitized_id = util.sanitize_id("cu %x 123") assert sanitized_id == "cu++%25x+123" - - def test_stripe_deprecate_parameter(self): - @util.stripe_deprecate_parameter("foo") - def to_be_decorated(**params): - pass - - with warnings.catch_warnings(): - warnings.simplefilter("error") - to_be_decorated(params={}) - - # assert that warnings.warn was called appropriately - with pytest.warns(DeprecationWarning): - to_be_decorated(params={"foo": True}) - - with warnings.catch_warnings(): - warnings.simplefilter("error") - to_be_decorated(params={}) - - @util.stripe_deprecate_parameter("bar") - def to_be_decorated_non_existant_key(**params): - pass - - with warnings.catch_warnings(): - warnings.simplefilter("error") - to_be_decorated_non_existant_key(params={"foo": True}) - - @util.stripe_deprecate_parameter("") - def to_be_decorated_empty_key(**params): - pass - - with warnings.catch_warnings(): - warnings.simplefilter("error") - to_be_decorated_empty_key(params={"foo": True}) - - def test_stripe_deprecate_param_nested(self): - @util.stripe_deprecate_parameter("foo.bar") - def to_be_decorated_foo_bar(**params): - pass - - with pytest.warns(DeprecationWarning): - to_be_decorated_foo_bar(params={"foo": {"bar": True}}) - - @util.stripe_deprecate_parameter("custom_fields.name") - def to_be_decorated_custom_fields_name(**params): - pass - - with pytest.warns(DeprecationWarning): - to_be_decorated_custom_fields_name( - params={"custom_fields": [{"name": "blah"}]} - ) From 0a61e789e0078d180577c2e21211abb161e2bdc3 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 19:25:43 +0000 Subject: [PATCH 060/179] Update generated code (#1323) * Update generated code for v1010 * Update generated code for v1011 * Update generated code for v1012 * Update generated code for v1013 * Update generated code for v1014 * Update generated code for v1015 * Update generated code for v1016 * Update generated code for v1017 * Update generated code for v1019 * Update generated code for v1020 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 8 +- stripe/_account_service.py | 12 +- stripe/_capability.py | 4 +- stripe/_confirmation_token.py | 4 + stripe/_credit_note.py | 4 +- stripe/_credit_note_line_item_service.py | 4 +- stripe/_event.py | 2 + stripe/_invoice.py | 12 ++ stripe/_invoice_item.py | 2 +- stripe/_invoice_item_service.py | 2 +- stripe/_invoice_service.py | 8 + stripe/_invoice_upcoming_lines_service.py | 4 + stripe/_payment_method.py | 4 + stripe/_token.py | 6 +- stripe/_token_service.py | 6 +- stripe/_webhook_endpoint.py | 4 + stripe/_webhook_endpoint_service.py | 4 + stripe/checkout/_session.py | 4 +- stripe/checkout/_session_service.py | 2 +- .../treasury/_outbound_payment_service.py | 92 ++++++++- .../treasury/_outbound_transfer_service.py | 90 +++++++++ stripe/treasury/_outbound_payment.py | 184 ++++++++++++++++- stripe/treasury/_outbound_transfer.py | 188 ++++++++++++++++++ 24 files changed, 621 insertions(+), 31 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index cb70129c3..280e945f8 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1008 \ No newline at end of file +v1020 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 431dfc556..7ec40b628 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -2234,13 +2234,13 @@ class CreateParamsIndividual(TypedDict): """ address_kana: NotRequired["Account.CreateParamsIndividualAddressKana"] """ - The Kana variation of the the individual's primary address (Japan only). + The Kana variation of the individual's primary address (Japan only). """ address_kanji: NotRequired[ "Account.CreateParamsIndividualAddressKanji" ] """ - The Kanji variation of the the individual's primary address (Japan only). + The Kanji variation of the individual's primary address (Japan only). """ dob: NotRequired["Literal['']|Account.CreateParamsIndividualDob"] """ @@ -2256,7 +2256,7 @@ class CreateParamsIndividual(TypedDict): """ first_name_kana: NotRequired[str] """ - The Kana variation of the the individual's first name (Japan only). + The Kana variation of the individual's first name (Japan only). """ first_name_kanji: NotRequired[str] """ @@ -3757,7 +3757,7 @@ class RetrievePersonParams(RequestOptions): """ details_submitted: Optional[bool] """ - Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. + Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. Accounts where this is false should be directed to [an onboarding flow](https://stripe.com/connect/onboarding) to finish submitting account details. """ email: Optional[str] """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 2c483cf5c..b7c53e47b 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -1083,13 +1083,13 @@ class CreateParamsIndividual(TypedDict): "AccountService.CreateParamsIndividualAddressKana" ] """ - The Kana variation of the the individual's primary address (Japan only). + The Kana variation of the individual's primary address (Japan only). """ address_kanji: NotRequired[ "AccountService.CreateParamsIndividualAddressKanji" ] """ - The Kanji variation of the the individual's primary address (Japan only). + The Kanji variation of the individual's primary address (Japan only). """ dob: NotRequired[ "Literal['']|AccountService.CreateParamsIndividualDob" @@ -1107,7 +1107,7 @@ class CreateParamsIndividual(TypedDict): """ first_name_kana: NotRequired[str] """ - The Kana variation of the the individual's first name (Japan only). + The Kana variation of the individual's first name (Japan only). """ first_name_kanji: NotRequired[str] """ @@ -2647,13 +2647,13 @@ class UpdateParamsIndividual(TypedDict): "AccountService.UpdateParamsIndividualAddressKana" ] """ - The Kana variation of the the individual's primary address (Japan only). + The Kana variation of the individual's primary address (Japan only). """ address_kanji: NotRequired[ "AccountService.UpdateParamsIndividualAddressKanji" ] """ - The Kanji variation of the the individual's primary address (Japan only). + The Kanji variation of the individual's primary address (Japan only). """ dob: NotRequired[ "Literal['']|AccountService.UpdateParamsIndividualDob" @@ -2671,7 +2671,7 @@ class UpdateParamsIndividual(TypedDict): """ first_name_kana: NotRequired[str] """ - The Kana variation of the the individual's first name (Japan only). + The Kana variation of the individual's first name (Japan only). """ first_name_kanji: NotRequired[str] """ diff --git a/stripe/_capability.py b/stripe/_capability.py index d365fc781..8e800be8f 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -294,13 +294,11 @@ class Error(StripeObject): """ disabled_reason: Optional[str] """ - If the capability is disabled, this string describes why. Can be `requirements.fields_needed`, `pending.onboarding`, `pending.review`, `rejected.fraud`, `rejected.other`, `platform_paused`, `action_required.requested_capabilities`, `rejected.inactivty`, or `rejected.unsupported_business`. + If the capability is disabled, this string describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). Can be `requirements.fields_needed`, `pending.onboarding`, `pending.review`, `rejected.other`, `platform_paused`, `rejected.inactivty`, or `rejected.unsupported_business`. `rejected.unsupported_business` means that the account's business is not supported by the capability. For example, payment methods may restrict the businesses they support in their terms of service, such as in [Afterpay Clearpay's terms of service](https://stripe.com/afterpay-clearpay/legal#restricted-businesses). `rejected.inactivity` means that the capability has been paused for inactivity. This disabled reason currently only applies to the Issuing capability. See [Issuing: Managing Inactive Connects](https://support.stripe.com/questions/issuing-managing-inactive-connect-accounts) for more details. - - If you believe that a rejection is in error, please contact support at https://support.stripe.com/contact/ for assistance. """ errors: List[Error] """ diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 10e6c25f6..7d2b24833 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -1014,6 +1014,10 @@ class Zip(StripeObject): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + allow_redisplay: Optional[Literal["always", "limited", "unspecified"]] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. + """ amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 90d00a1ed..8b82defcc 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -1079,7 +1079,7 @@ def list_lines( cls, credit_note: str, **params: Unpack["CreditNote.ListLinesParams"] ) -> ListObject["CreditNoteLineItem"]: """ - When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["CreditNoteLineItem"], @@ -1097,7 +1097,7 @@ async def list_lines_async( cls, credit_note: str, **params: Unpack["CreditNote.ListLinesParams"] ) -> ListObject["CreditNoteLineItem"]: """ - When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["CreditNoteLineItem"], diff --git a/stripe/_credit_note_line_item_service.py b/stripe/_credit_note_line_item_service.py index 2baa2f65f..094bd3057 100644 --- a/stripe/_credit_note_line_item_service.py +++ b/stripe/_credit_note_line_item_service.py @@ -35,7 +35,7 @@ def list( options: RequestOptions = {}, ) -> ListObject[CreditNoteLineItem]: """ - When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[CreditNoteLineItem], @@ -58,7 +58,7 @@ async def list_async( options: RequestOptions = {}, ) -> ListObject[CreditNoteLineItem]: """ - When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[CreditNoteLineItem], diff --git a/stripe/_event.py b/stripe/_event.py index 53297eb5e..d520d8e7b 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -373,12 +373,14 @@ class RetrieveParams(RequestOptions): "treasury.outbound_payment.failed", "treasury.outbound_payment.posted", "treasury.outbound_payment.returned", + "treasury.outbound_payment.tracking_details_updated", "treasury.outbound_transfer.canceled", "treasury.outbound_transfer.created", "treasury.outbound_transfer.expected_arrival_date_updated", "treasury.outbound_transfer.failed", "treasury.outbound_transfer.posted", "treasury.outbound_transfer.returned", + "treasury.outbound_transfer.tracking_details_updated", "treasury.received_credit.created", "treasury.received_credit.failed", "treasury.received_credit.succeeded", diff --git a/stripe/_invoice.py b/stripe/_invoice.py index e7878e018..752322abd 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -1640,6 +1640,10 @@ class CreatePreviewParams(RequestOptions): """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ + preview_mode: NotRequired[Literal["next", "recurring"]] + """ + Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. + """ schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. @@ -3355,6 +3359,10 @@ class UpcomingLinesParams(RequestOptions): """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ + preview_mode: NotRequired[Literal["next", "recurring"]] + """ + Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. + """ schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. @@ -4489,6 +4497,10 @@ class UpcomingParams(RequestOptions): """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ + preview_mode: NotRequired[Literal["next", "recurring"]] + """ + Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. + """ schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index 1155d1aa3..cc7ade7ed 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -118,7 +118,7 @@ class CreateParams(RequestOptions): """ subscription: NotRequired[str] """ - The ID of a subscription to add this invoice item to. When left blank, the invoice item will be be added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. + The ID of a subscription to add this invoice item to. When left blank, the invoice item is added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] diff --git a/stripe/_invoice_item_service.py b/stripe/_invoice_item_service.py index 07631cfb9..f1f2cf8d0 100644 --- a/stripe/_invoice_item_service.py +++ b/stripe/_invoice_item_service.py @@ -67,7 +67,7 @@ class CreateParams(TypedDict): """ subscription: NotRequired[str] """ - The ID of a subscription to add this invoice item to. When left blank, the invoice item will be be added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. + The ID of a subscription to add this invoice item to. When left blank, the invoice item is added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index ad307742d..592abf248 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -676,6 +676,10 @@ class CreatePreviewParams(TypedDict): """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ + preview_mode: NotRequired[Literal["next", "recurring"]] + """ + Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. + """ schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. @@ -1812,6 +1816,10 @@ class UpcomingParams(TypedDict): """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ + preview_mode: NotRequired[Literal["next", "recurring"]] + """ + Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. + """ schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index bd9ef2048..ca4b3665d 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -66,6 +66,10 @@ class ListParams(TypedDict): """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ + preview_mode: NotRequired[Literal["next", "recurring"]] + """ + Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. + """ schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index c4d96a23e..676a4d8c9 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -1802,6 +1802,10 @@ class RetrieveParams(RequestOptions): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + allow_redisplay: Optional[Literal["always", "limited", "unspecified"]] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. + """ amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] diff --git a/stripe/_token.py b/stripe/_token.py index 8da78239c..3b1dd5358 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -315,13 +315,13 @@ class CreateParamsAccountIndividual(TypedDict): "Token.CreateParamsAccountIndividualAddressKana" ] """ - The Kana variation of the the individual's primary address (Japan only). + The Kana variation of the individual's primary address (Japan only). """ address_kanji: NotRequired[ "Token.CreateParamsAccountIndividualAddressKanji" ] """ - The Kanji variation of the the individual's primary address (Japan only). + The Kanji variation of the individual's primary address (Japan only). """ dob: NotRequired["Literal['']|Token.CreateParamsAccountIndividualDob"] """ @@ -337,7 +337,7 @@ class CreateParamsAccountIndividual(TypedDict): """ first_name_kana: NotRequired[str] """ - The Kana variation of the the individual's first name (Japan only). + The Kana variation of the individual's first name (Japan only). """ first_name_kanji: NotRequired[str] """ diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 445eeb773..dae80cd3f 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -284,13 +284,13 @@ class CreateParamsAccountIndividual(TypedDict): "TokenService.CreateParamsAccountIndividualAddressKana" ] """ - The Kana variation of the the individual's primary address (Japan only). + The Kana variation of the individual's primary address (Japan only). """ address_kanji: NotRequired[ "TokenService.CreateParamsAccountIndividualAddressKanji" ] """ - The Kanji variation of the the individual's primary address (Japan only). + The Kanji variation of the individual's primary address (Japan only). """ dob: NotRequired[ "Literal['']|TokenService.CreateParamsAccountIndividualDob" @@ -308,7 +308,7 @@ class CreateParamsAccountIndividual(TypedDict): """ first_name_kana: NotRequired[str] """ - The Kana variation of the the individual's first name (Japan only). + The Kana variation of the individual's first name (Japan only). """ first_name_kanji: NotRequired[str] """ diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 59d21d78f..a31b96569 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -366,12 +366,14 @@ class CreateParams(RequestOptions): "treasury.outbound_payment.failed", "treasury.outbound_payment.posted", "treasury.outbound_payment.returned", + "treasury.outbound_payment.tracking_details_updated", "treasury.outbound_transfer.canceled", "treasury.outbound_transfer.created", "treasury.outbound_transfer.expected_arrival_date_updated", "treasury.outbound_transfer.failed", "treasury.outbound_transfer.posted", "treasury.outbound_transfer.returned", + "treasury.outbound_transfer.tracking_details_updated", "treasury.received_credit.created", "treasury.received_credit.failed", "treasury.received_credit.succeeded", @@ -645,12 +647,14 @@ class ModifyParams(RequestOptions): "treasury.outbound_payment.failed", "treasury.outbound_payment.posted", "treasury.outbound_payment.returned", + "treasury.outbound_payment.tracking_details_updated", "treasury.outbound_transfer.canceled", "treasury.outbound_transfer.created", "treasury.outbound_transfer.expected_arrival_date_updated", "treasury.outbound_transfer.failed", "treasury.outbound_transfer.posted", "treasury.outbound_transfer.returned", + "treasury.outbound_transfer.tracking_details_updated", "treasury.received_credit.created", "treasury.received_credit.failed", "treasury.received_credit.succeeded", diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index a45d35338..2d1c7513a 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -347,12 +347,14 @@ class CreateParams(TypedDict): "treasury.outbound_payment.failed", "treasury.outbound_payment.posted", "treasury.outbound_payment.returned", + "treasury.outbound_payment.tracking_details_updated", "treasury.outbound_transfer.canceled", "treasury.outbound_transfer.created", "treasury.outbound_transfer.expected_arrival_date_updated", "treasury.outbound_transfer.failed", "treasury.outbound_transfer.posted", "treasury.outbound_transfer.returned", + "treasury.outbound_transfer.tracking_details_updated", "treasury.received_credit.created", "treasury.received_credit.failed", "treasury.received_credit.succeeded", @@ -632,12 +634,14 @@ class UpdateParams(TypedDict): "treasury.outbound_payment.failed", "treasury.outbound_payment.posted", "treasury.outbound_payment.returned", + "treasury.outbound_payment.tracking_details_updated", "treasury.outbound_transfer.canceled", "treasury.outbound_transfer.created", "treasury.outbound_transfer.expected_arrival_date_updated", "treasury.outbound_transfer.failed", "treasury.outbound_transfer.posted", "treasury.outbound_transfer.returned", + "treasury.outbound_transfer.tracking_details_updated", "treasury.received_credit.created", "treasury.received_credit.failed", "treasury.received_credit.succeeded", diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 0c4afc0b3..7b5c9d337 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1066,7 +1066,7 @@ class SavedPaymentMethodOptions(StripeObject): """ payment_method_save: Optional[Literal["disabled", "enabled"]] """ - Enable customers to choose if they wish to save their payment method for future use. + Enable customers to choose if they wish to save their payment method for future use. Disabled by default. """ class ShippingAddressCollection(StripeObject): @@ -3101,7 +3101,7 @@ class CreateParamsSavedPaymentMethodOptions(TypedDict): """ payment_method_save: NotRequired[Literal["disabled", "enabled"]] """ - Enable customers to choose if they wish to save their payment method for future use. + Enable customers to choose if they wish to save their payment method for future use. Disabled by default. """ class CreateParamsSetupIntentData(TypedDict): diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 38e2d1460..05cff7d09 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -1653,7 +1653,7 @@ class CreateParamsSavedPaymentMethodOptions(TypedDict): """ payment_method_save: NotRequired[Literal["disabled", "enabled"]] """ - Enable customers to choose if they wish to save their payment method for future use. + Enable customers to choose if they wish to save their payment method for future use. Disabled by default. """ class CreateParamsSetupIntentData(TypedDict): diff --git a/stripe/test_helpers/treasury/_outbound_payment_service.py b/stripe/test_helpers/treasury/_outbound_payment_service.py index 2506837af..754c7cba2 100644 --- a/stripe/test_helpers/treasury/_outbound_payment_service.py +++ b/stripe/test_helpers/treasury/_outbound_payment_service.py @@ -30,7 +30,7 @@ class ReturnOutboundPaymentParams(TypedDict): "OutboundPaymentService.ReturnOutboundPaymentParamsReturnedDetails" ] """ - Optional hash to set the the return code. + Optional hash to set the return code. """ class ReturnOutboundPaymentParamsReturnedDetails(TypedDict): @@ -52,6 +52,96 @@ class ReturnOutboundPaymentParamsReturnedDetails(TypedDict): The return code to be set on the OutboundPayment object. """ + class UpdateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + tracking_details: "OutboundPaymentService.UpdateParamsTrackingDetails" + """ + Details about network-specific tracking information. + """ + + class UpdateParamsTrackingDetails(TypedDict): + ach: NotRequired[ + "OutboundPaymentService.UpdateParamsTrackingDetailsAch" + ] + """ + ACH network tracking details. + """ + type: Literal["ach", "us_domestic_wire"] + """ + The US bank account network used to send funds. + """ + us_domestic_wire: NotRequired[ + "OutboundPaymentService.UpdateParamsTrackingDetailsUsDomesticWire" + ] + """ + US domestic wire network tracking details. + """ + + class UpdateParamsTrackingDetailsAch(TypedDict): + trace_id: str + """ + ACH trace ID for funds sent over the `ach` network. + """ + + class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): + imad: NotRequired[str] + """ + IMAD for funds sent over the `us_domestic_wire` network. + """ + omad: NotRequired[str] + """ + OMAD for funds sent over the `us_domestic_wire` network. + """ + + def update( + self, + id: str, + params: "OutboundPaymentService.UpdateParams", + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. + """ + return cast( + OutboundPayment, + self._request( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: "OutboundPaymentService.UpdateParams", + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. + """ + return cast( + OutboundPayment, + await self._request_async( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}".format( + id=sanitize_id(id), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def fail( self, id: str, diff --git a/stripe/test_helpers/treasury/_outbound_transfer_service.py b/stripe/test_helpers/treasury/_outbound_transfer_service.py index a16ae3792..6bc5760bb 100644 --- a/stripe/test_helpers/treasury/_outbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_outbound_transfer_service.py @@ -52,6 +52,96 @@ class ReturnOutboundTransferParamsReturnedDetails(TypedDict): Reason for the return. """ + class UpdateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + tracking_details: "OutboundTransferService.UpdateParamsTrackingDetails" + """ + Details about network-specific tracking information. + """ + + class UpdateParamsTrackingDetails(TypedDict): + ach: NotRequired[ + "OutboundTransferService.UpdateParamsTrackingDetailsAch" + ] + """ + ACH network tracking details. + """ + type: Literal["ach", "us_domestic_wire"] + """ + The US bank account network used to send funds. + """ + us_domestic_wire: NotRequired[ + "OutboundTransferService.UpdateParamsTrackingDetailsUsDomesticWire" + ] + """ + US domestic wire network tracking details. + """ + + class UpdateParamsTrackingDetailsAch(TypedDict): + trace_id: str + """ + ACH trace ID for funds sent over the `ach` network. + """ + + class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): + imad: NotRequired[str] + """ + IMAD for funds sent over the `us_domestic_wire` network. + """ + omad: NotRequired[str] + """ + OMAD for funds sent over the `us_domestic_wire` network. + """ + + def update( + self, + outbound_transfer: str, + params: "OutboundTransferService.UpdateParams", + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. + """ + return cast( + OutboundTransfer, + self._request( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( + outbound_transfer=sanitize_id(outbound_transfer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + outbound_transfer: str, + params: "OutboundTransferService.UpdateParams", + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. + """ + return cast( + OutboundTransfer, + await self._request_async( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( + outbound_transfer=sanitize_id(outbound_transfer), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def fail( self, outbound_transfer: str, diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index c843c9866..7ad22009c 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -182,6 +182,31 @@ class StatusTransitions(StripeObject): Timestamp describing when an OutboundPayment changed status to `returned`. """ + class TrackingDetails(StripeObject): + class Ach(StripeObject): + trace_id: str + """ + ACH trace ID of the OutboundPayment for payments sent over the `ach` network. + """ + + class UsDomesticWire(StripeObject): + imad: str + """ + IMAD of the OutboundPayment for payments sent over the `us_domestic_wire` network. + """ + omad: Optional[str] + """ + OMAD of the OutboundPayment for payments sent over the `us_domestic_wire` network. + """ + + ach: Optional[Ach] + type: Literal["ach", "us_domestic_wire"] + """ + The US bank account network used to send funds. + """ + us_domestic_wire: Optional[UsDomesticWire] + _inner_class_types = {"ach": Ach, "us_domestic_wire": UsDomesticWire} + class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -445,7 +470,7 @@ class ReturnOutboundPaymentParams(RequestOptions): "OutboundPayment.ReturnOutboundPaymentParamsReturnedDetails" ] """ - Optional hash to set the the return code. + Optional hash to set the return code. """ class ReturnOutboundPaymentParamsReturnedDetails(TypedDict): @@ -467,6 +492,48 @@ class ReturnOutboundPaymentParamsReturnedDetails(TypedDict): The return code to be set on the OutboundPayment object. """ + class UpdateParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + tracking_details: "OutboundPayment.UpdateParamsTrackingDetails" + """ + Details about network-specific tracking information. + """ + + class UpdateParamsTrackingDetails(TypedDict): + ach: NotRequired["OutboundPayment.UpdateParamsTrackingDetailsAch"] + """ + ACH network tracking details. + """ + type: Literal["ach", "us_domestic_wire"] + """ + The US bank account network used to send funds. + """ + us_domestic_wire: NotRequired[ + "OutboundPayment.UpdateParamsTrackingDetailsUsDomesticWire" + ] + """ + US domestic wire network tracking details. + """ + + class UpdateParamsTrackingDetailsAch(TypedDict): + trace_id: str + """ + ACH trace ID for funds sent over the `ach` network. + """ + + class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): + imad: NotRequired[str] + """ + IMAD for funds sent over the `us_domestic_wire` network. + """ + omad: NotRequired[str] + """ + OMAD for funds sent over the `us_domestic_wire` network. + """ + amount: int """ Amount (in cents) transferred. @@ -546,6 +613,10 @@ class ReturnOutboundPaymentParamsReturnedDetails(TypedDict): Current status of the OutboundPayment: `processing`, `failed`, `posted`, `returned`, `canceled`. An OutboundPayment is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundPayment has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundPayment fails to arrive at its destination, its status will change to `returned`. """ status_transitions: StatusTransitions + tracking_details: Optional[TrackingDetails] + """ + Details about network-specific tracking information if available. + """ transaction: ExpandableField["Transaction"] """ The Transaction associated with this object. @@ -1100,6 +1171,116 @@ async def return_outbound_payment_async( # pyright: ignore[reportGeneralTypeIss ), ) + @classmethod + def _cls_update( + cls, id: str, **params: Unpack["OutboundPayment.UpdateParams"] + ) -> "OutboundPayment": + """ + Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. + """ + return cast( + "OutboundPayment", + cls._static_request( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def update( + id: str, **params: Unpack["OutboundPayment.UpdateParams"] + ) -> "OutboundPayment": + """ + Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. + """ + ... + + @overload + def update( + self, **params: Unpack["OutboundPayment.UpdateParams"] + ) -> "OutboundPayment": + """ + Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. + """ + ... + + @class_method_variant("_cls_update") + def update( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OutboundPayment.UpdateParams"] + ) -> "OutboundPayment": + """ + Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. + """ + return cast( + "OutboundPayment", + self.resource._request( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}".format( + id=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_update_async( + cls, id: str, **params: Unpack["OutboundPayment.UpdateParams"] + ) -> "OutboundPayment": + """ + Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. + """ + return cast( + "OutboundPayment", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def update_async( + id: str, **params: Unpack["OutboundPayment.UpdateParams"] + ) -> "OutboundPayment": + """ + Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. + """ + ... + + @overload + async def update_async( + self, **params: Unpack["OutboundPayment.UpdateParams"] + ) -> "OutboundPayment": + """ + Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. + """ + ... + + @class_method_variant("_cls_update_async") + async def update_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OutboundPayment.UpdateParams"] + ) -> "OutboundPayment": + """ + Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. + """ + return cast( + "OutboundPayment", + await self.resource._request_async( + "post", + "/v1/test_helpers/treasury/outbound_payments/{id}".format( + id=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) @@ -1109,6 +1290,7 @@ def test_helpers(self): "end_user_details": EndUserDetails, "returned_details": ReturnedDetails, "status_transitions": StatusTransitions, + "tracking_details": TrackingDetails, } diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index b78f668eb..9aa024b1f 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -160,6 +160,31 @@ class StatusTransitions(StripeObject): Timestamp describing when an OutboundTransfer changed status to `returned` """ + class TrackingDetails(StripeObject): + class Ach(StripeObject): + trace_id: str + """ + ACH trace ID of the OutboundTransfer for transfers sent over the `ach` network. + """ + + class UsDomesticWire(StripeObject): + imad: str + """ + IMAD of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. + """ + omad: Optional[str] + """ + OMAD of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. + """ + + ach: Optional[Ach] + type: Literal["ach", "us_domestic_wire"] + """ + The US bank account network used to send funds. + """ + us_domestic_wire: Optional[UsDomesticWire] + _inner_class_types = {"ach": Ach, "us_domestic_wire": UsDomesticWire} + class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -297,6 +322,48 @@ class ReturnOutboundTransferParamsReturnedDetails(TypedDict): Reason for the return. """ + class UpdateParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + tracking_details: "OutboundTransfer.UpdateParamsTrackingDetails" + """ + Details about network-specific tracking information. + """ + + class UpdateParamsTrackingDetails(TypedDict): + ach: NotRequired["OutboundTransfer.UpdateParamsTrackingDetailsAch"] + """ + ACH network tracking details. + """ + type: Literal["ach", "us_domestic_wire"] + """ + The US bank account network used to send funds. + """ + us_domestic_wire: NotRequired[ + "OutboundTransfer.UpdateParamsTrackingDetailsUsDomesticWire" + ] + """ + US domestic wire network tracking details. + """ + + class UpdateParamsTrackingDetailsAch(TypedDict): + trace_id: str + """ + ACH trace ID for funds sent over the `ach` network. + """ + + class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): + imad: NotRequired[str] + """ + IMAD for funds sent over the `us_domestic_wire` network. + """ + omad: NotRequired[str] + """ + OMAD for funds sent over the `us_domestic_wire` network. + """ + amount: int """ Amount (in cents) transferred. @@ -363,6 +430,10 @@ class ReturnOutboundTransferParamsReturnedDetails(TypedDict): Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. An OutboundTransfer is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. """ status_transitions: StatusTransitions + tracking_details: Optional[TrackingDetails] + """ + Details about network-specific tracking information if available. + """ transaction: ExpandableField["Transaction"] """ The Transaction associated with this object. @@ -935,6 +1006,122 @@ async def return_outbound_transfer_async( # pyright: ignore[reportGeneralTypeIs ), ) + @classmethod + def _cls_update( + cls, + outbound_transfer: str, + **params: Unpack["OutboundTransfer.UpdateParams"] + ) -> "OutboundTransfer": + """ + Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. + """ + return cast( + "OutboundTransfer", + cls._static_request( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( + outbound_transfer=sanitize_id(outbound_transfer) + ), + params=params, + ), + ) + + @overload + @staticmethod + def update( + outbound_transfer: str, + **params: Unpack["OutboundTransfer.UpdateParams"] + ) -> "OutboundTransfer": + """ + Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. + """ + ... + + @overload + def update( + self, **params: Unpack["OutboundTransfer.UpdateParams"] + ) -> "OutboundTransfer": + """ + Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. + """ + ... + + @class_method_variant("_cls_update") + def update( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OutboundTransfer.UpdateParams"] + ) -> "OutboundTransfer": + """ + Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. + """ + return cast( + "OutboundTransfer", + self.resource._request( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( + outbound_transfer=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_update_async( + cls, + outbound_transfer: str, + **params: Unpack["OutboundTransfer.UpdateParams"] + ) -> "OutboundTransfer": + """ + Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. + """ + return cast( + "OutboundTransfer", + await cls._static_request_async( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( + outbound_transfer=sanitize_id(outbound_transfer) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def update_async( + outbound_transfer: str, + **params: Unpack["OutboundTransfer.UpdateParams"] + ) -> "OutboundTransfer": + """ + Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. + """ + ... + + @overload + async def update_async( + self, **params: Unpack["OutboundTransfer.UpdateParams"] + ) -> "OutboundTransfer": + """ + Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. + """ + ... + + @class_method_variant("_cls_update_async") + async def update_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OutboundTransfer.UpdateParams"] + ) -> "OutboundTransfer": + """ + Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. + """ + return cast( + "OutboundTransfer", + await self.resource._request_async( + "post", + "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( + outbound_transfer=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) @@ -943,6 +1130,7 @@ def test_helpers(self): "destination_payment_method_details": DestinationPaymentMethodDetails, "returned_details": ReturnedDetails, "status_transitions": StatusTransitions, + "tracking_details": TrackingDetails, } From aea13b317c95a712aa86396fd7d163c66eb74268 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 9 May 2024 12:40:13 -0700 Subject: [PATCH 061/179] Bump version to 9.6.0 --- CHANGELOG.md | 46 ++++++++++++++++++++++++++++------------------ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c572d710c..d0d3a85cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,27 +1,37 @@ +## 9.6.0 - 2024-05-09 +* [#1323](https://github.com/stripe/stripe-python/pull/1323) Update generated code + * Add support for `allow_redisplay` on resource class `stripe.ConfirmationToken.PaymentMethodPreview` and resource `stripe.PaymentMethod` + * Add support for `preview_mode` on parameter classes `stripe.Invoice.CreatePreviewParams`, `stripe.Invoice.UpcomingLinesParams`, and `stripe.Invoice.UpcomingParams` + * Add support for `_cls_update` on resources `stripe.treasury.OutboundPayment` and `stripe.treasury.OutboundTransfer` + * Add support for `tracking_details` on resources `stripe.treasury.OutboundPayment` and `stripe.treasury.OutboundTransfer` + * Add support for `update` on resources `stripe.treasury.OutboundPayment` and `stripe.treasury.OutboundTransfer` + * Add support for `treasury.outbound_payment.tracking_details_updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `treasury.outbound_transfer.tracking_details_updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + ## 9.5.0 - 2024-05-02 * [#1317](https://github.com/stripe/stripe-python/pull/1317) Update generated code - * Add support for `paypal` on resource class `stripe.Dispute.PaymentMethodDetails` - * Add support for `payment_method_types` on parameter class `stripe.PaymentIntent.ConfirmParams` - * Add support for `ship_from_details` on parameter class `stripe.tax.Calculation.CreateParams` and resources `stripe.tax.Calculation` and `stripe.tax.Transaction` - * Add support for `bh`, `eg`, `ge`, `ke`, `kz`, `ng`, `om` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` - * Add support for `paypal` on enum `stripe.Dispute.PaymentMethodDetails.type` - * Add support for `shipping_address_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` - * Change type of `metadata` on `stripe.entitlements.Feature.ModifyParams` from `Dict[str, str]` to `Literal['']|Dict[str, str]` + * Add support for `paypal` on resource class `stripe.Dispute.PaymentMethodDetails` + * Add support for `payment_method_types` on parameter class `stripe.PaymentIntent.ConfirmParams` + * Add support for `ship_from_details` on parameter class `stripe.tax.Calculation.CreateParams` and resources `stripe.tax.Calculation` and `stripe.tax.Transaction` + * Add support for `bh`, `eg`, `ge`, `ke`, `kz`, `ng`, `om` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `paypal` on enum `stripe.Dispute.PaymentMethodDetails.type` + * Add support for `shipping_address_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Change type of `metadata` on `stripe.entitlements.Feature.ModifyParams` from `Dict[str, str]` to `Literal['']|Dict[str, str]` * [#1319](https://github.com/stripe/stripe-python/pull/1319) Fix type change entries in Python Changelog ## 9.4.0 - 2024-04-25 * [#1316](https://github.com/stripe/stripe-python/pull/1316) Update generated code - * Add support for `amazon_pay` on resource classes `stripe.Mandate.PaymentMethodDetails` and `stripe.SetupAttempt.PaymentMethodDetails` - * Add support for `revolut_pay` on resource classes `stripe.Mandate.PaymentMethodDetails` and `stripe.SetupAttempt.PaymentMethodDetails` - * Add support for `setup_future_usage` on resource classes `stripe.PaymentIntent.PaymentMethodOptions.AmazonPay`, `stripe.PaymentIntent.PaymentMethodOptions.RevolutPay`, `stripe.checkout.Session.PaymentMethodOptions.AmazonPay`, and `stripe.checkout.Session.PaymentMethodOptions.RevolutPay` - * Add support for `mobilepay` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` - * Add support for `ending_before` on parameter class `stripe.PaymentMethodConfiguration.ListParams` - * Add support for `limit` on parameter class `stripe.PaymentMethodConfiguration.ListParams` - * Add support for `starting_after` on parameter class `stripe.PaymentMethodConfiguration.ListParams` - * Change type of `feature` on `stripe.entitlements.ActiveEntitlement` from `str` to `ExpandableField[Feature]` - * Add support for `amazon_pay` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` - * Add support for `revolut_pay` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` - * Remove support for inadvertently released identity verification features `email` and `phone` on parameter classes `stripe.identity.VerificationSession.CreateParamsOptions` and `stripe.identity.VerificationSession.ModifyParamsOptions` + * Add support for `amazon_pay` on resource classes `stripe.Mandate.PaymentMethodDetails` and `stripe.SetupAttempt.PaymentMethodDetails` + * Add support for `revolut_pay` on resource classes `stripe.Mandate.PaymentMethodDetails` and `stripe.SetupAttempt.PaymentMethodDetails` + * Add support for `setup_future_usage` on resource classes `stripe.PaymentIntent.PaymentMethodOptions.AmazonPay`, `stripe.PaymentIntent.PaymentMethodOptions.RevolutPay`, `stripe.checkout.Session.PaymentMethodOptions.AmazonPay`, and `stripe.checkout.Session.PaymentMethodOptions.RevolutPay` + * Add support for `mobilepay` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` + * Add support for `ending_before` on parameter class `stripe.PaymentMethodConfiguration.ListParams` + * Add support for `limit` on parameter class `stripe.PaymentMethodConfiguration.ListParams` + * Add support for `starting_after` on parameter class `stripe.PaymentMethodConfiguration.ListParams` + * Change type of `feature` on `stripe.entitlements.ActiveEntitlement` from `str` to `ExpandableField[Feature]` + * Add support for `amazon_pay` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Add support for `revolut_pay` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Remove support for inadvertently released identity verification features `email` and `phone` on parameter classes `stripe.identity.VerificationSession.CreateParamsOptions` and `stripe.identity.VerificationSession.ModifyParamsOptions` * [#1307](https://github.com/stripe/stripe-python/pull/1307) Bump aiohttp from 3.9.2 to 3.9.4 ## 9.3.0 - 2024-04-18 diff --git a/VERSION b/VERSION index d223b4510..7b0680f4e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.5.0 +9.6.0 diff --git a/stripe/_version.py b/stripe/_version.py index 3a497b358..bace651be 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.5.0" +VERSION = "9.6.0" From 287c85d98b6b8bcbe07332eb5e8cafb8d886ffa2 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Thu, 9 May 2024 15:20:40 -0700 Subject: [PATCH 062/179] Add lint rule to ensure `async` functions are named `X_async` (#1326) add lint rule to ensure async functions are named X_async --- .flake8 | 3 ++- flake8_stripe/flake8_stripe.py | 27 +++++++++++++++++++++++++++ stripe/_stripe_response.py | 3 ++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index a5f814528..65fd3e81c 100644 --- a/.flake8 +++ b/.flake8 @@ -9,7 +9,7 @@ per-file-ignores = */__init__.py: IMP100, E402, F401 # we test various import patterns tests/test_exports.py: IMP100, IMP101, IMP102 - tests/*: IMP101, IMP102, BAN100 + tests/*: IMP101, IMP102, BAN100, ASY100 # backcompat with outdated import patterns stripe/api_resources/*: IMP100, E402, F401 @@ -37,4 +37,5 @@ extension = SPY = flake8_stripe:TypingImportsChecker IMP = flake8_stripe:StripeImportsChecker BAN = flake8_stripe:BanPublicMethodsChecker + ASY = flake8_stripe:AsyncNamingConventions paths=./flake8_stripe diff --git a/flake8_stripe/flake8_stripe.py b/flake8_stripe/flake8_stripe.py index 88e49cd36..4cdca2b40 100644 --- a/flake8_stripe/flake8_stripe.py +++ b/flake8_stripe/flake8_stripe.py @@ -224,3 +224,30 @@ def run(self) -> Iterator[Tuple[int, int, str, type]]: msg, type(self), ) + + +class AsyncNamingConventions: + name = __name__ + version = "0.1.0" + + def __init__(self, tree: ast.AST, filename: str): + self.tree = tree + self.filename = filename + + def run(self) -> Iterator[Tuple[int, int, str, type]]: + for node in ast.walk(self.tree): + # ignore anything that isn't an async function declaration + if not isinstance(node, ast.AsyncFunctionDef): + continue + + # dunders need specific names, so don't worry about them + if node.name.startswith("__") and node.name.endswith("__"): + continue + + if not node.name.endswith("_async"): + yield ( + node.lineno, + node.col_offset, + "ASY100 Async methods must be named X_async", + type(self), + ) diff --git a/stripe/_stripe_response.py b/stripe/_stripe_response.py index b50121546..f3901d5c9 100644 --- a/stripe/_stripe_response.py +++ b/stripe/_stripe_response.py @@ -61,5 +61,6 @@ def __init__( def stream(self) -> AsyncIterable[bytes]: return self._stream - async def read(self) -> bytes: + # TODO (MAJOR): rename this to `read_async` + async def read(self) -> bytes: # noqa: ASY100 return b"".join([chunk async for chunk in self._stream]) From 46edbe3eb974044309f0fe40293829fc664a7440 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Mon, 13 May 2024 08:32:26 -0700 Subject: [PATCH 063/179] Switch from `black` to `ruff` for formatting (#1329) * swap black to ruff * mass-format w/ latest ruff * add git-blame-ignore-revs * add ruff as recommended extension * remove extra whitespace --- .flake8 | 4 +- .git-blame-ignore-revs | 3 + .vscode/extensions.json | 1 + README.md | 4 +- examples/oauth.py | 8 +- pyproject.toml | 33 ++---- requirements.txt | 2 +- stripe/__init__.py | 1 - stripe/_account.py | 42 ++++---- stripe/_api_requestor.py | 6 +- stripe/_apple_pay_domain.py | 2 - stripe/_application_fee.py | 10 +- stripe/_balance_transaction.py | 8 +- stripe/_charge.py | 6 +- stripe/_connect_collection_transfer.py | 6 +- stripe/_country_spec.py | 2 - stripe/_coupon.py | 2 - stripe/_credit_note.py | 2 - stripe/_credit_note_line_item.py | 6 +- stripe/_customer.py | 86 ++++++++------- stripe/_customer_balance_transaction.py | 6 +- stripe/_customer_cash_balance_transaction.py | 6 +- .../_customer_funding_instructions_service.py | 4 +- stripe/_dispute.py | 2 - stripe/_error_object.py | 2 +- stripe/_event.py | 2 - stripe/_exchange_rate.py | 2 - stripe/_file.py | 2 - stripe/_file_link.py | 2 - stripe/_funding_instructions.py | 6 +- stripe/_http_client.py | 52 ++++----- stripe/_invoice.py | 14 ++- stripe/_invoice_item.py | 2 - stripe/_invoice_line_item_service.py | 4 +- stripe/_invoice_service.py | 8 +- stripe/_list_object.py | 1 - stripe/_payment_intent.py | 30 +++--- stripe/_payment_intent_service.py | 4 +- stripe/_payment_link.py | 22 ++-- stripe/_payment_link_service.py | 8 +- stripe/_payment_method.py | 10 +- stripe/_payment_method_configuration.py | 16 ++- stripe/_payment_method_domain.py | 16 ++- stripe/_payout.py | 2 - stripe/_plan.py | 2 - stripe/_price.py | 2 - stripe/_product.py | 10 +- stripe/_promotion_code.py | 2 - stripe/_quote.py | 10 +- stripe/_refund.py | 2 - stripe/_request_options.py | 2 +- stripe/_reserve_transaction.py | 6 +- stripe/_review.py | 2 - stripe/_setup_attempt.py | 2 - stripe/_setup_intent.py | 10 +- stripe/_setup_intent_service.py | 4 +- stripe/_shipping_rate.py | 2 - stripe/_source.py | 4 +- stripe/_source_mandate_notification.py | 6 +- stripe/_stripe_client.py | 1 - stripe/_stripe_object.py | 10 +- stripe/_subscription.py | 18 ++-- stripe/_subscription_item.py | 10 +- stripe/_subscription_schedule.py | 24 +++-- stripe/_subscription_service.py | 8 +- stripe/_tax_code.py | 2 - stripe/_tax_deducted_at_source.py | 6 +- stripe/_tax_id.py | 2 - stripe/_tax_rate.py | 2 - stripe/_topup.py | 2 - stripe/_transfer.py | 10 +- stripe/_usage_record_summary.py | 6 +- stripe/_util.py | 20 ++-- stripe/_verify_mixin.py | 6 +- stripe/_webhook_endpoint.py | 2 - stripe/app_info.py | 1 + stripe/apps/_secret.py | 2 - stripe/billing/_meter.py | 2 - stripe/billing/_meter_event.py | 6 +- stripe/billing/_meter_event_adjustment.py | 6 +- stripe/billing/_meter_event_summary.py | 6 +- stripe/billing_portal/_configuration.py | 8 +- stripe/billing_portal/_session.py | 6 +- stripe/checkout/_session.py | 6 +- stripe/climate/_order.py | 2 - stripe/climate/_product.py | 2 - stripe/climate/_supplier.py | 2 - stripe/entitlements/_active_entitlement.py | 8 +- stripe/entitlements/_feature.py | 8 +- stripe/financial_connections/_account.py | 8 +- .../financial_connections/_account_owner.py | 6 +- stripe/financial_connections/_session.py | 6 +- stripe/financial_connections/_transaction.py | 8 +- stripe/forwarding/_request.py | 2 - stripe/identity/_verification_report.py | 8 +- stripe/identity/_verification_session.py | 8 +- stripe/issuing/_authorization.py | 36 +++---- stripe/issuing/_card.py | 2 - stripe/issuing/_cardholder.py | 2 - stripe/issuing/_dispute.py | 2 - stripe/issuing/_personalization_design.py | 32 +++--- stripe/issuing/_physical_bundle.py | 8 +- stripe/issuing/_token.py | 2 - stripe/issuing/_transaction.py | 8 +- stripe/radar/_early_fraud_warning.py | 8 +- stripe/radar/_value_list.py | 2 - stripe/radar/_value_list_item.py | 8 +- stripe/reporting/_report_run.py | 8 +- stripe/reporting/_report_type.py | 8 +- stripe/sigma/_scheduled_query_run.py | 8 +- stripe/tax/_calculation.py | 4 +- stripe/tax/_calculation_line_item.py | 6 +- stripe/tax/_registration.py | 2 - stripe/tax/_transaction.py | 4 +- stripe/tax/_transaction_line_item.py | 6 +- stripe/terminal/_configuration.py | 8 +- stripe/terminal/_connection_token.py | 6 +- stripe/terminal/_location.py | 2 - stripe/terminal/_reader.py | 6 +- stripe/test_helpers/_test_clock.py | 8 +- .../_personalization_design_service.py | 4 +- stripe/treasury/_credit_reversal.py | 8 +- stripe/treasury/_debit_reversal.py | 8 +- stripe/treasury/_financial_account.py | 24 ++--- .../treasury/_financial_account_features.py | 6 +- stripe/treasury/_inbound_transfer.py | 28 +++-- stripe/treasury/_outbound_payment.py | 24 ++--- stripe/treasury/_outbound_transfer.py | 56 +++++----- stripe/treasury/_received_credit.py | 8 +- stripe/treasury/_received_debit.py | 8 +- stripe/treasury/_transaction.py | 8 +- stripe/treasury/_transaction_entry.py | 8 +- tests/test_api_requestor.py | 2 +- tests/test_exports.py | 28 ++++- tests/test_generated_examples.py | 102 +++++++++--------- tests/test_http_client.py | 22 ++-- tox.ini | 2 +- 137 files changed, 581 insertions(+), 714 deletions(-) create mode 100644 .git-blame-ignore-revs diff --git a/.flake8 b/.flake8 index 65fd3e81c..25a15e502 100644 --- a/.flake8 +++ b/.flake8 @@ -4,7 +4,9 @@ # length, but can go over in some cases. # W503 goes against PEP8 rules. It's disabled by default, but must be disabled # explicitly when using `ignore`. -ignore = E501, W503 +# E704 is disabled in the default configuration, but by specifying `ignore`, we wipe that out. +# ruff formatting creates code that violates it, so we have to disable it manually +ignore = E501, W503, E704 per-file-ignores = */__init__.py: IMP100, E402, F401 # we test various import patterns diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..5d191dfb5 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,3 @@ +# .git-blame-ignore-revs +# mass formatted w/ ruff (2024-05-10) +c46b4b950ea77e9d18ab98885cda721b3de247c0 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 753de054f..e1511b0d9 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,5 +3,6 @@ "ms-python.python", "EditorConfig.editorconfig", "ms-python.flake8", + "charliermarsh.ruff" ] } diff --git a/README.md b/README.md index e2bbc4e3d..1723b0e2e 100644 --- a/README.md +++ b/README.md @@ -369,7 +369,7 @@ Run the linter with: make lint ``` -The library uses [Black][black] for code formatting. Code must be formatted +The library uses [Ruff][ruff] for code formatting. Code must be formatted with Black before PRs are submitted, otherwise CI will fail. Run the formatter with: @@ -378,7 +378,7 @@ make fmt ``` [api-keys]: https://dashboard.stripe.com/account/apikeys -[black]: https://github.com/ambv/black +[ruff]: https://github.com/astral-sh/ruff [connect]: https://stripe.com/connect [poetry]: https://github.com/sdispater/poetry [stripe-mock]: https://github.com/stripe/stripe-mock diff --git a/examples/oauth.py b/examples/oauth.py index b7ffc3881..1d2ad31cc 100644 --- a/examples/oauth.py +++ b/examples/oauth.py @@ -33,9 +33,7 @@ def callback():

Success! Account {stripe_user_id} is connected.

Click here to disconnect the account.

-""".format( - stripe_user_id=resp["stripe_user_id"] - ) +""".format(stripe_user_id=resp["stripe_user_id"]) @app.route("/deauthorize") @@ -49,9 +47,7 @@ def deauthorize(): return """

Success! Account {stripe_user_id} is disconnected.

Click here to restart the OAuth flow.

-""".format( - stripe_user_id=stripe_user_id - ) +""".format(stripe_user_id=stripe_user_id) if __name__ == "__main__": diff --git a/pyproject.toml b/pyproject.toml index 20b979ea5..7ed6ba63c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,33 +1,18 @@ -[tool.black] +[tool.ruff] +# same as our black config line-length = 79 -target-version = [ - "py35", - "py36", - "py37", - "py38", - "py39", - "py310", - # "py311", # black 21.12b0 doesn't - # "py312", # support these targets -] -exclude = ''' -/( - \.eggs/ - | \.git/ - | \.tox/ - | \.venv/ - | _build/ - | build/ - | dist/ - | venv/ -) -''' +extend-exclude = ["build"] + +[tool.ruff.format] +# currently the default value, but opt-out in the future +docstring-code-format = false + [tool.pyright] include = [ "stripe", "tests/test_generated_examples.py", "tests/test_exports.py", - "tests/test_http_client.py" + "tests/test_http_client.py", ] exclude = ["build", "**/__pycache__"] reportMissingTypeArgument = true diff --git a/requirements.txt b/requirements.txt index 4078f2661..cfe397d29 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ tox == 4.5.0 #Virtualenv 20.22.0 dropped support for all Python versions smaller or equal to Python 3.6. virtualenv<20.22.0 pyright == 1.1.336 -black == 22.8.0 +ruff == 0.4.4 flake8 mypy == 1.7.0 diff --git a/stripe/__init__.py b/stripe/__init__.py index e624851bb..10b4feefc 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -528,5 +528,4 @@ def __getattr__(name): from stripe._webhook_endpoint_service import ( WebhookEndpointService as WebhookEndpointService, ) - # The end of the section generated from our OpenAPI spec diff --git a/stripe/_account.py b/stripe/_account.py index 7ec40b628..4e47dcbf8 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -4004,7 +4004,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -4025,7 +4024,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -4322,7 +4320,7 @@ def retrieve_capability( cls, account: str, capability: str, - **params: Unpack["Account.RetrieveCapabilityParams"] + **params: Unpack["Account.RetrieveCapabilityParams"], ) -> "Capability": """ Retrieves information about the specified Account Capability. @@ -4344,7 +4342,7 @@ async def retrieve_capability_async( cls, account: str, capability: str, - **params: Unpack["Account.RetrieveCapabilityParams"] + **params: Unpack["Account.RetrieveCapabilityParams"], ) -> "Capability": """ Retrieves information about the specified Account Capability. @@ -4366,7 +4364,7 @@ def modify_capability( cls, account: str, capability: str, - **params: Unpack["Account.ModifyCapabilityParams"] + **params: Unpack["Account.ModifyCapabilityParams"], ) -> "Capability": """ Updates an existing Account Capability. Request or remove a capability by updating its requested parameter. @@ -4388,7 +4386,7 @@ async def modify_capability_async( cls, account: str, capability: str, - **params: Unpack["Account.ModifyCapabilityParams"] + **params: Unpack["Account.ModifyCapabilityParams"], ) -> "Capability": """ Updates an existing Account Capability. Request or remove a capability by updating its requested parameter. @@ -4445,7 +4443,7 @@ async def list_capabilities_async( def create_external_account( cls, account: str, - **params: Unpack["Account.CreateExternalAccountParams"] + **params: Unpack["Account.CreateExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Create an external account for a given account. @@ -4465,7 +4463,7 @@ def create_external_account( async def create_external_account_async( cls, account: str, - **params: Unpack["Account.CreateExternalAccountParams"] + **params: Unpack["Account.CreateExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Create an external account for a given account. @@ -4486,7 +4484,7 @@ def retrieve_external_account( cls, account: str, id: str, - **params: Unpack["Account.RetrieveExternalAccountParams"] + **params: Unpack["Account.RetrieveExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Retrieve a specified external account for a given account. @@ -4507,7 +4505,7 @@ async def retrieve_external_account_async( cls, account: str, id: str, - **params: Unpack["Account.RetrieveExternalAccountParams"] + **params: Unpack["Account.RetrieveExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Retrieve a specified external account for a given account. @@ -4528,7 +4526,7 @@ def modify_external_account( cls, account: str, id: str, - **params: Unpack["Account.ModifyExternalAccountParams"] + **params: Unpack["Account.ModifyExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Updates the metadata, account holder name, account holder type of a bank account belonging to @@ -4556,7 +4554,7 @@ async def modify_external_account_async( cls, account: str, id: str, - **params: Unpack["Account.ModifyExternalAccountParams"] + **params: Unpack["Account.ModifyExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Updates the metadata, account holder name, account holder type of a bank account belonging to @@ -4584,7 +4582,7 @@ def delete_external_account( cls, account: str, id: str, - **params: Unpack["Account.DeleteExternalAccountParams"] + **params: Unpack["Account.DeleteExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. @@ -4605,7 +4603,7 @@ async def delete_external_account_async( cls, account: str, id: str, - **params: Unpack["Account.DeleteExternalAccountParams"] + **params: Unpack["Account.DeleteExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. @@ -4625,7 +4623,7 @@ async def delete_external_account_async( def list_external_accounts( cls, account: str, - **params: Unpack["Account.ListExternalAccountsParams"] + **params: Unpack["Account.ListExternalAccountsParams"], ) -> ListObject[Union["BankAccount", "Card"]]: """ List external accounts for an account. @@ -4645,7 +4643,7 @@ def list_external_accounts( async def list_external_accounts_async( cls, account: str, - **params: Unpack["Account.ListExternalAccountsParams"] + **params: Unpack["Account.ListExternalAccountsParams"], ) -> ListObject[Union["BankAccount", "Card"]]: """ List external accounts for an account. @@ -4742,7 +4740,7 @@ def retrieve_person( cls, account: str, person: str, - **params: Unpack["Account.RetrievePersonParams"] + **params: Unpack["Account.RetrievePersonParams"], ) -> "Person": """ Retrieves an existing person. @@ -4763,7 +4761,7 @@ async def retrieve_person_async( cls, account: str, person: str, - **params: Unpack["Account.RetrievePersonParams"] + **params: Unpack["Account.RetrievePersonParams"], ) -> "Person": """ Retrieves an existing person. @@ -4784,7 +4782,7 @@ def modify_person( cls, account: str, person: str, - **params: Unpack["Account.ModifyPersonParams"] + **params: Unpack["Account.ModifyPersonParams"], ) -> "Person": """ Updates an existing person. @@ -4805,7 +4803,7 @@ async def modify_person_async( cls, account: str, person: str, - **params: Unpack["Account.ModifyPersonParams"] + **params: Unpack["Account.ModifyPersonParams"], ) -> "Person": """ Updates an existing person. @@ -4826,7 +4824,7 @@ def delete_person( cls, account: str, person: str, - **params: Unpack["Account.DeletePersonParams"] + **params: Unpack["Account.DeletePersonParams"], ) -> "Person": """ Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. @@ -4847,7 +4845,7 @@ async def delete_person_async( cls, account: str, person: str, - **params: Unpack["Account.DeletePersonParams"] + **params: Unpack["Account.DeletePersonParams"], ) -> "Person": """ Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index a110fd5f9..cc75eb516 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -511,9 +511,9 @@ def _args_for_request_with_retries( generator = MultipartDataGenerator() generator.add_params(params or {}) post_data = generator.get_post_data() - headers[ - "Content-Type" - ] = "multipart/form-data; boundary=%s" % (generator.boundary,) + headers["Content-Type"] = ( + "multipart/form-data; boundary=%s" % (generator.boundary,) + ) else: post_data = encoded_body else: diff --git a/stripe/_apple_pay_domain.py b/stripe/_apple_pay_domain.py index 254841b3f..e88f6a708 100644 --- a/stripe/_apple_pay_domain.py +++ b/stripe/_apple_pay_domain.py @@ -217,7 +217,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -238,7 +237,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_application_fee.py b/stripe/_application_fee.py index d0f617b5a..c6428ac9e 100644 --- a/stripe/_application_fee.py +++ b/stripe/_application_fee.py @@ -209,7 +209,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -230,7 +229,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -483,7 +481,7 @@ def retrieve_refund( cls, fee: str, id: str, - **params: Unpack["ApplicationFee.RetrieveRefundParams"] + **params: Unpack["ApplicationFee.RetrieveRefundParams"], ) -> "ApplicationFeeRefund": """ By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. @@ -504,7 +502,7 @@ async def retrieve_refund_async( cls, fee: str, id: str, - **params: Unpack["ApplicationFee.RetrieveRefundParams"] + **params: Unpack["ApplicationFee.RetrieveRefundParams"], ) -> "ApplicationFeeRefund": """ By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. @@ -525,7 +523,7 @@ def modify_refund( cls, fee: str, id: str, - **params: Unpack["ApplicationFee.ModifyRefundParams"] + **params: Unpack["ApplicationFee.ModifyRefundParams"], ) -> "ApplicationFeeRefund": """ Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -548,7 +546,7 @@ async def modify_refund_async( cls, fee: str, id: str, - **params: Unpack["ApplicationFee.ModifyRefundParams"] + **params: Unpack["ApplicationFee.ModifyRefundParams"], ) -> "ApplicationFeeRefund": """ Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. diff --git a/stripe/_balance_transaction.py b/stripe/_balance_transaction.py index a08724cc5..16ade6d2c 100644 --- a/stripe/_balance_transaction.py +++ b/stripe/_balance_transaction.py @@ -44,9 +44,9 @@ class BalanceTransaction(ListableAPIResource["BalanceTransaction"]): Related guide: [Balance transaction types](https://stripe.com/docs/reports/balance-transaction-types) """ - OBJECT_NAME: ClassVar[ - Literal["balance_transaction"] - ] = "balance_transaction" + OBJECT_NAME: ClassVar[Literal["balance_transaction"]] = ( + "balance_transaction" + ) class FeeDetail(StripeObject): amount: int @@ -271,7 +271,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -294,7 +293,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_charge.py b/stripe/_charge.py index eafe8c1dd..1b4f60f29 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -2486,7 +2486,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -2507,7 +2506,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -2632,7 +2630,7 @@ def retrieve_refund( cls, charge: str, refund: str, - **params: Unpack["Charge.RetrieveRefundParams"] + **params: Unpack["Charge.RetrieveRefundParams"], ) -> "Refund": """ Retrieves the details of an existing refund. @@ -2653,7 +2651,7 @@ async def retrieve_refund_async( cls, charge: str, refund: str, - **params: Unpack["Charge.RetrieveRefundParams"] + **params: Unpack["Charge.RetrieveRefundParams"], ) -> "Refund": """ Retrieves the details of an existing refund. diff --git a/stripe/_connect_collection_transfer.py b/stripe/_connect_collection_transfer.py index 258173535..397e20d15 100644 --- a/stripe/_connect_collection_transfer.py +++ b/stripe/_connect_collection_transfer.py @@ -10,9 +10,9 @@ class ConnectCollectionTransfer(StripeObject): - OBJECT_NAME: ClassVar[ - Literal["connect_collection_transfer"] - ] = "connect_collection_transfer" + OBJECT_NAME: ClassVar[Literal["connect_collection_transfer"]] = ( + "connect_collection_transfer" + ) amount: int """ Amount transferred, in cents (or local equivalent). diff --git a/stripe/_country_spec.py b/stripe/_country_spec.py index 15c4886ba..8304d3380 100644 --- a/stripe/_country_spec.py +++ b/stripe/_country_spec.py @@ -112,7 +112,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -133,7 +132,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_coupon.py b/stripe/_coupon.py index f1d55a169..125282fa1 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -392,7 +392,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -413,7 +412,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 8b82defcc..3a634a940 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -819,7 +819,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -840,7 +839,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_credit_note_line_item.py b/stripe/_credit_note_line_item.py index f358bc77a..40ebeb2df 100644 --- a/stripe/_credit_note_line_item.py +++ b/stripe/_credit_note_line_item.py @@ -15,9 +15,9 @@ class CreditNoteLineItem(StripeObject): The credit note line item object """ - OBJECT_NAME: ClassVar[ - Literal["credit_note_line_item"] - ] = "credit_note_line_item" + OBJECT_NAME: ClassVar[Literal["credit_note_line_item"]] = ( + "credit_note_line_item" + ) class DiscountAmount(StripeObject): amount: int diff --git a/stripe/_customer.py b/stripe/_customer.py index f3da232c0..c824dac3d 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -1469,7 +1469,7 @@ async def create_async( def _cls_create_funding_instructions( cls, customer: str, - **params: Unpack["Customer.CreateFundingInstructionsParams"] + **params: Unpack["Customer.CreateFundingInstructionsParams"], ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new @@ -1491,7 +1491,7 @@ def _cls_create_funding_instructions( @staticmethod def create_funding_instructions( customer: str, - **params: Unpack["Customer.CreateFundingInstructionsParams"] + **params: Unpack["Customer.CreateFundingInstructionsParams"], ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new @@ -1535,7 +1535,7 @@ def create_funding_instructions( # pyright: ignore[reportGeneralTypeIssues] async def _cls_create_funding_instructions_async( cls, customer: str, - **params: Unpack["Customer.CreateFundingInstructionsParams"] + **params: Unpack["Customer.CreateFundingInstructionsParams"], ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new @@ -1557,7 +1557,7 @@ async def _cls_create_funding_instructions_async( @staticmethod async def create_funding_instructions_async( customer: str, - **params: Unpack["Customer.CreateFundingInstructionsParams"] + **params: Unpack["Customer.CreateFundingInstructionsParams"], ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new @@ -1816,7 +1816,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1837,7 +1836,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1849,7 +1847,7 @@ async def list_async( def _cls_list_payment_methods( cls, customer: str, - **params: Unpack["Customer.ListPaymentMethodsParams"] + **params: Unpack["Customer.ListPaymentMethodsParams"], ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer @@ -1906,7 +1904,7 @@ def list_payment_methods( # pyright: ignore[reportGeneralTypeIssues] async def _cls_list_payment_methods_async( cls, customer: str, - **params: Unpack["Customer.ListPaymentMethodsParams"] + **params: Unpack["Customer.ListPaymentMethodsParams"], ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer @@ -2024,7 +2022,7 @@ def _cls_retrieve_payment_method( cls, customer: str, payment_method: str, - **params: Unpack["Customer.RetrievePaymentMethodParams"] + **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. @@ -2046,7 +2044,7 @@ def _cls_retrieve_payment_method( def retrieve_payment_method( customer: str, payment_method: str, - **params: Unpack["Customer.RetrievePaymentMethodParams"] + **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. @@ -2057,7 +2055,7 @@ def retrieve_payment_method( def retrieve_payment_method( self, payment_method: str, - **params: Unpack["Customer.RetrievePaymentMethodParams"] + **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. @@ -2068,7 +2066,7 @@ def retrieve_payment_method( def retrieve_payment_method( # pyright: ignore[reportGeneralTypeIssues] self, payment_method: str, - **params: Unpack["Customer.RetrievePaymentMethodParams"] + **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. @@ -2090,7 +2088,7 @@ async def _cls_retrieve_payment_method_async( cls, customer: str, payment_method: str, - **params: Unpack["Customer.RetrievePaymentMethodParams"] + **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. @@ -2112,7 +2110,7 @@ async def _cls_retrieve_payment_method_async( async def retrieve_payment_method_async( customer: str, payment_method: str, - **params: Unpack["Customer.RetrievePaymentMethodParams"] + **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. @@ -2123,7 +2121,7 @@ async def retrieve_payment_method_async( async def retrieve_payment_method_async( self, payment_method: str, - **params: Unpack["Customer.RetrievePaymentMethodParams"] + **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. @@ -2134,7 +2132,7 @@ async def retrieve_payment_method_async( async def retrieve_payment_method_async( # pyright: ignore[reportGeneralTypeIssues] self, payment_method: str, - **params: Unpack["Customer.RetrievePaymentMethodParams"] + **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. @@ -2193,7 +2191,7 @@ async def search_auto_paging_iter_async( def create_balance_transaction( cls, customer: str, - **params: Unpack["Customer.CreateBalanceTransactionParams"] + **params: Unpack["Customer.CreateBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). @@ -2213,7 +2211,7 @@ def create_balance_transaction( async def create_balance_transaction_async( cls, customer: str, - **params: Unpack["Customer.CreateBalanceTransactionParams"] + **params: Unpack["Customer.CreateBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). @@ -2234,7 +2232,7 @@ def retrieve_balance_transaction( cls, customer: str, transaction: str, - **params: Unpack["Customer.RetrieveBalanceTransactionParams"] + **params: Unpack["Customer.RetrieveBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). @@ -2256,7 +2254,7 @@ async def retrieve_balance_transaction_async( cls, customer: str, transaction: str, - **params: Unpack["Customer.RetrieveBalanceTransactionParams"] + **params: Unpack["Customer.RetrieveBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). @@ -2278,7 +2276,7 @@ def modify_balance_transaction( cls, customer: str, transaction: str, - **params: Unpack["Customer.ModifyBalanceTransactionParams"] + **params: Unpack["Customer.ModifyBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ Most credit balance transaction fields are immutable, but you may update its description and metadata. @@ -2300,7 +2298,7 @@ async def modify_balance_transaction_async( cls, customer: str, transaction: str, - **params: Unpack["Customer.ModifyBalanceTransactionParams"] + **params: Unpack["Customer.ModifyBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ Most credit balance transaction fields are immutable, but you may update its description and metadata. @@ -2321,7 +2319,7 @@ async def modify_balance_transaction_async( def list_balance_transactions( cls, customer: str, - **params: Unpack["Customer.ListBalanceTransactionsParams"] + **params: Unpack["Customer.ListBalanceTransactionsParams"], ) -> ListObject["CustomerBalanceTransaction"]: """ Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). @@ -2341,7 +2339,7 @@ def list_balance_transactions( async def list_balance_transactions_async( cls, customer: str, - **params: Unpack["Customer.ListBalanceTransactionsParams"] + **params: Unpack["Customer.ListBalanceTransactionsParams"], ) -> ListObject["CustomerBalanceTransaction"]: """ Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). @@ -2362,7 +2360,7 @@ def retrieve_cash_balance_transaction( cls, customer: str, transaction: str, - **params: Unpack["Customer.RetrieveCashBalanceTransactionParams"] + **params: Unpack["Customer.RetrieveCashBalanceTransactionParams"], ) -> "CustomerCashBalanceTransaction": """ Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). @@ -2384,7 +2382,7 @@ async def retrieve_cash_balance_transaction_async( cls, customer: str, transaction: str, - **params: Unpack["Customer.RetrieveCashBalanceTransactionParams"] + **params: Unpack["Customer.RetrieveCashBalanceTransactionParams"], ) -> "CustomerCashBalanceTransaction": """ Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). @@ -2405,7 +2403,7 @@ async def retrieve_cash_balance_transaction_async( def list_cash_balance_transactions( cls, customer: str, - **params: Unpack["Customer.ListCashBalanceTransactionsParams"] + **params: Unpack["Customer.ListCashBalanceTransactionsParams"], ) -> ListObject["CustomerCashBalanceTransaction"]: """ Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). @@ -2425,7 +2423,7 @@ def list_cash_balance_transactions( async def list_cash_balance_transactions_async( cls, customer: str, - **params: Unpack["Customer.ListCashBalanceTransactionsParams"] + **params: Unpack["Customer.ListCashBalanceTransactionsParams"], ) -> ListObject["CustomerCashBalanceTransaction"]: """ Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). @@ -2490,7 +2488,7 @@ def retrieve_source( cls, customer: str, id: str, - **params: Unpack["Customer.RetrieveSourceParams"] + **params: Unpack["Customer.RetrieveSourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ Retrieve a specified source for a given customer. @@ -2511,7 +2509,7 @@ async def retrieve_source_async( cls, customer: str, id: str, - **params: Unpack["Customer.RetrieveSourceParams"] + **params: Unpack["Customer.RetrieveSourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ Retrieve a specified source for a given customer. @@ -2532,7 +2530,7 @@ def modify_source( cls, customer: str, id: str, - **params: Unpack["Customer.ModifySourceParams"] + **params: Unpack["Customer.ModifySourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ Update a specified source for a given customer. @@ -2553,7 +2551,7 @@ async def modify_source_async( cls, customer: str, id: str, - **params: Unpack["Customer.ModifySourceParams"] + **params: Unpack["Customer.ModifySourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ Update a specified source for a given customer. @@ -2574,7 +2572,7 @@ def delete_source( cls, customer: str, id: str, - **params: Unpack["Customer.DeleteSourceParams"] + **params: Unpack["Customer.DeleteSourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ Delete a specified source for a given customer. @@ -2595,7 +2593,7 @@ async def delete_source_async( cls, customer: str, id: str, - **params: Unpack["Customer.DeleteSourceParams"] + **params: Unpack["Customer.DeleteSourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ Delete a specified source for a given customer. @@ -2688,7 +2686,7 @@ def retrieve_tax_id( cls, customer: str, id: str, - **params: Unpack["Customer.RetrieveTaxIdParams"] + **params: Unpack["Customer.RetrieveTaxIdParams"], ) -> "TaxId": """ Retrieves the tax_id object with the given identifier. @@ -2709,7 +2707,7 @@ async def retrieve_tax_id_async( cls, customer: str, id: str, - **params: Unpack["Customer.RetrieveTaxIdParams"] + **params: Unpack["Customer.RetrieveTaxIdParams"], ) -> "TaxId": """ Retrieves the tax_id object with the given identifier. @@ -2730,7 +2728,7 @@ def delete_tax_id( cls, customer: str, id: str, - **params: Unpack["Customer.DeleteTaxIdParams"] + **params: Unpack["Customer.DeleteTaxIdParams"], ) -> "TaxId": """ Deletes an existing tax_id object. @@ -2751,7 +2749,7 @@ async def delete_tax_id_async( cls, customer: str, id: str, - **params: Unpack["Customer.DeleteTaxIdParams"] + **params: Unpack["Customer.DeleteTaxIdParams"], ) -> "TaxId": """ Deletes an existing tax_id object. @@ -2807,7 +2805,7 @@ async def list_tax_ids_async( def retrieve_cash_balance( cls, customer: str, - **params: Unpack["Customer.RetrieveCashBalanceParams"] + **params: Unpack["Customer.RetrieveCashBalanceParams"], ) -> "CashBalance": """ Retrieves a customer's cash balance. @@ -2827,7 +2825,7 @@ def retrieve_cash_balance( async def retrieve_cash_balance_async( cls, customer: str, - **params: Unpack["Customer.RetrieveCashBalanceParams"] + **params: Unpack["Customer.RetrieveCashBalanceParams"], ) -> "CashBalance": """ Retrieves a customer's cash balance. @@ -2847,7 +2845,7 @@ async def retrieve_cash_balance_async( def modify_cash_balance( cls, customer: str, - **params: Unpack["Customer.ModifyCashBalanceParams"] + **params: Unpack["Customer.ModifyCashBalanceParams"], ) -> "CashBalance": """ Changes the settings on a customer's cash balance. @@ -2867,7 +2865,7 @@ def modify_cash_balance( async def modify_cash_balance_async( cls, customer: str, - **params: Unpack["Customer.ModifyCashBalanceParams"] + **params: Unpack["Customer.ModifyCashBalanceParams"], ) -> "CashBalance": """ Changes the settings on a customer's cash balance. @@ -2890,7 +2888,7 @@ class TestHelpers(APIResourceTestHelpers["Customer"]): def _cls_fund_cash_balance( cls, customer: str, - **params: Unpack["Customer.FundCashBalanceParams"] + **params: Unpack["Customer.FundCashBalanceParams"], ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer @@ -2947,7 +2945,7 @@ def fund_cash_balance( # pyright: ignore[reportGeneralTypeIssues] async def _cls_fund_cash_balance_async( cls, customer: str, - **params: Unpack["Customer.FundCashBalanceParams"] + **params: Unpack["Customer.FundCashBalanceParams"], ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer diff --git a/stripe/_customer_balance_transaction.py b/stripe/_customer_balance_transaction.py index fd342c70f..2befceca3 100644 --- a/stripe/_customer_balance_transaction.py +++ b/stripe/_customer_balance_transaction.py @@ -22,9 +22,9 @@ class CustomerBalanceTransaction(APIResource["CustomerBalanceTransaction"]): Related guide: [Customer balance](https://stripe.com/docs/billing/customer/balance) """ - OBJECT_NAME: ClassVar[ - Literal["customer_balance_transaction"] - ] = "customer_balance_transaction" + OBJECT_NAME: ClassVar[Literal["customer_balance_transaction"]] = ( + "customer_balance_transaction" + ) amount: int """ The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`. diff --git a/stripe/_customer_cash_balance_transaction.py b/stripe/_customer_cash_balance_transaction.py index 0983295d1..64db2470e 100644 --- a/stripe/_customer_cash_balance_transaction.py +++ b/stripe/_customer_cash_balance_transaction.py @@ -20,9 +20,9 @@ class CustomerCashBalanceTransaction(StripeObject): to payments, and refunds to the customer. """ - OBJECT_NAME: ClassVar[ - Literal["customer_cash_balance_transaction"] - ] = "customer_cash_balance_transaction" + OBJECT_NAME: ClassVar[Literal["customer_cash_balance_transaction"]] = ( + "customer_cash_balance_transaction" + ) class AdjustedForOverdraft(StripeObject): balance_transaction: ExpandableField["BalanceTransaction"] diff --git a/stripe/_customer_funding_instructions_service.py b/stripe/_customer_funding_instructions_service.py index b397991a2..0b287c8e4 100644 --- a/stripe/_customer_funding_instructions_service.py +++ b/stripe/_customer_funding_instructions_service.py @@ -10,7 +10,9 @@ class CustomerFundingInstructionsService(StripeService): class CreateParams(TypedDict): - bank_transfer: "CustomerFundingInstructionsService.CreateParamsBankTransfer" + bank_transfer: ( + "CustomerFundingInstructionsService.CreateParamsBankTransfer" + ) """ Additional parameters for `bank_transfer` funding types """ diff --git a/stripe/_dispute.py b/stripe/_dispute.py index 07729b273..851becaec 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -583,7 +583,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -604,7 +603,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_error_object.py b/stripe/_error_object.py index f3556b019..da2f38918 100644 --- a/stripe/_error_object.py +++ b/stripe/_error_object.py @@ -56,7 +56,7 @@ def _refresh_from( partial=False, last_response=None, requestor, - api_mode: ApiMode + api_mode: ApiMode, ) -> None: # Unlike most other API resources, the API will omit attributes in # error objects when they have a null value. We manually set default diff --git a/stripe/_event.py b/stripe/_event.py index d520d8e7b..8161a9ce1 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -401,7 +401,6 @@ def list(cls, **params: Unpack["Event.ListParams"]) -> ListObject["Event"]: params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -422,7 +421,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_exchange_rate.py b/stripe/_exchange_rate.py index 443400403..535678a93 100644 --- a/stripe/_exchange_rate.py +++ b/stripe/_exchange_rate.py @@ -89,7 +89,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -110,7 +109,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_file.py b/stripe/_file.py index c83b91752..72e4c82e7 100644 --- a/stripe/_file.py +++ b/stripe/_file.py @@ -251,7 +251,6 @@ def list(cls, **params: Unpack["File.ListParams"]) -> ListObject["File"]: params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -272,7 +271,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_file_link.py b/stripe/_file_link.py index e03684b86..ff62720d5 100644 --- a/stripe/_file_link.py +++ b/stripe/_file_link.py @@ -199,7 +199,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -220,7 +219,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_funding_instructions.py b/stripe/_funding_instructions.py index 658638ff3..ccab42862 100644 --- a/stripe/_funding_instructions.py +++ b/stripe/_funding_instructions.py @@ -14,9 +14,9 @@ class FundingInstructions(StripeObject): Related guide: [Customer balance funding instructions](https://stripe.com/docs/payments/customer-balance/funding-instructions) """ - OBJECT_NAME: ClassVar[ - Literal["funding_instructions"] - ] = "funding_instructions" + OBJECT_NAME: ClassVar[Literal["funding_instructions"]] = ( + "funding_instructions" + ) class BankTransfer(StripeObject): class FinancialAddress(StripeObject): diff --git a/stripe/_http_client.py b/stripe/_http_client.py index f7969a5b5..a936dd654 100644 --- a/stripe/_http_client.py +++ b/stripe/_http_client.py @@ -162,9 +162,7 @@ def __init__( if proxy: if isinstance(proxy, str): proxy = {"http": proxy, "https": proxy} - if not isinstance( - proxy, dict - ): # pyright: ignore[reportUnnecessaryIsInstance] + if not isinstance(proxy, dict): # pyright: ignore[reportUnnecessaryIsInstance] raise ValueError( "Proxy(ies) must be specified as either a string " "URL or a dict() with string URL under the" @@ -399,7 +397,7 @@ def request( headers: Optional[Mapping[str, str]], post_data: Any = None, *, - _usage: Optional[List[str]] = None + _usage: Optional[List[str]] = None, ) -> Tuple[str, int, Mapping[str, str]]: raise NotImplementedError( "HTTPClient subclasses must implement `request`" @@ -412,7 +410,7 @@ def request_stream( headers: Optional[Mapping[str, str]], post_data: Any = None, *, - _usage: Optional[List[str]] = None + _usage: Optional[List[str]] = None, ) -> Tuple[Any, int, Mapping[str, str]]: raise NotImplementedError( "HTTPClient subclasses must implement `request_stream`" @@ -431,7 +429,7 @@ async def request_with_retries_async( post_data=None, max_network_retries: Optional[int] = None, *, - _usage: Optional[List[str]] = None + _usage: Optional[List[str]] = None, ) -> Tuple[Any, int, Any]: return await self._request_with_retries_internal_async( method, @@ -451,7 +449,7 @@ async def request_stream_with_retries_async( post_data=None, max_network_retries=None, *, - _usage: Optional[List[str]] = None + _usage: Optional[List[str]] = None, ) -> Tuple[AsyncIterable[bytes], int, Any]: return await self._request_with_retries_internal_async( method, @@ -473,9 +471,8 @@ async def _request_with_retries_internal_async( is_streaming: Literal[False], max_network_retries: Optional[int], *, - _usage: Optional[List[str]] = None - ) -> Tuple[Any, int, Mapping[str, str]]: - ... + _usage: Optional[List[str]] = None, + ) -> Tuple[Any, int, Mapping[str, str]]: ... @overload async def _request_with_retries_internal_async( @@ -487,9 +484,8 @@ async def _request_with_retries_internal_async( is_streaming: Literal[True], max_network_retries: Optional[int], *, - _usage: Optional[List[str]] = None - ) -> Tuple[AsyncIterable[bytes], int, Mapping[str, str]]: - ... + _usage: Optional[List[str]] = None, + ) -> Tuple[AsyncIterable[bytes], int, Mapping[str, str]]: ... async def _request_with_retries_internal_async( self, @@ -500,7 +496,7 @@ async def _request_with_retries_internal_async( is_streaming: bool, max_network_retries: Optional[int], *, - _usage: Optional[List[str]] = None + _usage: Optional[List[str]] = None, ) -> Tuple[Any, int, Mapping[str, str]]: headers = self._add_telemetry_header(headers) @@ -599,7 +595,7 @@ def __init__( verify_ssl_certs: bool = True, proxy: Optional[Union[str, HTTPClient._Proxy]] = None, async_fallback_client: Optional[HTTPClient] = None, - **kwargs + **kwargs, ): super(RequestsClient, self).__init__( verify_ssl_certs=verify_ssl_certs, @@ -642,8 +638,7 @@ def _request_internal( headers: Optional[Mapping[str, str]], post_data, is_streaming: Literal[True], - ) -> Tuple[Any, int, Mapping[str, str]]: - ... + ) -> Tuple[Any, int, Mapping[str, str]]: ... @overload def _request_internal( @@ -653,8 +648,7 @@ def _request_internal( headers: Optional[Mapping[str, str]], post_data, is_streaming: Literal[False], - ) -> Tuple[bytes, int, Mapping[str, str]]: - ... + ) -> Tuple[bytes, int, Mapping[str, str]]: ... def _request_internal( self, @@ -832,8 +826,7 @@ def _request_internal( headers: Mapping[str, str], post_data, is_streaming: Literal[True], - ) -> Tuple[BytesIO, int, Any]: - ... + ) -> Tuple[BytesIO, int, Any]: ... @overload def _request_internal( @@ -843,8 +836,7 @@ def _request_internal( headers: Mapping[str, str], post_data, is_streaming: Literal[False], - ) -> Tuple[str, int, Any]: - ... + ) -> Tuple[str, int, Any]: ... def _request_internal( self, @@ -970,8 +962,7 @@ def _request_internal( headers: Mapping[str, str], post_data, is_streaming: Literal[True], - ) -> Tuple[BytesIO, int, Any]: - ... + ) -> Tuple[BytesIO, int, Any]: ... @overload def _request_internal( @@ -981,8 +972,7 @@ def _request_internal( headers: Mapping[str, str], post_data, is_streaming: Literal[False], - ) -> Tuple[str, int, Mapping[str, str]]: - ... + ) -> Tuple[str, int, Mapping[str, str]]: ... def _request_internal( self, @@ -1149,8 +1139,7 @@ def _request_internal( headers: Mapping[str, str], post_data, is_streaming: Literal[False], - ) -> Tuple[str, int, Any]: - ... + ) -> Tuple[str, int, Any]: ... @overload def _request_internal( @@ -1160,8 +1149,7 @@ def _request_internal( headers: Mapping[str, str], post_data, is_streaming: Literal[True], - ) -> Tuple[HTTPResponse, int, Any]: - ... + ) -> Tuple[HTTPResponse, int, Any]: ... def _request_internal( self, @@ -1227,7 +1215,7 @@ def __init__( self, timeout: Optional[Union[float, "HTTPXTimeout"]] = 80, allow_sync_methods=False, - **kwargs + **kwargs, ): super(HTTPXClient, self).__init__(**kwargs) diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 752322abd..a3b70fe4d 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -4425,7 +4425,9 @@ class UpcomingLinesParamsSubscriptionItemPriceData(TypedDict): """ The ID of the product that this price will belong to. """ - recurring: "Invoice.UpcomingLinesParamsSubscriptionItemPriceDataRecurring" + recurring: ( + "Invoice.UpcomingLinesParamsSubscriptionItemPriceDataRecurring" + ) """ The recurring components of a price such as `interval` and `interval_count`. """ @@ -5253,7 +5255,9 @@ class UpcomingParamsScheduleDetailsPhaseItemPriceData(TypedDict): """ The ID of the product that this price will belong to. """ - recurring: "Invoice.UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring" + recurring: ( + "Invoice.UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring" + ) """ The recurring components of a price such as `interval` and `interval_count`. """ @@ -5423,7 +5427,9 @@ class UpcomingParamsSubscriptionDetailsItemPriceData(TypedDict): """ The ID of the product that this price will belong to. """ - recurring: "Invoice.UpcomingParamsSubscriptionDetailsItemPriceDataRecurring" + recurring: ( + "Invoice.UpcomingParamsSubscriptionDetailsItemPriceDataRecurring" + ) """ The recurring components of a price such as `interval` and `interval_count`. """ @@ -6203,7 +6209,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -6224,7 +6229,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index cc7ade7ed..9fa29f594 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -603,7 +603,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -624,7 +623,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index 5c0733d1c..4cacab135 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -163,7 +163,9 @@ class UpdateParamsTaxAmount(TypedDict): """ The amount, in cents (or local equivalent), of the tax. """ - tax_rate_data: "InvoiceLineItemService.UpdateParamsTaxAmountTaxRateData" + tax_rate_data: ( + "InvoiceLineItemService.UpdateParamsTaxAmountTaxRateData" + ) """ Data to find or create a TaxRate object. diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 592abf248..52ce5b187 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -782,7 +782,9 @@ class CreatePreviewParamsCustomerDetailsAddress(TypedDict): """ class CreatePreviewParamsCustomerDetailsShipping(TypedDict): - address: "InvoiceService.CreatePreviewParamsCustomerDetailsShippingAddress" + address: ( + "InvoiceService.CreatePreviewParamsCustomerDetailsShippingAddress" + ) """ Customer shipping address. """ @@ -2862,7 +2864,9 @@ class UpcomingParamsSubscriptionItemPriceData(TypedDict): """ The ID of the product that this price will belong to. """ - recurring: "InvoiceService.UpcomingParamsSubscriptionItemPriceDataRecurring" + recurring: ( + "InvoiceService.UpcomingParamsSubscriptionItemPriceDataRecurring" + ) """ The recurring components of a price such as `interval` and `interval_count`. """ diff --git a/stripe/_list_object.py b/stripe/_list_object.py index 2e2d03ff1..bb007269f 100644 --- a/stripe/_list_object.py +++ b/stripe/_list_object.py @@ -190,7 +190,6 @@ def is_empty(self) -> bool: def _get_filters_for_next_page( self, params: RequestOptions ) -> Mapping[str, Any]: - last_id = getattr(self.data[-1], "id") if not last_id: raise ValueError( diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index eccda247a..aff76766f 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -4237,7 +4237,9 @@ class CreateParamsAutomaticPaymentMethods(TypedDict): """ class CreateParamsMandateData(TypedDict): - customer_acceptance: "PaymentIntent.CreateParamsMandateDataCustomerAcceptance" + customer_acceptance: ( + "PaymentIntent.CreateParamsMandateDataCustomerAcceptance" + ) """ This hash contains details about the customer acceptance of the Mandate. """ @@ -8679,7 +8681,7 @@ class VerifyMicrodepositsParams(RequestOptions): def _cls_apply_customer_balance( cls, intent: str, - **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] + **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"], ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. @@ -8699,7 +8701,7 @@ def _cls_apply_customer_balance( @staticmethod def apply_customer_balance( intent: str, - **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] + **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"], ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. @@ -8737,7 +8739,7 @@ def apply_customer_balance( # pyright: ignore[reportGeneralTypeIssues] async def _cls_apply_customer_balance_async( cls, intent: str, - **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] + **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"], ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. @@ -8757,7 +8759,7 @@ async def _cls_apply_customer_balance_async( @staticmethod async def apply_customer_balance_async( intent: str, - **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] + **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"], ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. @@ -9407,7 +9409,7 @@ async def create_async( def _cls_increment_authorization( cls, intent: str, - **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] + **params: Unpack["PaymentIntent.IncrementAuthorizationParams"], ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible @@ -9450,7 +9452,7 @@ def _cls_increment_authorization( @staticmethod def increment_authorization( intent: str, - **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] + **params: Unpack["PaymentIntent.IncrementAuthorizationParams"], ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible @@ -9557,7 +9559,7 @@ def increment_authorization( # pyright: ignore[reportGeneralTypeIssues] async def _cls_increment_authorization_async( cls, intent: str, - **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] + **params: Unpack["PaymentIntent.IncrementAuthorizationParams"], ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible @@ -9600,7 +9602,7 @@ async def _cls_increment_authorization_async( @staticmethod async def increment_authorization_async( intent: str, - **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] + **params: Unpack["PaymentIntent.IncrementAuthorizationParams"], ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible @@ -9716,7 +9718,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -9737,7 +9738,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -9825,7 +9825,7 @@ async def retrieve_async( def _cls_verify_microdeposits( cls, intent: str, - **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] + **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"], ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. @@ -9845,7 +9845,7 @@ def _cls_verify_microdeposits( @staticmethod def verify_microdeposits( intent: str, - **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] + **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"], ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. @@ -9883,7 +9883,7 @@ def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] async def _cls_verify_microdeposits_async( cls, intent: str, - **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] + **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"], ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. @@ -9903,7 +9903,7 @@ async def _cls_verify_microdeposits_async( @staticmethod async def verify_microdeposits_async( intent: str, - **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] + **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"], ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 273eb3838..1dee3a221 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -2395,7 +2395,9 @@ class CreateParamsAutomaticPaymentMethods(TypedDict): """ class CreateParamsMandateData(TypedDict): - customer_acceptance: "PaymentIntentService.CreateParamsMandateDataCustomerAcceptance" + customer_acceptance: ( + "PaymentIntentService.CreateParamsMandateDataCustomerAcceptance" + ) """ This hash contains details about the customer acceptance of the Mandate. """ diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 8e1e1e132..31ba7f183 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -1208,7 +1208,9 @@ class CreateParamsPhoneNumberCollection(TypedDict): """ class CreateParamsRestrictions(TypedDict): - completed_sessions: "PaymentLink.CreateParamsRestrictionsCompletedSessions" + completed_sessions: ( + "PaymentLink.CreateParamsRestrictionsCompletedSessions" + ) """ Configuration for the `completed_sessions` restriction type. """ @@ -1517,7 +1519,9 @@ class CreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): """ class CreateParamsSubscriptionDataTrialSettings(TypedDict): - end_behavior: "PaymentLink.CreateParamsSubscriptionDataTrialSettingsEndBehavior" + end_behavior: ( + "PaymentLink.CreateParamsSubscriptionDataTrialSettingsEndBehavior" + ) """ Defines how the subscription should behave when the user's free trial ends. """ @@ -1992,7 +1996,9 @@ class ModifyParamsPaymentIntentData(TypedDict): """ class ModifyParamsRestrictions(TypedDict): - completed_sessions: "PaymentLink.ModifyParamsRestrictionsCompletedSessions" + completed_sessions: ( + "PaymentLink.ModifyParamsRestrictionsCompletedSessions" + ) """ Configuration for the `completed_sessions` restriction type. """ @@ -2287,7 +2293,9 @@ class ModifyParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): """ class ModifyParamsSubscriptionDataTrialSettings(TypedDict): - end_behavior: "PaymentLink.ModifyParamsSubscriptionDataTrialSettingsEndBehavior" + end_behavior: ( + "PaymentLink.ModifyParamsSubscriptionDataTrialSettingsEndBehavior" + ) """ Defines how the subscription should behave when the user's free trial ends. """ @@ -2501,7 +2509,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -2522,7 +2529,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -2534,7 +2540,7 @@ async def list_async( def _cls_list_line_items( cls, payment_link: str, - **params: Unpack["PaymentLink.ListLineItemsParams"] + **params: Unpack["PaymentLink.ListLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -2591,7 +2597,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] async def _cls_list_line_items_async( cls, payment_link: str, - **params: Unpack["PaymentLink.ListLineItemsParams"] + **params: Unpack["PaymentLink.ListLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 924ba0d28..553136978 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -562,7 +562,9 @@ class CreateParamsPhoneNumberCollection(TypedDict): """ class CreateParamsRestrictions(TypedDict): - completed_sessions: "PaymentLinkService.CreateParamsRestrictionsCompletedSessions" + completed_sessions: ( + "PaymentLinkService.CreateParamsRestrictionsCompletedSessions" + ) """ Configuration for the `completed_sessions` restriction type. """ @@ -1346,7 +1348,9 @@ class UpdateParamsPaymentIntentData(TypedDict): """ class UpdateParamsRestrictions(TypedDict): - completed_sessions: "PaymentLinkService.UpdateParamsRestrictionsCompletedSessions" + completed_sessions: ( + "PaymentLinkService.UpdateParamsRestrictionsCompletedSessions" + ) """ Configuration for the `completed_sessions` restriction type. """ diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 676a4d8c9..8070922e7 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -1915,7 +1915,7 @@ class RetrieveParams(RequestOptions): def _cls_attach( cls, payment_method: str, - **params: Unpack["PaymentMethod.AttachParams"] + **params: Unpack["PaymentMethod.AttachParams"], ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. @@ -2020,7 +2020,7 @@ def attach( # pyright: ignore[reportGeneralTypeIssues] async def _cls_attach_async( cls, payment_method: str, - **params: Unpack["PaymentMethod.AttachParams"] + **params: Unpack["PaymentMethod.AttachParams"], ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. @@ -2161,7 +2161,7 @@ async def create_async( def _cls_detach( cls, payment_method: str, - **params: Unpack["PaymentMethod.DetachParams"] + **params: Unpack["PaymentMethod.DetachParams"], ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. @@ -2218,7 +2218,7 @@ def detach( # pyright: ignore[reportGeneralTypeIssues] async def _cls_detach_async( cls, payment_method: str, - **params: Unpack["PaymentMethod.DetachParams"] + **params: Unpack["PaymentMethod.DetachParams"], ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. @@ -2284,7 +2284,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -2305,7 +2304,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 7670d57dc..6ddfe3be4 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -33,9 +33,9 @@ class PaymentMethodConfiguration( - [Multiple configurations for your Connect accounts](https://stripe.com/docs/connect/multiple-payment-method-configurations) """ - OBJECT_NAME: ClassVar[ - Literal["payment_method_configuration"] - ] = "payment_method_configuration" + OBJECT_NAME: ClassVar[Literal["payment_method_configuration"]] = ( + "payment_method_configuration" + ) class AcssDebit(StripeObject): class DisplayPreference(StripeObject): @@ -2517,7 +2517,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -2538,7 +2537,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -2550,7 +2548,7 @@ async def list_async( def modify( cls, id: str, - **params: Unpack["PaymentMethodConfiguration.ModifyParams"] + **params: Unpack["PaymentMethodConfiguration.ModifyParams"], ) -> "PaymentMethodConfiguration": """ Update payment method configuration @@ -2569,7 +2567,7 @@ def modify( async def modify_async( cls, id: str, - **params: Unpack["PaymentMethodConfiguration.ModifyParams"] + **params: Unpack["PaymentMethodConfiguration.ModifyParams"], ) -> "PaymentMethodConfiguration": """ Update payment method configuration @@ -2588,7 +2586,7 @@ async def modify_async( def retrieve( cls, id: str, - **params: Unpack["PaymentMethodConfiguration.RetrieveParams"] + **params: Unpack["PaymentMethodConfiguration.RetrieveParams"], ) -> "PaymentMethodConfiguration": """ Retrieve payment method configuration @@ -2601,7 +2599,7 @@ def retrieve( async def retrieve_async( cls, id: str, - **params: Unpack["PaymentMethodConfiguration.RetrieveParams"] + **params: Unpack["PaymentMethodConfiguration.RetrieveParams"], ) -> "PaymentMethodConfiguration": """ Retrieve payment method configuration diff --git a/stripe/_payment_method_domain.py b/stripe/_payment_method_domain.py index c92a4c5c2..60e544186 100644 --- a/stripe/_payment_method_domain.py +++ b/stripe/_payment_method_domain.py @@ -23,9 +23,9 @@ class PaymentMethodDomain( Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ - OBJECT_NAME: ClassVar[ - Literal["payment_method_domain"] - ] = "payment_method_domain" + OBJECT_NAME: ClassVar[Literal["payment_method_domain"]] = ( + "payment_method_domain" + ) class ApplePay(StripeObject): class StatusDetails(StripeObject): @@ -243,7 +243,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -264,7 +263,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -332,7 +330,7 @@ async def retrieve_async( def _cls_validate( cls, payment_method_domain: str, - **params: Unpack["PaymentMethodDomain.ValidateParams"] + **params: Unpack["PaymentMethodDomain.ValidateParams"], ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. @@ -357,7 +355,7 @@ def _cls_validate( @staticmethod def validate( payment_method_domain: str, - **params: Unpack["PaymentMethodDomain.ValidateParams"] + **params: Unpack["PaymentMethodDomain.ValidateParams"], ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. @@ -410,7 +408,7 @@ def validate( # pyright: ignore[reportGeneralTypeIssues] async def _cls_validate_async( cls, payment_method_domain: str, - **params: Unpack["PaymentMethodDomain.ValidateParams"] + **params: Unpack["PaymentMethodDomain.ValidateParams"], ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. @@ -435,7 +433,7 @@ async def _cls_validate_async( @staticmethod async def validate_async( payment_method_domain: str, - **params: Unpack["PaymentMethodDomain.ValidateParams"] + **params: Unpack["PaymentMethodDomain.ValidateParams"], ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. diff --git a/stripe/_payout.py b/stripe/_payout.py index 6becddf37..7e1d627c2 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -436,7 +436,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -457,7 +456,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_plan.py b/stripe/_plan.py index 7d2343e04..07bdb1c1a 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -523,7 +523,6 @@ def list(cls, **params: Unpack["Plan.ListParams"]) -> ListObject["Plan"]: params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -544,7 +543,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_price.py b/stripe/_price.py index 4539ee5d8..9397e6c80 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -781,7 +781,6 @@ def list(cls, **params: Unpack["Price.ListParams"]) -> ListObject["Price"]: params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -802,7 +801,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_product.py b/stripe/_product.py index 52acddacf..b660d5146 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -722,7 +722,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -743,7 +742,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -850,7 +848,7 @@ def delete_feature( cls, product: str, id: str, - **params: Unpack["Product.DeleteFeatureParams"] + **params: Unpack["Product.DeleteFeatureParams"], ) -> "ProductFeature": """ Deletes the feature attachment to a product @@ -871,7 +869,7 @@ async def delete_feature_async( cls, product: str, id: str, - **params: Unpack["Product.DeleteFeatureParams"] + **params: Unpack["Product.DeleteFeatureParams"], ) -> "ProductFeature": """ Deletes the feature attachment to a product @@ -964,7 +962,7 @@ def retrieve_feature( cls, product: str, id: str, - **params: Unpack["Product.RetrieveFeatureParams"] + **params: Unpack["Product.RetrieveFeatureParams"], ) -> "ProductFeature": """ Retrieves a product_feature, which represents a feature attachment to a product @@ -985,7 +983,7 @@ async def retrieve_feature_async( cls, product: str, id: str, - **params: Unpack["Product.RetrieveFeatureParams"] + **params: Unpack["Product.RetrieveFeatureParams"], ) -> "ProductFeature": """ Retrieves a product_feature, which represents a feature attachment to a product diff --git a/stripe/_promotion_code.py b/stripe/_promotion_code.py index f785facd4..13fb3c528 100644 --- a/stripe/_promotion_code.py +++ b/stripe/_promotion_code.py @@ -315,7 +315,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -336,7 +335,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_quote.py b/stripe/_quote.py index d4f5d71e2..fc7dc4df7 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -1501,7 +1501,6 @@ def list(cls, **params: Unpack["Quote.ListParams"]) -> ListObject["Quote"]: params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1522,7 +1521,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1534,7 +1532,7 @@ async def list_async( def _cls_list_computed_upfront_line_items( cls, quote: str, - **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. @@ -1554,7 +1552,7 @@ def _cls_list_computed_upfront_line_items( @staticmethod def list_computed_upfront_line_items( quote: str, - **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. @@ -1592,7 +1590,7 @@ def list_computed_upfront_line_items( # pyright: ignore[reportGeneralTypeIssues async def _cls_list_computed_upfront_line_items_async( cls, quote: str, - **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. @@ -1612,7 +1610,7 @@ async def _cls_list_computed_upfront_line_items_async( @staticmethod async def list_computed_upfront_line_items_async( quote: str, - **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. diff --git a/stripe/_refund.py b/stripe/_refund.py index 1fc7f726c..4a455ff11 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -706,7 +706,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -727,7 +726,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_request_options.py b/stripe/_request_options.py index 0d39e885a..d188818f8 100644 --- a/stripe/_request_options.py +++ b/stripe/_request_options.py @@ -45,7 +45,7 @@ def merge_options( def extract_options_from_dict( - d: Optional[Mapping[str, Any]] + d: Optional[Mapping[str, Any]], ) -> Tuple[RequestOptions, Dict[str, Any]]: """ Extracts a RequestOptions object from a dict, and returns a tuple of diff --git a/stripe/_reserve_transaction.py b/stripe/_reserve_transaction.py index 72e367f7a..aef70b250 100644 --- a/stripe/_reserve_transaction.py +++ b/stripe/_reserve_transaction.py @@ -6,9 +6,9 @@ class ReserveTransaction(StripeObject): - OBJECT_NAME: ClassVar[ - Literal["reserve_transaction"] - ] = "reserve_transaction" + OBJECT_NAME: ClassVar[Literal["reserve_transaction"]] = ( + "reserve_transaction" + ) amount: int currency: str """ diff --git a/stripe/_review.py b/stripe/_review.py index 82c4a8cf6..691e8335a 100644 --- a/stripe/_review.py +++ b/stripe/_review.py @@ -304,7 +304,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -325,7 +324,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 58c53bd74..027b1280d 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -809,7 +809,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -830,7 +829,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 79ea36afc..72d19b7d8 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -1760,7 +1760,9 @@ class CreateParamsAutomaticPaymentMethods(TypedDict): """ class CreateParamsMandateData(TypedDict): - customer_acceptance: "SetupIntent.CreateParamsMandateDataCustomerAcceptance" + customer_acceptance: ( + "SetupIntent.CreateParamsMandateDataCustomerAcceptance" + ) """ This hash contains details about the customer acceptance of the Mandate. """ @@ -4318,7 +4320,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -4339,7 +4340,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -4415,7 +4415,7 @@ async def retrieve_async( def _cls_verify_microdeposits( cls, intent: str, - **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] + **params: Unpack["SetupIntent.VerifyMicrodepositsParams"], ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. @@ -4472,7 +4472,7 @@ def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] async def _cls_verify_microdeposits_async( cls, intent: str, - **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] + **params: Unpack["SetupIntent.VerifyMicrodepositsParams"], ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index af9f2421f..a0f7c3842 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -1189,7 +1189,9 @@ class CreateParamsAutomaticPaymentMethods(TypedDict): """ class CreateParamsMandateData(TypedDict): - customer_acceptance: "SetupIntentService.CreateParamsMandateDataCustomerAcceptance" + customer_acceptance: ( + "SetupIntentService.CreateParamsMandateDataCustomerAcceptance" + ) """ This hash contains details about the customer acceptance of the Mandate. """ diff --git a/stripe/_shipping_rate.py b/stripe/_shipping_rate.py index fa424e3c9..b156339ea 100644 --- a/stripe/_shipping_rate.py +++ b/stripe/_shipping_rate.py @@ -379,7 +379,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -400,7 +399,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_source.py b/stripe/_source.py index 74e8c25b1..3af9dbfbe 100644 --- a/stripe/_source.py +++ b/stripe/_source.py @@ -1147,7 +1147,7 @@ async def create_async( def _cls_list_source_transactions( cls, source: str, - **params: Unpack["Source.ListSourceTransactionsParams"] + **params: Unpack["Source.ListSourceTransactionsParams"], ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. @@ -1204,7 +1204,7 @@ def list_source_transactions( # pyright: ignore[reportGeneralTypeIssues] async def _cls_list_source_transactions_async( cls, source: str, - **params: Unpack["Source.ListSourceTransactionsParams"] + **params: Unpack["Source.ListSourceTransactionsParams"], ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. diff --git a/stripe/_source_mandate_notification.py b/stripe/_source_mandate_notification.py index fbb525eb1..2d6a62020 100644 --- a/stripe/_source_mandate_notification.py +++ b/stripe/_source_mandate_notification.py @@ -15,9 +15,9 @@ class SourceMandateNotification(StripeObject): deliver an email to the customer. """ - OBJECT_NAME: ClassVar[ - Literal["source_mandate_notification"] - ] = "source_mandate_notification" + OBJECT_NAME: ClassVar[Literal["source_mandate_notification"]] = ( + "source_mandate_notification" + ) class AcssDebit(StripeObject): statement_descriptor: Optional[str] diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 691797af7..d88ea65a4 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -97,7 +97,6 @@ from stripe._transfer_service import TransferService from stripe._treasury_service import TreasuryService from stripe._webhook_endpoint_service import WebhookEndpointService - # services: The end of the section generated from our OpenAPI spec diff --git a/stripe/_stripe_object.py b/stripe/_stripe_object.py index 4a036e9b7..d0b2230f0 100644 --- a/stripe/_stripe_object.py +++ b/stripe/_stripe_object.py @@ -38,15 +38,13 @@ @overload def _compute_diff( current: Dict[str, Any], previous: Optional[Dict[str, Any]] -) -> Dict[str, Any]: - ... +) -> Dict[str, Any]: ... @overload def _compute_diff( current: object, previous: Optional[Dict[str, Any]] -) -> object: - ... +) -> object: ... def _compute_diff( @@ -101,7 +99,7 @@ def __init__( *, _requestor: Optional["_APIRequestor"] = None, # TODO: is a more specific type possible here? - **params: Any + **params: Any, ): super(StripeObject, self).__init__() @@ -522,7 +520,7 @@ def to_dict(self) -> Dict[str, Any]: def _to_dict_recursive(self) -> Dict[str, Any]: def maybe_to_dict_recursive( - value: Optional[Union[StripeObject, Dict[str, Any]]] + value: Optional[Union[StripeObject, Dict[str, Any]]], ) -> Optional[Dict[str, Any]]: if value is None: return None diff --git a/stripe/_subscription.py b/stripe/_subscription.py index f2ec1273e..dd79eb2f0 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -2194,7 +2194,7 @@ class SearchParams(RequestOptions): def _cls_cancel( cls, subscription_exposed_id: str, - **params: Unpack["Subscription.CancelParams"] + **params: Unpack["Subscription.CancelParams"], ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. @@ -2220,7 +2220,7 @@ def _cls_cancel( @staticmethod def cancel( subscription_exposed_id: str, - **params: Unpack["Subscription.CancelParams"] + **params: Unpack["Subscription.CancelParams"], ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. @@ -2270,7 +2270,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] async def _cls_cancel_async( cls, subscription_exposed_id: str, - **params: Unpack["Subscription.CancelParams"] + **params: Unpack["Subscription.CancelParams"], ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. @@ -2296,7 +2296,7 @@ async def _cls_cancel_async( @staticmethod async def cancel_async( subscription_exposed_id: str, - **params: Unpack["Subscription.CancelParams"] + **params: Unpack["Subscription.CancelParams"], ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. @@ -2390,7 +2390,7 @@ async def create_async( def _cls_delete_discount( cls, subscription_exposed_id: str, - **params: Unpack["Subscription.DeleteDiscountParams"] + **params: Unpack["Subscription.DeleteDiscountParams"], ) -> "Discount": """ Removes the currently applied discount on a subscription. @@ -2412,7 +2412,7 @@ def _cls_delete_discount( @staticmethod def delete_discount( subscription_exposed_id: str, - **params: Unpack["Subscription.DeleteDiscountParams"] + **params: Unpack["Subscription.DeleteDiscountParams"], ) -> "Discount": """ Removes the currently applied discount on a subscription. @@ -2450,7 +2450,7 @@ def delete_discount( # pyright: ignore[reportGeneralTypeIssues] async def _cls_delete_discount_async( cls, subscription_exposed_id: str, - **params: Unpack["Subscription.DeleteDiscountParams"] + **params: Unpack["Subscription.DeleteDiscountParams"], ) -> "Discount": """ Removes the currently applied discount on a subscription. @@ -2472,7 +2472,7 @@ async def _cls_delete_discount_async( @staticmethod async def delete_discount_async( subscription_exposed_id: str, - **params: Unpack["Subscription.DeleteDiscountParams"] + **params: Unpack["Subscription.DeleteDiscountParams"], ) -> "Discount": """ Removes the currently applied discount on a subscription. @@ -2519,7 +2519,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -2540,7 +2539,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index 5dd7abec8..9fbf79626 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -595,7 +595,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -616,7 +615,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -684,7 +682,7 @@ async def retrieve_async( def create_usage_record( cls, subscription_item: str, - **params: Unpack["SubscriptionItem.CreateUsageRecordParams"] + **params: Unpack["SubscriptionItem.CreateUsageRecordParams"], ) -> "UsageRecord": """ Creates a usage record for a specified subscription item and date, and fills it with a quantity. @@ -710,7 +708,7 @@ def create_usage_record( async def create_usage_record_async( cls, subscription_item: str, - **params: Unpack["SubscriptionItem.CreateUsageRecordParams"] + **params: Unpack["SubscriptionItem.CreateUsageRecordParams"], ) -> "UsageRecord": """ Creates a usage record for a specified subscription item and date, and fills it with a quantity. @@ -736,7 +734,7 @@ async def create_usage_record_async( def list_usage_record_summaries( cls, subscription_item: str, - **params: Unpack["SubscriptionItem.ListUsageRecordSummariesParams"] + **params: Unpack["SubscriptionItem.ListUsageRecordSummariesParams"], ) -> ListObject["UsageRecordSummary"]: """ For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). @@ -758,7 +756,7 @@ def list_usage_record_summaries( async def list_usage_record_summaries_async( cls, subscription_item: str, - **params: Unpack["SubscriptionItem.ListUsageRecordSummariesParams"] + **params: Unpack["SubscriptionItem.ListUsageRecordSummariesParams"], ) -> ListObject["UsageRecordSummary"]: """ For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index f5a2f1e95..11738c8f3 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -44,9 +44,9 @@ class SubscriptionSchedule( Related guide: [Subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules) """ - OBJECT_NAME: ClassVar[ - Literal["subscription_schedule"] - ] = "subscription_schedule" + OBJECT_NAME: ClassVar[Literal["subscription_schedule"]] = ( + "subscription_schedule" + ) class CurrentPhase(StripeObject): end_date: int @@ -913,7 +913,9 @@ class CreateParamsPhaseItemPriceData(TypedDict): """ The ID of the product that this price will belong to. """ - recurring: "SubscriptionSchedule.CreateParamsPhaseItemPriceDataRecurring" + recurring: ( + "SubscriptionSchedule.CreateParamsPhaseItemPriceDataRecurring" + ) """ The recurring components of a price such as `interval` and `interval_count`. """ @@ -1541,7 +1543,9 @@ class ModifyParamsPhaseItemPriceData(TypedDict): """ The ID of the product that this price will belong to. """ - recurring: "SubscriptionSchedule.ModifyParamsPhaseItemPriceDataRecurring" + recurring: ( + "SubscriptionSchedule.ModifyParamsPhaseItemPriceDataRecurring" + ) """ The recurring components of a price such as `interval` and `interval_count`. """ @@ -1672,7 +1676,7 @@ class RetrieveParams(RequestOptions): def _cls_cancel( cls, schedule: str, - **params: Unpack["SubscriptionSchedule.CancelParams"] + **params: Unpack["SubscriptionSchedule.CancelParams"], ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. @@ -1729,7 +1733,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] async def _cls_cancel_async( cls, schedule: str, - **params: Unpack["SubscriptionSchedule.CancelParams"] + **params: Unpack["SubscriptionSchedule.CancelParams"], ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. @@ -1827,7 +1831,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1848,7 +1851,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1894,7 +1896,7 @@ async def modify_async( def _cls_release( cls, schedule: str, - **params: Unpack["SubscriptionSchedule.ReleaseParams"] + **params: Unpack["SubscriptionSchedule.ReleaseParams"], ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. @@ -1951,7 +1953,7 @@ def release( # pyright: ignore[reportGeneralTypeIssues] async def _cls_release_async( cls, schedule: str, - **params: Unpack["SubscriptionSchedule.ReleaseParams"] + **params: Unpack["SubscriptionSchedule.ReleaseParams"], ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index d36ad3315..0fbe94712 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -718,7 +718,9 @@ class CreateParamsTransferData(TypedDict): """ class CreateParamsTrialSettings(TypedDict): - end_behavior: "SubscriptionService.CreateParamsTrialSettingsEndBehavior" + end_behavior: ( + "SubscriptionService.CreateParamsTrialSettingsEndBehavior" + ) """ Defines how the subscription should behave when the user's free trial ends. """ @@ -1585,7 +1587,9 @@ class UpdateParamsTransferData(TypedDict): """ class UpdateParamsTrialSettings(TypedDict): - end_behavior: "SubscriptionService.UpdateParamsTrialSettingsEndBehavior" + end_behavior: ( + "SubscriptionService.UpdateParamsTrialSettingsEndBehavior" + ) """ Defines how the subscription should behave when the user's free trial ends. """ diff --git a/stripe/_tax_code.py b/stripe/_tax_code.py index a20795230..e9160c8b1 100644 --- a/stripe/_tax_code.py +++ b/stripe/_tax_code.py @@ -68,7 +68,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -89,7 +88,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_tax_deducted_at_source.py b/stripe/_tax_deducted_at_source.py index c2a064fa9..a07bcf4ca 100644 --- a/stripe/_tax_deducted_at_source.py +++ b/stripe/_tax_deducted_at_source.py @@ -6,9 +6,9 @@ class TaxDeductedAtSource(StripeObject): - OBJECT_NAME: ClassVar[ - Literal["tax_deducted_at_source"] - ] = "tax_deducted_at_source" + OBJECT_NAME: ClassVar[Literal["tax_deducted_at_source"]] = ( + "tax_deducted_at_source" + ) id: str """ Unique identifier for the object. diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index 1e481e344..bc61e7638 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -471,7 +471,6 @@ def list(cls, **params: Unpack["TaxId.ListParams"]) -> ListObject["TaxId"]: params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -492,7 +491,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index 8ab062194..8a19bb5d5 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -318,7 +318,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -339,7 +338,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_topup.py b/stripe/_topup.py index c6404973e..9c1dc0004 100644 --- a/stripe/_topup.py +++ b/stripe/_topup.py @@ -372,7 +372,6 @@ def list(cls, **params: Unpack["Topup.ListParams"]) -> ListObject["Topup"]: params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -393,7 +392,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/_transfer.py b/stripe/_transfer.py index 222d59d72..f691fd9a3 100644 --- a/stripe/_transfer.py +++ b/stripe/_transfer.py @@ -319,7 +319,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -340,7 +339,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -453,7 +451,7 @@ def retrieve_reversal( cls, transfer: str, id: str, - **params: Unpack["Transfer.RetrieveReversalParams"] + **params: Unpack["Transfer.RetrieveReversalParams"], ) -> "Reversal": """ By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. @@ -474,7 +472,7 @@ async def retrieve_reversal_async( cls, transfer: str, id: str, - **params: Unpack["Transfer.RetrieveReversalParams"] + **params: Unpack["Transfer.RetrieveReversalParams"], ) -> "Reversal": """ By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. @@ -495,7 +493,7 @@ def modify_reversal( cls, transfer: str, id: str, - **params: Unpack["Transfer.ModifyReversalParams"] + **params: Unpack["Transfer.ModifyReversalParams"], ) -> "Reversal": """ Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -518,7 +516,7 @@ async def modify_reversal_async( cls, transfer: str, id: str, - **params: Unpack["Transfer.ModifyReversalParams"] + **params: Unpack["Transfer.ModifyReversalParams"], ) -> "Reversal": """ Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. diff --git a/stripe/_usage_record_summary.py b/stripe/_usage_record_summary.py index 0e450a682..fa46e82e3 100644 --- a/stripe/_usage_record_summary.py +++ b/stripe/_usage_record_summary.py @@ -6,9 +6,9 @@ class UsageRecordSummary(StripeObject): - OBJECT_NAME: ClassVar[ - Literal["usage_record_summary"] - ] = "usage_record_summary" + OBJECT_NAME: ClassVar[Literal["usage_record_summary"]] = ( + "usage_record_summary" + ) class Period(StripeObject): end: Optional[int] diff --git a/stripe/_util.py b/stripe/_util.py index 0c14b2a10..6458d70a7 100644 --- a/stripe/_util.py +++ b/stripe/_util.py @@ -212,8 +212,7 @@ def convert_to_stripe_object( klass_: Optional[Type["StripeObject"]] = None, *, api_mode: ApiMode = "V1", -) -> "StripeObject": - ... +) -> "StripeObject": ... @overload @@ -226,8 +225,7 @@ def convert_to_stripe_object( klass_: Optional[Type["StripeObject"]] = None, *, api_mode: ApiMode = "V1", -) -> List["StripeObject"]: - ... +) -> List["StripeObject"]: ... def convert_to_stripe_object( @@ -263,8 +261,7 @@ def _convert_to_stripe_object( klass_: Optional[Type["StripeObject"]] = None, requestor: "_APIRequestor", api_mode: ApiMode, -) -> "StripeObject": - ... +) -> "StripeObject": ... @overload @@ -275,8 +272,7 @@ def _convert_to_stripe_object( klass_: Optional[Type["StripeObject"]] = None, requestor: "_APIRequestor", api_mode: ApiMode, -) -> List["StripeObject"]: - ... +) -> List["StripeObject"]: ... def _convert_to_stripe_object( @@ -368,17 +364,15 @@ def convert_to_dict(obj): @overload def populate_headers( idempotency_key: str, -) -> Dict[str, str]: - ... +) -> Dict[str, str]: ... @overload -def populate_headers(idempotency_key: None) -> None: - ... +def populate_headers(idempotency_key: None) -> None: ... def populate_headers( - idempotency_key: Union[str, None] + idempotency_key: Union[str, None], ) -> Union[Dict[str, str], None]: if idempotency_key is not None: return {"Idempotency-Key": idempotency_key} diff --git a/stripe/_verify_mixin.py b/stripe/_verify_mixin.py index 870eff351..bf779c617 100644 --- a/stripe/_verify_mixin.py +++ b/stripe/_verify_mixin.py @@ -5,16 +5,14 @@ class _Verifiable(Protocol): - def instance_url(self) -> str: - ... + def instance_url(self) -> str: ... def _request( self, method: str, url: str, params: Dict[str, Any], - ) -> StripeObject: - ... + ) -> StripeObject: ... class VerifyMixin(object): diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index a31b96569..c23848bbc 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -880,7 +880,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -901,7 +900,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/app_info.py b/stripe/app_info.py index 44b9fe99d..b4be7cadc 100644 --- a/stripe/app_info.py +++ b/stripe/app_info.py @@ -7,6 +7,7 @@ To: from stripe import AppInfo """ + from typing_extensions import TYPE_CHECKING # No deprecation warning is raised here, because it would happen diff --git a/stripe/apps/_secret.py b/stripe/apps/_secret.py index 39f7ef8e2..f79259ba8 100644 --- a/stripe/apps/_secret.py +++ b/stripe/apps/_secret.py @@ -285,7 +285,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -306,7 +305,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index a6d0221b6..084c06e2a 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -389,7 +389,6 @@ def list(cls, **params: Unpack["Meter.ListParams"]) -> ListObject["Meter"]: params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -410,7 +409,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/billing/_meter_event.py b/stripe/billing/_meter_event.py index aa247a91a..46fc203e6 100644 --- a/stripe/billing/_meter_event.py +++ b/stripe/billing/_meter_event.py @@ -12,9 +12,9 @@ class MeterEvent(CreateableAPIResource["MeterEvent"]): Meter events are associated with billing meters, which define the shape of the event's payload and how those events are aggregated for billing. """ - OBJECT_NAME: ClassVar[ - Literal["billing.meter_event"] - ] = "billing.meter_event" + OBJECT_NAME: ClassVar[Literal["billing.meter_event"]] = ( + "billing.meter_event" + ) class CreateParams(RequestOptions): event_name: str diff --git a/stripe/billing/_meter_event_adjustment.py b/stripe/billing/_meter_event_adjustment.py index a1199b996..23f7ab0ac 100644 --- a/stripe/billing/_meter_event_adjustment.py +++ b/stripe/billing/_meter_event_adjustment.py @@ -12,9 +12,9 @@ class MeterEventAdjustment(CreateableAPIResource["MeterEventAdjustment"]): A billing meter event adjustment is a resource that allows you to cancel a meter event. For example, you might create a billing meter event adjustment to cancel a meter event that was created in error or attached to the wrong customer. """ - OBJECT_NAME: ClassVar[ - Literal["billing.meter_event_adjustment"] - ] = "billing.meter_event_adjustment" + OBJECT_NAME: ClassVar[Literal["billing.meter_event_adjustment"]] = ( + "billing.meter_event_adjustment" + ) class Cancel(StripeObject): identifier: Optional[str] diff --git a/stripe/billing/_meter_event_summary.py b/stripe/billing/_meter_event_summary.py index 5b6fc0700..a6b1e23fc 100644 --- a/stripe/billing/_meter_event_summary.py +++ b/stripe/billing/_meter_event_summary.py @@ -11,9 +11,9 @@ class MeterEventSummary(StripeObject): usage was accrued by a customer for that period. """ - OBJECT_NAME: ClassVar[ - Literal["billing.meter_event_summary"] - ] = "billing.meter_event_summary" + OBJECT_NAME: ClassVar[Literal["billing.meter_event_summary"]] = ( + "billing.meter_event_summary" + ) aggregated_value: float """ Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). The aggregation strategy is defined on meter via `default_aggregation`. diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index 39e28a3e6..90bc5fbd2 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -30,9 +30,9 @@ class Configuration( A portal configuration describes the functionality and behavior of a portal session. """ - OBJECT_NAME: ClassVar[ - Literal["billing_portal.configuration"] - ] = "billing_portal.configuration" + OBJECT_NAME: ClassVar[Literal["billing_portal.configuration"]] = ( + "billing_portal.configuration" + ) class BusinessProfile(StripeObject): headline: Optional[str] @@ -656,7 +656,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -677,7 +676,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index 12cacac9d..608d06d04 100644 --- a/stripe/billing_portal/_session.py +++ b/stripe/billing_portal/_session.py @@ -35,9 +35,9 @@ class Session(CreateableAPIResource["Session"]): Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal). """ - OBJECT_NAME: ClassVar[ - Literal["billing_portal.session"] - ] = "billing_portal.session" + OBJECT_NAME: ClassVar[Literal["billing_portal.session"]] = ( + "billing_portal.session" + ) class Flow(StripeObject): class AfterCompletion(StripeObject): diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 7b5c9d337..983b1d8ba 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -3578,7 +3578,9 @@ class CreateParamsSubscriptionDataTransferData(TypedDict): """ class CreateParamsSubscriptionDataTrialSettings(TypedDict): - end_behavior: "Session.CreateParamsSubscriptionDataTrialSettingsEndBehavior" + end_behavior: ( + "Session.CreateParamsSubscriptionDataTrialSettingsEndBehavior" + ) """ Defines how the subscription should behave when the user's free trial ends. """ @@ -4133,7 +4135,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -4154,7 +4155,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/climate/_order.py b/stripe/climate/_order.py index 1fdf62de0..1a51fc668 100644 --- a/stripe/climate/_order.py +++ b/stripe/climate/_order.py @@ -435,7 +435,6 @@ def list(cls, **params: Unpack["Order.ListParams"]) -> ListObject["Order"]: params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -457,7 +456,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/climate/_product.py b/stripe/climate/_product.py index 8117c7aa5..fbe5c4d16 100644 --- a/stripe/climate/_product.py +++ b/stripe/climate/_product.py @@ -109,7 +109,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -130,7 +129,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/climate/_supplier.py b/stripe/climate/_supplier.py index 9b4c61f0f..78b76bbc0 100644 --- a/stripe/climate/_supplier.py +++ b/stripe/climate/_supplier.py @@ -107,7 +107,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -128,7 +127,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/entitlements/_active_entitlement.py b/stripe/entitlements/_active_entitlement.py index 7fa4f76f8..51d324d5c 100644 --- a/stripe/entitlements/_active_entitlement.py +++ b/stripe/entitlements/_active_entitlement.py @@ -16,9 +16,9 @@ class ActiveEntitlement(ListableAPIResource["ActiveEntitlement"]): An active entitlement describes access to a feature for a customer. """ - OBJECT_NAME: ClassVar[ - Literal["entitlements.active_entitlement"] - ] = "entitlements.active_entitlement" + OBJECT_NAME: ClassVar[Literal["entitlements.active_entitlement"]] = ( + "entitlements.active_entitlement" + ) class ListParams(RequestOptions): customer: str @@ -82,7 +82,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -103,7 +102,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/entitlements/_feature.py b/stripe/entitlements/_feature.py index 3c6249681..99162f70a 100644 --- a/stripe/entitlements/_feature.py +++ b/stripe/entitlements/_feature.py @@ -20,9 +20,9 @@ class Feature( Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. """ - OBJECT_NAME: ClassVar[ - Literal["entitlements.feature"] - ] = "entitlements.feature" + OBJECT_NAME: ClassVar[Literal["entitlements.feature"]] = ( + "entitlements.feature" + ) class CreateParams(RequestOptions): expand: NotRequired[List[str]] @@ -156,7 +156,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -177,7 +176,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/financial_connections/_account.py b/stripe/financial_connections/_account.py index 9ad72758d..4cda93ad7 100644 --- a/stripe/financial_connections/_account.py +++ b/stripe/financial_connections/_account.py @@ -29,9 +29,9 @@ class Account(ListableAPIResource["Account"]): A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access. """ - OBJECT_NAME: ClassVar[ - Literal["financial_connections.account"] - ] = "financial_connections.account" + OBJECT_NAME: ClassVar[Literal["financial_connections.account"]] = ( + "financial_connections.account" + ) class AccountHolder(StripeObject): account: Optional[ExpandableField["AccountResource"]] @@ -458,7 +458,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -479,7 +478,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/financial_connections/_account_owner.py b/stripe/financial_connections/_account_owner.py index bada8d828..86e2a5c87 100644 --- a/stripe/financial_connections/_account_owner.py +++ b/stripe/financial_connections/_account_owner.py @@ -10,9 +10,9 @@ class AccountOwner(StripeObject): Describes an owner of an account. """ - OBJECT_NAME: ClassVar[ - Literal["financial_connections.account_owner"] - ] = "financial_connections.account_owner" + OBJECT_NAME: ClassVar[Literal["financial_connections.account_owner"]] = ( + "financial_connections.account_owner" + ) email: Optional[str] """ The email address of the owner. diff --git a/stripe/financial_connections/_session.py b/stripe/financial_connections/_session.py index 54e50ebcf..0b9cff990 100644 --- a/stripe/financial_connections/_session.py +++ b/stripe/financial_connections/_session.py @@ -27,9 +27,9 @@ class Session(CreateableAPIResource["Session"]): A Financial Connections Session is the secure way to programmatically launch the client-side Stripe.js modal that lets your users link their accounts. """ - OBJECT_NAME: ClassVar[ - Literal["financial_connections.session"] - ] = "financial_connections.session" + OBJECT_NAME: ClassVar[Literal["financial_connections.session"]] = ( + "financial_connections.session" + ) class AccountHolder(StripeObject): account: Optional[ExpandableField["AccountResource"]] diff --git a/stripe/financial_connections/_transaction.py b/stripe/financial_connections/_transaction.py index 70b6ce9bb..1874a2b52 100644 --- a/stripe/financial_connections/_transaction.py +++ b/stripe/financial_connections/_transaction.py @@ -13,9 +13,9 @@ class Transaction(ListableAPIResource["Transaction"]): A Transaction represents a real transaction that affects a Financial Connections Account balance. """ - OBJECT_NAME: ClassVar[ - Literal["financial_connections.transaction"] - ] = "financial_connections.transaction" + OBJECT_NAME: ClassVar[Literal["financial_connections.transaction"]] = ( + "financial_connections.transaction" + ) class StatusTransitions(StripeObject): posted_at: Optional[int] @@ -148,7 +148,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -169,7 +168,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/forwarding/_request.py b/stripe/forwarding/_request.py index 084c647cb..f371f380c 100644 --- a/stripe/forwarding/_request.py +++ b/stripe/forwarding/_request.py @@ -271,7 +271,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -292,7 +291,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index 0bbf39b37..a8e721ac7 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -23,9 +23,9 @@ class VerificationReport(ListableAPIResource["VerificationReport"]): Related guides: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results). """ - OBJECT_NAME: ClassVar[ - Literal["identity.verification_report"] - ] = "identity.verification_report" + OBJECT_NAME: ClassVar[Literal["identity.verification_report"]] = ( + "identity.verification_report" + ) class Document(StripeObject): class Address(StripeObject): @@ -476,7 +476,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -497,7 +496,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 333126995..277141df8 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -40,9 +40,9 @@ class VerificationSession( Related guide: [The Verification Sessions API](https://stripe.com/docs/identity/verification-sessions) """ - OBJECT_NAME: ClassVar[ - Literal["identity.verification_session"] - ] = "identity.verification_session" + OBJECT_NAME: ClassVar[Literal["identity.verification_session"]] = ( + "identity.verification_session" + ) class LastError(StripeObject): code: Optional[ @@ -670,7 +670,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -691,7 +690,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index 529120e10..1ad54228d 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -38,9 +38,9 @@ class Authorization( Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations) """ - OBJECT_NAME: ClassVar[ - Literal["issuing.authorization"] - ] = "issuing.authorization" + OBJECT_NAME: ClassVar[Literal["issuing.authorization"]] = ( + "issuing.authorization" + ) class AmountDetails(StripeObject): atm_fee: Optional[int] @@ -1109,7 +1109,7 @@ class ReverseParams(RequestOptions): def _cls_approve( cls, authorization: str, - **params: Unpack["Authorization.ApproveParams"] + **params: Unpack["Authorization.ApproveParams"], ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -1170,7 +1170,7 @@ def approve( # pyright: ignore[reportGeneralTypeIssues] async def _cls_approve_async( cls, authorization: str, - **params: Unpack["Authorization.ApproveParams"] + **params: Unpack["Authorization.ApproveParams"], ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -1231,7 +1231,7 @@ async def approve_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_decline( cls, authorization: str, - **params: Unpack["Authorization.DeclineParams"] + **params: Unpack["Authorization.DeclineParams"], ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -1292,7 +1292,7 @@ def decline( # pyright: ignore[reportGeneralTypeIssues] async def _cls_decline_async( cls, authorization: str, - **params: Unpack["Authorization.DeclineParams"] + **params: Unpack["Authorization.DeclineParams"], ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -1362,7 +1362,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1383,7 +1382,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1454,7 +1452,7 @@ class TestHelpers(APIResourceTestHelpers["Authorization"]): def _cls_capture( cls, authorization: str, - **params: Unpack["Authorization.CaptureParams"] + **params: Unpack["Authorization.CaptureParams"], ) -> "Authorization": """ Capture a test-mode authorization. @@ -1511,7 +1509,7 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] async def _cls_capture_async( cls, authorization: str, - **params: Unpack["Authorization.CaptureParams"] + **params: Unpack["Authorization.CaptureParams"], ) -> "Authorization": """ Capture a test-mode authorization. @@ -1600,7 +1598,7 @@ async def create_async( def _cls_expire( cls, authorization: str, - **params: Unpack["Authorization.ExpireParams"] + **params: Unpack["Authorization.ExpireParams"], ) -> "Authorization": """ Expire a test-mode Authorization. @@ -1657,7 +1655,7 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] async def _cls_expire_async( cls, authorization: str, - **params: Unpack["Authorization.ExpireParams"] + **params: Unpack["Authorization.ExpireParams"], ) -> "Authorization": """ Expire a test-mode Authorization. @@ -1714,7 +1712,7 @@ async def expire_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_increment( cls, authorization: str, - **params: Unpack["Authorization.IncrementParams"] + **params: Unpack["Authorization.IncrementParams"], ) -> "Authorization": """ Increment a test-mode Authorization. @@ -1734,7 +1732,7 @@ def _cls_increment( @staticmethod def increment( authorization: str, - **params: Unpack["Authorization.IncrementParams"] + **params: Unpack["Authorization.IncrementParams"], ) -> "Authorization": """ Increment a test-mode Authorization. @@ -1772,7 +1770,7 @@ def increment( # pyright: ignore[reportGeneralTypeIssues] async def _cls_increment_async( cls, authorization: str, - **params: Unpack["Authorization.IncrementParams"] + **params: Unpack["Authorization.IncrementParams"], ) -> "Authorization": """ Increment a test-mode Authorization. @@ -1792,7 +1790,7 @@ async def _cls_increment_async( @staticmethod async def increment_async( authorization: str, - **params: Unpack["Authorization.IncrementParams"] + **params: Unpack["Authorization.IncrementParams"], ) -> "Authorization": """ Increment a test-mode Authorization. @@ -1830,7 +1828,7 @@ async def increment_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_reverse( cls, authorization: str, - **params: Unpack["Authorization.ReverseParams"] + **params: Unpack["Authorization.ReverseParams"], ) -> "Authorization": """ Reverse a test-mode Authorization. @@ -1887,7 +1885,7 @@ def reverse( # pyright: ignore[reportGeneralTypeIssues] async def _cls_reverse_async( cls, authorization: str, - **params: Unpack["Authorization.ReverseParams"] + **params: Unpack["Authorization.ReverseParams"], ) -> "Authorization": """ Reverse a test-mode Authorization. diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index 903215bfc..86507a293 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -3395,7 +3395,6 @@ def list(cls, **params: Unpack["Card.ListParams"]) -> ListObject["Card"]: params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -3416,7 +3415,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/issuing/_cardholder.py b/stripe/issuing/_cardholder.py index 71d21f76f..4d5163009 100644 --- a/stripe/issuing/_cardholder.py +++ b/stripe/issuing/_cardholder.py @@ -3531,7 +3531,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -3552,7 +3551,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/issuing/_dispute.py b/stripe/issuing/_dispute.py index 32c735376..9102bcf07 100644 --- a/stripe/issuing/_dispute.py +++ b/stripe/issuing/_dispute.py @@ -911,7 +911,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -932,7 +931,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/issuing/_personalization_design.py b/stripe/issuing/_personalization_design.py index 16b2aaa9d..c8520e8ee 100644 --- a/stripe/issuing/_personalization_design.py +++ b/stripe/issuing/_personalization_design.py @@ -33,9 +33,9 @@ class PersonalizationDesign( A Personalization Design is a logical grouping of a Physical Bundle, card logo, and carrier text that represents a product line. """ - OBJECT_NAME: ClassVar[ - Literal["issuing.personalization_design"] - ] = "issuing.personalization_design" + OBJECT_NAME: ClassVar[Literal["issuing.personalization_design"]] = ( + "issuing.personalization_design" + ) class CarrierText(StripeObject): footer_body: Optional[str] @@ -429,7 +429,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -450,7 +449,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -521,7 +519,7 @@ class TestHelpers(APIResourceTestHelpers["PersonalizationDesign"]): def _cls_activate( cls, personalization_design: str, - **params: Unpack["PersonalizationDesign.ActivateParams"] + **params: Unpack["PersonalizationDesign.ActivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to active. @@ -543,7 +541,7 @@ def _cls_activate( @staticmethod def activate( personalization_design: str, - **params: Unpack["PersonalizationDesign.ActivateParams"] + **params: Unpack["PersonalizationDesign.ActivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to active. @@ -583,7 +581,7 @@ def activate( # pyright: ignore[reportGeneralTypeIssues] async def _cls_activate_async( cls, personalization_design: str, - **params: Unpack["PersonalizationDesign.ActivateParams"] + **params: Unpack["PersonalizationDesign.ActivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to active. @@ -605,7 +603,7 @@ async def _cls_activate_async( @staticmethod async def activate_async( personalization_design: str, - **params: Unpack["PersonalizationDesign.ActivateParams"] + **params: Unpack["PersonalizationDesign.ActivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to active. @@ -645,7 +643,7 @@ async def activate_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_deactivate( cls, personalization_design: str, - **params: Unpack["PersonalizationDesign.DeactivateParams"] + **params: Unpack["PersonalizationDesign.DeactivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to inactive. @@ -667,7 +665,7 @@ def _cls_deactivate( @staticmethod def deactivate( personalization_design: str, - **params: Unpack["PersonalizationDesign.DeactivateParams"] + **params: Unpack["PersonalizationDesign.DeactivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to inactive. @@ -707,7 +705,7 @@ def deactivate( # pyright: ignore[reportGeneralTypeIssues] async def _cls_deactivate_async( cls, personalization_design: str, - **params: Unpack["PersonalizationDesign.DeactivateParams"] + **params: Unpack["PersonalizationDesign.DeactivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to inactive. @@ -729,7 +727,7 @@ async def _cls_deactivate_async( @staticmethod async def deactivate_async( personalization_design: str, - **params: Unpack["PersonalizationDesign.DeactivateParams"] + **params: Unpack["PersonalizationDesign.DeactivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to inactive. @@ -769,7 +767,7 @@ async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_reject( cls, personalization_design: str, - **params: Unpack["PersonalizationDesign.RejectParams"] + **params: Unpack["PersonalizationDesign.RejectParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to rejected. @@ -791,7 +789,7 @@ def _cls_reject( @staticmethod def reject( personalization_design: str, - **params: Unpack["PersonalizationDesign.RejectParams"] + **params: Unpack["PersonalizationDesign.RejectParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to rejected. @@ -831,7 +829,7 @@ def reject( # pyright: ignore[reportGeneralTypeIssues] async def _cls_reject_async( cls, personalization_design: str, - **params: Unpack["PersonalizationDesign.RejectParams"] + **params: Unpack["PersonalizationDesign.RejectParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to rejected. @@ -853,7 +851,7 @@ async def _cls_reject_async( @staticmethod async def reject_async( personalization_design: str, - **params: Unpack["PersonalizationDesign.RejectParams"] + **params: Unpack["PersonalizationDesign.RejectParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to rejected. diff --git a/stripe/issuing/_physical_bundle.py b/stripe/issuing/_physical_bundle.py index c5c5d0c82..45b959c11 100644 --- a/stripe/issuing/_physical_bundle.py +++ b/stripe/issuing/_physical_bundle.py @@ -13,9 +13,9 @@ class PhysicalBundle(ListableAPIResource["PhysicalBundle"]): A Physical Bundle represents the bundle of physical items - card stock, carrier letter, and envelope - that is shipped to a cardholder when you create a physical card. """ - OBJECT_NAME: ClassVar[ - Literal["issuing.physical_bundle"] - ] = "issuing.physical_bundle" + OBJECT_NAME: ClassVar[Literal["issuing.physical_bundle"]] = ( + "issuing.physical_bundle" + ) class Features(StripeObject): card_logo: Literal["optional", "required", "unsupported"] @@ -102,7 +102,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -123,7 +122,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/issuing/_token.py b/stripe/issuing/_token.py index cd22e21f6..214976671 100644 --- a/stripe/issuing/_token.py +++ b/stripe/issuing/_token.py @@ -317,7 +317,6 @@ def list(cls, **params: Unpack["Token.ListParams"]) -> ListObject["Token"]: params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -338,7 +337,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index 8609f87de..c61ce560c 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -39,9 +39,9 @@ class Transaction( Related guide: [Issued card transactions](https://stripe.com/docs/issuing/purchases/transactions) """ - OBJECT_NAME: ClassVar[ - Literal["issuing.transaction"] - ] = "issuing.transaction" + OBJECT_NAME: ClassVar[Literal["issuing.transaction"]] = ( + "issuing.transaction" + ) class AmountDetails(StripeObject): atm_fee: Optional[int] @@ -1399,7 +1399,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1420,7 +1419,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/radar/_early_fraud_warning.py b/stripe/radar/_early_fraud_warning.py index 5a6c54658..77d1ab156 100644 --- a/stripe/radar/_early_fraud_warning.py +++ b/stripe/radar/_early_fraud_warning.py @@ -26,9 +26,9 @@ class EarlyFraudWarning(ListableAPIResource["EarlyFraudWarning"]): Related guide: [Early fraud warnings](https://stripe.com/docs/disputes/measuring#early-fraud-warnings) """ - OBJECT_NAME: ClassVar[ - Literal["radar.early_fraud_warning"] - ] = "radar.early_fraud_warning" + OBJECT_NAME: ClassVar[Literal["radar.early_fraud_warning"]] = ( + "radar.early_fraud_warning" + ) class ListParams(RequestOptions): charge: NotRequired[str] @@ -130,7 +130,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -151,7 +150,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/radar/_value_list.py b/stripe/radar/_value_list.py index 158494dac..c4c41f808 100644 --- a/stripe/radar/_value_list.py +++ b/stripe/radar/_value_list.py @@ -341,7 +341,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -362,7 +361,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/radar/_value_list_item.py b/stripe/radar/_value_list_item.py index b48d9d542..36c42a870 100644 --- a/stripe/radar/_value_list_item.py +++ b/stripe/radar/_value_list_item.py @@ -21,9 +21,9 @@ class ValueListItem( Related guide: [Managing list items](https://stripe.com/docs/radar/lists#managing-list-items) """ - OBJECT_NAME: ClassVar[ - Literal["radar.value_list_item"] - ] = "radar.value_list_item" + OBJECT_NAME: ClassVar[Literal["radar.value_list_item"]] = ( + "radar.value_list_item" + ) class CreateParams(RequestOptions): expand: NotRequired[List[str]] @@ -272,7 +272,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -293,7 +292,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/reporting/_report_run.py b/stripe/reporting/_report_run.py index 4ca96087c..3a610d51b 100644 --- a/stripe/reporting/_report_run.py +++ b/stripe/reporting/_report_run.py @@ -33,9 +33,9 @@ class ReportRun( data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). """ - OBJECT_NAME: ClassVar[ - Literal["reporting.report_run"] - ] = "reporting.report_run" + OBJECT_NAME: ClassVar[Literal["reporting.report_run"]] = ( + "reporting.report_run" + ) class Parameters(StripeObject): columns: Optional[List[str]] @@ -892,7 +892,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -913,7 +912,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/reporting/_report_type.py b/stripe/reporting/_report_type.py index b6e476595..af722ea57 100644 --- a/stripe/reporting/_report_type.py +++ b/stripe/reporting/_report_type.py @@ -19,9 +19,9 @@ class ReportType(ListableAPIResource["ReportType"]): data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). """ - OBJECT_NAME: ClassVar[ - Literal["reporting.report_type"] - ] = "reporting.report_type" + OBJECT_NAME: ClassVar[Literal["reporting.report_type"]] = ( + "reporting.report_type" + ) class ListParams(RequestOptions): expand: NotRequired[List[str]] @@ -85,7 +85,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -106,7 +105,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/sigma/_scheduled_query_run.py b/stripe/sigma/_scheduled_query_run.py index aef65a5d0..f3c2b855e 100644 --- a/stripe/sigma/_scheduled_query_run.py +++ b/stripe/sigma/_scheduled_query_run.py @@ -19,9 +19,9 @@ class ScheduledQueryRun(ListableAPIResource["ScheduledQueryRun"]): retrieve the query results. """ - OBJECT_NAME: ClassVar[ - Literal["scheduled_query_run"] - ] = "scheduled_query_run" + OBJECT_NAME: ClassVar[Literal["scheduled_query_run"]] = ( + "scheduled_query_run" + ) class Error(StripeObject): message: str @@ -108,7 +108,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -129,7 +128,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index acdddf026..a91f55871 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -740,7 +740,7 @@ async def create_async( def _cls_list_line_items( cls, calculation: str, - **params: Unpack["Calculation.ListLineItemsParams"] + **params: Unpack["Calculation.ListLineItemsParams"], ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a persisted tax calculation as a collection. @@ -797,7 +797,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] async def _cls_list_line_items_async( cls, calculation: str, - **params: Unpack["Calculation.ListLineItemsParams"] + **params: Unpack["Calculation.ListLineItemsParams"], ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a persisted tax calculation as a collection. diff --git a/stripe/tax/_calculation_line_item.py b/stripe/tax/_calculation_line_item.py index e33257168..376dd7a36 100644 --- a/stripe/tax/_calculation_line_item.py +++ b/stripe/tax/_calculation_line_item.py @@ -6,9 +6,9 @@ class CalculationLineItem(StripeObject): - OBJECT_NAME: ClassVar[ - Literal["tax.calculation_line_item"] - ] = "tax.calculation_line_item" + OBJECT_NAME: ClassVar[Literal["tax.calculation_line_item"]] = ( + "tax.calculation_line_item" + ) class TaxBreakdown(StripeObject): class Jurisdiction(StripeObject): diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index d4e243bae..807558ad0 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -1805,7 +1805,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1826,7 +1825,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index de586844c..011726e0a 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -556,7 +556,7 @@ async def create_reversal_async( def _cls_list_line_items( cls, transaction: str, - **params: Unpack["Transaction.ListLineItemsParams"] + **params: Unpack["Transaction.ListLineItemsParams"], ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. @@ -613,7 +613,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] async def _cls_list_line_items_async( cls, transaction: str, - **params: Unpack["Transaction.ListLineItemsParams"] + **params: Unpack["Transaction.ListLineItemsParams"], ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. diff --git a/stripe/tax/_transaction_line_item.py b/stripe/tax/_transaction_line_item.py index 659ae9423..87c817b36 100644 --- a/stripe/tax/_transaction_line_item.py +++ b/stripe/tax/_transaction_line_item.py @@ -6,9 +6,9 @@ class TransactionLineItem(StripeObject): - OBJECT_NAME: ClassVar[ - Literal["tax.transaction_line_item"] - ] = "tax.transaction_line_item" + OBJECT_NAME: ClassVar[Literal["tax.transaction_line_item"]] = ( + "tax.transaction_line_item" + ) class Reversal(StripeObject): original_line_item: str diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index 786a5f0ba..14a7e1e7f 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -32,9 +32,9 @@ class Configuration( A Configurations object represents how features should be configured for terminal readers. """ - OBJECT_NAME: ClassVar[ - Literal["terminal.configuration"] - ] = "terminal.configuration" + OBJECT_NAME: ClassVar[Literal["terminal.configuration"]] = ( + "terminal.configuration" + ) class BbposWiseposE(StripeObject): splashscreen: Optional[ExpandableField["File"]] @@ -1085,7 +1085,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1106,7 +1105,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/terminal/_connection_token.py b/stripe/terminal/_connection_token.py index 294eb02b7..a454b68dc 100644 --- a/stripe/terminal/_connection_token.py +++ b/stripe/terminal/_connection_token.py @@ -13,9 +13,9 @@ class ConnectionToken(CreateableAPIResource["ConnectionToken"]): Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations) """ - OBJECT_NAME: ClassVar[ - Literal["terminal.connection_token"] - ] = "terminal.connection_token" + OBJECT_NAME: ClassVar[Literal["terminal.connection_token"]] = ( + "terminal.connection_token" + ) class CreateParams(RequestOptions): expand: NotRequired[List[str]] diff --git a/stripe/terminal/_location.py b/stripe/terminal/_location.py index fe38a4c11..98f3feb17 100644 --- a/stripe/terminal/_location.py +++ b/stripe/terminal/_location.py @@ -346,7 +346,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -367,7 +366,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index 0faaa43b5..d7e455aa4 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -824,7 +824,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -845,7 +844,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1356,7 +1354,7 @@ class TestHelpers(APIResourceTestHelpers["Reader"]): def _cls_present_payment_method( cls, reader: str, - **params: Unpack["Reader.PresentPaymentMethodParams"] + **params: Unpack["Reader.PresentPaymentMethodParams"], ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. @@ -1413,7 +1411,7 @@ def present_payment_method( # pyright: ignore[reportGeneralTypeIssues] async def _cls_present_payment_method_async( cls, reader: str, - **params: Unpack["Reader.PresentPaymentMethodParams"] + **params: Unpack["Reader.PresentPaymentMethodParams"], ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. diff --git a/stripe/test_helpers/_test_clock.py b/stripe/test_helpers/_test_clock.py index 97996fe29..b73b93ed9 100644 --- a/stripe/test_helpers/_test_clock.py +++ b/stripe/test_helpers/_test_clock.py @@ -21,9 +21,9 @@ class TestClock( you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time. """ - OBJECT_NAME: ClassVar[ - Literal["test_helpers.test_clock"] - ] = "test_helpers.test_clock" + OBJECT_NAME: ClassVar[Literal["test_helpers.test_clock"]] = ( + "test_helpers.test_clock" + ) class AdvanceParams(RequestOptions): expand: NotRequired[List[str]] @@ -364,7 +364,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -385,7 +384,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/test_helpers/issuing/_personalization_design_service.py b/stripe/test_helpers/issuing/_personalization_design_service.py index 18823b094..671952b57 100644 --- a/stripe/test_helpers/issuing/_personalization_design_service.py +++ b/stripe/test_helpers/issuing/_personalization_design_service.py @@ -26,7 +26,9 @@ class RejectParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - rejection_reasons: "PersonalizationDesignService.RejectParamsRejectionReasons" + rejection_reasons: ( + "PersonalizationDesignService.RejectParamsRejectionReasons" + ) """ The reason(s) the personalization design was rejected. """ diff --git a/stripe/treasury/_credit_reversal.py b/stripe/treasury/_credit_reversal.py index 1318c3d53..f8d64de25 100644 --- a/stripe/treasury/_credit_reversal.py +++ b/stripe/treasury/_credit_reversal.py @@ -21,9 +21,9 @@ class CreditReversal( You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. """ - OBJECT_NAME: ClassVar[ - Literal["treasury.credit_reversal"] - ] = "treasury.credit_reversal" + OBJECT_NAME: ClassVar[Literal["treasury.credit_reversal"]] = ( + "treasury.credit_reversal" + ) class StatusTransitions(StripeObject): posted_at: Optional[int] @@ -180,7 +180,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -201,7 +200,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/treasury/_debit_reversal.py b/stripe/treasury/_debit_reversal.py index 6c1ec1c0c..dbc042bd1 100644 --- a/stripe/treasury/_debit_reversal.py +++ b/stripe/treasury/_debit_reversal.py @@ -21,9 +21,9 @@ class DebitReversal( You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. """ - OBJECT_NAME: ClassVar[ - Literal["treasury.debit_reversal"] - ] = "treasury.debit_reversal" + OBJECT_NAME: ClassVar[Literal["treasury.debit_reversal"]] = ( + "treasury.debit_reversal" + ) class LinkedFlows(StripeObject): issuing_dispute: Optional[str] @@ -194,7 +194,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -215,7 +214,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index 3cbd88346..52299c702 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -32,9 +32,9 @@ class FinancialAccount( FinancialAccounts serve as the source and destination of Treasury's money movement APIs. """ - OBJECT_NAME: ClassVar[ - Literal["treasury.financial_account"] - ] = "treasury.financial_account" + OBJECT_NAME: ClassVar[Literal["treasury.financial_account"]] = ( + "treasury.financial_account" + ) class Balance(StripeObject): cash: Dict[str, int] @@ -811,7 +811,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -832,7 +831,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -900,7 +898,7 @@ async def retrieve_async( def _cls_retrieve_features( cls, financial_account: str, - **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] + **params: Unpack["FinancialAccount.RetrieveFeaturesParams"], ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. @@ -920,7 +918,7 @@ def _cls_retrieve_features( @staticmethod def retrieve_features( financial_account: str, - **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] + **params: Unpack["FinancialAccount.RetrieveFeaturesParams"], ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. @@ -958,7 +956,7 @@ def retrieve_features( # pyright: ignore[reportGeneralTypeIssues] async def _cls_retrieve_features_async( cls, financial_account: str, - **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] + **params: Unpack["FinancialAccount.RetrieveFeaturesParams"], ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. @@ -978,7 +976,7 @@ async def _cls_retrieve_features_async( @staticmethod async def retrieve_features_async( financial_account: str, - **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] + **params: Unpack["FinancialAccount.RetrieveFeaturesParams"], ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. @@ -1016,7 +1014,7 @@ async def retrieve_features_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_update_features( cls, financial_account: str, - **params: Unpack["FinancialAccount.UpdateFeaturesParams"] + **params: Unpack["FinancialAccount.UpdateFeaturesParams"], ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. @@ -1036,7 +1034,7 @@ def _cls_update_features( @staticmethod def update_features( financial_account: str, - **params: Unpack["FinancialAccount.UpdateFeaturesParams"] + **params: Unpack["FinancialAccount.UpdateFeaturesParams"], ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. @@ -1074,7 +1072,7 @@ def update_features( # pyright: ignore[reportGeneralTypeIssues] async def _cls_update_features_async( cls, financial_account: str, - **params: Unpack["FinancialAccount.UpdateFeaturesParams"] + **params: Unpack["FinancialAccount.UpdateFeaturesParams"], ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. @@ -1094,7 +1092,7 @@ async def _cls_update_features_async( @staticmethod async def update_features_async( financial_account: str, - **params: Unpack["FinancialAccount.UpdateFeaturesParams"] + **params: Unpack["FinancialAccount.UpdateFeaturesParams"], ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. diff --git a/stripe/treasury/_financial_account_features.py b/stripe/treasury/_financial_account_features.py index dd44af71d..60c378efe 100644 --- a/stripe/treasury/_financial_account_features.py +++ b/stripe/treasury/_financial_account_features.py @@ -11,9 +11,9 @@ class FinancialAccountFeatures(StripeObject): Stripe or the platform can control Features via the requested field. """ - OBJECT_NAME: ClassVar[ - Literal["treasury.financial_account_features"] - ] = "treasury.financial_account_features" + OBJECT_NAME: ClassVar[Literal["treasury.financial_account_features"]] = ( + "treasury.financial_account_features" + ) class CardIssuing(StripeObject): class StatusDetail(StripeObject): diff --git a/stripe/treasury/_inbound_transfer.py b/stripe/treasury/_inbound_transfer.py index ec921ddac..d23b01a94 100644 --- a/stripe/treasury/_inbound_transfer.py +++ b/stripe/treasury/_inbound_transfer.py @@ -31,9 +31,9 @@ class InboundTransfer( Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. """ - OBJECT_NAME: ClassVar[ - Literal["treasury.inbound_transfer"] - ] = "treasury.inbound_transfer" + OBJECT_NAME: ClassVar[Literal["treasury.inbound_transfer"]] = ( + "treasury.inbound_transfer" + ) class FailureDetails(StripeObject): code: Literal[ @@ -358,7 +358,7 @@ class SucceedParams(RequestOptions): def _cls_cancel( cls, inbound_transfer: str, - **params: Unpack["InboundTransfer.CancelParams"] + **params: Unpack["InboundTransfer.CancelParams"], ) -> "InboundTransfer": """ Cancels an InboundTransfer. @@ -415,7 +415,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] async def _cls_cancel_async( cls, inbound_transfer: str, - **params: Unpack["InboundTransfer.CancelParams"] + **params: Unpack["InboundTransfer.CancelParams"], ) -> "InboundTransfer": """ Cancels an InboundTransfer. @@ -513,7 +513,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -534,7 +533,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -681,7 +679,7 @@ async def fail_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_return_inbound_transfer( cls, id: str, - **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] + **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. @@ -701,7 +699,7 @@ def _cls_return_inbound_transfer( @staticmethod def return_inbound_transfer( id: str, - **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] + **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. @@ -711,7 +709,7 @@ def return_inbound_transfer( @overload def return_inbound_transfer( self, - **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] + **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. @@ -721,7 +719,7 @@ def return_inbound_transfer( @class_method_variant("_cls_return_inbound_transfer") def return_inbound_transfer( # pyright: ignore[reportGeneralTypeIssues] self, - **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] + **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. @@ -741,7 +739,7 @@ def return_inbound_transfer( # pyright: ignore[reportGeneralTypeIssues] async def _cls_return_inbound_transfer_async( cls, id: str, - **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] + **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. @@ -761,7 +759,7 @@ async def _cls_return_inbound_transfer_async( @staticmethod async def return_inbound_transfer_async( id: str, - **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] + **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. @@ -771,7 +769,7 @@ async def return_inbound_transfer_async( @overload async def return_inbound_transfer_async( self, - **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] + **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. @@ -781,7 +779,7 @@ async def return_inbound_transfer_async( @class_method_variant("_cls_return_inbound_transfer_async") async def return_inbound_transfer_async( # pyright: ignore[reportGeneralTypeIssues] self, - **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] + **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index 7ad22009c..36d468169 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -33,9 +33,9 @@ class OutboundPayment( Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. """ - OBJECT_NAME: ClassVar[ - Literal["treasury.outbound_payment"] - ] = "treasury.outbound_payment" + OBJECT_NAME: ClassVar[Literal["treasury.outbound_payment"]] = ( + "treasury.outbound_payment" + ) class DestinationPaymentMethodDetails(StripeObject): class BillingDetails(StripeObject): @@ -777,7 +777,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -798,7 +797,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -1055,7 +1053,7 @@ async def post_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_return_outbound_payment( cls, id: str, - **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] + **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. @@ -1075,7 +1073,7 @@ def _cls_return_outbound_payment( @staticmethod def return_outbound_payment( id: str, - **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] + **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. @@ -1085,7 +1083,7 @@ def return_outbound_payment( @overload def return_outbound_payment( self, - **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] + **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. @@ -1095,7 +1093,7 @@ def return_outbound_payment( @class_method_variant("_cls_return_outbound_payment") def return_outbound_payment( # pyright: ignore[reportGeneralTypeIssues] self, - **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] + **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. @@ -1115,7 +1113,7 @@ def return_outbound_payment( # pyright: ignore[reportGeneralTypeIssues] async def _cls_return_outbound_payment_async( cls, id: str, - **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] + **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. @@ -1135,7 +1133,7 @@ async def _cls_return_outbound_payment_async( @staticmethod async def return_outbound_payment_async( id: str, - **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] + **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. @@ -1145,7 +1143,7 @@ async def return_outbound_payment_async( @overload async def return_outbound_payment_async( self, - **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] + **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. @@ -1155,7 +1153,7 @@ async def return_outbound_payment_async( @class_method_variant("_cls_return_outbound_payment_async") async def return_outbound_payment_async( # pyright: ignore[reportGeneralTypeIssues] self, - **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] + **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index 9aa024b1f..794a444e1 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -33,9 +33,9 @@ class OutboundTransfer( Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. """ - OBJECT_NAME: ClassVar[ - Literal["treasury.outbound_transfer"] - ] = "treasury.outbound_transfer" + OBJECT_NAME: ClassVar[Literal["treasury.outbound_transfer"]] = ( + "treasury.outbound_transfer" + ) class DestinationPaymentMethodDetails(StripeObject): class BillingDetails(StripeObject): @@ -443,7 +443,7 @@ class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): def _cls_cancel( cls, outbound_transfer: str, - **params: Unpack["OutboundTransfer.CancelParams"] + **params: Unpack["OutboundTransfer.CancelParams"], ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. @@ -463,7 +463,7 @@ def _cls_cancel( @staticmethod def cancel( outbound_transfer: str, - **params: Unpack["OutboundTransfer.CancelParams"] + **params: Unpack["OutboundTransfer.CancelParams"], ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. @@ -501,7 +501,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] async def _cls_cancel_async( cls, outbound_transfer: str, - **params: Unpack["OutboundTransfer.CancelParams"] + **params: Unpack["OutboundTransfer.CancelParams"], ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. @@ -521,7 +521,7 @@ async def _cls_cancel_async( @staticmethod async def cancel_async( outbound_transfer: str, - **params: Unpack["OutboundTransfer.CancelParams"] + **params: Unpack["OutboundTransfer.CancelParams"], ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. @@ -600,7 +600,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -621,7 +620,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -658,7 +656,7 @@ class TestHelpers(APIResourceTestHelpers["OutboundTransfer"]): def _cls_fail( cls, outbound_transfer: str, - **params: Unpack["OutboundTransfer.FailParams"] + **params: Unpack["OutboundTransfer.FailParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. @@ -678,7 +676,7 @@ def _cls_fail( @staticmethod def fail( outbound_transfer: str, - **params: Unpack["OutboundTransfer.FailParams"] + **params: Unpack["OutboundTransfer.FailParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. @@ -716,7 +714,7 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] async def _cls_fail_async( cls, outbound_transfer: str, - **params: Unpack["OutboundTransfer.FailParams"] + **params: Unpack["OutboundTransfer.FailParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. @@ -736,7 +734,7 @@ async def _cls_fail_async( @staticmethod async def fail_async( outbound_transfer: str, - **params: Unpack["OutboundTransfer.FailParams"] + **params: Unpack["OutboundTransfer.FailParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. @@ -774,7 +772,7 @@ async def fail_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_post( cls, outbound_transfer: str, - **params: Unpack["OutboundTransfer.PostParams"] + **params: Unpack["OutboundTransfer.PostParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. @@ -794,7 +792,7 @@ def _cls_post( @staticmethod def post( outbound_transfer: str, - **params: Unpack["OutboundTransfer.PostParams"] + **params: Unpack["OutboundTransfer.PostParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. @@ -832,7 +830,7 @@ def post( # pyright: ignore[reportGeneralTypeIssues] async def _cls_post_async( cls, outbound_transfer: str, - **params: Unpack["OutboundTransfer.PostParams"] + **params: Unpack["OutboundTransfer.PostParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. @@ -852,7 +850,7 @@ async def _cls_post_async( @staticmethod async def post_async( outbound_transfer: str, - **params: Unpack["OutboundTransfer.PostParams"] + **params: Unpack["OutboundTransfer.PostParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. @@ -890,7 +888,7 @@ async def post_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_return_outbound_transfer( cls, outbound_transfer: str, - **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] + **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. @@ -910,7 +908,7 @@ def _cls_return_outbound_transfer( @staticmethod def return_outbound_transfer( outbound_transfer: str, - **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] + **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. @@ -920,7 +918,7 @@ def return_outbound_transfer( @overload def return_outbound_transfer( self, - **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] + **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. @@ -930,7 +928,7 @@ def return_outbound_transfer( @class_method_variant("_cls_return_outbound_transfer") def return_outbound_transfer( # pyright: ignore[reportGeneralTypeIssues] self, - **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] + **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. @@ -950,7 +948,7 @@ def return_outbound_transfer( # pyright: ignore[reportGeneralTypeIssues] async def _cls_return_outbound_transfer_async( cls, outbound_transfer: str, - **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] + **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. @@ -970,7 +968,7 @@ async def _cls_return_outbound_transfer_async( @staticmethod async def return_outbound_transfer_async( outbound_transfer: str, - **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] + **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. @@ -980,7 +978,7 @@ async def return_outbound_transfer_async( @overload async def return_outbound_transfer_async( self, - **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] + **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. @@ -990,7 +988,7 @@ async def return_outbound_transfer_async( @class_method_variant("_cls_return_outbound_transfer_async") async def return_outbound_transfer_async( # pyright: ignore[reportGeneralTypeIssues] self, - **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] + **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. @@ -1010,7 +1008,7 @@ async def return_outbound_transfer_async( # pyright: ignore[reportGeneralTypeIs def _cls_update( cls, outbound_transfer: str, - **params: Unpack["OutboundTransfer.UpdateParams"] + **params: Unpack["OutboundTransfer.UpdateParams"], ) -> "OutboundTransfer": """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. @@ -1030,7 +1028,7 @@ def _cls_update( @staticmethod def update( outbound_transfer: str, - **params: Unpack["OutboundTransfer.UpdateParams"] + **params: Unpack["OutboundTransfer.UpdateParams"], ) -> "OutboundTransfer": """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. @@ -1068,7 +1066,7 @@ def update( # pyright: ignore[reportGeneralTypeIssues] async def _cls_update_async( cls, outbound_transfer: str, - **params: Unpack["OutboundTransfer.UpdateParams"] + **params: Unpack["OutboundTransfer.UpdateParams"], ) -> "OutboundTransfer": """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. @@ -1088,7 +1086,7 @@ async def _cls_update_async( @staticmethod async def update_async( outbound_transfer: str, - **params: Unpack["OutboundTransfer.UpdateParams"] + **params: Unpack["OutboundTransfer.UpdateParams"], ) -> "OutboundTransfer": """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 077ce9509..4aad11661 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -28,9 +28,9 @@ class ReceivedCredit(ListableAPIResource["ReceivedCredit"]): ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. """ - OBJECT_NAME: ClassVar[ - Literal["treasury.received_credit"] - ] = "treasury.received_credit" + OBJECT_NAME: ClassVar[Literal["treasury.received_credit"]] = ( + "treasury.received_credit" + ) class InitiatingPaymentMethodDetails(StripeObject): class BillingDetails(StripeObject): @@ -372,7 +372,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -393,7 +392,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/treasury/_received_debit.py b/stripe/treasury/_received_debit.py index 49e3f127d..fe167d746 100644 --- a/stripe/treasury/_received_debit.py +++ b/stripe/treasury/_received_debit.py @@ -25,9 +25,9 @@ class ReceivedDebit(ListableAPIResource["ReceivedDebit"]): ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. """ - OBJECT_NAME: ClassVar[ - Literal["treasury.received_debit"] - ] = "treasury.received_debit" + OBJECT_NAME: ClassVar[Literal["treasury.received_debit"]] = ( + "treasury.received_debit" + ) class InitiatingPaymentMethodDetails(StripeObject): class BillingDetails(StripeObject): @@ -325,7 +325,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -346,7 +345,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/treasury/_transaction.py b/stripe/treasury/_transaction.py index 146739365..a8d220526 100644 --- a/stripe/treasury/_transaction.py +++ b/stripe/treasury/_transaction.py @@ -30,9 +30,9 @@ class Transaction(ListableAPIResource["Transaction"]): Transactions represent changes to a [FinancialAccount's](https://stripe.com/docs/api#financial_accounts) balance. """ - OBJECT_NAME: ClassVar[ - Literal["treasury.transaction"] - ] = "treasury.transaction" + OBJECT_NAME: ClassVar[Literal["treasury.transaction"]] = ( + "treasury.transaction" + ) class BalanceImpact(StripeObject): cash: int @@ -285,7 +285,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -306,7 +305,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/treasury/_transaction_entry.py b/stripe/treasury/_transaction_entry.py index 18ebfe248..6633d2785 100644 --- a/stripe/treasury/_transaction_entry.py +++ b/stripe/treasury/_transaction_entry.py @@ -31,9 +31,9 @@ class TransactionEntry(ListableAPIResource["TransactionEntry"]): TransactionEntries represent individual units of money movements within a single [Transaction](https://stripe.com/docs/api#transactions). """ - OBJECT_NAME: ClassVar[ - Literal["treasury.transaction_entry"] - ] = "treasury.transaction_entry" + OBJECT_NAME: ClassVar[Literal["treasury.transaction_entry"]] = ( + "treasury.transaction_entry" + ) class BalanceImpact(StripeObject): cash: int @@ -279,7 +279,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -300,7 +299,6 @@ async def list_async( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/tests/test_api_requestor.py b/tests/test_api_requestor.py index 98daecda3..a2d197430 100644 --- a/tests/test_api_requestor.py +++ b/tests/test_api_requestor.py @@ -829,7 +829,7 @@ def test_extract_error_from_stream_request_for_response( def test_raw_request_with_file_param(self, requestor, http_client_mock): test_file = tempfile.NamedTemporaryFile() - test_file.write("\u263A".encode("utf-16")) + test_file.write("\u263a".encode("utf-16")) test_file.seek(0) meth = "post" path = "/v1/files" diff --git a/tests/test_exports.py b/tests/test_exports.py index ebdb2499c..307529e85 100644 --- a/tests/test_exports.py +++ b/tests/test_exports.py @@ -23,20 +23,25 @@ def assert_output(code: str, expected: str) -> None: def test_can_import_stripe_object() -> None: + # fmt: off from stripe.stripe_object import StripeObject as StripeObjectFromStripeStripeObject # type: ignore + # fmt: on from stripe import ( StripeObject as StripeObjectFromStripe, ) - assert ( - stripe.stripe_object.StripeObject is StripeObjectFromStripeStripeObject # type: ignore - ) + # fmt: off + assert stripe.stripe_object.StripeObject is StripeObjectFromStripeStripeObject # type: ignore + # fmt: on assert stripe.StripeObject is StripeObjectFromStripeStripeObject assert StripeObjectFromStripe is StripeObjectFromStripeStripeObject def test_can_import_request_options() -> None: + # fmt: off from stripe.request_options import RequestOptions as RequestOptionsStripeRequestOptions # type: ignore + # fmt: on + from stripe import ( RequestOptions as RequestOptionsFromStripe, ) @@ -47,10 +52,13 @@ def test_can_import_request_options() -> None: def test_can_import_http_client() -> None: from stripe.http_client import HTTPClient as HTTPClientFromStripeHTTPClient # type: ignore + + # fmt: off from stripe.http_client import PycurlClient as PycurlClientFromStripeHTTPClient # type: ignore from stripe.http_client import RequestsClient as RequestsClientFromStripeHTTPClient # type: ignore from stripe.http_client import UrlFetchClient as UrlFetchClientFromStripeHTTPClient # type: ignore from stripe.http_client import new_default_http_client as new_default_http_clientFromStripeHTTPClient # type: ignore + # fmt: on from stripe import ( HTTPClient as HTTPClientFromStripe, @@ -81,7 +89,10 @@ def test_can_import_http_client() -> None: def test_can_import_webhook_members() -> None: from stripe.webhook import Webhook as WebhookFromStripeWebhook # type: ignore + + # fmt: off from stripe.webhook import WebhookSignature as WebhookSignatureFromStripeWebhook # type: ignore + # fmt: on from stripe import ( Webhook, @@ -96,7 +107,6 @@ def test_can_import_webhook_members() -> None: def test_can_import_list_search_objects() -> None: - # This import has to be single line, mypy and pyright are producing errors # on different lines of multiline import # fmt: off @@ -128,8 +138,11 @@ def test_can_import_misc_resources() -> None: ErrorObject as ErrorObjectFromStripe, OAuthErrorObject as OAuthErrorObjectFromStripe, ) + + # fmt: off from stripe.api_resources.error_object import ErrorObject as ErrorObjectFromStripeApiResources # type: ignore from stripe.api_resources.error_object import OAuthErrorObject as OAuthErrorObjectFromStripeApiResources # type: ignore + # fmt: on # FileUpload is an old alias for File, time to hide it from stripe.api_resources import FileUpload as FileUploadFromApiResources # type: ignore @@ -245,9 +258,11 @@ def test_can_import_app_info() -> None: def test_can_import_stripe_response() -> None: + # fmt: off from stripe.stripe_response import StripeResponse as StripeResponseFromStripeResponse # type: ignore from stripe.stripe_response import StripeResponseBase as StripeResponseBaseFromStripeResponse # type: ignore from stripe.stripe_response import StripeStreamResponse as StripeStreamResponseFromStripeResponse # type: ignore + # fmt: on from stripe import ( StripeResponse as StripeResponseFromStripe, @@ -288,7 +303,10 @@ def test_can_import_oauth_members() -> None: def test_can_import_util() -> None: + # fmt: off from stripe.util import convert_to_stripe_object as convert_to_stripe_objectFromStripeUtil # type: ignore + # fmt: on + from stripe import ( convert_to_stripe_object as convert_to_stripe_objectFromStripe, ) @@ -383,7 +401,9 @@ def test_can_import_namespaced_resource() -> None: # This import has to be single line, mypy and pyright are producing errors # on different lines of multiline import + # fmt: off from stripe.api_resources.tax.calculation import Calculation as CalcFromModule # type: ignore + # fmt: on assert stripe.tax is TaxPackage assert stripe.tax.Calculation is CalculationFromStripe diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 3ea06984c..02e9cb3f2 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -26935,8 +26935,10 @@ async def test_test_helpers_issuing_personalization_designs_activate_post_servic http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.personalization_designs.activate_async( - "pd_xyz" + await ( + client.test_helpers.issuing.personalization_designs.activate_async( + "pd_xyz" + ) ) http_client_mock.assert_requested( "post", @@ -26981,8 +26983,10 @@ def test_test_helpers_issuing_personalization_designs_deactivate_post_service( async def test_test_helpers_issuing_personalization_designs_deactivate_post_async( self, http_client_mock: HTTPClientMock ) -> None: - await stripe.issuing.PersonalizationDesign.TestHelpers.deactivate_async( - "pd_xyz", + await ( + stripe.issuing.PersonalizationDesign.TestHelpers.deactivate_async( + "pd_xyz", + ) ) http_client_mock.assert_requested( "post", @@ -27225,54 +27229,56 @@ def test_test_helpers_issuing_transactions_create_force_capture_post_service( async def test_test_helpers_issuing_transactions_create_force_capture_post_async( self, http_client_mock: HTTPClientMock ) -> None: - await stripe.issuing.Transaction.TestHelpers.create_force_capture_async( - amount=100, - card="foo", - currency="usd", - merchant_data={ - "category": "ac_refrigeration_repair", - "city": "foo", - "country": "US", - "name": "foo", - "network_id": "bar", - "postal_code": "10001", - "state": "NY", - "terminal_id": "foo", - }, - purchase_details={ - "flight": { - "departure_at": 1633651200, - "passenger_name": "John Doe", - "refundable": True, - "segments": [ + await ( + stripe.issuing.Transaction.TestHelpers.create_force_capture_async( + amount=100, + card="foo", + currency="usd", + merchant_data={ + "category": "ac_refrigeration_repair", + "city": "foo", + "country": "US", + "name": "foo", + "network_id": "bar", + "postal_code": "10001", + "state": "NY", + "terminal_id": "foo", + }, + purchase_details={ + "flight": { + "departure_at": 1633651200, + "passenger_name": "John Doe", + "refundable": True, + "segments": [ + { + "arrival_airport_code": "SFO", + "carrier": "Delta", + "departure_airport_code": "LAX", + "flight_number": "DL100", + "service_class": "Economy", + "stopover_allowed": True, + }, + ], + "travel_agency": "Orbitz", + }, + "fuel": { + "type": "diesel", + "unit": "liter", + "unit_cost_decimal": "3.5", + "volume_decimal": "10", + }, + "lodging": {"check_in_at": 1533651200, "nights": 2}, + "receipt": [ { - "arrival_airport_code": "SFO", - "carrier": "Delta", - "departure_airport_code": "LAX", - "flight_number": "DL100", - "service_class": "Economy", - "stopover_allowed": True, + "description": "Room charge", + "quantity": "1", + "total": 200, + "unit_cost": 200, }, ], - "travel_agency": "Orbitz", - }, - "fuel": { - "type": "diesel", - "unit": "liter", - "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "reference": "foo", }, - "lodging": {"check_in_at": 1533651200, "nights": 2}, - "receipt": [ - { - "description": "Room charge", - "quantity": "1", - "total": 200, - "unit_cost": 200, - }, - ], - "reference": "foo", - }, + ) ) http_client_mock.assert_requested( "post", diff --git a/tests/test_http_client.py b/tests/test_http_client.py index 3b8292188..d6cbbbdf5 100644 --- a/tests/test_http_client.py +++ b/tests/test_http_client.py @@ -467,9 +467,9 @@ def __eq__(self, other): class TestRequestsClient(StripeClientTestCase, ClientTestBase): - REQUEST_CLIENT: Type[ + REQUEST_CLIENT: Type[_http_client.RequestsClient] = ( _http_client.RequestsClient - ] = _http_client.RequestsClient + ) @pytest.fixture def session(self, mocker, request_mocks): @@ -834,9 +834,9 @@ def check_call( class TestUrllib2Client(StripeClientTestCase, ClientTestBase): - REQUEST_CLIENT: Type[ + REQUEST_CLIENT: Type[_http_client.Urllib2Client] = ( _http_client.Urllib2Client - ] = _http_client.Urllib2Client + ) request_object: Any @@ -1254,7 +1254,6 @@ async def make_request_stream_async( async def test_request_async( self, request_mock, mock_response, check_call_async ): - mock_response(request_mock, '{"foo": "baz"}', 200) for method in VALID_API_METHODS: @@ -1549,9 +1548,9 @@ def test_timeout_async(self): class TestAIOHTTPClient(StripeClientTestCase, ClientTestBase): - REQUEST_CLIENT: Type[ + REQUEST_CLIENT: Type[_http_client.AIOHTTPClient] = ( _http_client.AIOHTTPClient - ] = _http_client.AIOHTTPClient + ) @pytest.fixture def mock_response(self, mocker, request_mock): @@ -1559,9 +1558,11 @@ def mock_response(mock, body={}, code=200): class Content: def __aiter__(self): async def chunk(): - yield bytes(body, "utf-8") if isinstance( - body, str - ) else body + yield ( + bytes(body, "utf-8") + if isinstance(body, str) + else body + ) return chunk() @@ -1683,7 +1684,6 @@ def test_request_stream(self): async def test_request_async( self, request_mock, mock_response, check_call_async ): - mock_response(request_mock, '{"foo": "baz"}', 200) for method in VALID_API_METHODS: diff --git a/tox.ini b/tox.ini index 7d157e410..23ee4816e 100644 --- a/tox.ini +++ b/tox.ini @@ -39,7 +39,7 @@ skip_install = true commands = pyright: pyright {posargs} lint: python -m flake8 --show-source stripe tests setup.py - fmt: black . {posargs} + fmt: ruff format . {posargs} mypy: mypy {posargs} deps = -r requirements.txt From e11f4fb02be8a1ad83785810a9d1ab5add7b4654 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 22:05:00 +0000 Subject: [PATCH 064/179] Update generated code (#1328) * Update generated code for v1022 * Update generated code for v1023 * Update generated code for v1025 * Update generated code for v1027 * Update generated code for v1028 * Update generated code for v1029 * Update generated code for v1030 * Update generated code for v1032 * Update generated code for v1033 * Update generated code for v1034 * Update generated code for v1035 * Update generated code for v1036 * Update generated code for v1037 * Update generated code for v1038 * Update generated code for v1039 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_application_fee.py | 21 ++++++ stripe/_balance.py | 35 ++++++++- stripe/_charge.py | 4 + stripe/_confirmation_token.py | 4 + stripe/_dispute.py | 11 ++- stripe/_invoice.py | 2 +- stripe/_payment_intent.py | 46 ++++++++++++ stripe/_payment_intent_service.py | 36 +++++++++ stripe/_payment_method.py | 4 + stripe/_payout.py | 9 +++ stripe/_price.py | 2 +- stripe/_price_service.py | 2 +- stripe/_product.py | 6 +- stripe/_product_service.py | 4 +- stripe/_token.py | 2 +- stripe/_token_service.py | 2 +- stripe/checkout/_session.py | 4 +- stripe/checkout/_session_service.py | 2 +- stripe/entitlements/_feature.py | 8 ++ stripe/entitlements/_feature_service.py | 8 ++ stripe/financial_connections/_session.py | 2 +- .../financial_connections/_session_service.py | 2 +- stripe/issuing/_dispute.py | 74 +++++++++++++++++++ stripe/issuing/_dispute_service.py | 34 +++++++++ stripe/terminal/_configuration.py | 30 ++++++++ stripe/terminal/_configuration_service.py | 22 ++++++ 27 files changed, 359 insertions(+), 19 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 280e945f8..e0801e4ff 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1020 \ No newline at end of file +v1039 \ No newline at end of file diff --git a/stripe/_application_fee.py b/stripe/_application_fee.py index c6428ac9e..b7051d248 100644 --- a/stripe/_application_fee.py +++ b/stripe/_application_fee.py @@ -5,6 +5,7 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( @@ -27,6 +28,20 @@ class ApplicationFee(ListableAPIResource["ApplicationFee"]): OBJECT_NAME: ClassVar[Literal["application_fee"]] = "application_fee" + class FeeSource(StripeObject): + charge: Optional[str] + """ + Charge ID that created this application fee. + """ + payout: Optional[str] + """ + Payout ID that created this application fee. + """ + type: Literal["charge", "payout"] + """ + Type of object that created the application fee, either `charge` or `payout`. + """ + class CreateRefundParams(RequestOptions): amount: NotRequired[int] """ @@ -171,6 +186,10 @@ class RetrieveRefundParams(RequestOptions): """ 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). """ + fee_source: Optional[FeeSource] + """ + Polymorphic source of the application fee. Includes the ID of the object the application fee was created from. + """ id: str """ Unique identifier for the object. @@ -595,3 +614,5 @@ async def list_refunds_async( params=params, ), ) + + _inner_class_types = {"fee_source": FeeSource} diff --git a/stripe/_balance.py b/stripe/_balance.py index 1cbc6312e..ed80ed6ab 100644 --- a/stripe/_balance.py +++ b/stripe/_balance.py @@ -77,6 +77,32 @@ class SourceTypes(StripeObject): _inner_class_types = {"source_types": SourceTypes} class InstantAvailable(StripeObject): + class NetAvailable(StripeObject): + class SourceTypes(StripeObject): + bank_account: Optional[int] + """ + Amount for bank account. + """ + card: Optional[int] + """ + Amount for card. + """ + fpx: Optional[int] + """ + Amount for FPX. + """ + + amount: int + """ + Net balance amount, subtracting fees from platform-set pricing. + """ + destination: str + """ + ID of the external account for this net balance (not expandable). + """ + source_types: Optional[SourceTypes] + _inner_class_types = {"source_types": SourceTypes} + class SourceTypes(StripeObject): bank_account: Optional[int] """ @@ -99,8 +125,15 @@ class SourceTypes(StripeObject): """ 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). """ + net_available: Optional[List[NetAvailable]] + """ + Breakdown of balance by destination. + """ source_types: Optional[SourceTypes] - _inner_class_types = {"source_types": SourceTypes} + _inner_class_types = { + "net_available": NetAvailable, + "source_types": SourceTypes, + } class Issuing(StripeObject): class Available(StripeObject): diff --git a/stripe/_charge.py b/stripe/_charge.py index 1b4f60f29..63d1385fc 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -918,6 +918,10 @@ class Receipt(StripeObject): """ Defines whether the authorized amount can be over-captured or not """ + preferred_locales: Optional[List[str]] + """ + EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + """ read_method: Optional[ Literal[ "contact_emv", diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 7d2b24833..c8cbd375b 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -539,6 +539,10 @@ class Networks(StripeObject): """ Contains information about card networks that can be used to process the payment. """ + preferred_locales: Optional[List[str]] + """ + EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + """ read_method: Optional[ Literal[ "contact_emv", diff --git a/stripe/_dispute.py b/stripe/_dispute.py index 851becaec..092b2986b 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -175,6 +175,12 @@ class Card(StripeObject): The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network. """ + class Klarna(StripeObject): + reason_code: Optional[str] + """ + The reason for the dispute as defined by Klarna + """ + class Paypal(StripeObject): case_id: Optional[str] """ @@ -186,12 +192,13 @@ class Paypal(StripeObject): """ card: Optional[Card] + klarna: Optional[Klarna] paypal: Optional[Paypal] - type: Literal["card", "paypal"] + type: Literal["card", "klarna", "paypal"] """ Payment method type. """ - _inner_class_types = {"card": Card, "paypal": Paypal} + _inner_class_types = {"card": Card, "klarna": Klarna, "paypal": Paypal} class CloseParams(RequestOptions): expand: NotRequired[List[str]] diff --git a/stripe/_invoice.py b/stripe/_invoice.py index a3b70fe4d..7f450660b 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -5612,7 +5612,7 @@ class VoidInvoiceParams(RequestOptions): """ attempt_count: int """ - Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. + Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. """ attempted: bool """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index aff76766f..9fea82170 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1278,6 +1278,14 @@ class MandateOptions(StripeObject): } class CardPresent(StripeObject): + class Routing(StripeObject): + requested_priority: Optional[ + Literal["domestic", "international"] + ] + """ + Requested routing priority + """ + request_extended_authorization: Optional[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) @@ -1286,6 +1294,8 @@ class CardPresent(StripeObject): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ + routing: Optional[Routing] + _inner_class_types = {"routing": Routing} class Cashapp(StripeObject): capture_method: Optional[Literal["manual"]] @@ -3311,6 +3321,18 @@ class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ + routing: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardPresentRouting" + ] + """ + Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. + """ + + class ConfirmParamsPaymentMethodOptionsCardPresentRouting(TypedDict): + requested_priority: NotRequired[Literal["domestic", "international"]] + """ + Routing requested priority + """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ @@ -5500,6 +5522,18 @@ class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ + routing: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardPresentRouting" + ] + """ + Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. + """ + + class CreateParamsPaymentMethodOptionsCardPresentRouting(TypedDict): + requested_priority: NotRequired[Literal["domestic", "international"]] + """ + Routing requested priority + """ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ @@ -7683,6 +7717,18 @@ class ModifyParamsPaymentMethodOptionsCardPresent(TypedDict): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ + routing: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsCardPresentRouting" + ] + """ + Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. + """ + + class ModifyParamsPaymentMethodOptionsCardPresentRouting(TypedDict): + requested_priority: NotRequired[Literal["domestic", "international"]] + """ + Routing requested priority + """ class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 1dee3a221..d2e1c83d4 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -1465,6 +1465,18 @@ class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ + routing: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardPresentRouting" + ] + """ + Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. + """ + + class ConfirmParamsPaymentMethodOptionsCardPresentRouting(TypedDict): + requested_priority: NotRequired[Literal["domestic", "international"]] + """ + Routing requested priority + """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ @@ -3678,6 +3690,18 @@ class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ + routing: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsCardPresentRouting" + ] + """ + Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. + """ + + class CreateParamsPaymentMethodOptionsCardPresentRouting(TypedDict): + requested_priority: NotRequired[Literal["domestic", "international"]] + """ + Routing requested priority + """ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ @@ -5913,6 +5937,18 @@ class UpdateParamsPaymentMethodOptionsCardPresent(TypedDict): """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ + routing: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodOptionsCardPresentRouting" + ] + """ + Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. + """ + + class UpdateParamsPaymentMethodOptionsCardPresentRouting(TypedDict): + requested_priority: NotRequired[Literal["domestic", "international"]] + """ + Routing requested priority + """ class UpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 8070922e7..aa5f8e897 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -515,6 +515,10 @@ class Networks(StripeObject): """ Contains information about card networks that can be used to process the payment. """ + preferred_locales: Optional[List[str]] + """ + EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + """ read_method: Optional[ Literal[ "contact_emv", diff --git a/stripe/_payout.py b/stripe/_payout.py index 7e1d627c2..62fbe67ee 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -17,6 +17,7 @@ ) if TYPE_CHECKING: + from stripe._application_fee import ApplicationFee from stripe._balance_transaction import BalanceTransaction from stripe._bank_account import BankAccount from stripe._card import Card @@ -184,6 +185,14 @@ class ReverseParams(RequestOptions): """ The amount (in cents (or local equivalent)) that transfers to your bank account or debit card. """ + application_fee: Optional[ExpandableField["ApplicationFee"]] + """ + The application fee (if any) for the payout. [See the Connect documentation](https://stripe.com/docs/connect/instant-payouts#monetization-and-fees) for details. + """ + application_fee_amount: Optional[int] + """ + The amount of the application fee (if any) requested for the payout. [See the Connect documentation](https://stripe.com/docs/connect/instant-payouts#monetization-and-fees) for details. + """ arrival_date: int """ Date that you can expect the payout to arrive in the bank. This factors in delays to account for weekends or bank holidays. diff --git a/stripe/_price.py b/stripe/_price.py index 9397e6c80..3b2811826 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -472,7 +472,7 @@ class ListParams(RequestOptions): """ lookup_keys: NotRequired[List[str]] """ - Only return the price with these lookup_keys, if any exist. + Only return the price with these lookup_keys, if any exist. You can specify up to 10 lookup_keys. """ product: NotRequired[str] """ diff --git a/stripe/_price_service.py b/stripe/_price_service.py index f43af4019..bf2388309 100644 --- a/stripe/_price_service.py +++ b/stripe/_price_service.py @@ -302,7 +302,7 @@ class ListParams(TypedDict): """ lookup_keys: NotRequired[List[str]] """ - Only return the price with these lookup_keys, if any exist. + Only return the price with these lookup_keys, if any exist. You can specify up to 10 lookup_keys. """ product: NotRequired[str] """ diff --git a/stripe/_product.py b/stripe/_product.py index b660d5146..ea3cda794 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -146,7 +146,7 @@ class CreateParams(RequestOptions): An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. - It must contain at least one letter. + It must contain at least one letter. Only used for subscription payments. """ tax_code: NotRequired[str] """ @@ -433,7 +433,7 @@ class ModifyParams(RequestOptions): An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. - It must contain at least one letter. May only be set if `type=service`. + It must contain at least one letter. May only be set if `type=service`. Only used for subscription payments. """ tax_code: NotRequired["Literal['']|str"] """ @@ -556,7 +556,7 @@ class SearchParams(RequestOptions): """ statement_descriptor: Optional[str] """ - Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. + Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. Only used for subscription payments. """ tax_code: Optional[ExpandableField["TaxCode"]] """ diff --git a/stripe/_product_service.py b/stripe/_product_service.py index 90b17ca4a..cde4ad8a0 100644 --- a/stripe/_product_service.py +++ b/stripe/_product_service.py @@ -72,7 +72,7 @@ class CreateParams(TypedDict): An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. - It must contain at least one letter. + It must contain at least one letter. Only used for subscription payments. """ tax_code: NotRequired[str] """ @@ -369,7 +369,7 @@ class UpdateParams(TypedDict): An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. - It must contain at least one letter. May only be set if `type=service`. + It must contain at least one letter. May only be set if `type=service`. Only used for subscription payments. """ tax_code: NotRequired["Literal['']|str"] """ diff --git a/stripe/_token.py b/stripe/_token.py index 3b1dd5358..36ae4308a 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -627,7 +627,7 @@ class CreateParamsBankAccount(TypedDict): """ routing_number: NotRequired[str] """ - The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. + The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for `account_number`, this field is not required. """ class CreateParamsCard(TypedDict): diff --git a/stripe/_token_service.py b/stripe/_token_service.py index dae80cd3f..841017566 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -598,7 +598,7 @@ class CreateParamsBankAccount(TypedDict): """ routing_number: NotRequired[str] """ - The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. + The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for `account_number`, this field is not required. """ class CreateParamsCard(TypedDict): diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 983b1d8ba..8d504d963 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1062,7 +1062,7 @@ class SavedPaymentMethodOptions(StripeObject): List[Literal["always", "limited", "unspecified"]] ] """ - Controls which payment methods are eligible to be redisplayed to returning customers. Corresponds to `allow_redisplay` on the payment method. + Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. By default, only saved payment methods with 'allow_redisplay: ‘always' are shown in Checkout. """ payment_method_save: Optional[Literal["disabled", "enabled"]] """ @@ -3097,7 +3097,7 @@ class CreateParamsSavedPaymentMethodOptions(TypedDict): List[Literal["always", "limited", "unspecified"]] ] """ - Controls which payment methods are eligible to be redisplayed to returning customers. Corresponds to `allow_redisplay` on the payment method. + Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. By default, only saved payment methods with 'allow_redisplay: ‘always' are shown in Checkout. """ payment_method_save: NotRequired[Literal["disabled", "enabled"]] """ diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 05cff7d09..defe9f25a 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -1649,7 +1649,7 @@ class CreateParamsSavedPaymentMethodOptions(TypedDict): List[Literal["always", "limited", "unspecified"]] ] """ - Controls which payment methods are eligible to be redisplayed to returning customers. Corresponds to `allow_redisplay` on the payment method. + Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. By default, only saved payment methods with 'allow_redisplay: ‘always' are shown in Checkout. """ payment_method_save: NotRequired[Literal["disabled", "enabled"]] """ diff --git a/stripe/entitlements/_feature.py b/stripe/entitlements/_feature.py index 99162f70a..85bca6f8f 100644 --- a/stripe/entitlements/_feature.py +++ b/stripe/entitlements/_feature.py @@ -43,6 +43,10 @@ class CreateParams(RequestOptions): """ class ListParams(RequestOptions): + archived: NotRequired[bool] + """ + If set, filter results to only include features with the given archive status. + """ 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. @@ -55,6 +59,10 @@ class ListParams(RequestOptions): """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ + lookup_key: NotRequired[str] + """ + If set, filter results to only include features with the given lookup_key. + """ 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. diff --git a/stripe/entitlements/_feature_service.py b/stripe/entitlements/_feature_service.py index d9b480b8b..dea34b0f2 100644 --- a/stripe/entitlements/_feature_service.py +++ b/stripe/entitlements/_feature_service.py @@ -29,6 +29,10 @@ class CreateParams(TypedDict): """ class ListParams(TypedDict): + archived: NotRequired[bool] + """ + If set, filter results to only include features with the given archive status. + """ 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. @@ -41,6 +45,10 @@ class ListParams(TypedDict): """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ + lookup_key: NotRequired[str] + """ + If set, filter results to only include features with the given lookup_key. + """ 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. diff --git a/stripe/financial_connections/_session.py b/stripe/financial_connections/_session.py index 0b9cff990..8dc534188 100644 --- a/stripe/financial_connections/_session.py +++ b/stripe/financial_connections/_session.py @@ -98,7 +98,7 @@ class CreateParamsAccountHolder(TypedDict): """ class CreateParamsFilters(TypedDict): - countries: List[str] + countries: NotRequired[List[str]] """ List of countries from which to collect accounts. """ diff --git a/stripe/financial_connections/_session_service.py b/stripe/financial_connections/_session_service.py index d15529e5e..69a70c80d 100644 --- a/stripe/financial_connections/_session_service.py +++ b/stripe/financial_connections/_session_service.py @@ -56,7 +56,7 @@ class CreateParamsAccountHolder(TypedDict): """ class CreateParamsFilters(TypedDict): - countries: List[str] + countries: NotRequired[List[str]] """ List of countries from which to collect accounts. """ diff --git a/stripe/issuing/_dispute.py b/stripe/issuing/_dispute.py index 9102bcf07..c6bcb13d1 100644 --- a/stripe/issuing/_dispute.py +++ b/stripe/issuing/_dispute.py @@ -141,6 +141,16 @@ class MerchandiseNotAsDescribed(StripeObject): Date when the product was returned or attempted to be returned. """ + class NoValidAuthorization(StripeObject): + additional_documentation: Optional[ExpandableField["File"]] + """ + (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + """ + explanation: Optional[str] + """ + Explanation of why the cardholder is disputing this transaction. + """ + class NotReceived(StripeObject): additional_documentation: Optional[ExpandableField["File"]] """ @@ -207,6 +217,7 @@ class ServiceNotAsDescribed(StripeObject): duplicate: Optional[Duplicate] fraudulent: Optional[Fraudulent] merchandise_not_as_described: Optional[MerchandiseNotAsDescribed] + no_valid_authorization: Optional[NoValidAuthorization] not_received: Optional[NotReceived] other: Optional[Other] reason: Literal[ @@ -214,6 +225,7 @@ class ServiceNotAsDescribed(StripeObject): "duplicate", "fraudulent", "merchandise_not_as_described", + "no_valid_authorization", "not_received", "other", "service_not_as_described", @@ -227,6 +239,7 @@ class ServiceNotAsDescribed(StripeObject): "duplicate": Duplicate, "fraudulent": Fraudulent, "merchandise_not_as_described": MerchandiseNotAsDescribed, + "no_valid_authorization": NoValidAuthorization, "not_received": NotReceived, "other": Other, "service_not_as_described": ServiceNotAsDescribed, @@ -293,6 +306,12 @@ class CreateParamsEvidence(TypedDict): """ Evidence provided when `reason` is 'merchandise_not_as_described'. """ + no_valid_authorization: NotRequired[ + "Literal['']|Dispute.CreateParamsEvidenceNoValidAuthorization" + ] + """ + Evidence provided when `reason` is 'no_valid_authorization'. + """ not_received: NotRequired[ "Literal['']|Dispute.CreateParamsEvidenceNotReceived" ] @@ -309,6 +328,7 @@ class CreateParamsEvidence(TypedDict): "duplicate", "fraudulent", "merchandise_not_as_described", + "no_valid_authorization", "not_received", "other", "service_not_as_described", @@ -434,6 +454,16 @@ class CreateParamsEvidenceMerchandiseNotAsDescribed(TypedDict): Date when the product was returned or attempted to be returned. """ + class CreateParamsEvidenceNoValidAuthorization(TypedDict): + additional_documentation: NotRequired["Literal['']|str"] + """ + (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + """ + explanation: NotRequired["Literal['']|str"] + """ + Explanation of why the cardholder is disputing this transaction. + """ + class CreateParamsEvidenceNotReceived(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ @@ -599,6 +629,12 @@ class ModifyParamsEvidence(TypedDict): """ Evidence provided when `reason` is 'merchandise_not_as_described'. """ + no_valid_authorization: NotRequired[ + "Literal['']|Dispute.ModifyParamsEvidenceNoValidAuthorization" + ] + """ + Evidence provided when `reason` is 'no_valid_authorization'. + """ not_received: NotRequired[ "Literal['']|Dispute.ModifyParamsEvidenceNotReceived" ] @@ -615,6 +651,7 @@ class ModifyParamsEvidence(TypedDict): "duplicate", "fraudulent", "merchandise_not_as_described", + "no_valid_authorization", "not_received", "other", "service_not_as_described", @@ -740,6 +777,16 @@ class ModifyParamsEvidenceMerchandiseNotAsDescribed(TypedDict): Date when the product was returned or attempted to be returned. """ + class ModifyParamsEvidenceNoValidAuthorization(TypedDict): + additional_documentation: NotRequired["Literal['']|str"] + """ + (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + """ + explanation: NotRequired["Literal['']|str"] + """ + Explanation of why the cardholder is disputing this transaction. + """ + class ModifyParamsEvidenceNotReceived(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ @@ -847,6 +894,33 @@ class SubmitParams(RequestOptions): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ + loss_reason: Optional[ + Literal[ + "cardholder_authentication_issuer_liability", + "eci5_token_transaction_with_tavv", + "excess_disputes_in_timeframe", + "has_not_met_the_minimum_dispute_amount_requirements", + "invalid_duplicate_dispute", + "invalid_incorrect_amount_dispute", + "invalid_no_authorization", + "invalid_use_of_disputes", + "merchandise_delivered_or_shipped", + "merchandise_or_service_as_described", + "not_cancelled", + "other", + "refund_issued", + "submitted_beyond_allowable_time_limit", + "transaction_3ds_required", + "transaction_approved_after_prior_fraud_dispute", + "transaction_authorized", + "transaction_electronically_read", + "transaction_qualifies_for_visa_easy_payment_service", + "transaction_unattended", + ] + ] + """ + The enum that describes the dispute loss outcome. If the dispute is not lost, this field will be absent. New enum values may be added in the future, so be sure to handle unknown values. + """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. diff --git a/stripe/issuing/_dispute_service.py b/stripe/issuing/_dispute_service.py index 4b567e3ce..66492a871 100644 --- a/stripe/issuing/_dispute_service.py +++ b/stripe/issuing/_dispute_service.py @@ -61,6 +61,12 @@ class CreateParamsEvidence(TypedDict): """ Evidence provided when `reason` is 'merchandise_not_as_described'. """ + no_valid_authorization: NotRequired[ + "Literal['']|DisputeService.CreateParamsEvidenceNoValidAuthorization" + ] + """ + Evidence provided when `reason` is 'no_valid_authorization'. + """ not_received: NotRequired[ "Literal['']|DisputeService.CreateParamsEvidenceNotReceived" ] @@ -79,6 +85,7 @@ class CreateParamsEvidence(TypedDict): "duplicate", "fraudulent", "merchandise_not_as_described", + "no_valid_authorization", "not_received", "other", "service_not_as_described", @@ -204,6 +211,16 @@ class CreateParamsEvidenceMerchandiseNotAsDescribed(TypedDict): Date when the product was returned or attempted to be returned. """ + class CreateParamsEvidenceNoValidAuthorization(TypedDict): + additional_documentation: NotRequired["Literal['']|str"] + """ + (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + """ + explanation: NotRequired["Literal['']|str"] + """ + Explanation of why the cardholder is disputing this transaction. + """ + class CreateParamsEvidenceNotReceived(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ @@ -385,6 +402,12 @@ class UpdateParamsEvidence(TypedDict): """ Evidence provided when `reason` is 'merchandise_not_as_described'. """ + no_valid_authorization: NotRequired[ + "Literal['']|DisputeService.UpdateParamsEvidenceNoValidAuthorization" + ] + """ + Evidence provided when `reason` is 'no_valid_authorization'. + """ not_received: NotRequired[ "Literal['']|DisputeService.UpdateParamsEvidenceNotReceived" ] @@ -403,6 +426,7 @@ class UpdateParamsEvidence(TypedDict): "duplicate", "fraudulent", "merchandise_not_as_described", + "no_valid_authorization", "not_received", "other", "service_not_as_described", @@ -528,6 +552,16 @@ class UpdateParamsEvidenceMerchandiseNotAsDescribed(TypedDict): Date when the product was returned or attempted to be returned. """ + class UpdateParamsEvidenceNoValidAuthorization(TypedDict): + additional_documentation: NotRequired["Literal['']|str"] + """ + (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + """ + explanation: NotRequired["Literal['']|str"] + """ + Explanation of why the cardholder is disputing this transaction. + """ + class UpdateParamsEvidenceNotReceived(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index 14a7e1e7f..a9f1351c9 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -48,6 +48,12 @@ class Offline(StripeObject): Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ + class StripeS700(StripeObject): + splashscreen: Optional[ExpandableField["File"]] + """ + A File ID representing an image you would like displayed on the reader. + """ + class Tipping(StripeObject): class Aud(StripeObject): fixed_amounts: Optional[List[int]] @@ -299,6 +305,10 @@ class CreateParams(RequestOptions): """ Configurations for collecting transactions offline. """ + stripe_s700: NotRequired["Configuration.CreateParamsStripeS700"] + """ + An object containing device type specific settings for Stripe S700 readers + """ tipping: NotRequired["Literal['']|Configuration.CreateParamsTipping"] """ Tipping configurations for readers supporting on-reader tips @@ -320,6 +330,12 @@ class CreateParamsOffline(TypedDict): Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ + class CreateParamsStripeS700(TypedDict): + splashscreen: NotRequired["Literal['']|str"] + """ + A File ID representing an image you would like displayed on the reader. + """ + class CreateParamsTipping(TypedDict): aud: NotRequired["Configuration.CreateParamsTippingAud"] """ @@ -624,6 +640,12 @@ class ModifyParams(RequestOptions): """ Configurations for collecting transactions offline. """ + stripe_s700: NotRequired[ + "Literal['']|Configuration.ModifyParamsStripeS700" + ] + """ + An object containing device type specific settings for Stripe S700 readers + """ tipping: NotRequired["Literal['']|Configuration.ModifyParamsTipping"] """ Tipping configurations for readers supporting on-reader tips @@ -647,6 +669,12 @@ class ModifyParamsOffline(TypedDict): Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ + class ModifyParamsStripeS700(TypedDict): + splashscreen: NotRequired["Literal['']|str"] + """ + A File ID representing an image you would like displayed on the reader. + """ + class ModifyParamsTipping(TypedDict): aud: NotRequired["Configuration.ModifyParamsTippingAud"] """ @@ -935,6 +963,7 @@ class RetrieveParams(RequestOptions): String representing the object's type. Objects of the same type share the same value. """ offline: Optional[Offline] + stripe_s700: Optional[StripeS700] tipping: Optional[Tipping] verifone_p400: Optional[VerifoneP400] deleted: Optional[Literal[True]] @@ -1171,6 +1200,7 @@ async def retrieve_async( _inner_class_types = { "bbpos_wisepos_e": BbposWiseposE, "offline": Offline, + "stripe_s700": StripeS700, "tipping": Tipping, "verifone_p400": VerifoneP400, } diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index 76740d703..7a87a5fc2 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -31,6 +31,10 @@ class CreateParams(TypedDict): """ Configurations for collecting transactions offline. """ + stripe_s700: NotRequired["ConfigurationService.CreateParamsStripeS700"] + """ + An object containing device type specific settings for Stripe S700 readers + """ tipping: NotRequired[ "Literal['']|ConfigurationService.CreateParamsTipping" ] @@ -56,6 +60,12 @@ class CreateParamsOffline(TypedDict): Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ + class CreateParamsStripeS700(TypedDict): + splashscreen: NotRequired["Literal['']|str"] + """ + A File ID representing an image you would like displayed on the reader. + """ + class CreateParamsTipping(TypedDict): aud: NotRequired["ConfigurationService.CreateParamsTippingAud"] """ @@ -368,6 +378,12 @@ class UpdateParams(TypedDict): """ Configurations for collecting transactions offline. """ + stripe_s700: NotRequired[ + "Literal['']|ConfigurationService.UpdateParamsStripeS700" + ] + """ + An object containing device type specific settings for Stripe S700 readers + """ tipping: NotRequired[ "Literal['']|ConfigurationService.UpdateParamsTipping" ] @@ -393,6 +409,12 @@ class UpdateParamsOffline(TypedDict): Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ + class UpdateParamsStripeS700(TypedDict): + splashscreen: NotRequired["Literal['']|str"] + """ + A File ID representing an image you would like displayed on the reader. + """ + class UpdateParamsTipping(TypedDict): aud: NotRequired["ConfigurationService.UpdateParamsTippingAud"] """ From 6809d4cafa3184c43bdcdfe0f0ceeffe69748c19 Mon Sep 17 00:00:00 2001 From: Prathmesh Ranaut Date: Thu, 16 May 2024 18:19:27 -0400 Subject: [PATCH 065/179] Bump version to 9.7.0 --- CHANGELOG.md | 18 ++++++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0d3a85cb..9f02a0b82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +## 9.7.0 - 2024-05-16 +* [#1328](https://github.com/stripe/stripe-python/pull/1328) Update generated code + * Add support for `fee_source` on resource `stripe.ApplicationFee` + * Add support for `net_available` on resource class `stripe.Balance.InstantAvailable` + * Add support for `preferred_locales` on resource classes `stripe.Charge.PaymentMethodDetails.CardPresent`, `stripe.ConfirmationToken.PaymentMethodPreview.CardPresent`, and `stripe.PaymentMethod.CardPresent` + * Add support for `klarna` on resource class `stripe.Dispute.PaymentMethodDetails` + * Add support for `routing` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsCardPresent`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsCardPresent`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsCardPresent` and resource class `stripe.PaymentIntent.PaymentMethodOptions.CardPresent` + * Add support for `application_fee` on resource `stripe.Payout` + * Add support for `archived` on parameter class `stripe.entitlements.Feature.ListParams` + * Add support for `lookup_key` on parameter class `stripe.entitlements.Feature.ListParams` + * Add support for `no_valid_authorization` on parameter classes `stripe.issuing.Dispute.CreateParamsEvidence` and `stripe.issuing.Dispute.ModifyParamsEvidence` and resource class `stripe.issuing.Dispute.Evidence` + * Add support for `loss_reason` on resource `stripe.issuing.Dispute` + * Add support for `stripe_s700` on parameter classes `stripe.terminal.Configuration.CreateParams` and `stripe.terminal.Configuration.ModifyParams` and resource `stripe.terminal.Configuration` + * Add support for `klarna` on enum `stripe.Dispute.PaymentMethodDetails.type` + * Add support for `no_valid_authorization` on enums `stripe.issuing.Dispute.Evidence.reason`, `stripe.issuing.Dispute.CreateParamsEvidence.reason`, and `stripe.issuing.Dispute.ModifyParamsEvidence.reason` + * Change type of `countries` on `stripe.financial_connections.Session.CreateParamsFilters` from `List[str]` to `NotRequired[List[str]]` +* [#1329](https://github.com/stripe/stripe-python/pull/1329) Switch from `black` to `ruff` for formatting + ## 9.6.0 - 2024-05-09 * [#1323](https://github.com/stripe/stripe-python/pull/1323) Update generated code * Add support for `allow_redisplay` on resource class `stripe.ConfirmationToken.PaymentMethodPreview` and resource `stripe.PaymentMethod` diff --git a/VERSION b/VERSION index 7b0680f4e..a458a24cc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.6.0 +9.7.0 diff --git a/stripe/_version.py b/stripe/_version.py index bace651be..0cb2df74f 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.6.0" +VERSION = "9.7.0" From 61d17bdf92d8b0e9d875e573f5d7d17d14a3988b Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 16:16:41 -0400 Subject: [PATCH 066/179] Update generated code (#1332) * Update generated code for v1040 * Update generated code for v1044 * Update generated code for v1045 * Update generated code for v1046 * Update generated code for v1047 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 2 +- stripe/_account_session.py | 16 ++++++++ stripe/_account_session_service.py | 8 ++++ stripe/_invoice.py | 45 ++++++++++++----------- stripe/_invoice_item.py | 8 ++-- stripe/_invoice_item_service.py | 8 ++-- stripe/_invoice_line_item.py | 4 +- stripe/_invoice_line_item_service.py | 4 +- stripe/_invoice_service.py | 28 +++++++------- stripe/_invoice_upcoming_lines_service.py | 16 ++++---- stripe/_payment_intent.py | 1 + stripe/_setup_attempt.py | 1 + stripe/_setup_intent.py | 1 + stripe/_subscription.py | 12 +++--- stripe/_subscription_item.py | 4 +- stripe/_subscription_item_service.py | 4 +- stripe/_subscription_schedule.py | 8 ++-- stripe/_subscription_schedule_service.py | 8 ++-- stripe/_subscription_service.py | 12 +++--- stripe/checkout/_session.py | 4 ++ 21 files changed, 114 insertions(+), 82 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e0801e4ff..20970a9f9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1039 \ No newline at end of file +v1047 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 4e47dcbf8..e58390170 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -268,7 +268,7 @@ class Capabilities(StripeObject): """ mobilepay_payments: Optional[Literal["active", "inactive", "pending"]] """ - The status of the MobilepPay capability of the account, or whether the account can directly process MobilePay charges. + The status of the MobilePay capability of the account, or whether the account can directly process MobilePay charges. """ oxxo_payments: Optional[Literal["active", "inactive", "pending"]] """ diff --git a/stripe/_account_session.py b/stripe/_account_session.py index dee4292d1..c4ae483f8 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -55,6 +55,10 @@ class Features(StripeObject): """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ + external_account_collection: bool + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ instant_payouts: bool """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. @@ -154,6 +158,10 @@ class Features(StripeObject): """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ + external_account_collection: bool + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ instant_payouts: bool """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. @@ -319,6 +327,10 @@ class CreateParamsComponentsBalancesFeatures(TypedDict): """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ + external_account_collection: NotRequired[bool] + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ instant_payouts: NotRequired[bool] """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. @@ -438,6 +450,10 @@ class CreateParamsComponentsPayoutsFeatures(TypedDict): """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ + external_account_collection: NotRequired[bool] + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ instant_payouts: NotRequired[bool] """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index f30dfb65f..39b7f6407 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -131,6 +131,10 @@ class CreateParamsComponentsBalancesFeatures(TypedDict): """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ + external_account_collection: NotRequired[bool] + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ instant_payouts: NotRequired[bool] """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. @@ -250,6 +254,10 @@ class CreateParamsComponentsPayoutsFeatures(TypedDict): """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ + external_account_collection: NotRequired[bool] + """ + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + """ instant_payouts: NotRequired[bool] """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 7f450660b..f6cbbbfb6 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -476,6 +476,7 @@ class LastFinalizationError(StripeObject): "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", + "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", "testmode_charges_only", @@ -1922,13 +1923,13 @@ class CreatePreviewParamsInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Invoice.CreatePreviewParamsInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -2156,13 +2157,13 @@ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Invoice.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -2488,13 +2489,13 @@ class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "Invoice.CreatePreviewParamsSubscriptionDetailsItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -3699,13 +3700,13 @@ class UpcomingLinesParamsInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Invoice.UpcomingLinesParamsInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -3933,13 +3934,13 @@ class UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -4265,13 +4266,13 @@ class UpcomingLinesParamsSubscriptionDetailsItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "Invoice.UpcomingLinesParamsSubscriptionDetailsItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -4379,13 +4380,13 @@ class UpcomingLinesParamsSubscriptionItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "Invoice.UpcomingLinesParamsSubscriptionItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -4831,11 +4832,11 @@ class UpcomingParamsInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["Invoice.UpcomingParamsInvoiceItemPriceData"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -5059,13 +5060,13 @@ class UpcomingParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Invoice.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -5381,13 +5382,13 @@ class UpcomingParamsSubscriptionDetailsItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "Invoice.UpcomingParamsSubscriptionDetailsItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -5493,13 +5494,13 @@ class UpcomingParamsSubscriptionItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "Invoice.UpcomingParamsSubscriptionItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index 9fa29f594..968f94dd0 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -106,11 +106,11 @@ class CreateParams(RequestOptions): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["InvoiceItem.CreateParamsPriceData"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -279,11 +279,11 @@ class ModifyParams(RequestOptions): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["InvoiceItem.ModifyParamsPriceData"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ diff --git a/stripe/_invoice_item_service.py b/stripe/_invoice_item_service.py index f1f2cf8d0..aa97cd0c7 100644 --- a/stripe/_invoice_item_service.py +++ b/stripe/_invoice_item_service.py @@ -55,11 +55,11 @@ class CreateParams(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["InvoiceItemService.CreateParamsPriceData"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -234,11 +234,11 @@ class UpdateParams(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["InvoiceItemService.UpdateParamsPriceData"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 837e0b337..4ebc11c7f 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -137,11 +137,11 @@ class ModifyParams(RequestOptions): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["InvoiceLineItem.ModifyParamsPriceData"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index 4cacab135..21be17673 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -61,11 +61,11 @@ class UpdateParams(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["InvoiceLineItemService.UpdateParamsPriceData"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 52ce5b187..82a527768 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -964,13 +964,13 @@ class CreatePreviewParamsInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "InvoiceService.CreatePreviewParamsInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -1200,13 +1200,13 @@ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -1532,13 +1532,13 @@ class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "InvoiceService.CreatePreviewParamsSubscriptionDetailsItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -2154,13 +2154,13 @@ class UpcomingParamsInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "InvoiceService.UpcomingParamsInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -2388,13 +2388,13 @@ class UpcomingParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "InvoiceService.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -2708,13 +2708,13 @@ class UpcomingParamsSubscriptionDetailsItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "InvoiceService.UpcomingParamsSubscriptionDetailsItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -2818,13 +2818,13 @@ class UpcomingParamsSubscriptionItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "InvoiceService.UpcomingParamsSubscriptionItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index ca4b3665d..0087c058e 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -410,13 +410,13 @@ class ListParamsInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "InvoiceUpcomingLinesService.ListParamsInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -646,13 +646,13 @@ class ListParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -968,13 +968,13 @@ class ListParamsSubscriptionDetailsItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -1078,13 +1078,13 @@ class ListParamsSubscriptionItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "InvoiceUpcomingLinesService.ListParamsSubscriptionItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 9fea82170..b64e38c66 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -257,6 +257,7 @@ class LastPaymentError(StripeObject): "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", + "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", "testmode_charges_only", diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 027b1280d..7aedd8bb3 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -589,6 +589,7 @@ class SetupError(StripeObject): "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", + "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", "testmode_charges_only", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 72d19b7d8..55eda45b1 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -242,6 +242,7 @@ class LastSetupError(StripeObject): "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", + "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", "testmode_charges_only", diff --git a/stripe/_subscription.py b/stripe/_subscription.py index dd79eb2f0..0f51f8a44 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -643,13 +643,13 @@ class CreateParamsAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Subscription.CreateParamsAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -1444,13 +1444,13 @@ class ModifyParamsAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Subscription.ModifyParamsAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -1612,11 +1612,11 @@ class ModifyParamsItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired["Subscription.ModifyParamsItemPriceData"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index 9fbf79626..4614d3a90 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -302,11 +302,11 @@ class ModifyParams(RequestOptions): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired["SubscriptionItem.ModifyParamsPriceData"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] diff --git a/stripe/_subscription_item_service.py b/stripe/_subscription_item_service.py index 2e591da78..e8f520ec7 100644 --- a/stripe/_subscription_item_service.py +++ b/stripe/_subscription_item_service.py @@ -252,13 +252,13 @@ class UpdateParams(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "SubscriptionItemService.UpdateParamsPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index 11738c8f3..d688436d7 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -717,13 +717,13 @@ class CreateParamsPhaseAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "SubscriptionSchedule.CreateParamsPhaseAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -1347,13 +1347,13 @@ class ModifyParamsPhaseAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "SubscriptionSchedule.ModifyParamsPhaseAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index ca63af91f..48bd47bfb 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -301,13 +301,13 @@ class CreateParamsPhaseAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "SubscriptionScheduleService.CreateParamsPhaseAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -949,13 +949,13 @@ class UpdateParamsPhaseAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "SubscriptionScheduleService.UpdateParamsPhaseAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 0fbe94712..4e8b279eb 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -236,13 +236,13 @@ class CreateParamsAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "SubscriptionService.CreateParamsAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -1093,13 +1093,13 @@ class UpdateParamsAddInvoiceItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. + The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "SubscriptionService.UpdateParamsAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ @@ -1263,13 +1263,13 @@ class UpdateParamsItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "SubscriptionService.UpdateParamsItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 8d504d963..8535824d1 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1064,6 +1064,10 @@ class SavedPaymentMethodOptions(StripeObject): """ Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. By default, only saved payment methods with 'allow_redisplay: ‘always' are shown in Checkout. """ + payment_method_remove: Optional[Literal["disabled", "enabled"]] + """ + Enable customers to choose if they wish to remove their saved payment methods. Disabled by default. + """ payment_method_save: Optional[Literal["disabled", "enabled"]] """ Enable customers to choose if they wish to save their payment method for future use. Disabled by default. From c5e2eab211ff8cb39a93d08da45706bc42f8123e Mon Sep 17 00:00:00 2001 From: Prathmesh Ranaut Date: Thu, 23 May 2024 16:23:14 -0400 Subject: [PATCH 067/179] Bump version to 9.8.0 --- CHANGELOG.md | 6 ++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f02a0b82..a5009538d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 9.8.0 - 2024-05-23 +* [#1332](https://github.com/stripe/stripe-python/pull/1332) Update generated code + * Add support for `external_account_collection` on resource classes `stripe.AccountSession.Components.Balances.Features` and `stripe.AccountSession.Components.Payouts.Features` and parameter classes `stripe.AccountSession.CreateParamsComponentsBalancesFeatures` and `stripe.AccountSession.CreateParamsComponentsPayoutsFeatures` + * Add support for `payment_method_remove` on resource class `stripe.checkout.Session.SavedPaymentMethodOptions` + * Add support for `terminal_reader_invalid_location_for_payment` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + ## 9.7.0 - 2024-05-16 * [#1328](https://github.com/stripe/stripe-python/pull/1328) Update generated code * Add support for `fee_source` on resource `stripe.ApplicationFee` diff --git a/VERSION b/VERSION index a458a24cc..834eb3fa8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.7.0 +9.8.0 diff --git a/stripe/_version.py b/stripe/_version.py index 0cb2df74f..7334c2bfe 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.7.0" +VERSION = "9.8.0" From e559fded2793ae9b25749c6824378018e785a762 Mon Sep 17 00:00:00 2001 From: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> Date: Fri, 24 May 2024 10:42:02 -0700 Subject: [PATCH 068/179] Add method to list invoice line items (#1335) --- stripe/_invoice.py | 56 +++++++++++++++++++++++++++++ tests/api_resources/test_invoice.py | 5 +++ 2 files changed, 61 insertions(+) diff --git a/stripe/_invoice.py b/stripe/_invoice.py index f6cbbbfb6..5b628c477 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -5,6 +5,7 @@ from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource +from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._searchable_api_resource import SearchableAPIResource @@ -51,6 +52,7 @@ from stripe.test_helpers._test_clock import TestClock +@nested_resource_class_methods("line") class Invoice( CreateableAPIResource["Invoice"], DeletableAPIResource["Invoice"], @@ -2581,6 +2583,24 @@ class FinalizeInvoiceParams(RequestOptions): Specifies which fields in the response should be expanded. """ + class ListLinesParams(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. + """ + class ListParams(RequestOptions): collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] @@ -6883,6 +6903,42 @@ async def search_auto_paging_iter_async( ) -> AsyncIterator["Invoice"]: return (await cls.search_async(*args, **kwargs)).auto_paging_iter() + @classmethod + def list_lines( + cls, invoice: str, **params: Unpack["Invoice.ListLinesParams"] + ) -> ListObject["InvoiceLineItem"]: + """ + When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["InvoiceLineItem"], + cls._static_request( + "get", + "/v1/invoices/{invoice}/lines".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + + @classmethod + async def list_lines_async( + cls, invoice: str, **params: Unpack["Invoice.ListLinesParams"] + ) -> ListObject["InvoiceLineItem"]: + """ + When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["InvoiceLineItem"], + await cls._static_request_async( + "get", + "/v1/invoices/{invoice}/lines".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + _inner_class_types = { "automatic_tax": AutomaticTax, "custom_fields": CustomField, diff --git a/tests/api_resources/test_invoice.py b/tests/api_resources/test_invoice.py index 12e05701e..904c36382 100644 --- a/tests/api_resources/test_invoice.py +++ b/tests/api_resources/test_invoice.py @@ -144,3 +144,8 @@ def test_can_iterate_lines(self): seen = [item["id"] for item in resource.lines.auto_paging_iter()] assert seen.__len__() > 0 + + def test_can_list_line_items(self): + resource = stripe.Invoice.list_lines(TEST_RESOURCE_ID) + assert isinstance(resource.data, list) + assert isinstance(resource.data[0], stripe.InvoiceLineItem) From c28ec9de3faa58b429f5a65fd1bbb49fd9860044 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Wed, 29 May 2024 14:40:50 -0700 Subject: [PATCH 069/179] update VSCode settings (#1337) --- .vscode/extensions.json | 8 ++++---- .vscode/settings.json | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index e1511b0d9..d0344aead 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,8 +1,8 @@ { "recommendations": [ - "ms-python.python", - "EditorConfig.editorconfig", - "ms-python.flake8", - "charliermarsh.ruff" + "EditorConfig.editorconfig", // default + "ms-python.python", // intellisense + "ms-python.flake8", // linting + "charliermarsh.ruff" // formatting ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 20ac11136..324c33a9a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,19 +4,30 @@ "editor.renderWhitespace": "all", "files.exclude": { - "**/*.pyc": { "when": "$(basename).py" }, - "**/__pycache__": true + "**/*.pyc": true, + "**/__pycache__": true, + ".pytest_cache": true, + ".mypy_cache": true, + ".ruff_cache": true, + ".tox": true, + "*.egg-info": true, + "venv": true }, + // uses default venv name from Makefile + "python.defaultInterpreterPath": "./venv/bin/python", // Formatting "editor.formatOnSave": true, + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff" + }, // Tests "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, "python.terminal.activateEnvironment": true, - "python.defaultInterpreterPath": "~/venv/bin/python3", "python.analysis.diagnosticMode": "workspace", "python.analysis.typeCheckingMode": "basic", + "ruff.lint.enable": false // in favor of flake8 } From 00a078c60ad93c791d5fe1c1f815ff5c7a9d01c7 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 19:03:10 +0000 Subject: [PATCH 070/179] Update generated code (#1336) * Update generated code for v1049 * Update generated code for v1050 * Update generated code for v1051 * Update generated code for v1052 * Update generated code for v1053 * Update generated code for v1054 * Update generated code for v1055 * Update generated code for v1056 * Update generated code for v1058 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 4 +- stripe/_account_service.py | 4 +- stripe/_bank_account.py | 2 + stripe/_capability.py | 2 + stripe/_charge.py | 2 +- stripe/_confirmation_token.py | 182 ++++++++++++++++++++++ stripe/_event.py | 4 + stripe/_invoice.py | 6 +- stripe/_invoice_service.py | 4 +- stripe/_invoice_upcoming_lines_service.py | 2 +- stripe/_payment_intent.py | 168 ++++++++++---------- stripe/_payment_intent_service.py | 168 ++++++++++---------- stripe/_payment_method.py | 180 +++++++++++++++++++++ stripe/_person.py | 2 + stripe/_webhook_endpoint.py | 8 + stripe/_webhook_endpoint_service.py | 8 + stripe/checkout/_session.py | 26 +++- stripe/checkout/_session_service.py | 14 +- stripe/issuing/_physical_bundle.py | 4 +- 20 files changed, 615 insertions(+), 177 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 20970a9f9..4161e81ad 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1047 \ No newline at end of file +v1058 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index e58390170..80babd314 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -707,6 +707,7 @@ class Error(StripeObject): "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", + "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. @@ -855,6 +856,7 @@ class Error(StripeObject): "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", + "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. @@ -1264,7 +1266,7 @@ class CreateParams(RequestOptions): """ tos_acceptance: NotRequired["Account.CreateParamsTosAcceptance"] """ - Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. This property defaults to a `full` service agreement when empty. """ type: NotRequired[Literal["custom", "express", "standard"]] """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index b7c53e47b..437f1b7a3 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -101,7 +101,7 @@ class CreateParams(TypedDict): """ tos_acceptance: NotRequired["AccountService.CreateParamsTosAcceptance"] """ - Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. This property defaults to a `full` service agreement when empty. """ type: NotRequired[Literal["custom", "express", "standard"]] """ @@ -1707,7 +1707,7 @@ class UpdateParams(TypedDict): """ tos_acceptance: NotRequired["AccountService.UpdateParamsTosAcceptance"] """ - Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. This property defaults to a `full` service agreement when empty. """ class UpdateParamsBankAccount(TypedDict): diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index c74515d33..8f3799e37 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -126,6 +126,7 @@ class Error(StripeObject): "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", + "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. @@ -248,6 +249,7 @@ class Error(StripeObject): "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", + "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. diff --git a/stripe/_capability.py b/stripe/_capability.py index 8e800be8f..53ca37edd 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -119,6 +119,7 @@ class Error(StripeObject): "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", + "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. @@ -267,6 +268,7 @@ class Error(StripeObject): "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", + "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. diff --git a/stripe/_charge.py b/stripe/_charge.py index 63d1385fc..896a4c2ed 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1255,7 +1255,7 @@ class Klarna(StripeObject): preferred_locale: Optional[str] """ Preferred language of the Klarna authorization page that the customer is redirected to. - Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH` + Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `ro-RO`, `en-RO`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH` """ class Konbini(StripeObject): diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index c8cbd375b..8eba07da4 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -196,6 +196,183 @@ class Checks(StripeObject): If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ + class GeneratedFrom(StripeObject): + class PaymentMethodDetails(StripeObject): + class CardPresent(StripeObject): + class Offline(StripeObject): + stored_at: Optional[int] + """ + Time at which the payment was collected while offline + """ + + class Receipt(StripeObject): + account_type: Optional[ + Literal[ + "checking", "credit", "prepaid", "unknown" + ] + ] + """ + The type of account being debited or credited + """ + application_cryptogram: Optional[str] + """ + EMV tag 9F26, cryptogram generated by the integrated circuit chip. + """ + application_preferred_name: Optional[str] + """ + Mnenomic of the Application Identifier. + """ + authorization_code: Optional[str] + """ + Identifier for this transaction. + """ + authorization_response_code: Optional[str] + """ + EMV tag 8A. A code returned by the card issuer. + """ + cardholder_verification_method: Optional[str] + """ + Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + """ + dedicated_file_name: Optional[str] + """ + EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + """ + terminal_verification_results: Optional[str] + """ + The outcome of a series of EMV functions performed by the card reader. + """ + transaction_status_information: Optional[str] + """ + An indication of various EMV functions performed during the transaction. + """ + + amount_authorized: Optional[int] + """ + The authorized amount + """ + brand: Optional[str] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + capture_before: Optional[int] + """ + When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. + """ + cardholder_name: Optional[str] + """ + The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + description: Optional[str] + """ + A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + """ + emv_auth_data: Optional[str] + """ + Authorization response cryptogram. + """ + exp_month: int + """ + Two-digit number representing the card's expiration month. + """ + exp_year: int + """ + Four-digit number representing the card's expiration year. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + + *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: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + generated_card: Optional[str] + """ + ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + """ + iin: Optional[str] + """ + Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + """ + incremental_authorization_supported: bool + """ + Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). + """ + issuer: Optional[str] + """ + The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + network: Optional[str] + """ + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + offline: Optional[Offline] + """ + Details about payments collected offline. + """ + overcapture_supported: bool + """ + Defines whether the authorized amount can be over-captured or not + """ + preferred_locales: Optional[List[str]] + """ + EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + """ + read_method: Optional[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ] + ] + """ + How card details were read in this transaction. + """ + receipt: Optional[Receipt] + """ + A collection of fields required to be displayed on receipts. Only required for EMV transactions. + """ + _inner_class_types = { + "offline": Offline, + "receipt": Receipt, + } + + card_present: Optional[CardPresent] + type: str + """ + The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`. + """ + _inner_class_types = {"card_present": CardPresent} + + charge: Optional[str] + """ + The charge that created this object. + """ + payment_method_details: Optional[PaymentMethodDetails] + """ + Transaction-specific details of the payment method used in the payment. + """ + setup_attempt: Optional[ExpandableField["SetupAttempt"]] + """ + The ID of the SetupAttempt that generated this PaymentMethod, if any. + """ + _inner_class_types = { + "payment_method_details": PaymentMethodDetails, + } + class Networks(StripeObject): available: List[str] """ @@ -447,6 +624,10 @@ class ShippingAddress(StripeObject): """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ + generated_from: Optional[GeneratedFrom] + """ + Details of the original PaymentMethod that created this object. + """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) @@ -473,6 +654,7 @@ class ShippingAddress(StripeObject): """ _inner_class_types = { "checks": Checks, + "generated_from": GeneratedFrom, "networks": Networks, "three_d_secure_usage": ThreeDSecureUsage, "wallet": Wallet, diff --git a/stripe/_event.py b/stripe/_event.py index 8161a9ce1..40164c169 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -265,6 +265,10 @@ class RetrieveParams(RequestOptions): "issuing_dispute.funds_reinstated", "issuing_dispute.submitted", "issuing_dispute.updated", + "issuing_personalization_design.activated", + "issuing_personalization_design.deactivated", + "issuing_personalization_design.rejected", + "issuing_personalization_design.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 5b628c477..2670f8ec5 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -1659,7 +1659,7 @@ class CreatePreviewParams(RequestOptions): """ subscription: NotRequired[str] """ - The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ subscription_details: NotRequired[ "Invoice.CreatePreviewParamsSubscriptionDetails" @@ -3400,7 +3400,7 @@ class UpcomingLinesParams(RequestOptions): """ subscription: NotRequired[str] """ - The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ subscription_billing_cycle_anchor: NotRequired[ "Literal['now', 'unchanged']|int" @@ -4534,7 +4534,7 @@ class UpcomingParams(RequestOptions): """ subscription: NotRequired[str] """ - The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ subscription_billing_cycle_anchor: NotRequired[ "Literal['now', 'unchanged']|int" diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 82a527768..20813eedd 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -692,7 +692,7 @@ class CreatePreviewParams(TypedDict): """ subscription: NotRequired[str] """ - The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ subscription_details: NotRequired[ "InvoiceService.CreatePreviewParamsSubscriptionDetails" @@ -1834,7 +1834,7 @@ class UpcomingParams(TypedDict): """ subscription: NotRequired[str] """ - The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ subscription_billing_cycle_anchor: NotRequired[ "Literal['now', 'unchanged']|int" diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index 0087c058e..106daa5fd 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -86,7 +86,7 @@ class ListParams(TypedDict): """ subscription: NotRequired[str] """ - The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ subscription_billing_cycle_anchor: NotRequired[ "Literal['now', 'unchanged']|int" diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index b64e38c66..39183b13c 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -2976,11 +2976,11 @@ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[str] """ @@ -3000,11 +3000,11 @@ class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ reference: NotRequired[str] """ @@ -3039,11 +3039,11 @@ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -3139,11 +3139,11 @@ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): class ConfirmParamsPaymentMethodOptionsCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ cvc_token: NotRequired[str] """ @@ -3418,11 +3418,11 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBanca class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -3573,11 +3573,11 @@ class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[ Literal[ @@ -3607,6 +3607,7 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): "en-NZ", "en-PL", "en-PT", + "en-RO", "en-SE", "en-US", "es-ES", @@ -3623,6 +3624,7 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): "nl-NL", "pl-PL", "pt-PT", + "ro-RO", "sv-FI", "sv-SE", ] @@ -3672,11 +3674,11 @@ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): class ConfirmParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ persistent_token: NotRequired[str] """ @@ -3698,11 +3700,11 @@ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[Literal["none"]] """ @@ -3848,11 +3850,11 @@ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -5177,11 +5179,11 @@ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): class CreateParamsPaymentMethodOptionsAffirm(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[str] """ @@ -5201,11 +5203,11 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ reference: NotRequired[str] """ @@ -5240,11 +5242,11 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -5340,11 +5342,11 @@ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): class CreateParamsPaymentMethodOptionsCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ cvc_token: NotRequired[str] """ @@ -5619,11 +5621,11 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai class CreateParamsPaymentMethodOptionsCashapp(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -5774,11 +5776,11 @@ class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): class CreateParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[ Literal[ @@ -5808,6 +5810,7 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): "en-NZ", "en-PL", "en-PT", + "en-RO", "en-SE", "en-US", "es-ES", @@ -5824,6 +5827,7 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): "nl-NL", "pl-PL", "pt-PT", + "ro-RO", "sv-FI", "sv-SE", ] @@ -5873,11 +5877,11 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): class CreateParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ persistent_token: NotRequired[str] """ @@ -5899,11 +5903,11 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[Literal["none"]] """ @@ -6049,11 +6053,11 @@ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -7372,11 +7376,11 @@ class ModifyParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): class ModifyParamsPaymentMethodOptionsAffirm(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[str] """ @@ -7396,11 +7400,11 @@ class ModifyParamsPaymentMethodOptionsAffirm(TypedDict): class ModifyParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ reference: NotRequired[str] """ @@ -7435,11 +7439,11 @@ class ModifyParamsPaymentMethodOptionsAlipay(TypedDict): class ModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -7535,11 +7539,11 @@ class ModifyParamsPaymentMethodOptionsBoleto(TypedDict): class ModifyParamsPaymentMethodOptionsCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ cvc_token: NotRequired[str] """ @@ -7814,11 +7818,11 @@ class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai class ModifyParamsPaymentMethodOptionsCashapp(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -7969,11 +7973,11 @@ class ModifyParamsPaymentMethodOptionsInteracPresent(TypedDict): class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[ Literal[ @@ -8003,6 +8007,7 @@ class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): "en-NZ", "en-PL", "en-PT", + "en-RO", "en-SE", "en-US", "es-ES", @@ -8019,6 +8024,7 @@ class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): "nl-NL", "pl-PL", "pt-PT", + "ro-RO", "sv-FI", "sv-SE", ] @@ -8068,11 +8074,11 @@ class ModifyParamsPaymentMethodOptionsKonbini(TypedDict): class ModifyParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ persistent_token: NotRequired[str] """ @@ -8094,11 +8100,11 @@ class ModifyParamsPaymentMethodOptionsLink(TypedDict): class ModifyParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[Literal["none"]] """ @@ -8244,11 +8250,11 @@ class ModifyParamsPaymentMethodOptionsPromptpay(TypedDict): class ModifyParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index d2e1c83d4..fa94c2cd0 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -1119,11 +1119,11 @@ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[str] """ @@ -1143,11 +1143,11 @@ class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ reference: NotRequired[str] """ @@ -1182,11 +1182,11 @@ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -1282,11 +1282,11 @@ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): class ConfirmParamsPaymentMethodOptionsCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ cvc_token: NotRequired[str] """ @@ -1561,11 +1561,11 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBanca class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -1716,11 +1716,11 @@ class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[ Literal[ @@ -1750,6 +1750,7 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): "en-NZ", "en-PL", "en-PT", + "en-RO", "en-SE", "en-US", "es-ES", @@ -1766,6 +1767,7 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): "nl-NL", "pl-PL", "pt-PT", + "ro-RO", "sv-FI", "sv-SE", ] @@ -1815,11 +1817,11 @@ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): class ConfirmParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ persistent_token: NotRequired[str] """ @@ -1841,11 +1843,11 @@ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[Literal["none"]] """ @@ -1991,11 +1993,11 @@ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -3344,11 +3346,11 @@ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): class CreateParamsPaymentMethodOptionsAffirm(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[str] """ @@ -3368,11 +3370,11 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ reference: NotRequired[str] """ @@ -3407,11 +3409,11 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -3507,11 +3509,11 @@ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): class CreateParamsPaymentMethodOptionsCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ cvc_token: NotRequired[str] """ @@ -3786,11 +3788,11 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai class CreateParamsPaymentMethodOptionsCashapp(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -3941,11 +3943,11 @@ class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): class CreateParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[ Literal[ @@ -3975,6 +3977,7 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): "en-NZ", "en-PL", "en-PT", + "en-RO", "en-SE", "en-US", "es-ES", @@ -3991,6 +3994,7 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): "nl-NL", "pl-PL", "pt-PT", + "ro-RO", "sv-FI", "sv-SE", ] @@ -4040,11 +4044,11 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): class CreateParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ persistent_token: NotRequired[str] """ @@ -4066,11 +4070,11 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[Literal["none"]] """ @@ -4216,11 +4220,11 @@ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -5591,11 +5595,11 @@ class UpdateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): class UpdateParamsPaymentMethodOptionsAffirm(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[str] """ @@ -5615,11 +5619,11 @@ class UpdateParamsPaymentMethodOptionsAffirm(TypedDict): class UpdateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ reference: NotRequired[str] """ @@ -5654,11 +5658,11 @@ class UpdateParamsPaymentMethodOptionsAlipay(TypedDict): class UpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -5754,11 +5758,11 @@ class UpdateParamsPaymentMethodOptionsBoleto(TypedDict): class UpdateParamsPaymentMethodOptionsCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ cvc_token: NotRequired[str] """ @@ -6033,11 +6037,11 @@ class UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai class UpdateParamsPaymentMethodOptionsCashapp(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -6188,11 +6192,11 @@ class UpdateParamsPaymentMethodOptionsInteracPresent(TypedDict): class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[ Literal[ @@ -6222,6 +6226,7 @@ class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): "en-NZ", "en-PL", "en-PT", + "en-RO", "en-SE", "en-US", "es-ES", @@ -6238,6 +6243,7 @@ class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): "nl-NL", "pl-PL", "pt-PT", + "ro-RO", "sv-FI", "sv-SE", ] @@ -6287,11 +6293,11 @@ class UpdateParamsPaymentMethodOptionsKonbini(TypedDict): class UpdateParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ persistent_token: NotRequired[str] """ @@ -6313,11 +6319,11 @@ class UpdateParamsPaymentMethodOptionsLink(TypedDict): class UpdateParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[Literal["none"]] """ @@ -6463,11 +6469,11 @@ class UpdateParamsPaymentMethodOptionsPromptpay(TypedDict): class UpdateParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Controls when the funds will be captured from the customer's account. + Controls when the funds are captured from the customer's account. - If provided, this parameter will override the top level behavior of `capture_method` when finalizing the payment with this payment method type. + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index aa5f8e897..3a263b266 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -172,6 +172,181 @@ class Checks(StripeObject): If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ + class GeneratedFrom(StripeObject): + class PaymentMethodDetails(StripeObject): + class CardPresent(StripeObject): + class Offline(StripeObject): + stored_at: Optional[int] + """ + Time at which the payment was collected while offline + """ + + class Receipt(StripeObject): + account_type: Optional[ + Literal["checking", "credit", "prepaid", "unknown"] + ] + """ + The type of account being debited or credited + """ + application_cryptogram: Optional[str] + """ + EMV tag 9F26, cryptogram generated by the integrated circuit chip. + """ + application_preferred_name: Optional[str] + """ + Mnenomic of the Application Identifier. + """ + authorization_code: Optional[str] + """ + Identifier for this transaction. + """ + authorization_response_code: Optional[str] + """ + EMV tag 8A. A code returned by the card issuer. + """ + cardholder_verification_method: Optional[str] + """ + Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + """ + dedicated_file_name: Optional[str] + """ + EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + """ + terminal_verification_results: Optional[str] + """ + The outcome of a series of EMV functions performed by the card reader. + """ + transaction_status_information: Optional[str] + """ + An indication of various EMV functions performed during the transaction. + """ + + amount_authorized: Optional[int] + """ + The authorized amount + """ + brand: Optional[str] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + capture_before: Optional[int] + """ + When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. + """ + cardholder_name: Optional[str] + """ + The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + description: Optional[str] + """ + A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + """ + emv_auth_data: Optional[str] + """ + Authorization response cryptogram. + """ + exp_month: int + """ + Two-digit number representing the card's expiration month. + """ + exp_year: int + """ + Four-digit number representing the card's expiration year. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + + *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: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + generated_card: Optional[str] + """ + ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + """ + iin: Optional[str] + """ + Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + """ + incremental_authorization_supported: bool + """ + Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). + """ + issuer: Optional[str] + """ + The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + network: Optional[str] + """ + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + offline: Optional[Offline] + """ + Details about payments collected offline. + """ + overcapture_supported: bool + """ + Defines whether the authorized amount can be over-captured or not + """ + preferred_locales: Optional[List[str]] + """ + EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + """ + read_method: Optional[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ] + ] + """ + How card details were read in this transaction. + """ + receipt: Optional[Receipt] + """ + A collection of fields required to be displayed on receipts. Only required for EMV transactions. + """ + _inner_class_types = { + "offline": Offline, + "receipt": Receipt, + } + + card_present: Optional[CardPresent] + type: str + """ + The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`. + """ + _inner_class_types = {"card_present": CardPresent} + + charge: Optional[str] + """ + The charge that created this object. + """ + payment_method_details: Optional[PaymentMethodDetails] + """ + Transaction-specific details of the payment method used in the payment. + """ + setup_attempt: Optional[ExpandableField["SetupAttempt"]] + """ + The ID of the SetupAttempt that generated this PaymentMethod, if any. + """ + _inner_class_types = { + "payment_method_details": PaymentMethodDetails, + } + class Networks(StripeObject): available: List[str] """ @@ -423,6 +598,10 @@ class ShippingAddress(StripeObject): """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ + generated_from: Optional[GeneratedFrom] + """ + Details of the original PaymentMethod that created this object. + """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) @@ -449,6 +628,7 @@ class ShippingAddress(StripeObject): """ _inner_class_types = { "checks": Checks, + "generated_from": GeneratedFrom, "networks": Networks, "three_d_secure_usage": ThreeDSecureUsage, "wallet": Wallet, diff --git a/stripe/_person.py b/stripe/_person.py index d3461e966..399a97f2f 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -242,6 +242,7 @@ class Error(StripeObject): "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", + "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. @@ -438,6 +439,7 @@ class Error(StripeObject): "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", + "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index c23848bbc..4b32c05f8 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -258,6 +258,10 @@ class CreateParams(RequestOptions): "issuing_dispute.funds_reinstated", "issuing_dispute.submitted", "issuing_dispute.updated", + "issuing_personalization_design.activated", + "issuing_personalization_design.deactivated", + "issuing_personalization_design.rejected", + "issuing_personalization_design.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", @@ -539,6 +543,10 @@ class ModifyParams(RequestOptions): "issuing_dispute.funds_reinstated", "issuing_dispute.submitted", "issuing_dispute.updated", + "issuing_personalization_design.activated", + "issuing_personalization_design.deactivated", + "issuing_personalization_design.rejected", + "issuing_personalization_design.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 2d1c7513a..2a97e832c 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -239,6 +239,10 @@ class CreateParams(TypedDict): "issuing_dispute.funds_reinstated", "issuing_dispute.submitted", "issuing_dispute.updated", + "issuing_personalization_design.activated", + "issuing_personalization_design.deactivated", + "issuing_personalization_design.rejected", + "issuing_personalization_design.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", @@ -526,6 +530,10 @@ class UpdateParams(TypedDict): "issuing_dispute.funds_reinstated", "issuing_dispute.submitted", "issuing_dispute.updated", + "issuing_personalization_design.activated", + "issuing_personalization_design.deactivated", + "issuing_personalization_design.rejected", + "issuing_personalization_design.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 8535824d1..7cb3605d3 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -175,6 +175,10 @@ class Option(StripeObject): The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. """ + default_value: Optional[str] + """ + The value that will pre-fill on the payment page. + """ options: List[Option] """ The options available for the customer to select. Up to 200 options allowed. @@ -196,6 +200,10 @@ class Label(StripeObject): """ class Numeric(StripeObject): + default_value: Optional[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: Optional[int] """ The maximum character length constraint for the customer's input. @@ -210,6 +218,10 @@ class Numeric(StripeObject): """ class Text(StripeObject): + default_value: Optional[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: Optional[int] """ The maximum character length constraint for the customer's input. @@ -1936,6 +1948,10 @@ class CreateParamsCustomField(TypedDict): """ class CreateParamsCustomFieldDropdown(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page.Must match a `value` in the `options` array. + """ options: List["Session.CreateParamsCustomFieldDropdownOption"] """ The options available for the customer to select. Up to 200 options allowed. @@ -1962,6 +1978,10 @@ class CreateParamsCustomFieldLabel(TypedDict): """ class CreateParamsCustomFieldNumeric(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. @@ -1972,6 +1992,10 @@ class CreateParamsCustomFieldNumeric(TypedDict): """ class CreateParamsCustomFieldText(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. @@ -3378,7 +3402,7 @@ class CreateParamsShippingOption(TypedDict): "Session.CreateParamsShippingOptionShippingRateData" ] """ - Parameters to be passed to Shipping Rate creation for this shipping option + Parameters to be passed to Shipping Rate creation for this shipping option. """ class CreateParamsShippingOptionShippingRateData(TypedDict): diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index defe9f25a..289ed5fd0 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -448,6 +448,10 @@ class CreateParamsCustomField(TypedDict): """ class CreateParamsCustomFieldDropdown(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page.Must match a `value` in the `options` array. + """ options: List["SessionService.CreateParamsCustomFieldDropdownOption"] """ The options available for the customer to select. Up to 200 options allowed. @@ -474,6 +478,10 @@ class CreateParamsCustomFieldLabel(TypedDict): """ class CreateParamsCustomFieldNumeric(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. @@ -484,6 +492,10 @@ class CreateParamsCustomFieldNumeric(TypedDict): """ class CreateParamsCustomFieldText(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. @@ -1926,7 +1938,7 @@ class CreateParamsShippingOption(TypedDict): "SessionService.CreateParamsShippingOptionShippingRateData" ] """ - Parameters to be passed to Shipping Rate creation for this shipping option + Parameters to be passed to Shipping Rate creation for this shipping option. """ class CreateParamsShippingOptionShippingRateData(TypedDict): diff --git a/stripe/issuing/_physical_bundle.py b/stripe/issuing/_physical_bundle.py index 45b959c11..7f2661d49 100644 --- a/stripe/issuing/_physical_bundle.py +++ b/stripe/issuing/_physical_bundle.py @@ -4,7 +4,7 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List from typing_extensions import Literal, NotRequired, Unpack @@ -63,7 +63,7 @@ class RetrieveParams(RequestOptions): Specifies which fields in the response should be expanded. """ - features: Optional[Features] + features: Features id: str """ Unique identifier for the object. From 1d1986a779d21315d7af36e12cd02cf12a37d18a Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 30 May 2024 12:38:21 -0700 Subject: [PATCH 071/179] Bump version to 9.9.0 --- CHANGELOG.md | 15 +++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5009538d..f507eb0f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## 9.9.0 - 2024-05-30 +* [#1335](https://github.com/stripe/stripe-python/pull/1335) Add method to list invoice line items + * Add methods `list_lines()` and `list_lines_async()` on the class `Invoice` to list the invoice line items +* [#1336](https://github.com/stripe/stripe-python/pull/1336) Update generated code + * Add support for `generated_from` on resource classes `stripe.ConfirmationToken.PaymentMethodPreview.Card` and `stripe.PaymentMethod.Card` + * Add support for `default_value` on parameter classes `stripe.checkout.Session.CreateParamsCustomFieldDropdown`, `stripe.checkout.Session.CreateParamsCustomFieldNumeric`, and `stripe.checkout.Session.CreateParamsCustomFieldText` and resource classes `stripe.checkout.Session.CustomField.Dropdown`, `stripe.checkout.Session.CustomField.Numeric`, and `stripe.checkout.Session.CustomField.Text` + * Add support for `verification_requires_additional_proof_of_registration` on enums `stripe.Account.FutureRequirements.Error.code`, `stripe.Account.Requirements.Error.code`, `stripe.BankAccount.FutureRequirements.Error.code`, `stripe.BankAccount.Requirements.Error.code`, `stripe.Capability.FutureRequirements.Error.code`, `stripe.Capability.Requirements.Error.code`, `stripe.Person.FutureRequirements.Error.code`, and `stripe.Person.Requirements.Error.code` + * Add support for `issuing_personalization_design.activated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `issuing_personalization_design.deactivated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `issuing_personalization_design.rejected` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `issuing_personalization_design.updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `en-RO` on enums `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarna.preferred_locale`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsKlarna.preferred_locale`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsKlarna.preferred_locale` + * Add support for `ro-RO` on enums `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarna.preferred_locale`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsKlarna.preferred_locale`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsKlarna.preferred_locale` + * Change type of `features` on `stripe.issuing.PhysicalBundle` from `Optional[Features]` to `Features` + ## 9.8.0 - 2024-05-23 * [#1332](https://github.com/stripe/stripe-python/pull/1332) Update generated code * Add support for `external_account_collection` on resource classes `stripe.AccountSession.Components.Balances.Features` and `stripe.AccountSession.Components.Payouts.Features` and parameter classes `stripe.AccountSession.CreateParamsComponentsBalancesFeatures` and `stripe.AccountSession.CreateParamsComponentsPayoutsFeatures` diff --git a/VERSION b/VERSION index 834eb3fa8..5ffe92ddd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.8.0 +9.9.0 diff --git a/stripe/_version.py b/stripe/_version.py index 7334c2bfe..98c593915 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.8.0" +VERSION = "9.9.0" From aa85d65f5639068cd0ddde391e4714234ce9649b Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:23:12 -0400 Subject: [PATCH 072/179] Update generated code (#1340) * Update generated code for v1060 * Update generated code for v1061 * Update generated code for v1062 * Update generated code for v1063 * Update generated code for v1065 * Update generated code for v1065 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 90 ++++++++++++++++++++++ stripe/_account_service.py | 120 +++++++++++++++++++++++++++++ stripe/_invoice.py | 5 +- stripe/_invoice_service.py | 4 +- stripe/_setup_intent.py | 16 ++-- stripe/_setup_intent_service.py | 4 +- stripe/_subscription.py | 5 +- stripe/_subscription_service.py | 4 +- stripe/checkout/_session.py | 4 +- stripe/climate/_order.py | 16 ++-- stripe/climate/_order_service.py | 4 +- stripe/tax/_transaction.py | 4 +- stripe/tax/_transaction_service.py | 4 +- 14 files changed, 247 insertions(+), 35 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 4161e81ad..8d1f4287e 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1058 \ No newline at end of file +v1065 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 80babd314..6d161e8eb 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -228,6 +228,12 @@ class Capabilities(StripeObject): """ The status of the FPX payments capability of the account, or whether the account can directly process FPX charges. """ + gb_bank_transfer_payments: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the GB customer_balance payments (GBP currency) capability of the account, or whether the account can directly process GB customer_balance charges. + """ giropay_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the giropay payments capability of the account, or whether the account can directly process giropay charges. @@ -250,6 +256,12 @@ class Capabilities(StripeObject): """ The status of the JCB payments capability of the account, or whether the account (Japan only) can directly process JCB credit card charges in JPY currency. """ + jp_bank_transfer_payments: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the Japanese customer_balance payments (JPY currency) capability of the account, or whether the account can directly process Japanese customer_balance charges. + """ klarna_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Klarna payments capability of the account, or whether the account can directly process Klarna charges. @@ -270,6 +282,12 @@ class Capabilities(StripeObject): """ The status of the MobilePay capability of the account, or whether the account can directly process MobilePay charges. """ + mx_bank_transfer_payments: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the Mexican customer_balance payments (MXN currency) capability of the account, or whether the account can directly process Mexican customer_balance charges. + """ oxxo_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. @@ -292,6 +310,12 @@ class Capabilities(StripeObject): """ The status of the RevolutPay capability of the account, or whether the account can directly process RevolutPay payments. """ + sepa_bank_transfer_payments: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the SEPA customer_balance payments (EUR currency) capability of the account, or whether the account can directly process SEPA customer_balance charges. + """ sepa_debit_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. @@ -330,6 +354,12 @@ class Capabilities(StripeObject): """ The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges. """ + us_bank_transfer_payments: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the US customer_balance payments (USD currency) capability of the account, or whether the account can directly process US customer_balance charges. + """ zip_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Zip capability of the account, or whether the account can directly process Zip charges. @@ -1499,6 +1529,12 @@ class CreateParamsCapabilities(TypedDict): """ The fpx_payments capability. """ + gb_bank_transfer_payments: NotRequired[ + "Account.CreateParamsCapabilitiesGbBankTransferPayments" + ] + """ + The gb_bank_transfer_payments capability. + """ giropay_payments: NotRequired[ "Account.CreateParamsCapabilitiesGiropayPayments" ] @@ -1529,6 +1565,12 @@ class CreateParamsCapabilities(TypedDict): """ The jcb_payments capability. """ + jp_bank_transfer_payments: NotRequired[ + "Account.CreateParamsCapabilitiesJpBankTransferPayments" + ] + """ + The jp_bank_transfer_payments capability. + """ klarna_payments: NotRequired[ "Account.CreateParamsCapabilitiesKlarnaPayments" ] @@ -1559,6 +1601,12 @@ class CreateParamsCapabilities(TypedDict): """ The mobilepay_payments capability. """ + mx_bank_transfer_payments: NotRequired[ + "Account.CreateParamsCapabilitiesMxBankTransferPayments" + ] + """ + The mx_bank_transfer_payments capability. + """ oxxo_payments: NotRequired[ "Account.CreateParamsCapabilitiesOxxoPayments" ] @@ -1589,6 +1637,12 @@ class CreateParamsCapabilities(TypedDict): """ The revolut_pay_payments capability. """ + sepa_bank_transfer_payments: NotRequired[ + "Account.CreateParamsCapabilitiesSepaBankTransferPayments" + ] + """ + The sepa_bank_transfer_payments capability. + """ sepa_debit_payments: NotRequired[ "Account.CreateParamsCapabilitiesSepaDebitPayments" ] @@ -1633,6 +1687,12 @@ class CreateParamsCapabilities(TypedDict): """ The us_bank_account_ach_payments capability. """ + us_bank_transfer_payments: NotRequired[ + "Account.CreateParamsCapabilitiesUsBankTransferPayments" + ] + """ + The us_bank_transfer_payments capability. + """ zip_payments: NotRequired[ "Account.CreateParamsCapabilitiesZipPayments" ] @@ -1736,6 +1796,12 @@ class CreateParamsCapabilitiesFpxPayments(TypedDict): 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 CreateParamsCapabilitiesGbBankTransferPayments(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 CreateParamsCapabilitiesGiropayPayments(TypedDict): requested: NotRequired[bool] """ @@ -1766,6 +1832,12 @@ class CreateParamsCapabilitiesJcbPayments(TypedDict): 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 CreateParamsCapabilitiesJpBankTransferPayments(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 CreateParamsCapabilitiesKlarnaPayments(TypedDict): requested: NotRequired[bool] """ @@ -1796,6 +1868,12 @@ class CreateParamsCapabilitiesMobilepayPayments(TypedDict): 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 CreateParamsCapabilitiesMxBankTransferPayments(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 CreateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired[bool] """ @@ -1826,6 +1904,12 @@ class CreateParamsCapabilitiesRevolutPayPayments(TypedDict): 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 CreateParamsCapabilitiesSepaBankTransferPayments(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 CreateParamsCapabilitiesSepaDebitPayments(TypedDict): requested: NotRequired[bool] """ @@ -1874,6 +1958,12 @@ class CreateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): 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 CreateParamsCapabilitiesUsBankTransferPayments(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 CreateParamsCapabilitiesZipPayments(TypedDict): requested: NotRequired[bool] """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 437f1b7a3..705c492e8 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -334,6 +334,12 @@ class CreateParamsCapabilities(TypedDict): """ The fpx_payments capability. """ + gb_bank_transfer_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesGbBankTransferPayments" + ] + """ + The gb_bank_transfer_payments capability. + """ giropay_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesGiropayPayments" ] @@ -364,6 +370,12 @@ class CreateParamsCapabilities(TypedDict): """ The jcb_payments capability. """ + jp_bank_transfer_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesJpBankTransferPayments" + ] + """ + The jp_bank_transfer_payments capability. + """ klarna_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesKlarnaPayments" ] @@ -394,6 +406,12 @@ class CreateParamsCapabilities(TypedDict): """ The mobilepay_payments capability. """ + mx_bank_transfer_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesMxBankTransferPayments" + ] + """ + The mx_bank_transfer_payments capability. + """ oxxo_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesOxxoPayments" ] @@ -424,6 +442,12 @@ class CreateParamsCapabilities(TypedDict): """ The revolut_pay_payments capability. """ + sepa_bank_transfer_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesSepaBankTransferPayments" + ] + """ + The sepa_bank_transfer_payments capability. + """ sepa_debit_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesSepaDebitPayments" ] @@ -472,6 +496,12 @@ class CreateParamsCapabilities(TypedDict): """ The us_bank_account_ach_payments capability. """ + us_bank_transfer_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesUsBankTransferPayments" + ] + """ + The us_bank_transfer_payments capability. + """ zip_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesZipPayments" ] @@ -575,6 +605,12 @@ class CreateParamsCapabilitiesFpxPayments(TypedDict): 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 CreateParamsCapabilitiesGbBankTransferPayments(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 CreateParamsCapabilitiesGiropayPayments(TypedDict): requested: NotRequired[bool] """ @@ -605,6 +641,12 @@ class CreateParamsCapabilitiesJcbPayments(TypedDict): 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 CreateParamsCapabilitiesJpBankTransferPayments(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 CreateParamsCapabilitiesKlarnaPayments(TypedDict): requested: NotRequired[bool] """ @@ -635,6 +677,12 @@ class CreateParamsCapabilitiesMobilepayPayments(TypedDict): 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 CreateParamsCapabilitiesMxBankTransferPayments(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 CreateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired[bool] """ @@ -665,6 +713,12 @@ class CreateParamsCapabilitiesRevolutPayPayments(TypedDict): 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 CreateParamsCapabilitiesSepaBankTransferPayments(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 CreateParamsCapabilitiesSepaDebitPayments(TypedDict): requested: NotRequired[bool] """ @@ -713,6 +767,12 @@ class CreateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): 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 CreateParamsCapabilitiesUsBankTransferPayments(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 CreateParamsCapabilitiesZipPayments(TypedDict): requested: NotRequired[bool] """ @@ -1936,6 +1996,12 @@ class UpdateParamsCapabilities(TypedDict): """ The fpx_payments capability. """ + gb_bank_transfer_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesGbBankTransferPayments" + ] + """ + The gb_bank_transfer_payments capability. + """ giropay_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesGiropayPayments" ] @@ -1966,6 +2032,12 @@ class UpdateParamsCapabilities(TypedDict): """ The jcb_payments capability. """ + jp_bank_transfer_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesJpBankTransferPayments" + ] + """ + The jp_bank_transfer_payments capability. + """ klarna_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesKlarnaPayments" ] @@ -1996,6 +2068,12 @@ class UpdateParamsCapabilities(TypedDict): """ The mobilepay_payments capability. """ + mx_bank_transfer_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesMxBankTransferPayments" + ] + """ + The mx_bank_transfer_payments capability. + """ oxxo_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesOxxoPayments" ] @@ -2026,6 +2104,12 @@ class UpdateParamsCapabilities(TypedDict): """ The revolut_pay_payments capability. """ + sepa_bank_transfer_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesSepaBankTransferPayments" + ] + """ + The sepa_bank_transfer_payments capability. + """ sepa_debit_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesSepaDebitPayments" ] @@ -2074,6 +2158,12 @@ class UpdateParamsCapabilities(TypedDict): """ The us_bank_account_ach_payments capability. """ + us_bank_transfer_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesUsBankTransferPayments" + ] + """ + The us_bank_transfer_payments capability. + """ zip_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesZipPayments" ] @@ -2177,6 +2267,12 @@ class UpdateParamsCapabilitiesFpxPayments(TypedDict): 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 UpdateParamsCapabilitiesGbBankTransferPayments(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 UpdateParamsCapabilitiesGiropayPayments(TypedDict): requested: NotRequired[bool] """ @@ -2207,6 +2303,12 @@ class UpdateParamsCapabilitiesJcbPayments(TypedDict): 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 UpdateParamsCapabilitiesJpBankTransferPayments(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 UpdateParamsCapabilitiesKlarnaPayments(TypedDict): requested: NotRequired[bool] """ @@ -2237,6 +2339,12 @@ class UpdateParamsCapabilitiesMobilepayPayments(TypedDict): 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 UpdateParamsCapabilitiesMxBankTransferPayments(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 UpdateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired[bool] """ @@ -2267,6 +2375,12 @@ class UpdateParamsCapabilitiesRevolutPayPayments(TypedDict): 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 UpdateParamsCapabilitiesSepaBankTransferPayments(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 UpdateParamsCapabilitiesSepaDebitPayments(TypedDict): requested: NotRequired[bool] """ @@ -2315,6 +2429,12 @@ class UpdateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): 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 UpdateParamsCapabilitiesUsBankTransferPayments(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 UpdateParamsCapabilitiesZipPayments(TypedDict): requested: NotRequired[bool] """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 2670f8ec5..b504f169a 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -753,6 +753,7 @@ class FinancialConnections(StripeObject): "sepa_credit_transfer", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", ] @@ -1203,7 +1204,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -2870,7 +2871,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 20813eedd..9ff265f53 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -234,7 +234,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -3083,7 +3083,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 55eda45b1..ffd3a165a 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -3937,7 +3937,7 @@ def _cls_cancel( """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. - After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( "SetupIntent", @@ -3958,7 +3958,7 @@ def cancel( """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. - After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ ... @@ -3969,7 +3969,7 @@ def cancel( """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. - After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ ... @@ -3980,7 +3980,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. - After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( "SetupIntent", @@ -4000,7 +4000,7 @@ async def _cls_cancel_async( """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. - After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( "SetupIntent", @@ -4021,7 +4021,7 @@ async def cancel_async( """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. - After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ ... @@ -4032,7 +4032,7 @@ async def cancel_async( """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. - After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ ... @@ -4043,7 +4043,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. - After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( "SetupIntent", diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index a0f7c3842..5021a0f14 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -3491,7 +3491,7 @@ def cancel( """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. - After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( SetupIntent, @@ -3516,7 +3516,7 @@ async def cancel_async( """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. - After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( SetupIntent, diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 0f51f8a44..23fd57445 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -352,6 +352,7 @@ class FinancialConnections(StripeObject): "sepa_credit_transfer", "sepa_debit", "sofort", + "swish", "us_bank_account", "wechat_pay", ] @@ -890,7 +891,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -1703,7 +1704,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 4e8b279eb..611cb6614 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -487,7 +487,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -1356,7 +1356,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 7cb3605d3..7bd893582 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -3895,7 +3895,7 @@ class RetrieveParams(RequestOptions): """ payment_intent: Optional[ExpandableField["PaymentIntent"]] """ - The ID of the PaymentIntent for Checkout Sessions in `payment` mode. + The ID of the PaymentIntent for Checkout Sessions in `payment` mode. You can't confirm or cancel the PaymentIntent for a Checkout Session. To cancel, [expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ payment_link: Optional[ExpandableField["PaymentLink"]] """ @@ -3944,7 +3944,7 @@ class RetrieveParams(RequestOptions): """ setup_intent: Optional[ExpandableField["SetupIntent"]] """ - The ID of the SetupIntent for Checkout Sessions in `setup` mode. + The ID of the SetupIntent for Checkout Sessions in `setup` mode. You can't confirm or cancel the SetupIntent for a Checkout Session. To cancel, [expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ shipping_address_collection: Optional[ShippingAddressCollection] """ diff --git a/stripe/climate/_order.py b/stripe/climate/_order.py index 1a51fc668..354821c46 100644 --- a/stripe/climate/_order.py +++ b/stripe/climate/_order.py @@ -266,7 +266,7 @@ def _cls_cancel( cls, order: str, **params: Unpack["Order.CancelParams"] ) -> "Order": """ - Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. @@ -286,7 +286,7 @@ def _cls_cancel( @staticmethod def cancel(order: str, **params: Unpack["Order.CancelParams"]) -> "Order": """ - Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. @@ -296,7 +296,7 @@ def cancel(order: str, **params: Unpack["Order.CancelParams"]) -> "Order": @overload def cancel(self, **params: Unpack["Order.CancelParams"]) -> "Order": """ - Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. @@ -308,7 +308,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Order.CancelParams"] ) -> "Order": """ - Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. @@ -329,7 +329,7 @@ async def _cls_cancel_async( cls, order: str, **params: Unpack["Order.CancelParams"] ) -> "Order": """ - Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. @@ -351,7 +351,7 @@ async def cancel_async( order: str, **params: Unpack["Order.CancelParams"] ) -> "Order": """ - Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. @@ -363,7 +363,7 @@ async def cancel_async( self, **params: Unpack["Order.CancelParams"] ) -> "Order": """ - Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. @@ -375,7 +375,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Order.CancelParams"] ) -> "Order": """ - Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. diff --git a/stripe/climate/_order_service.py b/stripe/climate/_order_service.py index 6ee55084a..0df6d6ef3 100644 --- a/stripe/climate/_order_service.py +++ b/stripe/climate/_order_service.py @@ -269,7 +269,7 @@ def cancel( options: RequestOptions = {}, ) -> Order: """ - Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. @@ -295,7 +295,7 @@ async def cancel_async( options: RequestOptions = {}, ) -> Order: """ - Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index 011726e0a..bf07df5e4 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -493,7 +493,7 @@ def create_from_calculation( cls, **params: Unpack["Transaction.CreateFromCalculationParams"] ) -> "Transaction": """ - Creates a Tax Transaction from a calculation. + Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days. """ return cast( "Transaction", @@ -509,7 +509,7 @@ async def create_from_calculation_async( cls, **params: Unpack["Transaction.CreateFromCalculationParams"] ) -> "Transaction": """ - Creates a Tax Transaction from a calculation. + Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days. """ return cast( "Transaction", diff --git a/stripe/tax/_transaction_service.py b/stripe/tax/_transaction_service.py index d4d488996..de7ec3187 100644 --- a/stripe/tax/_transaction_service.py +++ b/stripe/tax/_transaction_service.py @@ -166,7 +166,7 @@ def create_from_calculation( options: RequestOptions = {}, ) -> Transaction: """ - Creates a Tax Transaction from a calculation. + Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days. """ return cast( Transaction, @@ -186,7 +186,7 @@ async def create_from_calculation_async( options: RequestOptions = {}, ) -> Transaction: """ - Creates a Tax Transaction from a calculation. + Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days. """ return cast( Transaction, From 3d9c0dc78aa919e53a74a5736e4e6c728a4b4a50 Mon Sep 17 00:00:00 2001 From: Prathmesh Ranaut Date: Thu, 6 Jun 2024 15:30:57 -0400 Subject: [PATCH 073/179] Bump version to 9.10.0 --- CHANGELOG.md | 5 +++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f507eb0f2..900ba2628 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 9.10.0 - 2024-06-06 +* [#1340](https://github.com/stripe/stripe-python/pull/1340) Update generated code + * Add support for `gb_bank_transfer_payments`, `jp_bank_transfer_payments`, `mx_bank_transfer_payments`, `sepa_bank_transfer_payments`, `us_bank_transfer_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `swish` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + ## 9.9.0 - 2024-05-30 * [#1335](https://github.com/stripe/stripe-python/pull/1335) Add method to list invoice line items * Add methods `list_lines()` and `list_lines_async()` on the class `Invoice` to list the invoice line items diff --git a/VERSION b/VERSION index 5ffe92ddd..68478a595 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.9.0 +9.10.0 diff --git a/stripe/_version.py b/stripe/_version.py index 98c593915..179ca72b5 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.9.0" +VERSION = "9.10.0" From 7dac083895aca47a57191317f77344bbe9d56410 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:42:27 -0700 Subject: [PATCH 074/179] Update generated code (#1342) * Update generated code for v1066 * Update generated code for v1067 * Update generated code for v1068 * Update generated code for v1069 * Update generated code for v1070 * Update generated code for v1071 * Update generated code for v1072 * Update generated code for v1073 * Update generated code for v1075 * Update generated code for v1077 * Update generated code for v1077 * Update generated code for v1077 * Update generated code for v1077 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 32 +++ stripe/_account_service.py | 48 ++++ stripe/_bank_account.py | 3 +- stripe/_charge.py | 5 + stripe/_confirmation_token.py | 32 +++ stripe/_customer.py | 8 +- stripe/_customer_payment_method_service.py | 2 + stripe/_customer_service.py | 3 +- stripe/_customer_tax_id_service.py | 3 +- stripe/_invoice.py | 16 +- stripe/_invoice_service.py | 10 +- stripe/_invoice_upcoming_lines_service.py | 3 +- stripe/_payment_intent.py | 206 ++++++++++++++++++ stripe/_payment_intent_service.py | 168 ++++++++++++++ stripe/_payment_method.py | 30 +++ stripe/_payment_method_configuration.py | 64 ++++++ .../_payment_method_configuration_service.py | 40 ++++ stripe/_payment_method_service.py | 18 ++ stripe/_refund.py | 12 + stripe/_setup_intent.py | 54 +++++ stripe/_setup_intent_service.py | 60 +++++ stripe/_shipping_rate.py | 4 +- stripe/_shipping_rate_service.py | 2 +- stripe/_subscription.py | 25 ++- stripe/_subscription_service.py | 4 +- stripe/_tax_id.py | 6 +- stripe/_tax_id_service.py | 3 +- stripe/_token.py | 3 +- stripe/_transfer.py | 2 +- stripe/_transfer_reversal_service.py | 2 +- stripe/checkout/_session.py | 35 ++- stripe/checkout/_session_service.py | 20 +- stripe/tax/_calculation.py | 6 +- stripe/tax/_calculation_service.py | 3 +- stripe/tax/_transaction.py | 3 +- stripe/terminal/_location.py | 2 +- stripe/terminal/_location_service.py | 2 +- .../_confirmation_token_service.py | 20 ++ 39 files changed, 920 insertions(+), 41 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 8d1f4287e..ebd06a813 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1065 \ No newline at end of file +v1077 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 6d161e8eb..1479bcee4 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -282,6 +282,10 @@ class Capabilities(StripeObject): """ The status of the MobilePay capability of the account, or whether the account can directly process MobilePay charges. """ + multibanco_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the Multibanco payments capability of the account, or whether the account can directly process Multibanco charges. + """ mx_bank_transfer_payments: Optional[ Literal["active", "inactive", "pending"] ] @@ -348,6 +352,10 @@ class Capabilities(StripeObject): """ The status of the banking capability, or whether the account can have bank accounts. """ + twint_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the TWINT capability of the account, or whether the account can directly process TWINT charges. + """ us_bank_account_ach_payments: Optional[ Literal["active", "inactive", "pending"] ] @@ -1601,6 +1609,12 @@ class CreateParamsCapabilities(TypedDict): """ The mobilepay_payments capability. """ + multibanco_payments: NotRequired[ + "Account.CreateParamsCapabilitiesMultibancoPayments" + ] + """ + The multibanco_payments capability. + """ mx_bank_transfer_payments: NotRequired[ "Account.CreateParamsCapabilitiesMxBankTransferPayments" ] @@ -1681,6 +1695,12 @@ class CreateParamsCapabilities(TypedDict): """ The treasury capability. """ + twint_payments: NotRequired[ + "Account.CreateParamsCapabilitiesTwintPayments" + ] + """ + The twint_payments capability. + """ us_bank_account_ach_payments: NotRequired[ "Account.CreateParamsCapabilitiesUsBankAccountAchPayments" ] @@ -1868,6 +1888,12 @@ class CreateParamsCapabilitiesMobilepayPayments(TypedDict): 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 CreateParamsCapabilitiesMultibancoPayments(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 CreateParamsCapabilitiesMxBankTransferPayments(TypedDict): requested: NotRequired[bool] """ @@ -1952,6 +1978,12 @@ class CreateParamsCapabilitiesTreasury(TypedDict): 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 CreateParamsCapabilitiesTwintPayments(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 CreateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): requested: NotRequired[bool] """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 705c492e8..9a1924794 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -406,6 +406,12 @@ class CreateParamsCapabilities(TypedDict): """ The mobilepay_payments capability. """ + multibanco_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesMultibancoPayments" + ] + """ + The multibanco_payments capability. + """ mx_bank_transfer_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesMxBankTransferPayments" ] @@ -490,6 +496,12 @@ class CreateParamsCapabilities(TypedDict): """ The treasury capability. """ + twint_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesTwintPayments" + ] + """ + The twint_payments capability. + """ us_bank_account_ach_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesUsBankAccountAchPayments" ] @@ -677,6 +689,12 @@ class CreateParamsCapabilitiesMobilepayPayments(TypedDict): 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 CreateParamsCapabilitiesMultibancoPayments(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 CreateParamsCapabilitiesMxBankTransferPayments(TypedDict): requested: NotRequired[bool] """ @@ -761,6 +779,12 @@ class CreateParamsCapabilitiesTreasury(TypedDict): 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 CreateParamsCapabilitiesTwintPayments(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 CreateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): requested: NotRequired[bool] """ @@ -2068,6 +2092,12 @@ class UpdateParamsCapabilities(TypedDict): """ The mobilepay_payments capability. """ + multibanco_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesMultibancoPayments" + ] + """ + The multibanco_payments capability. + """ mx_bank_transfer_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesMxBankTransferPayments" ] @@ -2152,6 +2182,12 @@ class UpdateParamsCapabilities(TypedDict): """ The treasury capability. """ + twint_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesTwintPayments" + ] + """ + The twint_payments capability. + """ us_bank_account_ach_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesUsBankAccountAchPayments" ] @@ -2339,6 +2375,12 @@ class UpdateParamsCapabilitiesMobilepayPayments(TypedDict): 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 UpdateParamsCapabilitiesMultibancoPayments(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 UpdateParamsCapabilitiesMxBankTransferPayments(TypedDict): requested: NotRequired[bool] """ @@ -2423,6 +2465,12 @@ class UpdateParamsCapabilitiesTreasury(TypedDict): 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 UpdateParamsCapabilitiesTwintPayments(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 UpdateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): requested: NotRequired[bool] """ diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index 8f3799e37..733b7ba0e 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -26,8 +26,7 @@ class BankAccount( These bank accounts are payment methods on `Customer` objects. On the other hand [External Accounts](https://stripe.com/api#external_accounts) are transfer - destinations on `Account` objects for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) - is `application`, which includes [Custom accounts](https://stripe.com/connect/custom-accounts). + destinations on `Account` objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above. Related guide: [Bank debits and transfers](https://stripe.com/payments/bank-debits-transfers) diff --git a/stripe/_charge.py b/stripe/_charge.py index 896a4c2ed..d7cdc0084 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1529,6 +1529,9 @@ class Swish(StripeObject): The last four digits of the Swish account phone number """ + class Twint(StripeObject): + pass + class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ @@ -1618,6 +1621,7 @@ class Zip(StripeObject): sofort: Optional[Sofort] stripe_account: Optional[StripeAccount] swish: Optional[Swish] + twint: Optional[Twint] type: str """ The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`. @@ -1668,6 +1672,7 @@ class Zip(StripeObject): "sofort": Sofort, "stripe_account": StripeAccount, "swish": Swish, + "twint": Twint, "us_bank_account": UsBankAccount, "wechat": Wechat, "wechat_pay": WechatPay, diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 8eba07da4..9364a3fc0 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -993,6 +993,9 @@ class Link(StripeObject): class Mobilepay(StripeObject): pass + class Multibanco(StripeObject): + pass + class Oxxo(StripeObject): pass @@ -1100,6 +1103,9 @@ class Sofort(StripeObject): class Swish(StripeObject): pass + class Twint(StripeObject): + pass + class UsBankAccount(StripeObject): class Networks(StripeObject): preferred: Optional[str] @@ -1225,6 +1231,7 @@ class Zip(StripeObject): konbini: Optional[Konbini] link: Optional[Link] mobilepay: Optional[Mobilepay] + multibanco: Optional[Multibanco] oxxo: Optional[Oxxo] p24: Optional[P24] paynow: Optional[Paynow] @@ -1235,6 +1242,7 @@ class Zip(StripeObject): sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] + twint: Optional[Twint] type: Literal[ "acss_debit", "affirm", @@ -1260,6 +1268,7 @@ class Zip(StripeObject): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -1270,6 +1279,7 @@ class Zip(StripeObject): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -1306,6 +1316,7 @@ class Zip(StripeObject): "konbini": Konbini, "link": Link, "mobilepay": Mobilepay, + "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, @@ -1316,6 +1327,7 @@ class Zip(StripeObject): "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, + "twint": Twint, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, @@ -1534,6 +1546,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataOxxo" ] @@ -1596,6 +1614,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataTwint" + ] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -1618,6 +1642,7 @@ class CreateParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -1628,6 +1653,7 @@ class CreateParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -1897,6 +1923,9 @@ class CreateParamsPaymentMethodDataLink(TypedDict): class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass + class CreateParamsPaymentMethodDataMultibanco(TypedDict): + pass + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -1971,6 +2000,9 @@ class CreateParamsPaymentMethodDataSofort(TypedDict): class CreateParamsPaymentMethodDataSwish(TypedDict): pass + class CreateParamsPaymentMethodDataTwint(TypedDict): + pass + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ diff --git a/stripe/_customer.py b/stripe/_customer.py index c824dac3d..c6500dff1 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -526,6 +526,7 @@ class CreateParamsTaxIdDatum(TypedDict): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -578,7 +579,7 @@ class CreateParamsTaxIdDatum(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -627,6 +628,7 @@ class CreateTaxIdParams(RequestOptions): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -679,7 +681,7 @@ class CreateTaxIdParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -850,6 +852,7 @@ class ListPaymentMethodsParams(RequestOptions): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -860,6 +863,7 @@ class ListPaymentMethodsParams(RequestOptions): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 21a8870d0..31a03d337 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -57,6 +57,7 @@ class ListParams(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -67,6 +68,7 @@ class ListParams(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index c156dc5ae..1fbe88d8e 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -291,6 +291,7 @@ class CreateParamsTaxIdDatum(TypedDict): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -343,7 +344,7 @@ class CreateParamsTaxIdDatum(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index 5a23a05a6..7fd502ea6 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -37,6 +37,7 @@ class CreateParams(TypedDict): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -89,7 +90,7 @@ class CreateParams(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index b504f169a..fceb346bb 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -229,6 +229,7 @@ class CustomerTaxId(StripeObject): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -282,7 +283,7 @@ class CustomerTaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, or `unknown` """ value: Optional[str] """ @@ -1473,7 +1474,7 @@ class CreateParamsShippingCostShippingRateData(TypedDict): """ type: NotRequired[Literal["fixed_amount"]] """ - The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + The type of calculation to use on the shipping rate. """ class CreateParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): @@ -1816,6 +1817,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -1868,7 +1870,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -3140,7 +3142,7 @@ class ModifyParamsShippingCostShippingRateData(TypedDict): """ type: NotRequired[Literal["fixed_amount"]] """ - The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + The type of calculation to use on the shipping rate. """ class ModifyParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): @@ -3611,6 +3613,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -3663,7 +3666,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -4743,6 +4746,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -4795,7 +4799,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 9ff265f53..2d1b54e33 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -503,7 +503,7 @@ class CreateParamsShippingCostShippingRateData(TypedDict): """ type: NotRequired[Literal["fixed_amount"]] """ - The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + The type of calculation to use on the shipping rate. """ class CreateParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): @@ -852,6 +852,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -904,7 +905,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -2044,6 +2045,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -2096,7 +2098,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -3352,7 +3354,7 @@ class UpdateParamsShippingCostShippingRateData(TypedDict): """ type: NotRequired[Literal["fixed_amount"]] """ - The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + The type of calculation to use on the shipping rate. """ class UpdateParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index 106daa5fd..916bcf090 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -298,6 +298,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -350,7 +351,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 39183b13c..590cddb2a 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -699,6 +699,24 @@ class Seicomart(StripeObject): stores: Stores _inner_class_types = {"stores": Stores} + class MultibancoDisplayDetails(StripeObject): + entity: Optional[str] + """ + Entity number associated with this Multibanco payment. + """ + expires_at: Optional[int] + """ + The timestamp at which the Multibanco voucher expires. + """ + hosted_voucher_url: Optional[str] + """ + The URL for the hosted Multibanco voucher page, which allows customers to view a Multibanco voucher. + """ + reference: Optional[str] + """ + Reference number associated with this Multibanco payment. + """ + class OxxoDisplayDetails(StripeObject): expires_after: Optional[int] """ @@ -889,6 +907,7 @@ class WechatPayRedirectToIosApp(StripeObject): DisplayBankTransferInstructions ] konbini_display_details: Optional[KonbiniDisplayDetails] + multibanco_display_details: Optional[MultibancoDisplayDetails] oxxo_display_details: Optional[OxxoDisplayDetails] paynow_display_qr_code: Optional[PaynowDisplayQrCode] pix_display_qr_code: Optional[PixDisplayQrCode] @@ -918,6 +937,7 @@ class WechatPayRedirectToIosApp(StripeObject): "cashapp_handle_redirect_or_display_qr_code": CashappHandleRedirectOrDisplayQrCode, "display_bank_transfer_instructions": DisplayBankTransferInstructions, "konbini_display_details": KonbiniDisplayDetails, + "multibanco_display_details": MultibancoDisplayDetails, "oxxo_display_details": OxxoDisplayDetails, "paynow_display_qr_code": PaynowDisplayQrCode, "pix_display_qr_code": PixDisplayQrCode, @@ -1499,6 +1519,16 @@ class Mobilepay(StripeObject): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class Multibanco(StripeObject): + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class Oxxo(StripeObject): expires_after_days: int """ @@ -1644,6 +1674,16 @@ class Swish(StripeObject): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class Twint(StripeObject): + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): permissions: Optional[ @@ -1757,6 +1797,7 @@ class Zip(StripeObject): konbini: Optional[Konbini] link: Optional[Link] mobilepay: Optional[Mobilepay] + multibanco: Optional[Multibanco] oxxo: Optional[Oxxo] p24: Optional[P24] paynow: Optional[Paynow] @@ -1767,6 +1808,7 @@ class Zip(StripeObject): sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] + twint: Optional[Twint] us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] @@ -1795,6 +1837,7 @@ class Zip(StripeObject): "konbini": Konbini, "link": Link, "mobilepay": Mobilepay, + "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, @@ -1805,6 +1848,7 @@ class Zip(StripeObject): "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, + "twint": Twint, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, @@ -2240,6 +2284,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -2298,6 +2348,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataTwint"] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -2320,6 +2374,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -2330,6 +2385,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -2599,6 +2655,9 @@ class ConfirmParamsPaymentMethodDataLink(TypedDict): class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): pass + class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): + pass + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2673,6 +2732,9 @@ class ConfirmParamsPaymentMethodDataSofort(TypedDict): class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass + class ConfirmParamsPaymentMethodDataTwint(TypedDict): + pass + class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -2846,6 +2908,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ + multibanco: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsOxxo" ] @@ -2906,6 +2974,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ + twint: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsTwint" + ] + """ + If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccount" ] @@ -3717,6 +3791,18 @@ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -3926,6 +4012,18 @@ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -4443,6 +4541,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -4501,6 +4605,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataTwint"] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -4523,6 +4631,7 @@ class CreateParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -4533,6 +4642,7 @@ class CreateParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -4802,6 +4912,9 @@ class CreateParamsPaymentMethodDataLink(TypedDict): class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass + class CreateParamsPaymentMethodDataMultibanco(TypedDict): + pass + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -4876,6 +4989,9 @@ class CreateParamsPaymentMethodDataSofort(TypedDict): class CreateParamsPaymentMethodDataSwish(TypedDict): pass + class CreateParamsPaymentMethodDataTwint(TypedDict): + pass + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -5049,6 +5165,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ + multibanco: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsOxxo" ] @@ -5109,6 +5231,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ + twint: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsTwint" + ] + """ + If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccount" ] @@ -5920,6 +6048,18 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -6129,6 +6269,18 @@ class CreateParamsPaymentMethodOptionsSwish(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsTwint(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -6640,6 +6792,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -6698,6 +6856,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataTwint"] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -6720,6 +6882,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -6730,6 +6893,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -6999,6 +7163,9 @@ class ModifyParamsPaymentMethodDataLink(TypedDict): class ModifyParamsPaymentMethodDataMobilepay(TypedDict): pass + class ModifyParamsPaymentMethodDataMultibanco(TypedDict): + pass + class ModifyParamsPaymentMethodDataOxxo(TypedDict): pass @@ -7073,6 +7240,9 @@ class ModifyParamsPaymentMethodDataSofort(TypedDict): class ModifyParamsPaymentMethodDataSwish(TypedDict): pass + class ModifyParamsPaymentMethodDataTwint(TypedDict): + pass + class ModifyParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -7246,6 +7416,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ + multibanco: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsOxxo" ] @@ -7306,6 +7482,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ + twint: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsTwint" + ] + """ + If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccount" ] @@ -8117,6 +8299,18 @@ class ModifyParamsPaymentMethodOptionsMobilepay(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsMultibanco(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class ModifyParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -8326,6 +8520,18 @@ class ModifyParamsPaymentMethodOptionsSwish(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsTwint(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections" diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index fa94c2cd0..b0fc670d6 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -373,6 +373,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataOxxo" ] @@ -439,6 +445,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataTwint" + ] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -461,6 +473,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -471,6 +484,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -742,6 +756,9 @@ class ConfirmParamsPaymentMethodDataLink(TypedDict): class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): pass + class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): + pass + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -816,6 +833,9 @@ class ConfirmParamsPaymentMethodDataSofort(TypedDict): class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass + class ConfirmParamsPaymentMethodDataTwint(TypedDict): + pass + class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -989,6 +1009,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ + multibanco: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsOxxo" ] @@ -1049,6 +1075,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ + twint: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsTwint" + ] + """ + If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccount" ] @@ -1860,6 +1892,18 @@ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -2069,6 +2113,18 @@ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -2600,6 +2656,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataOxxo" ] @@ -2666,6 +2728,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataTwint" + ] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -2688,6 +2756,7 @@ class CreateParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -2698,6 +2767,7 @@ class CreateParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -2969,6 +3039,9 @@ class CreateParamsPaymentMethodDataLink(TypedDict): class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass + class CreateParamsPaymentMethodDataMultibanco(TypedDict): + pass + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -3043,6 +3116,9 @@ class CreateParamsPaymentMethodDataSofort(TypedDict): class CreateParamsPaymentMethodDataSwish(TypedDict): pass + class CreateParamsPaymentMethodDataTwint(TypedDict): + pass + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -3216,6 +3292,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ + multibanco: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsOxxo" ] @@ -3276,6 +3358,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ + twint: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsTwint" + ] + """ + If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccount" ] @@ -4087,6 +4175,18 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -4296,6 +4396,18 @@ class CreateParamsPaymentMethodOptionsSwish(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsTwint(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -4849,6 +4961,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataOxxo" ] @@ -4915,6 +5033,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataTwint" + ] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -4937,6 +5061,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -4947,6 +5072,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -5218,6 +5344,9 @@ class UpdateParamsPaymentMethodDataLink(TypedDict): class UpdateParamsPaymentMethodDataMobilepay(TypedDict): pass + class UpdateParamsPaymentMethodDataMultibanco(TypedDict): + pass + class UpdateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -5292,6 +5421,9 @@ class UpdateParamsPaymentMethodDataSofort(TypedDict): class UpdateParamsPaymentMethodDataSwish(TypedDict): pass + class UpdateParamsPaymentMethodDataTwint(TypedDict): + pass + class UpdateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -5465,6 +5597,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ + multibanco: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsOxxo" ] @@ -5525,6 +5663,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ + twint: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsTwint" + ] + """ + If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsUsBankAccount" ] @@ -6336,6 +6480,18 @@ class UpdateParamsPaymentMethodOptionsMobilepay(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsMultibanco(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class UpdateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -6545,6 +6701,18 @@ class UpdateParamsPaymentMethodOptionsSwish(TypedDict): If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsTwint(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 3a263b266..aadc504f9 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -967,6 +967,9 @@ class Link(StripeObject): class Mobilepay(StripeObject): pass + class Multibanco(StripeObject): + pass + class Oxxo(StripeObject): pass @@ -1080,6 +1083,9 @@ class Sofort(StripeObject): class Swish(StripeObject): pass + class Twint(StripeObject): + pass + class UsBankAccount(StripeObject): class Networks(StripeObject): preferred: Optional[str] @@ -1309,6 +1315,10 @@ class CreateParams(RequestOptions): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired["PaymentMethod.CreateParamsMultibanco"] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired["PaymentMethod.CreateParamsOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -1357,6 +1367,10 @@ class CreateParams(RequestOptions): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired["PaymentMethod.CreateParamsTwint"] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: NotRequired[ Literal[ "acss_debit", @@ -1381,6 +1395,7 @@ class CreateParams(RequestOptions): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -1391,6 +1406,7 @@ class CreateParams(RequestOptions): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -1689,6 +1705,9 @@ class CreateParamsLink(TypedDict): class CreateParamsMobilepay(TypedDict): pass + class CreateParamsMultibanco(TypedDict): + pass + class CreateParamsOxxo(TypedDict): pass @@ -1763,6 +1782,9 @@ class CreateParamsSofort(TypedDict): class CreateParamsSwish(TypedDict): pass + class CreateParamsTwint(TypedDict): + pass + class CreateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -1842,6 +1864,7 @@ class ListParams(RequestOptions): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -1852,6 +1875,7 @@ class ListParams(RequestOptions): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -2031,6 +2055,7 @@ class RetrieveParams(RequestOptions): Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ mobilepay: Optional[Mobilepay] + multibanco: Optional[Multibanco] object: Literal["payment_method"] """ String representing the object's type. Objects of the same type share the same value. @@ -2049,6 +2074,7 @@ class RetrieveParams(RequestOptions): sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] + twint: Optional[Twint] type: Literal[ "acss_debit", "affirm", @@ -2074,6 +2100,7 @@ class RetrieveParams(RequestOptions): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -2084,6 +2111,7 @@ class RetrieveParams(RequestOptions): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -2577,6 +2605,7 @@ async def retrieve_async( "konbini": Konbini, "link": Link, "mobilepay": Mobilepay, + "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, @@ -2588,6 +2617,7 @@ async def retrieve_async( "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, + "twint": Twint, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 6ddfe3be4..39b67ac54 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -609,6 +609,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Multibanco(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 Oxxo(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -1010,6 +1032,12 @@ class CreateParams(RequestOptions): """ MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. """ + multibanco: NotRequired[ + "PaymentMethodConfiguration.CreateParamsMultibanco" + ] + """ + Stripe users in Europe and the United States can accept Multibanco payments from customers in Portugal using [Sources](https://stripe.com/docs/sources)—a single integration path for creating payments using any supported method. + """ name: NotRequired[str] """ Configuration name. @@ -1455,6 +1483,20 @@ class CreateParamsMobilepayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsMultibanco(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsMultibancoDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsMultibancoDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsOxxoDisplayPreference" @@ -1786,6 +1828,12 @@ class ModifyParams(RequestOptions): """ MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. """ + multibanco: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsMultibanco" + ] + """ + Stripe users in Europe and the United States can accept Multibanco payments from customers in Portugal using [Sources](https://stripe.com/docs/sources)—a single integration path for creating payments using any supported method. + """ name: NotRequired[str] """ Configuration name. @@ -2227,6 +2275,20 @@ class ModifyParamsMobilepayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsMultibanco(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsMultibancoDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsMultibancoDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsOxxoDisplayPreference" @@ -2447,6 +2509,7 @@ class RetrieveParams(RequestOptions): Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ mobilepay: Optional[Mobilepay] + multibanco: Optional[Multibanco] name: str """ The configuration's name. @@ -2635,6 +2698,7 @@ async def retrieve_async( "konbini": Konbini, "link": Link, "mobilepay": Mobilepay, + "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index 49b1ce3f7..3b639f873 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -165,6 +165,12 @@ class CreateParams(TypedDict): """ MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. """ + multibanco: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsMultibanco" + ] + """ + Stripe users in Europe and the United States can accept Multibanco payments from customers in Portugal using [Sources](https://stripe.com/docs/sources)—a single integration path for creating payments using any supported method. + """ name: NotRequired[str] """ Configuration name. @@ -618,6 +624,20 @@ class CreateParamsMobilepayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsMultibanco(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsMultibancoDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsMultibancoDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsOxxoDisplayPreference" @@ -973,6 +993,12 @@ class UpdateParams(TypedDict): """ MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. """ + multibanco: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsMultibanco" + ] + """ + Stripe users in Europe and the United States can accept Multibanco payments from customers in Portugal using [Sources](https://stripe.com/docs/sources)—a single integration path for creating payments using any supported method. + """ name: NotRequired[str] """ Configuration name. @@ -1422,6 +1448,20 @@ class UpdateParamsMobilepayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsMultibanco(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsMultibancoDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsMultibancoDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsOxxoDisplayPreference" diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 86893c555..8f6a18872 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -145,6 +145,10 @@ class CreateParams(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired["PaymentMethodService.CreateParamsMultibanco"] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired["PaymentMethodService.CreateParamsOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -195,6 +199,10 @@ class CreateParams(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired["PaymentMethodService.CreateParamsTwint"] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: NotRequired[ Literal[ "acss_debit", @@ -219,6 +227,7 @@ class CreateParams(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -229,6 +238,7 @@ class CreateParams(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -529,6 +539,9 @@ class CreateParamsLink(TypedDict): class CreateParamsMobilepay(TypedDict): pass + class CreateParamsMultibanco(TypedDict): + pass + class CreateParamsOxxo(TypedDict): pass @@ -603,6 +616,9 @@ class CreateParamsSofort(TypedDict): class CreateParamsSwish(TypedDict): pass + class CreateParamsTwint(TypedDict): + pass + class CreateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -682,6 +698,7 @@ class ListParams(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -692,6 +709,7 @@ class ListParams(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", diff --git a/stripe/_refund.py b/stripe/_refund.py index 4a455ff11..bb2449bf7 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -143,6 +143,16 @@ class JpBankTransfer(StripeObject): class Klarna(StripeObject): pass + class Multibanco(StripeObject): + reference: Optional[str] + """ + The reference assigned to the refund. + """ + reference_status: Optional[str] + """ + Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + """ + class MxBankTransfer(StripeObject): reference: Optional[str] """ @@ -231,6 +241,7 @@ class Zip(StripeObject): grabpay: Optional[Grabpay] jp_bank_transfer: Optional[JpBankTransfer] klarna: Optional[Klarna] + multibanco: Optional[Multibanco] mx_bank_transfer: Optional[MxBankTransfer] p24: Optional[P24] paynow: Optional[Paynow] @@ -265,6 +276,7 @@ class Zip(StripeObject): "grabpay": Grabpay, "jp_bank_transfer": JpBankTransfer, "klarna": Klarna, + "multibanco": Multibanco, "mx_bank_transfer": MxBankTransfer, "p24": P24, "paynow": Paynow, diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index ffd3a165a..c969607f5 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -850,6 +850,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -902,6 +908,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataTwint"] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -924,6 +934,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -934,6 +945,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -1201,6 +1213,9 @@ class ConfirmParamsPaymentMethodDataLink(TypedDict): class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): pass + class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): + pass + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -1275,6 +1290,9 @@ class ConfirmParamsPaymentMethodDataSofort(TypedDict): class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass + class ConfirmParamsPaymentMethodDataTwint(TypedDict): + pass + class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -1934,6 +1952,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired["SetupIntent.CreateParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -1986,6 +2010,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired["SetupIntent.CreateParamsPaymentMethodDataTwint"] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -2008,6 +2036,7 @@ class CreateParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -2018,6 +2047,7 @@ class CreateParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -2285,6 +2315,9 @@ class CreateParamsPaymentMethodDataLink(TypedDict): class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass + class CreateParamsPaymentMethodDataMultibanco(TypedDict): + pass + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2359,6 +2392,9 @@ class CreateParamsPaymentMethodDataSofort(TypedDict): class CreateParamsPaymentMethodDataSwish(TypedDict): pass + class CreateParamsPaymentMethodDataTwint(TypedDict): + pass + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -2985,6 +3021,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -3037,6 +3079,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataTwint"] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -3059,6 +3105,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -3069,6 +3116,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -3336,6 +3384,9 @@ class ModifyParamsPaymentMethodDataLink(TypedDict): class ModifyParamsPaymentMethodDataMobilepay(TypedDict): pass + class ModifyParamsPaymentMethodDataMultibanco(TypedDict): + pass + class ModifyParamsPaymentMethodDataOxxo(TypedDict): pass @@ -3410,6 +3461,9 @@ class ModifyParamsPaymentMethodDataSofort(TypedDict): class ModifyParamsPaymentMethodDataSwish(TypedDict): pass + class ModifyParamsPaymentMethodDataTwint(TypedDict): + pass + class ModifyParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 5021a0f14..cf675859d 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -256,6 +256,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataOxxo" ] @@ -322,6 +328,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataTwint" + ] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -344,6 +356,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -354,6 +367,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -625,6 +639,9 @@ class ConfirmParamsPaymentMethodDataLink(TypedDict): class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): pass + class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): + pass + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -699,6 +716,9 @@ class ConfirmParamsPaymentMethodDataSofort(TypedDict): class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass + class ConfirmParamsPaymentMethodDataTwint(TypedDict): + pass + class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -1376,6 +1396,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataOxxo" ] @@ -1438,6 +1464,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataTwint" + ] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -1460,6 +1492,7 @@ class CreateParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -1470,6 +1503,7 @@ class CreateParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -1739,6 +1773,9 @@ class CreateParamsPaymentMethodDataLink(TypedDict): class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass + class CreateParamsPaymentMethodDataMultibanco(TypedDict): + pass + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -1813,6 +1850,9 @@ class CreateParamsPaymentMethodDataSofort(TypedDict): class CreateParamsPaymentMethodDataSwish(TypedDict): pass + class CreateParamsPaymentMethodDataTwint(TypedDict): + pass + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -2467,6 +2507,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataOxxo" ] @@ -2529,6 +2575,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataTwint" + ] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -2551,6 +2603,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -2561,6 +2614,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -2830,6 +2884,9 @@ class UpdateParamsPaymentMethodDataLink(TypedDict): class UpdateParamsPaymentMethodDataMobilepay(TypedDict): pass + class UpdateParamsPaymentMethodDataMultibanco(TypedDict): + pass + class UpdateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2904,6 +2961,9 @@ class UpdateParamsPaymentMethodDataSofort(TypedDict): class UpdateParamsPaymentMethodDataSwish(TypedDict): pass + class UpdateParamsPaymentMethodDataTwint(TypedDict): + pass + class UpdateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ diff --git a/stripe/_shipping_rate.py b/stripe/_shipping_rate.py index b156339ea..4373b7f00 100644 --- a/stripe/_shipping_rate.py +++ b/stripe/_shipping_rate.py @@ -125,7 +125,7 @@ class CreateParams(RequestOptions): """ type: NotRequired[Literal["fixed_amount"]] """ - The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + The type of calculation to use on the shipping rate. """ class CreateParamsDeliveryEstimate(TypedDict): @@ -331,7 +331,7 @@ class RetrieveParams(RequestOptions): """ type: Literal["fixed_amount"] """ - The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + The type of calculation to use on the shipping rate. """ @classmethod diff --git a/stripe/_shipping_rate_service.py b/stripe/_shipping_rate_service.py index 962d50b24..2e6c3f964 100644 --- a/stripe/_shipping_rate_service.py +++ b/stripe/_shipping_rate_service.py @@ -47,7 +47,7 @@ class CreateParams(TypedDict): """ type: NotRequired[Literal["fixed_amount"]] """ - The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + The type of calculation to use on the shipping rate. """ class CreateParamsDeliveryEstimate(TypedDict): diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 23fd57445..f75d8170b 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -43,6 +43,7 @@ from stripe._source import Source from stripe._subscription_item import SubscriptionItem from stripe._subscription_schedule import SubscriptionSchedule + from stripe._tax_id import TaxId from stripe._tax_rate import TaxRate from stripe.test_helpers._test_clock import TestClock @@ -144,6 +145,24 @@ class CancellationDetails(StripeObject): Why this subscription was canceled. """ + class InvoiceSettings(StripeObject): + class Issuer(StripeObject): + account: Optional[ExpandableField["Account"]] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced. + """ + + account_tax_ids: Optional[List[ExpandableField["TaxId"]]] + """ + The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. + """ + issuer: Issuer + _inner_class_types = {"issuer": Issuer} + class PauseCollection(StripeObject): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ @@ -439,11 +458,11 @@ class CancelParams(RequestOptions): """ invoice_now: NotRequired[bool] """ - Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. + Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`. """ prorate: NotRequired[bool] """ - Will generate a proration invoice item that credits remaining unused time until the subscription period end. + Will generate a proration invoice item that credits remaining unused time until the subscription period end. Defaults to `false`. """ class CancelParamsCancellationDetails(TypedDict): @@ -2091,6 +2110,7 @@ class SearchParams(RequestOptions): """ Unique identifier for the object. """ + invoice_settings: InvoiceSettings items: ListObject["SubscriptionItem"] """ List of subscription items, each with an attached price. @@ -2798,6 +2818,7 @@ async def search_auto_paging_iter_async( "billing_cycle_anchor_config": BillingCycleAnchorConfig, "billing_thresholds": BillingThresholds, "cancellation_details": CancellationDetails, + "invoice_settings": InvoiceSettings, "pause_collection": PauseCollection, "payment_settings": PaymentSettings, "pending_invoice_item_interval": PendingInvoiceItemInterval, diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 611cb6614..8ab003b72 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -25,11 +25,11 @@ class CancelParams(TypedDict): """ invoice_now: NotRequired[bool] """ - Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. + Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`. """ prorate: NotRequired[bool] """ - Will generate a proration invoice item that credits remaining unused time until the subscription period end. + Will generate a proration invoice item that credits remaining unused time until the subscription period end. Defaults to `false`. """ class CancelParamsCancellationDetails(TypedDict): diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index bc61e7638..16972e008 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -100,6 +100,7 @@ class CreateParams(RequestOptions): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -152,7 +153,7 @@ class CreateParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -268,6 +269,7 @@ class RetrieveParams(RequestOptions): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -321,7 +323,7 @@ class RetrieveParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` """ value: str """ diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py index 9e492e0e0..0ac3eac42 100644 --- a/stripe/_tax_id_service.py +++ b/stripe/_tax_id_service.py @@ -41,6 +41,7 @@ class CreateParams(TypedDict): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -93,7 +94,7 @@ class CreateParams(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_token.py b/stripe/_token.py index 36ae4308a..6292b4395 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -1069,8 +1069,7 @@ class RetrieveParams(RequestOptions): These bank accounts are payment methods on `Customer` objects. On the other hand [External Accounts](https://stripe.com/api#external_accounts) are transfer - destinations on `Account` objects for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) - is `application`, which includes [Custom accounts](https://stripe.com/connect/custom-accounts). + destinations on `Account` objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above. Related guide: [Bank debits and transfers](https://stripe.com/payments/bank-debits-transfers) diff --git a/stripe/_transfer.py b/stripe/_transfer.py index f691fd9a3..d8b59f2f1 100644 --- a/stripe/_transfer.py +++ b/stripe/_transfer.py @@ -90,7 +90,7 @@ class CreateReversalParams(RequestOptions): """ description: NotRequired[str] """ - An arbitrary string which you can attach to a reversal object. It is displayed alongside the reversal in the Dashboard. This will be unset if you POST an empty value. + An arbitrary string which you can attach to a reversal object. This will be unset if you POST an empty value. """ expand: NotRequired[List[str]] """ diff --git a/stripe/_transfer_reversal_service.py b/stripe/_transfer_reversal_service.py index 2159726ef..4d083ce14 100644 --- a/stripe/_transfer_reversal_service.py +++ b/stripe/_transfer_reversal_service.py @@ -17,7 +17,7 @@ class CreateParams(TypedDict): """ description: NotRequired[str] """ - An arbitrary string which you can attach to a reversal object. It is displayed alongside the reversal in the Dashboard. This will be unset if you POST an empty value. + An arbitrary string which you can attach to a reversal object. This will be unset if you POST an empty value. """ expand: NotRequired[List[str]] """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 7bd893582..6122ec416 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -356,6 +356,7 @@ class TaxId(StripeObject): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -409,7 +410,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, or `unknown` """ value: Optional[str] """ @@ -853,6 +854,16 @@ class Mobilepay(StripeObject): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class Multibanco(StripeObject): + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class Oxxo(StripeObject): expires_after_days: int """ @@ -1019,6 +1030,7 @@ class FinancialConnections(StripeObject): konbini: Optional[Konbini] link: Optional[Link] mobilepay: Optional[Mobilepay] + multibanco: Optional[Multibanco] oxxo: Optional[Oxxo] p24: Optional[P24] paynow: Optional[Paynow] @@ -1051,6 +1063,7 @@ class FinancialConnections(StripeObject): "konbini": Konbini, "link": Link, "mobilepay": Mobilepay, + "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, @@ -1754,6 +1767,7 @@ class CreateParams(RequestOptions): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -1764,6 +1778,7 @@ class CreateParams(RequestOptions): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -2514,6 +2529,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Mobilepay payment method options. """ + multibanco: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsMultibanco" + ] + """ + contains details about the Multibanco payment method options. + """ oxxo: NotRequired["Session.CreateParamsPaymentMethodOptionsOxxo"] """ contains details about the OXXO payment method options. @@ -2918,6 +2939,16 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -3438,7 +3469,7 @@ class CreateParamsShippingOptionShippingRateData(TypedDict): """ type: NotRequired[Literal["fixed_amount"]] """ - The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + The type of calculation to use on the shipping rate. """ class CreateParamsShippingOptionShippingRateDataDeliveryEstimate( diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 289ed5fd0..a64338c94 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -244,6 +244,7 @@ class CreateParams(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -254,6 +255,7 @@ class CreateParams(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -1040,6 +1042,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Mobilepay payment method options. """ + multibanco: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsMultibanco" + ] + """ + contains details about the Multibanco payment method options. + """ oxxo: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsOxxo" ] @@ -1454,6 +1462,16 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -1974,7 +1992,7 @@ class CreateParamsShippingOptionShippingRateData(TypedDict): """ type: NotRequired[Literal["fixed_amount"]] """ - The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + The type of calculation to use on the shipping rate. """ class CreateParamsShippingOptionShippingRateDataDeliveryEstimate( diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index a91f55871..eabc373a4 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -77,6 +77,7 @@ class TaxId(StripeObject): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -130,7 +131,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, or `unknown` """ value: str """ @@ -490,6 +491,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -542,7 +544,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index f974eea7b..0d760b549 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -132,6 +132,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -184,7 +185,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index bf07df5e4..52c0b6cfe 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -77,6 +77,7 @@ class TaxId(StripeObject): "cn_tin", "co_nit", "cr_tin", + "de_stn", "do_rcn", "ec_ruc", "eg_tin", @@ -130,7 +131,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, or `unknown` """ value: str """ diff --git a/stripe/terminal/_location.py b/stripe/terminal/_location.py index 98f3feb17..1d5990791 100644 --- a/stripe/terminal/_location.py +++ b/stripe/terminal/_location.py @@ -124,7 +124,7 @@ class ListParams(RequestOptions): class ModifyParams(RequestOptions): address: NotRequired["Location.ModifyParamsAddress"] """ - The full address of the location. + The full address of the location. If you're updating the `address` field, avoid changing the `country`. If you need to modify the `country` field, create a new `Location` object and re-register any existing readers to that location. """ configuration_overrides: NotRequired["Literal['']|str"] """ diff --git a/stripe/terminal/_location_service.py b/stripe/terminal/_location_service.py index 18a8458cb..3da89f547 100644 --- a/stripe/terminal/_location_service.py +++ b/stripe/terminal/_location_service.py @@ -88,7 +88,7 @@ class RetrieveParams(TypedDict): class UpdateParams(TypedDict): address: NotRequired["LocationService.UpdateParamsAddress"] """ - The full address of the location. + The full address of the location. If you're updating the `address` field, avoid changing the `country`. If you need to modify the `country` field, create a new `Location` object and re-register any existing readers to that location. """ configuration_overrides: NotRequired["Literal['']|str"] """ diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index 7a0333220..6d3e3473f 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -187,6 +187,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ + multibanco: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ oxxo: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataOxxo" ] @@ -253,6 +259,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ + twint: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataTwint" + ] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ type: Literal[ "acss_debit", "affirm", @@ -275,6 +287,7 @@ class CreateParamsPaymentMethodData(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -285,6 +298,7 @@ class CreateParamsPaymentMethodData(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", "zip", @@ -556,6 +570,9 @@ class CreateParamsPaymentMethodDataLink(TypedDict): class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass + class CreateParamsPaymentMethodDataMultibanco(TypedDict): + pass + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -630,6 +647,9 @@ class CreateParamsPaymentMethodDataSofort(TypedDict): class CreateParamsPaymentMethodDataSwish(TypedDict): pass + class CreateParamsPaymentMethodDataTwint(TypedDict): + pass + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ From 741844f40db13cd6aaecf336776028628ff6970a Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 13 Jun 2024 14:06:03 -0700 Subject: [PATCH 075/179] Bump version to 9.11.0 --- CHANGELOG.md | 12 ++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 900ba2628..bda803c47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 9.11.0 - 2024-06-13 +* [#1342](https://github.com/stripe/stripe-python/pull/1342) Update generated code + * Add support for `multibanco_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `twint_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `twint` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resource `stripe.PaymentMethod` + * Add support for `multibanco` on parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, resource classes `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, `stripe.Refund.DestinationDetails`, and `stripe.checkout.Session.PaymentMethodOptions`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` + * Add support for `multibanco_display_details` on resource class `stripe.PaymentIntent.NextAction` + * Add support for `invoice_settings` on resource `stripe.Subscription` + * Add support for `de_stn` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `multibanco` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `twint` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + ## 9.10.0 - 2024-06-06 * [#1340](https://github.com/stripe/stripe-python/pull/1340) Update generated code * Add support for `gb_bank_transfer_payments`, `jp_bank_transfer_payments`, `mx_bank_transfer_payments`, `sepa_bank_transfer_payments`, `us_bank_transfer_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` diff --git a/VERSION b/VERSION index 68478a595..ea5a45992 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.10.0 +9.11.0 diff --git a/stripe/_version.py b/stripe/_version.py index 179ca72b5..76fd4299e 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.10.0" +VERSION = "9.11.0" From 0eb15d695d48df48dda2e2b733d78c128cd33fef Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 09:08:38 -0700 Subject: [PATCH 076/179] Update generated code (#1348) * Update generated code for v1078 * Update generated code for v1079 * Update generated code for v1081 * Update generated code for v1082 * Update generated code for v1083 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 2 +- stripe/_account_capability_service.py | 2 +- stripe/_payment_link.py | 16 +++++++++++++++- stripe/_payment_link_service.py | 15 ++++++++++++++- stripe/tax/_calculation.py | 16 ++++++++-------- stripe/tax/_calculation_line_item_service.py | 4 ++-- stripe/terminal/_connection_token.py | 4 ++-- stripe/terminal/_connection_token_service.py | 2 +- 9 files changed, 45 insertions(+), 18 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ebd06a813..eeeff1529 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1077 \ No newline at end of file +v1083 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 1479bcee4..69b146b5f 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -3327,7 +3327,7 @@ class ModifyCapabilityParams(RequestOptions): """ To request a new capability for an account, pass true. There can be a delay before the requested capability becomes active. If the capability has any activation requirements, the response includes them in the `requirements` arrays. - If a capability isn't permanent, you can remove it from the account by passing false. Most capabilities are permanent after they've been requested. Attempting to remove a permanent capability returns an error. + If a capability isn't permanent, you can remove it from the account by passing false. Some capabilities are permanent after they've been requested. Attempting to remove a permanent capability returns an error. """ class ModifyExternalAccountParams(RequestOptions): diff --git a/stripe/_account_capability_service.py b/stripe/_account_capability_service.py index c2deeefe8..184b97c10 100644 --- a/stripe/_account_capability_service.py +++ b/stripe/_account_capability_service.py @@ -31,7 +31,7 @@ class UpdateParams(TypedDict): """ To request a new capability for an account, pass true. There can be a delay before the requested capability becomes active. If the capability has any activation requirements, the response includes them in the `requirements` arrays. - If a capability isn't permanent, you can remove it from the account by passing false. Most capabilities are permanent after they've been requested. Attempting to remove a permanent capability returns an error. + If a capability isn't permanent, you can remove it from the account by passing false. Some capabilities are permanent after they've been requested. Attempting to remove a permanent capability returns an error. """ def list( diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 31ba7f183..0dea20568 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -789,6 +789,7 @@ class CreateParams(RequestOptions): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -1667,7 +1668,7 @@ class ModifyParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ 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). @@ -1690,6 +1691,12 @@ class ModifyParams(RequestOptions): """ When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. """ + tax_id_collection: NotRequired[ + "PaymentLink.ModifyParamsTaxIdCollection" + ] + """ + Controls tax ID collection during checkout. + """ class ModifyParamsAfterCompletion(TypedDict): hosted_confirmation: NotRequired[ @@ -2306,6 +2313,12 @@ class ModifyParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ + class ModifyParamsTaxIdCollection(TypedDict): + enabled: bool + """ + Set to `true` to enable tax ID collection. + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -2416,6 +2429,7 @@ class RetrieveParams(RequestOptions): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 553136978..771f8b27f 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -131,6 +131,7 @@ class CreateParams(TypedDict): "klarna", "konbini", "link", + "mobilepay", "oxxo", "p24", "paynow", @@ -1011,7 +1012,7 @@ class UpdateParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ 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). @@ -1034,6 +1035,12 @@ class UpdateParams(TypedDict): """ When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. """ + tax_id_collection: NotRequired[ + "PaymentLinkService.UpdateParamsTaxIdCollection" + ] + """ + Controls tax ID collection during checkout. + """ class UpdateParamsAfterCompletion(TypedDict): hosted_confirmation: NotRequired[ @@ -1656,6 +1663,12 @@ class UpdateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ + class UpdateParamsTaxIdCollection(TypedDict): + enabled: bool + """ + Set to `true` to enable tax ID collection. + """ + def list( self, params: "PaymentLinkService.ListParams" = {}, diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index eabc373a4..0d4ad60a2 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -745,7 +745,7 @@ def _cls_list_line_items( **params: Unpack["Calculation.ListLineItemsParams"], ) -> ListObject["CalculationLineItem"]: """ - Retrieves the line items of a persisted tax calculation as a collection. + Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ return cast( ListObject["CalculationLineItem"], @@ -764,7 +764,7 @@ def list_line_items( calculation: str, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ - Retrieves the line items of a persisted tax calculation as a collection. + Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ ... @@ -773,7 +773,7 @@ def list_line_items( self, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ - Retrieves the line items of a persisted tax calculation as a collection. + Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ ... @@ -782,7 +782,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ - Retrieves the line items of a persisted tax calculation as a collection. + Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ return cast( ListObject["CalculationLineItem"], @@ -802,7 +802,7 @@ async def _cls_list_line_items_async( **params: Unpack["Calculation.ListLineItemsParams"], ) -> ListObject["CalculationLineItem"]: """ - Retrieves the line items of a persisted tax calculation as a collection. + Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ return cast( ListObject["CalculationLineItem"], @@ -821,7 +821,7 @@ async def list_line_items_async( calculation: str, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ - Retrieves the line items of a persisted tax calculation as a collection. + Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ ... @@ -830,7 +830,7 @@ async def list_line_items_async( self, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ - Retrieves the line items of a persisted tax calculation as a collection. + Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ ... @@ -839,7 +839,7 @@ async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ - Retrieves the line items of a persisted tax calculation as a collection. + Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ return cast( ListObject["CalculationLineItem"], diff --git a/stripe/tax/_calculation_line_item_service.py b/stripe/tax/_calculation_line_item_service.py index 1061d0ed2..08651f8eb 100644 --- a/stripe/tax/_calculation_line_item_service.py +++ b/stripe/tax/_calculation_line_item_service.py @@ -35,7 +35,7 @@ def list( options: RequestOptions = {}, ) -> ListObject[CalculationLineItem]: """ - Retrieves the line items of a persisted tax calculation as a collection. + Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ return cast( ListObject[CalculationLineItem], @@ -58,7 +58,7 @@ async def list_async( options: RequestOptions = {}, ) -> ListObject[CalculationLineItem]: """ - Retrieves the line items of a persisted tax calculation as a collection. + Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ return cast( ListObject[CalculationLineItem], diff --git a/stripe/terminal/_connection_token.py b/stripe/terminal/_connection_token.py index a454b68dc..4500eefe1 100644 --- a/stripe/terminal/_connection_token.py +++ b/stripe/terminal/_connection_token.py @@ -24,12 +24,12 @@ class CreateParams(RequestOptions): """ location: NotRequired[str] """ - The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). + The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens). """ location: Optional[str] """ - The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). + The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens). """ object: Literal["terminal.connection_token"] """ diff --git a/stripe/terminal/_connection_token_service.py b/stripe/terminal/_connection_token_service.py index 12861c259..536ca8795 100644 --- a/stripe/terminal/_connection_token_service.py +++ b/stripe/terminal/_connection_token_service.py @@ -15,7 +15,7 @@ class CreateParams(TypedDict): """ location: NotRequired[str] """ - The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). + The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens). """ def create( From 14d7dde56c87e4e470babd1d8418df819a8bb8b7 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Mon, 17 Jun 2024 09:14:19 -0700 Subject: [PATCH 077/179] Bump version to 9.12.0 --- CHANGELOG.md | 5 +++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bda803c47..97236deb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 9.12.0 - 2024-06-17 +* [#1348](https://github.com/stripe/stripe-python/pull/1348) Update generated code + * Add support for `tax_id_collection` on parameter class `stripe.PaymentLink.ModifyParams` + * Add support for `mobilepay` on enums `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, and `stripe.PaymentLink.ModifyParams.payment_method_types` + ## 9.11.0 - 2024-06-13 * [#1342](https://github.com/stripe/stripe-python/pull/1342) Update generated code * Add support for `multibanco_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` diff --git a/VERSION b/VERSION index ea5a45992..2f0dbe6f6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.11.0 +9.12.0 diff --git a/stripe/_version.py b/stripe/_version.py index 76fd4299e..2d5dd2775 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.11.0" +VERSION = "9.12.0" From 60778a925dea0d11bdc5b559041dd69e97c8eb1b Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:59:11 -0700 Subject: [PATCH 078/179] Update generated code (#1350) * Update generated code for v1084 * Update generated code for v1087 * Update generated code for v1088 * Update generated code for v1092 * Update generated code for v1093 * Update generated code for v1094 * Update generated code for v1095 * Update generated code for v1095 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/__init__.py | 1 - stripe/_api_version.py | 2 +- stripe/_balance_transaction.py | 2 - stripe/_capability.py | 36 +- stripe/_customer.py | 6 +- stripe/_customer_service.py | 3 +- stripe/_customer_tax_id_service.py | 3 +- stripe/_invoice.py | 12 +- stripe/_invoice_service.py | 6 +- stripe/_invoice_upcoming_lines_service.py | 3 +- stripe/_object_classes.py | 1 - stripe/_payment_link.py | 4 +- stripe/_payment_link_service.py | 4 +- stripe/_platform_tax_fee.py | 29 - stripe/_tax_id.py | 6 +- stripe/_tax_id_service.py | 3 +- stripe/_webhook_endpoint.py | 1 + stripe/_webhook_endpoint_service.py | 1 + stripe/api_resources/__init__.py | 1 - stripe/api_resources/platform_tax_fee.py | 21 - stripe/checkout/_session.py | 7 +- stripe/checkout/_session_service.py | 4 +- stripe/issuing/_authorization.py | 688 +++++++++++++++++- stripe/issuing/_transaction.py | 378 +++++++++- stripe/tax/_calculation.py | 10 +- stripe/tax/_calculation_service.py | 7 +- stripe/tax/_transaction.py | 3 +- .../issuing/_authorization_service.py | 469 +++++++++++- .../issuing/_transaction_service.py | 274 ++++++- tests/test_generated_examples.py | 48 +- 31 files changed, 1875 insertions(+), 160 deletions(-) delete mode 100644 stripe/_platform_tax_fee.py delete mode 100644 stripe/api_resources/platform_tax_fee.py diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index eeeff1529..eb43ae0c9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1083 \ No newline at end of file +v1095 \ No newline at end of file diff --git a/stripe/__init__.py b/stripe/__init__.py index 10b4feefc..e8d3e8578 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -423,7 +423,6 @@ def __getattr__(name): from stripe._person import Person as Person from stripe._plan import Plan as Plan from stripe._plan_service import PlanService as PlanService -from stripe._platform_tax_fee import PlatformTaxFee as PlatformTaxFee from stripe._price import Price as Price from stripe._price_service import PriceService as PriceService from stripe._product import Product as Product diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 000e03f4a..3e3f977ff 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 = "2024-04-10" + CURRENT = "2024-06-20" diff --git a/stripe/_balance_transaction.py b/stripe/_balance_transaction.py index 16ade6d2c..efc7ab96e 100644 --- a/stripe/_balance_transaction.py +++ b/stripe/_balance_transaction.py @@ -24,7 +24,6 @@ ) from stripe._dispute import Dispute as DisputeResource from stripe._payout import Payout - from stripe._platform_tax_fee import PlatformTaxFee from stripe._refund import Refund from stripe._reserve_transaction import ReserveTransaction from stripe._reversal import Reversal @@ -193,7 +192,6 @@ class RetrieveParams(RequestOptions): "IssuingDisputeResource", "Transaction", "Payout", - "PlatformTaxFee", "Refund", "ReserveTransaction", "TaxDeductedAtSource", diff --git a/stripe/_capability.py b/stripe/_capability.py index 53ca37edd..3c8670d29 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -145,7 +145,20 @@ class Error(StripeObject): """ Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. """ - disabled_reason: Optional[str] + disabled_reason: Optional[ + Literal[ + "other", + "paused.inactivity", + "pending.onboarding", + "pending.review", + "platform_disabled", + "platform_paused", + "rejected.inactivity", + "rejected.other", + "rejected.unsupported_business", + "requirements.fields_needed", + ] + ] """ This is typed as a string for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is empty because fields in `future_requirements` will never disable the account. """ @@ -294,13 +307,22 @@ class Error(StripeObject): """ Fields that need to be collected to keep the capability enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the capability is disabled. """ - disabled_reason: Optional[str] + disabled_reason: Optional[ + Literal[ + "other", + "paused.inactivity", + "pending.onboarding", + "pending.review", + "platform_disabled", + "platform_paused", + "rejected.inactivity", + "rejected.other", + "rejected.unsupported_business", + "requirements.fields_needed", + ] + ] """ - If the capability is disabled, this string describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). Can be `requirements.fields_needed`, `pending.onboarding`, `pending.review`, `rejected.other`, `platform_paused`, `rejected.inactivty`, or `rejected.unsupported_business`. - - `rejected.unsupported_business` means that the account's business is not supported by the capability. For example, payment methods may restrict the businesses they support in their terms of service, such as in [Afterpay Clearpay's terms of service](https://stripe.com/afterpay-clearpay/legal#restricted-businesses). - - `rejected.inactivity` means that the capability has been paused for inactivity. This disabled reason currently only applies to the Issuing capability. See [Issuing: Managing Inactive Connects](https://support.stripe.com/questions/issuing-managing-inactive-connect-accounts) for more details. + Description of why the capability is disabled. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). """ errors: List[Error] """ diff --git a/stripe/_customer.py b/stripe/_customer.py index c6500dff1..28d8ff286 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -521,6 +521,7 @@ class CreateParamsTaxIdDatum(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -579,7 +580,7 @@ class CreateParamsTaxIdDatum(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -623,6 +624,7 @@ class CreateTaxIdParams(RequestOptions): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -681,7 +683,7 @@ class CreateTaxIdParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 1fbe88d8e..a3456afc3 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -286,6 +286,7 @@ class CreateParamsTaxIdDatum(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -344,7 +345,7 @@ class CreateParamsTaxIdDatum(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index 7fd502ea6..ed126cdbf 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -32,6 +32,7 @@ class CreateParams(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -90,7 +91,7 @@ class CreateParams(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index fceb346bb..609963f3e 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -224,6 +224,7 @@ class CustomerTaxId(StripeObject): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -283,7 +284,7 @@ class CustomerTaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` """ value: Optional[str] """ @@ -1812,6 +1813,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -1870,7 +1872,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -3608,6 +3610,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -3666,7 +3669,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -4741,6 +4744,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -4799,7 +4803,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 2d1b54e33..41ce4c565 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -847,6 +847,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -905,7 +906,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -2040,6 +2041,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -2098,7 +2100,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index 916bcf090..a8b353801 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -293,6 +293,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -351,7 +352,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 5ae5ac434..62daa5bf0 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -83,7 +83,6 @@ stripe.Payout.OBJECT_NAME: stripe.Payout, stripe.Person.OBJECT_NAME: stripe.Person, stripe.Plan.OBJECT_NAME: stripe.Plan, - stripe.PlatformTaxFee.OBJECT_NAME: stripe.PlatformTaxFee, stripe.Price.OBJECT_NAME: stripe.Price, stripe.Product.OBJECT_NAME: stripe.Product, stripe.ProductFeature.OBJECT_NAME: stripe.ProductFeature, diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 0dea20568..2e83eeadb 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -1536,7 +1536,7 @@ class CreateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): class CreateParamsTaxIdCollection(TypedDict): enabled: bool """ - Set to `true` to enable tax ID collection. + Enable tax ID collection during checkout. Defaults to `false`. """ class CreateParamsTransferData(TypedDict): @@ -2316,7 +2316,7 @@ class ModifyParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): class ModifyParamsTaxIdCollection(TypedDict): enabled: bool """ - Set to `true` to enable tax ID collection. + Enable tax ID collection during checkout. Defaults to `false`. """ class RetrieveParams(RequestOptions): diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 771f8b27f..f9a83c5be 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -888,7 +888,7 @@ class CreateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): class CreateParamsTaxIdCollection(TypedDict): enabled: bool """ - Set to `true` to enable tax ID collection. + Enable tax ID collection during checkout. Defaults to `false`. """ class CreateParamsTransferData(TypedDict): @@ -1666,7 +1666,7 @@ class UpdateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): class UpdateParamsTaxIdCollection(TypedDict): enabled: bool """ - Set to `true` to enable tax ID collection. + Enable tax ID collection during checkout. Defaults to `false`. """ def list( diff --git a/stripe/_platform_tax_fee.py b/stripe/_platform_tax_fee.py deleted file mode 100644 index 9939d0324..000000000 --- a/stripe/_platform_tax_fee.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe._stripe_object import StripeObject -from typing import ClassVar -from typing_extensions import Literal - - -class PlatformTaxFee(StripeObject): - OBJECT_NAME: ClassVar[Literal["platform_tax_fee"]] = "platform_tax_fee" - account: str - """ - The Connected account that incurred this charge. - """ - id: str - """ - Unique identifier for the object. - """ - object: Literal["platform_tax_fee"] - """ - String representing the object's type. Objects of the same type share the same value. - """ - source_transaction: str - """ - The payment object that caused this tax to be inflicted. - """ - type: str - """ - The type of tax (VAT). - """ diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index 16972e008..436e6ade3 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -95,6 +95,7 @@ class CreateParams(RequestOptions): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -153,7 +154,7 @@ class CreateParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -264,6 +265,7 @@ class RetrieveParams(RequestOptions): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -323,7 +325,7 @@ class RetrieveParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` """ value: str """ diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py index 0ac3eac42..aa6e28c27 100644 --- a/stripe/_tax_id_service.py +++ b/stripe/_tax_id_service.py @@ -36,6 +36,7 @@ class CreateParams(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -94,7 +95,7 @@ class CreateParams(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 4b32c05f8..a8d934cb8 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -133,6 +133,7 @@ class CreateParams(RequestOptions): "2023-08-16", "2023-10-16", "2024-04-10", + "2024-06-20", ] ] """ diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 2a97e832c..7b3c2c745 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -114,6 +114,7 @@ class CreateParams(TypedDict): "2023-08-16", "2023-10-16", "2024-04-10", + "2024-06-20", ] ] """ diff --git a/stripe/api_resources/__init__.py b/stripe/api_resources/__init__.py index 46233b160..73e6b55f7 100644 --- a/stripe/api_resources/__init__.py +++ b/stripe/api_resources/__init__.py @@ -92,7 +92,6 @@ from stripe.api_resources.payout import Payout from stripe.api_resources.person import Person from stripe.api_resources.plan import Plan - from stripe.api_resources.platform_tax_fee import PlatformTaxFee from stripe.api_resources.price import Price from stripe.api_resources.product import Product from stripe.api_resources.product_feature import ProductFeature diff --git a/stripe/api_resources/platform_tax_fee.py b/stripe/api_resources/platform_tax_fee.py deleted file mode 100644 index d184bf42d..000000000 --- a/stripe/api_resources/platform_tax_fee.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from typing_extensions import TYPE_CHECKING -from warnings import warn - -warn( - """ - The stripe.api_resources.platform_tax_fee package is deprecated, please change your - imports to import from stripe directly. - From: - from stripe.api_resources.platform_tax_fee import PlatformTaxFee - To: - from stripe import PlatformTaxFee - """, - DeprecationWarning, - stacklevel=2, -) -if not TYPE_CHECKING: - from stripe._platform_tax_fee import ( # noqa - PlatformTaxFee, - ) diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 6122ec416..7b1f3ed88 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -351,6 +351,7 @@ class TaxId(StripeObject): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -410,7 +411,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` """ value: Optional[str] """ @@ -1861,7 +1862,7 @@ class CreateParams(RequestOptions): """ tax_id_collection: NotRequired["Session.CreateParamsTaxIdCollection"] """ - Controls tax ID collection settings for the session. + Controls tax ID collection during checkout. """ ui_mode: NotRequired[Literal["embedded", "hosted"]] """ @@ -3653,7 +3654,7 @@ class CreateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): class CreateParamsTaxIdCollection(TypedDict): enabled: bool """ - Set to true to enable Tax ID collection. + Enable tax ID collection during checkout. Defaults to `false`. """ class ExpireParams(RequestOptions): diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index a64338c94..a2b09b0eb 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -344,7 +344,7 @@ class CreateParams(TypedDict): "SessionService.CreateParamsTaxIdCollection" ] """ - Controls tax ID collection settings for the session. + Controls tax ID collection during checkout. """ ui_mode: NotRequired[Literal["embedded", "hosted"]] """ @@ -2174,7 +2174,7 @@ class CreateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): class CreateParamsTaxIdCollection(TypedDict): enabled: bool """ - Set to true to enable Tax ID collection. + Enable tax ID collection during checkout. Defaults to `false`. """ class ExpireParams(TypedDict): diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index 1ad54228d..2fa24ec97 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -52,6 +52,144 @@ class AmountDetails(StripeObject): The amount of cash requested by the cardholder. """ + class Fleet(StripeObject): + class CardholderPromptData(StripeObject): + alphanumeric_id: Optional[str] + """ + [Deprecated] An alphanumeric ID, though typical point of sales only support numeric entry. The card program can be configured to prompt for a vehicle ID, driver ID, or generic ID. + """ + driver_id: Optional[str] + """ + Driver ID. + """ + odometer: Optional[int] + """ + Odometer reading. + """ + unspecified_id: Optional[str] + """ + An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + """ + user_id: Optional[str] + """ + User ID. + """ + vehicle_number: Optional[str] + """ + Vehicle number. + """ + + class ReportedBreakdown(StripeObject): + class Fuel(StripeObject): + gross_amount_decimal: Optional[str] + """ + Gross fuel amount that should equal Fuel Quantity multiplied by Fuel Unit Cost, inclusive of taxes. + """ + + class NonFuel(StripeObject): + gross_amount_decimal: Optional[str] + """ + Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + """ + + class Tax(StripeObject): + local_amount_decimal: Optional[str] + """ + Amount of state or provincial Sales Tax included in the transaction amount. `null` if not reported by merchant or not subject to tax. + """ + national_amount_decimal: Optional[str] + """ + Amount of national Sales Tax or VAT included in the transaction amount. `null` if not reported by merchant or not subject to tax. + """ + + fuel: Optional[Fuel] + """ + Breakdown of fuel portion of the purchase. + """ + non_fuel: Optional[NonFuel] + """ + Breakdown of non-fuel portion of the purchase. + """ + tax: Optional[Tax] + """ + Information about tax included in this transaction. + """ + _inner_class_types = { + "fuel": Fuel, + "non_fuel": NonFuel, + "tax": Tax, + } + + cardholder_prompt_data: Optional[CardholderPromptData] + """ + Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + """ + purchase_type: Optional[ + Literal[ + "fuel_and_non_fuel_purchase", + "fuel_purchase", + "non_fuel_purchase", + ] + ] + """ + The type of purchase. + """ + reported_breakdown: Optional[ReportedBreakdown] + """ + More information about the total amount. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + """ + service_type: Optional[ + Literal["full_service", "non_fuel_transaction", "self_service"] + ] + """ + The type of fuel service. + """ + _inner_class_types = { + "cardholder_prompt_data": CardholderPromptData, + "reported_breakdown": ReportedBreakdown, + } + + class Fuel(StripeObject): + industry_product_code: Optional[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: Optional[str] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ + type: Optional[ + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ] + ] + """ + The type of fuel that was purchased. + """ + unit: Optional[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ] + ] + """ + The units for `quantity_decimal`. + """ + unit_cost_decimal: Optional[str] + """ + The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + """ + class MerchantData(StripeObject): category: str """ @@ -199,11 +337,16 @@ class AmountDetails(StripeObject): reason: Literal[ "account_disabled", "card_active", + "card_canceled", + "card_expired", "card_inactive", + "cardholder_blocked", "cardholder_inactive", "cardholder_verification_required", + "insecure_authorization_method", "insufficient_funds", "not_allowed", + "pin_blocked", "spending_controls", "suspected_fraud", "verification_failed", @@ -328,6 +471,10 @@ class CaptureParams(RequestOptions): """ class CaptureParamsPurchaseDetails(TypedDict): + fleet: NotRequired["Authorization.CaptureParamsPurchaseDetailsFleet"] + """ + Fleet-specific information for transactions using Fleet cards. + """ flight: NotRequired["Authorization.CaptureParamsPurchaseDetailsFlight"] """ Information about the flight that was purchased with this transaction. @@ -353,6 +500,100 @@ class CaptureParamsPurchaseDetails(TypedDict): A merchant-specific order number. """ + class CaptureParamsPurchaseDetailsFleet(TypedDict): + cardholder_prompt_data: NotRequired[ + "Authorization.CaptureParamsPurchaseDetailsFleetCardholderPromptData" + ] + """ + Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + """ + purchase_type: NotRequired[ + Literal[ + "fuel_and_non_fuel_purchase", + "fuel_purchase", + "non_fuel_purchase", + ] + ] + """ + The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + """ + reported_breakdown: NotRequired[ + "Authorization.CaptureParamsPurchaseDetailsFleetReportedBreakdown" + ] + """ + More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + """ + service_type: NotRequired[ + Literal["full_service", "non_fuel_transaction", "self_service"] + ] + """ + The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + """ + + class CaptureParamsPurchaseDetailsFleetCardholderPromptData(TypedDict): + driver_id: NotRequired[str] + """ + Driver ID. + """ + odometer: NotRequired[int] + """ + Odometer reading. + """ + unspecified_id: NotRequired[str] + """ + An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + """ + user_id: NotRequired[str] + """ + User ID. + """ + vehicle_number: NotRequired[str] + """ + Vehicle number. + """ + + class CaptureParamsPurchaseDetailsFleetReportedBreakdown(TypedDict): + fuel: NotRequired[ + "Authorization.CaptureParamsPurchaseDetailsFleetReportedBreakdownFuel" + ] + """ + Breakdown of fuel portion of the purchase. + """ + non_fuel: NotRequired[ + "Authorization.CaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel" + ] + """ + Breakdown of non-fuel portion of the purchase. + """ + tax: NotRequired[ + "Authorization.CaptureParamsPurchaseDetailsFleetReportedBreakdownTax" + ] + """ + Information about tax included in this transaction. + """ + + class CaptureParamsPurchaseDetailsFleetReportedBreakdownFuel(TypedDict): + gross_amount_decimal: NotRequired[str] + """ + Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + """ + + class CaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel(TypedDict): + gross_amount_decimal: NotRequired[str] + """ + Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + """ + + class CaptureParamsPurchaseDetailsFleetReportedBreakdownTax(TypedDict): + local_amount_decimal: NotRequired[str] + """ + Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + national_amount_decimal: NotRequired[str] + """ + Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + class CaptureParamsPurchaseDetailsFlight(TypedDict): departure_at: NotRequired[int] """ @@ -404,6 +645,14 @@ class CaptureParamsPurchaseDetailsFlightSegment(TypedDict): """ class CaptureParamsPurchaseDetailsFuel(TypedDict): + industry_product_code: NotRequired[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: NotRequired[str] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ type: NotRequired[ Literal[ "diesel", @@ -416,18 +665,25 @@ class CaptureParamsPurchaseDetailsFuel(TypedDict): """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired[Literal["liter", "other", "us_gallon"]] + unit: NotRequired[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ] + ] """ - The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. + The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: NotRequired[str] - """ - The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. - """ class CaptureParamsPurchaseDetailsLodging(TypedDict): check_in_at: NotRequired[int] @@ -472,6 +728,14 @@ class CreateParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + fleet: NotRequired["Authorization.CreateParamsFleet"] + """ + Fleet-specific information for authorizations using Fleet cards. + """ + fuel: NotRequired["Authorization.CreateParamsFuel"] + """ + Information about fuel that was purchased with this transaction. + """ is_amount_controllable: NotRequired[bool] """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. @@ -505,6 +769,139 @@ class CreateParamsAmountDetails(TypedDict): The amount of cash requested by the cardholder. """ + class CreateParamsFleet(TypedDict): + cardholder_prompt_data: NotRequired[ + "Authorization.CreateParamsFleetCardholderPromptData" + ] + """ + Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + """ + purchase_type: NotRequired[ + Literal[ + "fuel_and_non_fuel_purchase", + "fuel_purchase", + "non_fuel_purchase", + ] + ] + """ + The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + """ + reported_breakdown: NotRequired[ + "Authorization.CreateParamsFleetReportedBreakdown" + ] + """ + More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + """ + service_type: NotRequired[ + Literal["full_service", "non_fuel_transaction", "self_service"] + ] + """ + The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + """ + + class CreateParamsFleetCardholderPromptData(TypedDict): + driver_id: NotRequired[str] + """ + Driver ID. + """ + odometer: NotRequired[int] + """ + Odometer reading. + """ + unspecified_id: NotRequired[str] + """ + An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + """ + user_id: NotRequired[str] + """ + User ID. + """ + vehicle_number: NotRequired[str] + """ + Vehicle number. + """ + + class CreateParamsFleetReportedBreakdown(TypedDict): + fuel: NotRequired[ + "Authorization.CreateParamsFleetReportedBreakdownFuel" + ] + """ + Breakdown of fuel portion of the purchase. + """ + non_fuel: NotRequired[ + "Authorization.CreateParamsFleetReportedBreakdownNonFuel" + ] + """ + Breakdown of non-fuel portion of the purchase. + """ + tax: NotRequired["Authorization.CreateParamsFleetReportedBreakdownTax"] + """ + Information about tax included in this transaction. + """ + + class CreateParamsFleetReportedBreakdownFuel(TypedDict): + gross_amount_decimal: NotRequired[str] + """ + Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + """ + + class CreateParamsFleetReportedBreakdownNonFuel(TypedDict): + gross_amount_decimal: NotRequired[str] + """ + Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + """ + + class CreateParamsFleetReportedBreakdownTax(TypedDict): + local_amount_decimal: NotRequired[str] + """ + Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + national_amount_decimal: NotRequired[str] + """ + Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + + class CreateParamsFuel(TypedDict): + industry_product_code: NotRequired[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: NotRequired[str] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ + type: NotRequired[ + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ] + ] + """ + The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + """ + unit: NotRequired[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ] + ] + """ + The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. + """ + unit_cost_decimal: NotRequired[str] + """ + The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + """ + class CreateParamsMerchantData(TypedDict): category: NotRequired[ Literal[ @@ -916,6 +1313,159 @@ class ExpireParams(RequestOptions): Specifies which fields in the response should be expanded. """ + class FinalizeAmountParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + final_amount: int + """ + The final authorization amount that will be captured by the merchant. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + fleet: NotRequired["Authorization.FinalizeAmountParamsFleet"] + """ + Fleet-specific information for authorizations using Fleet cards. + """ + fuel: NotRequired["Authorization.FinalizeAmountParamsFuel"] + """ + Information about fuel that was purchased with this transaction. + """ + + class FinalizeAmountParamsFleet(TypedDict): + cardholder_prompt_data: NotRequired[ + "Authorization.FinalizeAmountParamsFleetCardholderPromptData" + ] + """ + Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + """ + purchase_type: NotRequired[ + Literal[ + "fuel_and_non_fuel_purchase", + "fuel_purchase", + "non_fuel_purchase", + ] + ] + """ + The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + """ + reported_breakdown: NotRequired[ + "Authorization.FinalizeAmountParamsFleetReportedBreakdown" + ] + """ + More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + """ + service_type: NotRequired[ + Literal["full_service", "non_fuel_transaction", "self_service"] + ] + """ + The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + """ + + class FinalizeAmountParamsFleetCardholderPromptData(TypedDict): + driver_id: NotRequired[str] + """ + Driver ID. + """ + odometer: NotRequired[int] + """ + Odometer reading. + """ + unspecified_id: NotRequired[str] + """ + An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + """ + user_id: NotRequired[str] + """ + User ID. + """ + vehicle_number: NotRequired[str] + """ + Vehicle number. + """ + + class FinalizeAmountParamsFleetReportedBreakdown(TypedDict): + fuel: NotRequired[ + "Authorization.FinalizeAmountParamsFleetReportedBreakdownFuel" + ] + """ + Breakdown of fuel portion of the purchase. + """ + non_fuel: NotRequired[ + "Authorization.FinalizeAmountParamsFleetReportedBreakdownNonFuel" + ] + """ + Breakdown of non-fuel portion of the purchase. + """ + tax: NotRequired[ + "Authorization.FinalizeAmountParamsFleetReportedBreakdownTax" + ] + """ + Information about tax included in this transaction. + """ + + class FinalizeAmountParamsFleetReportedBreakdownFuel(TypedDict): + gross_amount_decimal: NotRequired[str] + """ + Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + """ + + class FinalizeAmountParamsFleetReportedBreakdownNonFuel(TypedDict): + gross_amount_decimal: NotRequired[str] + """ + Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + """ + + class FinalizeAmountParamsFleetReportedBreakdownTax(TypedDict): + local_amount_decimal: NotRequired[str] + """ + Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + national_amount_decimal: NotRequired[str] + """ + Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + + class FinalizeAmountParamsFuel(TypedDict): + industry_product_code: NotRequired[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: NotRequired[str] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ + type: NotRequired[ + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ] + ] + """ + The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + """ + unit: NotRequired[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ] + ] + """ + The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. + """ + unit_cost_decimal: NotRequired[str] + """ + The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + """ + class IncrementParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -1046,6 +1596,14 @@ class ReverseParams(RequestOptions): """ The currency of the cardholder. This currency can be different from the currency presented at authorization and the `merchant_currency` field on this authorization. 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). """ + fleet: Optional[Fleet] + """ + Fleet-specific information for authorizations using Fleet cards. + """ + fuel: Optional[Fuel] + """ + Information about fuel that was purchased with this transaction. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. + """ id: str """ Unique identifier for the object. @@ -1708,6 +2266,122 @@ async def expire_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def _cls_finalize_amount( + cls, + authorization: str, + **params: Unpack["Authorization.FinalizeAmountParams"], + ) -> "Authorization": + """ + Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. + """ + return cast( + "Authorization", + cls._static_request( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( + authorization=sanitize_id(authorization) + ), + params=params, + ), + ) + + @overload + @staticmethod + def finalize_amount( + authorization: str, + **params: Unpack["Authorization.FinalizeAmountParams"], + ) -> "Authorization": + """ + Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. + """ + ... + + @overload + def finalize_amount( + self, **params: Unpack["Authorization.FinalizeAmountParams"] + ) -> "Authorization": + """ + Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. + """ + ... + + @class_method_variant("_cls_finalize_amount") + def finalize_amount( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Authorization.FinalizeAmountParams"] + ) -> "Authorization": + """ + Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. + """ + return cast( + "Authorization", + self.resource._request( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( + authorization=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_finalize_amount_async( + cls, + authorization: str, + **params: Unpack["Authorization.FinalizeAmountParams"], + ) -> "Authorization": + """ + Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. + """ + return cast( + "Authorization", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( + authorization=sanitize_id(authorization) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def finalize_amount_async( + authorization: str, + **params: Unpack["Authorization.FinalizeAmountParams"], + ) -> "Authorization": + """ + Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. + """ + ... + + @overload + async def finalize_amount_async( + self, **params: Unpack["Authorization.FinalizeAmountParams"] + ) -> "Authorization": + """ + Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. + """ + ... + + @class_method_variant("_cls_finalize_amount_async") + async def finalize_amount_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Authorization.FinalizeAmountParams"] + ) -> "Authorization": + """ + Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. + """ + return cast( + "Authorization", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( + authorization=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_increment( cls, @@ -1944,6 +2618,8 @@ def test_helpers(self): _inner_class_types = { "amount_details": AmountDetails, + "fleet": Fleet, + "fuel": Fuel, "merchant_data": MerchantData, "network_data": NetworkData, "pending_request": PendingRequest, diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index c61ce560c..dbfde9e50 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -110,6 +110,91 @@ class NetworkData(StripeObject): """ class PurchaseDetails(StripeObject): + class Fleet(StripeObject): + class CardholderPromptData(StripeObject): + driver_id: Optional[str] + """ + Driver ID. + """ + odometer: Optional[int] + """ + Odometer reading. + """ + unspecified_id: Optional[str] + """ + An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + """ + user_id: Optional[str] + """ + User ID. + """ + vehicle_number: Optional[str] + """ + Vehicle number. + """ + + class ReportedBreakdown(StripeObject): + class Fuel(StripeObject): + gross_amount_decimal: Optional[str] + """ + Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + """ + + class NonFuel(StripeObject): + gross_amount_decimal: Optional[str] + """ + Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + """ + + class Tax(StripeObject): + local_amount_decimal: Optional[str] + """ + Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + national_amount_decimal: Optional[str] + """ + Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + + fuel: Optional[Fuel] + """ + Breakdown of fuel portion of the purchase. + """ + non_fuel: Optional[NonFuel] + """ + Breakdown of non-fuel portion of the purchase. + """ + tax: Optional[Tax] + """ + Information about tax included in this transaction. + """ + _inner_class_types = { + "fuel": Fuel, + "non_fuel": NonFuel, + "tax": Tax, + } + + cardholder_prompt_data: Optional[CardholderPromptData] + """ + Answers to prompts presented to cardholder at point of sale. + """ + purchase_type: Optional[str] + """ + The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + """ + reported_breakdown: Optional[ReportedBreakdown] + """ + More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + """ + service_type: Optional[str] + """ + The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + """ + _inner_class_types = { + "cardholder_prompt_data": CardholderPromptData, + "reported_breakdown": ReportedBreakdown, + } + class Flight(StripeObject): class Segment(StripeObject): arrival_airport_code: Optional[str] @@ -160,22 +245,26 @@ class Segment(StripeObject): _inner_class_types = {"segments": Segment} class Fuel(StripeObject): + industry_product_code: Optional[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: Optional[str] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ type: str """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ unit: str """ - The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. + The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: str """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: Optional[str] - """ - The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. - """ class Lodging(StripeObject): check_in_at: Optional[int] @@ -205,6 +294,10 @@ class Receipt(StripeObject): The unit cost of the item in cents. """ + fleet: Optional[Fleet] + """ + Fleet-specific information for transactions using Fleet cards. + """ flight: Optional[Flight] """ Information about the flight that was purchased with this transaction. @@ -226,6 +319,7 @@ class Receipt(StripeObject): A merchant-specific order number. """ _inner_class_types = { + "fleet": Fleet, "flight": Flight, "fuel": Fuel, "lodging": Lodging, @@ -608,6 +702,12 @@ class CreateForceCaptureParamsMerchantData(TypedDict): """ class CreateForceCaptureParamsPurchaseDetails(TypedDict): + fleet: NotRequired[ + "Transaction.CreateForceCaptureParamsPurchaseDetailsFleet" + ] + """ + Fleet-specific information for transactions using Fleet cards. + """ flight: NotRequired[ "Transaction.CreateForceCaptureParamsPurchaseDetailsFlight" ] @@ -637,6 +737,110 @@ class CreateForceCaptureParamsPurchaseDetails(TypedDict): A merchant-specific order number. """ + class CreateForceCaptureParamsPurchaseDetailsFleet(TypedDict): + cardholder_prompt_data: NotRequired[ + "Transaction.CreateForceCaptureParamsPurchaseDetailsFleetCardholderPromptData" + ] + """ + Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + """ + purchase_type: NotRequired[ + Literal[ + "fuel_and_non_fuel_purchase", + "fuel_purchase", + "non_fuel_purchase", + ] + ] + """ + The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + """ + reported_breakdown: NotRequired[ + "Transaction.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdown" + ] + """ + More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + """ + service_type: NotRequired[ + Literal["full_service", "non_fuel_transaction", "self_service"] + ] + """ + The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + """ + + class CreateForceCaptureParamsPurchaseDetailsFleetCardholderPromptData( + TypedDict, + ): + driver_id: NotRequired[str] + """ + Driver ID. + """ + odometer: NotRequired[int] + """ + Odometer reading. + """ + unspecified_id: NotRequired[str] + """ + An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + """ + user_id: NotRequired[str] + """ + User ID. + """ + vehicle_number: NotRequired[str] + """ + Vehicle number. + """ + + class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdown( + TypedDict, + ): + fuel: NotRequired[ + "Transaction.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel" + ] + """ + Breakdown of fuel portion of the purchase. + """ + non_fuel: NotRequired[ + "Transaction.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel" + ] + """ + Breakdown of non-fuel portion of the purchase. + """ + tax: NotRequired[ + "Transaction.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownTax" + ] + """ + Information about tax included in this transaction. + """ + + class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel( + TypedDict, + ): + gross_amount_decimal: NotRequired[str] + """ + Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + """ + + class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel( + TypedDict, + ): + gross_amount_decimal: NotRequired[str] + """ + Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + """ + + class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownTax( + TypedDict, + ): + local_amount_decimal: NotRequired[str] + """ + Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + national_amount_decimal: NotRequired[str] + """ + Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + class CreateForceCaptureParamsPurchaseDetailsFlight(TypedDict): departure_at: NotRequired[int] """ @@ -690,6 +894,14 @@ class CreateForceCaptureParamsPurchaseDetailsFlightSegment(TypedDict): """ class CreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): + industry_product_code: NotRequired[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: NotRequired[str] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ type: NotRequired[ Literal[ "diesel", @@ -702,18 +914,25 @@ class CreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired[Literal["liter", "other", "us_gallon"]] + unit: NotRequired[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ] + ] """ - The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. + The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: NotRequired[str] - """ - The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. - """ class CreateForceCaptureParamsPurchaseDetailsLodging(TypedDict): check_in_at: NotRequired[int] @@ -1097,6 +1316,12 @@ class CreateUnlinkedRefundParamsMerchantData(TypedDict): """ class CreateUnlinkedRefundParamsPurchaseDetails(TypedDict): + fleet: NotRequired[ + "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFleet" + ] + """ + Fleet-specific information for transactions using Fleet cards. + """ flight: NotRequired[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFlight" ] @@ -1128,6 +1353,110 @@ class CreateUnlinkedRefundParamsPurchaseDetails(TypedDict): A merchant-specific order number. """ + class CreateUnlinkedRefundParamsPurchaseDetailsFleet(TypedDict): + cardholder_prompt_data: NotRequired[ + "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFleetCardholderPromptData" + ] + """ + Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + """ + purchase_type: NotRequired[ + Literal[ + "fuel_and_non_fuel_purchase", + "fuel_purchase", + "non_fuel_purchase", + ] + ] + """ + The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + """ + reported_breakdown: NotRequired[ + "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown" + ] + """ + More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + """ + service_type: NotRequired[ + Literal["full_service", "non_fuel_transaction", "self_service"] + ] + """ + The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + """ + + class CreateUnlinkedRefundParamsPurchaseDetailsFleetCardholderPromptData( + TypedDict, + ): + driver_id: NotRequired[str] + """ + Driver ID. + """ + odometer: NotRequired[int] + """ + Odometer reading. + """ + unspecified_id: NotRequired[str] + """ + An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + """ + user_id: NotRequired[str] + """ + User ID. + """ + vehicle_number: NotRequired[str] + """ + Vehicle number. + """ + + class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown( + TypedDict, + ): + fuel: NotRequired[ + "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownFuel" + ] + """ + Breakdown of fuel portion of the purchase. + """ + non_fuel: NotRequired[ + "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownNonFuel" + ] + """ + Breakdown of non-fuel portion of the purchase. + """ + tax: NotRequired[ + "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownTax" + ] + """ + Information about tax included in this transaction. + """ + + class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownFuel( + TypedDict, + ): + gross_amount_decimal: NotRequired[str] + """ + Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + """ + + class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownNonFuel( + TypedDict, + ): + gross_amount_decimal: NotRequired[str] + """ + Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + """ + + class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownTax( + TypedDict, + ): + local_amount_decimal: NotRequired[str] + """ + Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + national_amount_decimal: NotRequired[str] + """ + Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + class CreateUnlinkedRefundParamsPurchaseDetailsFlight(TypedDict): departure_at: NotRequired[int] """ @@ -1181,6 +1510,14 @@ class CreateUnlinkedRefundParamsPurchaseDetailsFlightSegment(TypedDict): """ class CreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): + industry_product_code: NotRequired[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: NotRequired[str] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ type: NotRequired[ Literal[ "diesel", @@ -1193,18 +1530,25 @@ class CreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired[Literal["liter", "other", "us_gallon"]] + unit: NotRequired[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ] + ] """ - The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. + The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: NotRequired[str] - """ - The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. - """ class CreateUnlinkedRefundParamsPurchaseDetailsLodging(TypedDict): check_in_at: NotRequired[int] diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 0d4ad60a2..0acc9b5ca 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -72,6 +72,7 @@ class TaxId(StripeObject): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -131,7 +132,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` """ value: str """ @@ -486,6 +487,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -544,7 +546,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -711,7 +713,7 @@ def create( cls, **params: Unpack["Calculation.CreateParams"] ) -> "Calculation": """ - Calculates tax based on input and returns a Tax Calculation object. + Calculates tax based on the input and returns a Tax Calculation object. """ return cast( "Calculation", @@ -727,7 +729,7 @@ async def create_async( cls, **params: Unpack["Calculation.CreateParams"] ) -> "Calculation": """ - Calculates tax based on input and returns a Tax Calculation object. + Calculates tax based on the input and returns a Tax Calculation object. """ return cast( "Calculation", diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index 0d760b549..0ae2bb045 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -127,6 +127,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -185,7 +186,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -277,7 +278,7 @@ def create( options: RequestOptions = {}, ) -> Calculation: """ - Calculates tax based on input and returns a Tax Calculation object. + Calculates tax based on the input and returns a Tax Calculation object. """ return cast( Calculation, @@ -297,7 +298,7 @@ async def create_async( options: RequestOptions = {}, ) -> Calculation: """ - Calculates tax based on input and returns a Tax Calculation object. + Calculates tax based on the input and returns a Tax Calculation object. """ return cast( Calculation, diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index 52c0b6cfe..c4f5b90a3 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -72,6 +72,7 @@ class TaxId(StripeObject): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "ch_uid", "ch_vat", "cl_tin", "cn_tin", @@ -131,7 +132,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` """ value: str """ diff --git a/stripe/test_helpers/issuing/_authorization_service.py b/stripe/test_helpers/issuing/_authorization_service.py index bf41b79b8..7279e4d19 100644 --- a/stripe/test_helpers/issuing/_authorization_service.py +++ b/stripe/test_helpers/issuing/_authorization_service.py @@ -30,6 +30,12 @@ class CaptureParams(TypedDict): """ class CaptureParamsPurchaseDetails(TypedDict): + fleet: NotRequired[ + "AuthorizationService.CaptureParamsPurchaseDetailsFleet" + ] + """ + Fleet-specific information for transactions using Fleet cards. + """ flight: NotRequired[ "AuthorizationService.CaptureParamsPurchaseDetailsFlight" ] @@ -59,6 +65,100 @@ class CaptureParamsPurchaseDetails(TypedDict): A merchant-specific order number. """ + class CaptureParamsPurchaseDetailsFleet(TypedDict): + cardholder_prompt_data: NotRequired[ + "AuthorizationService.CaptureParamsPurchaseDetailsFleetCardholderPromptData" + ] + """ + Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + """ + purchase_type: NotRequired[ + Literal[ + "fuel_and_non_fuel_purchase", + "fuel_purchase", + "non_fuel_purchase", + ] + ] + """ + The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + """ + reported_breakdown: NotRequired[ + "AuthorizationService.CaptureParamsPurchaseDetailsFleetReportedBreakdown" + ] + """ + More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + """ + service_type: NotRequired[ + Literal["full_service", "non_fuel_transaction", "self_service"] + ] + """ + The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + """ + + class CaptureParamsPurchaseDetailsFleetCardholderPromptData(TypedDict): + driver_id: NotRequired[str] + """ + Driver ID. + """ + odometer: NotRequired[int] + """ + Odometer reading. + """ + unspecified_id: NotRequired[str] + """ + An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + """ + user_id: NotRequired[str] + """ + User ID. + """ + vehicle_number: NotRequired[str] + """ + Vehicle number. + """ + + class CaptureParamsPurchaseDetailsFleetReportedBreakdown(TypedDict): + fuel: NotRequired[ + "AuthorizationService.CaptureParamsPurchaseDetailsFleetReportedBreakdownFuel" + ] + """ + Breakdown of fuel portion of the purchase. + """ + non_fuel: NotRequired[ + "AuthorizationService.CaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel" + ] + """ + Breakdown of non-fuel portion of the purchase. + """ + tax: NotRequired[ + "AuthorizationService.CaptureParamsPurchaseDetailsFleetReportedBreakdownTax" + ] + """ + Information about tax included in this transaction. + """ + + class CaptureParamsPurchaseDetailsFleetReportedBreakdownFuel(TypedDict): + gross_amount_decimal: NotRequired[str] + """ + Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + """ + + class CaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel(TypedDict): + gross_amount_decimal: NotRequired[str] + """ + Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + """ + + class CaptureParamsPurchaseDetailsFleetReportedBreakdownTax(TypedDict): + local_amount_decimal: NotRequired[str] + """ + Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + national_amount_decimal: NotRequired[str] + """ + Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + class CaptureParamsPurchaseDetailsFlight(TypedDict): departure_at: NotRequired[int] """ @@ -112,6 +212,14 @@ class CaptureParamsPurchaseDetailsFlightSegment(TypedDict): """ class CaptureParamsPurchaseDetailsFuel(TypedDict): + industry_product_code: NotRequired[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: NotRequired[str] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ type: NotRequired[ Literal[ "diesel", @@ -124,18 +232,25 @@ class CaptureParamsPurchaseDetailsFuel(TypedDict): """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired[Literal["liter", "other", "us_gallon"]] + unit: NotRequired[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ] + ] """ - The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. + The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: NotRequired[str] - """ - The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. - """ class CaptureParamsPurchaseDetailsLodging(TypedDict): check_in_at: NotRequired[int] @@ -182,6 +297,14 @@ class CreateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + fleet: NotRequired["AuthorizationService.CreateParamsFleet"] + """ + Fleet-specific information for authorizations using Fleet cards. + """ + fuel: NotRequired["AuthorizationService.CreateParamsFuel"] + """ + Information about fuel that was purchased with this transaction. + """ is_amount_controllable: NotRequired[bool] """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. @@ -219,6 +342,141 @@ class CreateParamsAmountDetails(TypedDict): The amount of cash requested by the cardholder. """ + class CreateParamsFleet(TypedDict): + cardholder_prompt_data: NotRequired[ + "AuthorizationService.CreateParamsFleetCardholderPromptData" + ] + """ + Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + """ + purchase_type: NotRequired[ + Literal[ + "fuel_and_non_fuel_purchase", + "fuel_purchase", + "non_fuel_purchase", + ] + ] + """ + The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + """ + reported_breakdown: NotRequired[ + "AuthorizationService.CreateParamsFleetReportedBreakdown" + ] + """ + More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + """ + service_type: NotRequired[ + Literal["full_service", "non_fuel_transaction", "self_service"] + ] + """ + The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + """ + + class CreateParamsFleetCardholderPromptData(TypedDict): + driver_id: NotRequired[str] + """ + Driver ID. + """ + odometer: NotRequired[int] + """ + Odometer reading. + """ + unspecified_id: NotRequired[str] + """ + An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + """ + user_id: NotRequired[str] + """ + User ID. + """ + vehicle_number: NotRequired[str] + """ + Vehicle number. + """ + + class CreateParamsFleetReportedBreakdown(TypedDict): + fuel: NotRequired[ + "AuthorizationService.CreateParamsFleetReportedBreakdownFuel" + ] + """ + Breakdown of fuel portion of the purchase. + """ + non_fuel: NotRequired[ + "AuthorizationService.CreateParamsFleetReportedBreakdownNonFuel" + ] + """ + Breakdown of non-fuel portion of the purchase. + """ + tax: NotRequired[ + "AuthorizationService.CreateParamsFleetReportedBreakdownTax" + ] + """ + Information about tax included in this transaction. + """ + + class CreateParamsFleetReportedBreakdownFuel(TypedDict): + gross_amount_decimal: NotRequired[str] + """ + Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + """ + + class CreateParamsFleetReportedBreakdownNonFuel(TypedDict): + gross_amount_decimal: NotRequired[str] + """ + Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + """ + + class CreateParamsFleetReportedBreakdownTax(TypedDict): + local_amount_decimal: NotRequired[str] + """ + Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + national_amount_decimal: NotRequired[str] + """ + Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + + class CreateParamsFuel(TypedDict): + industry_product_code: NotRequired[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: NotRequired[str] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ + type: NotRequired[ + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ] + ] + """ + The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + """ + unit: NotRequired[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ] + ] + """ + The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. + """ + unit_cost_decimal: NotRequired[str] + """ + The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + """ + class CreateParamsMerchantData(TypedDict): category: NotRequired[ Literal[ @@ -620,6 +878,159 @@ class ExpireParams(TypedDict): Specifies which fields in the response should be expanded. """ + class FinalizeAmountParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + final_amount: int + """ + The final authorization amount that will be captured by the merchant. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + fleet: NotRequired["AuthorizationService.FinalizeAmountParamsFleet"] + """ + Fleet-specific information for authorizations using Fleet cards. + """ + fuel: NotRequired["AuthorizationService.FinalizeAmountParamsFuel"] + """ + Information about fuel that was purchased with this transaction. + """ + + class FinalizeAmountParamsFleet(TypedDict): + cardholder_prompt_data: NotRequired[ + "AuthorizationService.FinalizeAmountParamsFleetCardholderPromptData" + ] + """ + Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + """ + purchase_type: NotRequired[ + Literal[ + "fuel_and_non_fuel_purchase", + "fuel_purchase", + "non_fuel_purchase", + ] + ] + """ + The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + """ + reported_breakdown: NotRequired[ + "AuthorizationService.FinalizeAmountParamsFleetReportedBreakdown" + ] + """ + More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + """ + service_type: NotRequired[ + Literal["full_service", "non_fuel_transaction", "self_service"] + ] + """ + The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + """ + + class FinalizeAmountParamsFleetCardholderPromptData(TypedDict): + driver_id: NotRequired[str] + """ + Driver ID. + """ + odometer: NotRequired[int] + """ + Odometer reading. + """ + unspecified_id: NotRequired[str] + """ + An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + """ + user_id: NotRequired[str] + """ + User ID. + """ + vehicle_number: NotRequired[str] + """ + Vehicle number. + """ + + class FinalizeAmountParamsFleetReportedBreakdown(TypedDict): + fuel: NotRequired[ + "AuthorizationService.FinalizeAmountParamsFleetReportedBreakdownFuel" + ] + """ + Breakdown of fuel portion of the purchase. + """ + non_fuel: NotRequired[ + "AuthorizationService.FinalizeAmountParamsFleetReportedBreakdownNonFuel" + ] + """ + Breakdown of non-fuel portion of the purchase. + """ + tax: NotRequired[ + "AuthorizationService.FinalizeAmountParamsFleetReportedBreakdownTax" + ] + """ + Information about tax included in this transaction. + """ + + class FinalizeAmountParamsFleetReportedBreakdownFuel(TypedDict): + gross_amount_decimal: NotRequired[str] + """ + Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + """ + + class FinalizeAmountParamsFleetReportedBreakdownNonFuel(TypedDict): + gross_amount_decimal: NotRequired[str] + """ + Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + """ + + class FinalizeAmountParamsFleetReportedBreakdownTax(TypedDict): + local_amount_decimal: NotRequired[str] + """ + Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + national_amount_decimal: NotRequired[str] + """ + Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + + class FinalizeAmountParamsFuel(TypedDict): + industry_product_code: NotRequired[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: NotRequired[str] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ + type: NotRequired[ + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ] + ] + """ + The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + """ + unit: NotRequired[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ] + ] + """ + The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. + """ + unit_cost_decimal: NotRequired[str] + """ + The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + """ + class IncrementParams(TypedDict): expand: NotRequired[List[str]] """ @@ -776,6 +1187,52 @@ async def expire_async( ), ) + def finalize_amount( + self, + authorization: str, + params: "AuthorizationService.FinalizeAmountParams", + options: RequestOptions = {}, + ) -> Authorization: + """ + Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. + """ + return cast( + Authorization, + self._request( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( + authorization=sanitize_id(authorization), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def finalize_amount_async( + self, + authorization: str, + params: "AuthorizationService.FinalizeAmountParams", + options: RequestOptions = {}, + ) -> Authorization: + """ + Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. + """ + return cast( + Authorization, + await self._request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( + authorization=sanitize_id(authorization), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def increment( self, authorization: str, diff --git a/stripe/test_helpers/issuing/_transaction_service.py b/stripe/test_helpers/issuing/_transaction_service.py index 2f93fce32..a585ce908 100644 --- a/stripe/test_helpers/issuing/_transaction_service.py +++ b/stripe/test_helpers/issuing/_transaction_service.py @@ -375,6 +375,12 @@ class CreateForceCaptureParamsMerchantData(TypedDict): """ class CreateForceCaptureParamsPurchaseDetails(TypedDict): + fleet: NotRequired[ + "TransactionService.CreateForceCaptureParamsPurchaseDetailsFleet" + ] + """ + Fleet-specific information for transactions using Fleet cards. + """ flight: NotRequired[ "TransactionService.CreateForceCaptureParamsPurchaseDetailsFlight" ] @@ -406,6 +412,110 @@ class CreateForceCaptureParamsPurchaseDetails(TypedDict): A merchant-specific order number. """ + class CreateForceCaptureParamsPurchaseDetailsFleet(TypedDict): + cardholder_prompt_data: NotRequired[ + "TransactionService.CreateForceCaptureParamsPurchaseDetailsFleetCardholderPromptData" + ] + """ + Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + """ + purchase_type: NotRequired[ + Literal[ + "fuel_and_non_fuel_purchase", + "fuel_purchase", + "non_fuel_purchase", + ] + ] + """ + The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + """ + reported_breakdown: NotRequired[ + "TransactionService.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdown" + ] + """ + More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + """ + service_type: NotRequired[ + Literal["full_service", "non_fuel_transaction", "self_service"] + ] + """ + The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + """ + + class CreateForceCaptureParamsPurchaseDetailsFleetCardholderPromptData( + TypedDict, + ): + driver_id: NotRequired[str] + """ + Driver ID. + """ + odometer: NotRequired[int] + """ + Odometer reading. + """ + unspecified_id: NotRequired[str] + """ + An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + """ + user_id: NotRequired[str] + """ + User ID. + """ + vehicle_number: NotRequired[str] + """ + Vehicle number. + """ + + class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdown( + TypedDict, + ): + fuel: NotRequired[ + "TransactionService.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel" + ] + """ + Breakdown of fuel portion of the purchase. + """ + non_fuel: NotRequired[ + "TransactionService.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel" + ] + """ + Breakdown of non-fuel portion of the purchase. + """ + tax: NotRequired[ + "TransactionService.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownTax" + ] + """ + Information about tax included in this transaction. + """ + + class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel( + TypedDict, + ): + gross_amount_decimal: NotRequired[str] + """ + Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + """ + + class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel( + TypedDict, + ): + gross_amount_decimal: NotRequired[str] + """ + Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + """ + + class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownTax( + TypedDict, + ): + local_amount_decimal: NotRequired[str] + """ + Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + national_amount_decimal: NotRequired[str] + """ + Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + class CreateForceCaptureParamsPurchaseDetailsFlight(TypedDict): departure_at: NotRequired[int] """ @@ -459,6 +569,14 @@ class CreateForceCaptureParamsPurchaseDetailsFlightSegment(TypedDict): """ class CreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): + industry_product_code: NotRequired[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: NotRequired[str] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ type: NotRequired[ Literal[ "diesel", @@ -471,18 +589,25 @@ class CreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired[Literal["liter", "other", "us_gallon"]] + unit: NotRequired[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ] + ] """ - The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. + The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: NotRequired[str] - """ - The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. - """ class CreateForceCaptureParamsPurchaseDetailsLodging(TypedDict): check_in_at: NotRequired[int] @@ -866,6 +991,12 @@ class CreateUnlinkedRefundParamsMerchantData(TypedDict): """ class CreateUnlinkedRefundParamsPurchaseDetails(TypedDict): + fleet: NotRequired[ + "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFleet" + ] + """ + Fleet-specific information for transactions using Fleet cards. + """ flight: NotRequired[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFlight" ] @@ -897,6 +1028,110 @@ class CreateUnlinkedRefundParamsPurchaseDetails(TypedDict): A merchant-specific order number. """ + class CreateUnlinkedRefundParamsPurchaseDetailsFleet(TypedDict): + cardholder_prompt_data: NotRequired[ + "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFleetCardholderPromptData" + ] + """ + Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + """ + purchase_type: NotRequired[ + Literal[ + "fuel_and_non_fuel_purchase", + "fuel_purchase", + "non_fuel_purchase", + ] + ] + """ + The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + """ + reported_breakdown: NotRequired[ + "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown" + ] + """ + More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + """ + service_type: NotRequired[ + Literal["full_service", "non_fuel_transaction", "self_service"] + ] + """ + The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + """ + + class CreateUnlinkedRefundParamsPurchaseDetailsFleetCardholderPromptData( + TypedDict, + ): + driver_id: NotRequired[str] + """ + Driver ID. + """ + odometer: NotRequired[int] + """ + Odometer reading. + """ + unspecified_id: NotRequired[str] + """ + An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + """ + user_id: NotRequired[str] + """ + User ID. + """ + vehicle_number: NotRequired[str] + """ + Vehicle number. + """ + + class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown( + TypedDict, + ): + fuel: NotRequired[ + "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownFuel" + ] + """ + Breakdown of fuel portion of the purchase. + """ + non_fuel: NotRequired[ + "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownNonFuel" + ] + """ + Breakdown of non-fuel portion of the purchase. + """ + tax: NotRequired[ + "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownTax" + ] + """ + Information about tax included in this transaction. + """ + + class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownFuel( + TypedDict, + ): + gross_amount_decimal: NotRequired[str] + """ + Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + """ + + class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownNonFuel( + TypedDict, + ): + gross_amount_decimal: NotRequired[str] + """ + Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + """ + + class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownTax( + TypedDict, + ): + local_amount_decimal: NotRequired[str] + """ + Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + national_amount_decimal: NotRequired[str] + """ + Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + """ + class CreateUnlinkedRefundParamsPurchaseDetailsFlight(TypedDict): departure_at: NotRequired[int] """ @@ -950,6 +1185,14 @@ class CreateUnlinkedRefundParamsPurchaseDetailsFlightSegment(TypedDict): """ class CreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): + industry_product_code: NotRequired[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: NotRequired[str] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ type: NotRequired[ Literal[ "diesel", @@ -962,18 +1205,25 @@ class CreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ - unit: NotRequired[Literal["liter", "other", "us_gallon"]] + unit: NotRequired[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ] + ] """ - The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. + The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ - volume_decimal: NotRequired[str] - """ - The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. - """ class CreateUnlinkedRefundParamsPurchaseDetailsLodging(TypedDict): check_in_at: NotRequired[int] diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 02e9cb3f2..64b304971 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -26039,7 +26039,7 @@ def test_test_helpers_issuing_authorizations_capture_post( "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "quantity_decimal": "10", }, "lodging": {"check_in_at": 1633651200, "nights": 2}, "receipt": [ @@ -26057,7 +26057,7 @@ def test_test_helpers_issuing_authorizations_capture_post( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", query_string="", - post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_authorizations_capture_post_service( @@ -26098,7 +26098,7 @@ def test_test_helpers_issuing_authorizations_capture_post_service( "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "quantity_decimal": "10", }, "lodging": {"check_in_at": 1633651200, "nights": 2}, "receipt": [ @@ -26118,7 +26118,7 @@ def test_test_helpers_issuing_authorizations_capture_post_service( path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", query_string="", api_base="https://api.stripe.com", - post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) @pytest.mark.anyio @@ -26150,7 +26150,7 @@ async def test_test_helpers_issuing_authorizations_capture_post_async( "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "quantity_decimal": "10", }, "lodging": {"check_in_at": 1633651200, "nights": 2}, "receipt": [ @@ -26168,7 +26168,7 @@ async def test_test_helpers_issuing_authorizations_capture_post_async( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", query_string="", - post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) @pytest.mark.anyio @@ -26210,7 +26210,7 @@ async def test_test_helpers_issuing_authorizations_capture_post_service_async( "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "quantity_decimal": "10", }, "lodging": {"check_in_at": 1633651200, "nights": 2}, "receipt": [ @@ -26230,7 +26230,7 @@ async def test_test_helpers_issuing_authorizations_capture_post_service_async( path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", query_string="", api_base="https://api.stripe.com", - post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_authorizations_expire_post( @@ -27133,7 +27133,7 @@ def test_test_helpers_issuing_transactions_create_force_capture_post( "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ @@ -27151,7 +27151,7 @@ def test_test_helpers_issuing_transactions_create_force_capture_post( "post", path="/v1/test_helpers/issuing/transactions/create_force_capture", query_string="", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_transactions_create_force_capture_post_service( @@ -27202,7 +27202,7 @@ def test_test_helpers_issuing_transactions_create_force_capture_post_service( "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ @@ -27222,7 +27222,7 @@ def test_test_helpers_issuing_transactions_create_force_capture_post_service( path="/v1/test_helpers/issuing/transactions/create_force_capture", query_string="", api_base="https://api.stripe.com", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) @pytest.mark.anyio @@ -27265,7 +27265,7 @@ async def test_test_helpers_issuing_transactions_create_force_capture_post_async "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ @@ -27284,7 +27284,7 @@ async def test_test_helpers_issuing_transactions_create_force_capture_post_async "post", path="/v1/test_helpers/issuing/transactions/create_force_capture", query_string="", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) @pytest.mark.anyio @@ -27336,7 +27336,7 @@ async def test_test_helpers_issuing_transactions_create_force_capture_post_servi "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ @@ -27356,7 +27356,7 @@ async def test_test_helpers_issuing_transactions_create_force_capture_post_servi path="/v1/test_helpers/issuing/transactions/create_force_capture", query_string="", api_base="https://api.stripe.com", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_transactions_create_unlinked_refund_post( @@ -27397,7 +27397,7 @@ def test_test_helpers_issuing_transactions_create_unlinked_refund_post( "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ @@ -27415,7 +27415,7 @@ def test_test_helpers_issuing_transactions_create_unlinked_refund_post( "post", path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", query_string="", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service( @@ -27466,7 +27466,7 @@ def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service( "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ @@ -27486,7 +27486,7 @@ def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service( path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", query_string="", api_base="https://api.stripe.com", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) @pytest.mark.anyio @@ -27528,7 +27528,7 @@ async def test_test_helpers_issuing_transactions_create_unlinked_refund_post_asy "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ @@ -27546,7 +27546,7 @@ async def test_test_helpers_issuing_transactions_create_unlinked_refund_post_asy "post", path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", query_string="", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) @pytest.mark.anyio @@ -27598,7 +27598,7 @@ async def test_test_helpers_issuing_transactions_create_unlinked_refund_post_ser "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", - "volume_decimal": "10", + "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ @@ -27618,7 +27618,7 @@ async def test_test_helpers_issuing_transactions_create_unlinked_refund_post_ser path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", query_string="", api_base="https://api.stripe.com", - post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][volume_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", + post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_transactions_refund_post( From 993551e51b85e8100c1408afd6983bdd253e866d Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Mon, 24 Jun 2024 16:11:15 -0700 Subject: [PATCH 079/179] Bump version to 10.0.0 --- CHANGELOG.md | 25 +++++++++++++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97236deb8..86c54179f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,28 @@ +## 10.0.0 - 2024-06-24 +* [#1350](https://github.com/stripe/stripe-python/pull/1350) Update generated code + + This release changes the pinned API version to 2024-06-20. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-06-20) and carefully review the API changes before upgrading. + + ### ⚠️ Breaking changes + + * Remove the unused resource `PlatformTaxFee` + * Rename `volume_decimal` to `quantity_decimal` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel` and resource class `stripe.issuing.Transaction.PurchaseDetails.Fuel` + + ### Additions + + * Add support for `fleet` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetails`, `stripe.issuing.Authorization.CreateParams`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetails`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetails`, resource `stripe.issuing.Authorization`, and resource class `stripe.issuing.Transaction.PurchaseDetails` + * Add support for new values `platform_disabled`, `paused.inactivity` and `other` on enums `Capability.Requirements.disabled_reason` and `Capability.FutureRequirements.disabled_reason` + * Add support for `industry_product_code` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel` and resource class `stripe.issuing.Transaction.PurchaseDetails.Fuel` + * Add support for `quantity_decimal` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel` and resource class `stripe.issuing.Transaction.PurchaseDetails.Fuel` + * Add support for `fuel` on parameter class `stripe.issuing.Authorization.CreateParams` and resource `stripe.issuing.Authorization` + * Add support for `_cls_finalize_amount` on resource `stripe.issuing.Authorization` + * Add support for `finalize_amount` on resource `stripe.issuing.Authorization` + * Change type of `disabled_reason` on `stripe.Capability.FutureRequirements` and `stripe.Capability.Requirements` from `str` to `Literal['other', 'paused.inactivity', 'pending.onboarding', 'pending.review', 'platform_disabled', 'platform_paused', 'rejected.inactivity', 'rejected.other', 'rejected.unsupported_business', 'requirements.fields_needed']` + * Add support for `ch_uid` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `card_canceled`, `card_expired`, `cardholder_blocked`, `insecure_authorization_method` and `pin_blocked` on enum `stripe.issuing.Authorization.RequestHistory.reason` + * Add support for `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `pound`, on enums `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel.unit`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel.unit`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel.unit` + * Add support for `2024-06-20` on enum `stripe.WebhookEndpoint.CreateParams.api_version` + ## 9.12.0 - 2024-06-17 * [#1348](https://github.com/stripe/stripe-python/pull/1348) Update generated code * Add support for `tax_id_collection` on parameter class `stripe.PaymentLink.ModifyParams` diff --git a/VERSION b/VERSION index 2f0dbe6f6..a13e7b9c8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.12.0 +10.0.0 diff --git a/stripe/_version.py b/stripe/_version.py index 2d5dd2775..b91ab216f 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "9.12.0" +VERSION = "10.0.0" From 410ac74ff940b461cc9dc8c86a3cb6a457b55add Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:20:43 -0700 Subject: [PATCH 080/179] Update generated code (#1353) * Update generated code for v1096 * Update generated code for v1097 * Update generated code for v1099 * Update generated code for v1101 * Update generated code for v1103 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_capability.py | 2 +- stripe/_credit_note.py | 12 ++++ stripe/_credit_note_preview_lines_service.py | 4 ++ stripe/_credit_note_service.py | 8 +++ stripe/_invoice.py | 42 ++++++++++++++ stripe/_invoice_service.py | 32 ++++++++++ stripe/_payment_intent.py | 58 +++++++++++++++++++ stripe/_payment_intent_service.py | 48 +++++++++++++++ stripe/_payment_link.py | 8 ++- stripe/_payment_link_service.py | 5 +- stripe/_setup_intent.py | 58 +++++++++++++++++++ stripe/_setup_intent_service.py | 48 +++++++++++++++ stripe/_subscription.py | 42 ++++++++++++++ stripe/_subscription_service.py | 32 ++++++++++ stripe/billing/_meter.py | 4 +- .../billing/_meter_event_summary_service.py | 4 +- stripe/checkout/_session.py | 10 ++++ stripe/financial_connections/_session.py | 28 +++++++++ .../financial_connections/_session_service.py | 14 +++++ stripe/terminal/_configuration.py | 42 ++++++++++++++ stripe/terminal/_configuration_service.py | 32 ++++++++++ 22 files changed, 527 insertions(+), 8 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index eb43ae0c9..1129f2eb6 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1095 \ No newline at end of file +v1103 \ No newline at end of file diff --git a/stripe/_capability.py b/stripe/_capability.py index 3c8670d29..0974b8d52 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -160,7 +160,7 @@ class Error(StripeObject): ] ] """ - This is typed as a string for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is empty because fields in `future_requirements` will never disable the account. + This is typed as an enum for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is null because fields in `future_requirements` will never disable the account. """ errors: List[Error] """ diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 3a634a940..8054b28e5 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -167,6 +167,10 @@ class CreateParams(RequestOptions): """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ + email_type: NotRequired[Literal["credit_note", "none"]] + """ + Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -368,6 +372,10 @@ class PreviewLinesParams(RequestOptions): """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ + email_type: NotRequired[Literal["credit_note", "none"]] + """ + Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. + """ 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. @@ -501,6 +509,10 @@ class PreviewParams(RequestOptions): """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ + email_type: NotRequired[Literal["credit_note", "none"]] + """ + Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. diff --git a/stripe/_credit_note_preview_lines_service.py b/stripe/_credit_note_preview_lines_service.py index 72f949caa..fa41fb7c0 100644 --- a/stripe/_credit_note_preview_lines_service.py +++ b/stripe/_credit_note_preview_lines_service.py @@ -22,6 +22,10 @@ class ListParams(TypedDict): """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ + email_type: NotRequired[Literal["credit_note", "none"]] + """ + Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. + """ 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. diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index e70713b8d..a076ce15b 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -32,6 +32,10 @@ class CreateParams(TypedDict): """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ + email_type: NotRequired[Literal["credit_note", "none"]] + """ + Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -203,6 +207,10 @@ class PreviewParams(TypedDict): """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ + email_type: NotRequired[Literal["credit_note", "none"]] + """ + Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 609963f3e..0f7a80139 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -649,6 +649,15 @@ class SepaDebit(StripeObject): class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): + class Filters(StripeObject): + account_subcategories: Optional[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + """ + + filters: Optional[Filters] permissions: Optional[ List[ Literal[ @@ -668,6 +677,7 @@ class FinancialConnections(StripeObject): """ Data features requested to be retrieved upon account creation. """ + _inner_class_types = {"filters": Filters} financial_connections: Optional[FinancialConnections] verification_method: Optional[ @@ -1393,6 +1403,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method. + """ permissions: NotRequired[ List[ Literal[ @@ -1410,6 +1426,16 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne List of data features that you would like to retrieve upon account creation. """ + class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class CreateParamsRendering(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" @@ -3062,6 +3088,12 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method. + """ permissions: NotRequired[ List[ Literal[ @@ -3079,6 +3111,16 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne List of data features that you would like to retrieve upon account creation. """ + class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class ModifyParamsRendering(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 41ce4c565..6c654de69 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -421,6 +421,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method. + """ permissions: NotRequired[ List[ Literal[ @@ -438,6 +444,16 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne List of data features that you would like to retrieve upon account creation. """ + class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class CreateParamsRendering(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" @@ -3274,6 +3290,12 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method. + """ permissions: NotRequired[ List[ Literal[ @@ -3291,6 +3313,16 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne List of data features that you would like to retrieve upon account creation. """ + class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class UpdateParamsRendering(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 590cddb2a..5c8d804c3 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1686,6 +1686,15 @@ class Twint(StripeObject): class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): + class Filters(StripeObject): + account_subcategories: Optional[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + """ + + filters: Optional[Filters] permissions: Optional[ List[ Literal[ @@ -1709,6 +1718,7 @@ class FinancialConnections(StripeObject): """ 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. """ + _inner_class_types = {"filters": Filters} class MandateOptions(StripeObject): collection_method: Optional[Literal["paper"]] @@ -4071,6 +4081,12 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method + """ permissions: NotRequired[ List[ Literal[ @@ -4092,6 +4108,16 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( 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. """ + class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): @@ -6328,6 +6354,12 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method + """ permissions: NotRequired[ List[ Literal[ @@ -6349,6 +6381,16 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( 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. """ + class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): @@ -8579,6 +8621,12 @@ class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method + """ permissions: NotRequired[ List[ Literal[ @@ -8600,6 +8648,16 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( 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. """ + class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class ModifyParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index b0fc670d6..23fd5c18d 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -2172,6 +2172,12 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method + """ permissions: NotRequired[ List[ Literal[ @@ -2193,6 +2199,16 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( 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. """ + class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): @@ -4455,6 +4471,12 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method + """ permissions: NotRequired[ List[ Literal[ @@ -4476,6 +4498,16 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( 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. """ + class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): @@ -6760,6 +6792,12 @@ class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method + """ permissions: NotRequired[ List[ Literal[ @@ -6781,6 +6819,16 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( 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. """ + class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class UpdateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 2e83eeadb..7cd67469d 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -790,6 +790,7 @@ class CreateParams(RequestOptions): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -799,8 +800,10 @@ class CreateParams(RequestOptions): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", + "zip", ] ] ] @@ -1668,7 +1671,7 @@ class ModifyParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', '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). @@ -2430,6 +2433,7 @@ class RetrieveParams(RequestOptions): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -2439,8 +2443,10 @@ class RetrieveParams(RequestOptions): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", + "zip", ] ] ] diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index f9a83c5be..026046830 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -132,6 +132,7 @@ class CreateParams(TypedDict): "konbini", "link", "mobilepay", + "multibanco", "oxxo", "p24", "paynow", @@ -141,8 +142,10 @@ class CreateParams(TypedDict): "sepa_debit", "sofort", "swish", + "twint", "us_bank_account", "wechat_pay", + "zip", ] ] ] @@ -1012,7 +1015,7 @@ class UpdateParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', '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/_setup_intent.py b/stripe/_setup_intent.py index c969607f5..dedeefd03 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -560,6 +560,15 @@ class MandateOptions(StripeObject): class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): + class Filters(StripeObject): + account_subcategories: Optional[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + """ + + filters: Optional[Filters] permissions: Optional[ List[ Literal[ @@ -583,6 +592,7 @@ class FinancialConnections(StripeObject): """ 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. """ + _inner_class_types = {"filters": Filters} class MandateOptions(StripeObject): collection_method: Optional[Literal["paper"]] @@ -1632,6 +1642,12 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method + """ permissions: NotRequired[ List[ Literal[ @@ -1653,6 +1669,16 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( 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. """ + class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): @@ -2734,6 +2760,12 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method + """ permissions: NotRequired[ List[ Literal[ @@ -2755,6 +2787,16 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( 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. """ + class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): @@ -3803,6 +3845,12 @@ class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method + """ permissions: NotRequired[ List[ Literal[ @@ -3824,6 +3872,16 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( 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. """ + class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class ModifyParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index cf675859d..f08d7e158 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -1062,6 +1062,12 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method + """ permissions: NotRequired[ List[ Literal[ @@ -1083,6 +1089,16 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( 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. """ + class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): @@ -2196,6 +2212,12 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method + """ permissions: NotRequired[ List[ Literal[ @@ -2217,6 +2239,16 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( 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. """ + class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): @@ -3307,6 +3339,12 @@ class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method + """ permissions: NotRequired[ List[ Literal[ @@ -3328,6 +3366,16 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( 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. """ + class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class UpdateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): diff --git a/stripe/_subscription.py b/stripe/_subscription.py index f75d8170b..218f56c86 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -269,6 +269,15 @@ class SepaDebit(StripeObject): class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): + class Filters(StripeObject): + account_subcategories: Optional[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + """ + + filters: Optional[Filters] permissions: Optional[ List[ Literal[ @@ -288,6 +297,7 @@ class FinancialConnections(StripeObject): """ Data features requested to be retrieved upon account creation. """ + _inner_class_types = {"filters": Filters} financial_connections: Optional[FinancialConnections] verification_method: Optional[ @@ -1103,6 +1113,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method. + """ permissions: NotRequired[ List[ Literal[ @@ -1120,6 +1136,16 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne List of data features that you would like to retrieve upon account creation. """ + class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class CreateParamsPendingInvoiceItemInterval(TypedDict): interval: Literal["day", "month", "week", "year"] """ @@ -1916,6 +1942,12 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method. + """ permissions: NotRequired[ List[ Literal[ @@ -1933,6 +1965,16 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne List of data features that you would like to retrieve upon account creation. """ + class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class ModifyParamsPendingInvoiceItemInterval(TypedDict): interval: Literal["day", "month", "week", "year"] """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 8ab003b72..c853c8aad 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -680,6 +680,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method. + """ permissions: NotRequired[ List[ Literal[ @@ -697,6 +703,16 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne List of data features that you would like to retrieve upon account creation. """ + class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class CreateParamsPendingInvoiceItemInterval(TypedDict): interval: Literal["day", "month", "week", "year"] """ @@ -1549,6 +1565,12 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): + filters: NotRequired[ + "SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method. + """ permissions: NotRequired[ List[ Literal[ @@ -1566,6 +1588,16 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne List of data features that you would like to retrieve upon account creation. """ + class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + class UpdateParamsPendingInvoiceItemInterval(TypedDict): interval: Literal["day", "month", "week", "year"] """ diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index 084c06e2a..f2fe0f0ee 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -148,9 +148,9 @@ class ListEventSummariesParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - value_grouping_window: NotRequired[Literal["hour"]] + value_grouping_window: NotRequired[Literal["day", "hour"]] """ - Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range. + Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range. For hourly granularity, start and end times must align with hour boundaries (e.g., 00:00, 01:00, ..., 23:00). For daily granularity, start and end times must align with UTC day boundaries (00:00 UTC). """ class ListParams(RequestOptions): diff --git a/stripe/billing/_meter_event_summary_service.py b/stripe/billing/_meter_event_summary_service.py index 73096be0e..48b2cacb5 100644 --- a/stripe/billing/_meter_event_summary_service.py +++ b/stripe/billing/_meter_event_summary_service.py @@ -39,9 +39,9 @@ class ListParams(TypedDict): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - value_grouping_window: NotRequired[Literal["hour"]] + value_grouping_window: NotRequired[Literal["day", "hour"]] """ - Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range. + Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range. For hourly granularity, start and end times must align with hour boundaries (e.g., 00:00, 01:00, ..., 23:00). For daily granularity, start and end times must align with UTC day boundaries (00:00 UTC). """ def list( diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 7b1f3ed88..9fcb892bc 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -967,6 +967,15 @@ class Swish(StripeObject): class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): + class Filters(StripeObject): + account_subcategories: Optional[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + """ + + filters: Optional[Filters] permissions: Optional[ List[ Literal[ @@ -990,6 +999,7 @@ class FinancialConnections(StripeObject): """ 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. """ + _inner_class_types = {"filters": Filters} financial_connections: Optional[FinancialConnections] setup_future_usage: Optional[ diff --git a/stripe/financial_connections/_session.py b/stripe/financial_connections/_session.py index 8dc534188..1109ccda9 100644 --- a/stripe/financial_connections/_session.py +++ b/stripe/financial_connections/_session.py @@ -46,6 +46,20 @@ class AccountHolder(StripeObject): """ class Filters(StripeObject): + account_subcategories: Optional[ + List[ + Literal[ + "checking", + "credit_card", + "line_of_credit", + "mortgage", + "savings", + ] + ] + ] + """ + Restricts the Session to subcategories of accounts that can be linked. Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`. + """ countries: Optional[List[str]] """ List of countries from which to filter accounts. @@ -98,6 +112,20 @@ class CreateParamsAccountHolder(TypedDict): """ class CreateParamsFilters(TypedDict): + account_subcategories: NotRequired[ + List[ + Literal[ + "checking", + "credit_card", + "line_of_credit", + "mortgage", + "savings", + ] + ] + ] + """ + Restricts the Session to subcategories of accounts that can be linked. Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`. + """ countries: NotRequired[List[str]] """ List of countries from which to collect accounts. diff --git a/stripe/financial_connections/_session_service.py b/stripe/financial_connections/_session_service.py index 69a70c80d..3ca67b8bf 100644 --- a/stripe/financial_connections/_session_service.py +++ b/stripe/financial_connections/_session_service.py @@ -56,6 +56,20 @@ class CreateParamsAccountHolder(TypedDict): """ class CreateParamsFilters(TypedDict): + account_subcategories: NotRequired[ + List[ + Literal[ + "checking", + "credit_card", + "line_of_credit", + "mortgage", + "savings", + ] + ] + ] + """ + Restricts the Session to subcategories of accounts that can be linked. Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`. + """ countries: NotRequired[List[str]] """ List of countries from which to collect accounts. diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index a9f1351c9..84a7dda32 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -48,6 +48,16 @@ class Offline(StripeObject): Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ + class RebootWindow(StripeObject): + end_hour: int + """ + Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour. + """ + start_hour: int + """ + Integer between 0 to 23 that represents the start hour of the reboot time window. + """ + class StripeS700(StripeObject): splashscreen: Optional[ExpandableField["File"]] """ @@ -305,6 +315,10 @@ class CreateParams(RequestOptions): """ Configurations for collecting transactions offline. """ + reboot_window: NotRequired["Configuration.CreateParamsRebootWindow"] + """ + Reboot time settings for readers that support customized reboot time configuration. + """ stripe_s700: NotRequired["Configuration.CreateParamsStripeS700"] """ An object containing device type specific settings for Stripe S700 readers @@ -330,6 +344,16 @@ class CreateParamsOffline(TypedDict): Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ + class CreateParamsRebootWindow(TypedDict): + end_hour: int + """ + Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour. + """ + start_hour: int + """ + Integer between 0 to 23 that represents the start hour of the reboot time window. + """ + class CreateParamsStripeS700(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ @@ -640,6 +664,12 @@ class ModifyParams(RequestOptions): """ Configurations for collecting transactions offline. """ + reboot_window: NotRequired[ + "Literal['']|Configuration.ModifyParamsRebootWindow" + ] + """ + Reboot time settings for readers that support customized reboot time configuration. + """ stripe_s700: NotRequired[ "Literal['']|Configuration.ModifyParamsStripeS700" ] @@ -669,6 +699,16 @@ class ModifyParamsOffline(TypedDict): Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ + class ModifyParamsRebootWindow(TypedDict): + end_hour: int + """ + Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour. + """ + start_hour: int + """ + Integer between 0 to 23 that represents the start hour of the reboot time window. + """ + class ModifyParamsStripeS700(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ @@ -963,6 +1003,7 @@ class RetrieveParams(RequestOptions): String representing the object's type. Objects of the same type share the same value. """ offline: Optional[Offline] + reboot_window: Optional[RebootWindow] stripe_s700: Optional[StripeS700] tipping: Optional[Tipping] verifone_p400: Optional[VerifoneP400] @@ -1200,6 +1241,7 @@ async def retrieve_async( _inner_class_types = { "bbpos_wisepos_e": BbposWiseposE, "offline": Offline, + "reboot_window": RebootWindow, "stripe_s700": StripeS700, "tipping": Tipping, "verifone_p400": VerifoneP400, diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index 7a87a5fc2..002f55fb5 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -31,6 +31,12 @@ class CreateParams(TypedDict): """ Configurations for collecting transactions offline. """ + reboot_window: NotRequired[ + "ConfigurationService.CreateParamsRebootWindow" + ] + """ + Reboot time settings for readers that support customized reboot time configuration. + """ stripe_s700: NotRequired["ConfigurationService.CreateParamsStripeS700"] """ An object containing device type specific settings for Stripe S700 readers @@ -60,6 +66,16 @@ class CreateParamsOffline(TypedDict): Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ + class CreateParamsRebootWindow(TypedDict): + end_hour: int + """ + Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour. + """ + start_hour: int + """ + Integer between 0 to 23 that represents the start hour of the reboot time window. + """ + class CreateParamsStripeS700(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ @@ -378,6 +394,12 @@ class UpdateParams(TypedDict): """ Configurations for collecting transactions offline. """ + reboot_window: NotRequired[ + "Literal['']|ConfigurationService.UpdateParamsRebootWindow" + ] + """ + Reboot time settings for readers that support customized reboot time configuration. + """ stripe_s700: NotRequired[ "Literal['']|ConfigurationService.UpdateParamsStripeS700" ] @@ -409,6 +431,16 @@ class UpdateParamsOffline(TypedDict): Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ + class UpdateParamsRebootWindow(TypedDict): + end_hour: int + """ + Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour. + """ + start_hour: int + """ + Integer between 0 to 23 that represents the start hour of the reboot time window. + """ + class UpdateParamsStripeS700(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ From 26db537efdd18b195254af162bda74acb4c15754 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 27 Jun 2024 14:28:05 -0700 Subject: [PATCH 081/179] Bump version to 10.1.0 --- CHANGELOG.md | 11 +++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86c54179f..69075a3e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## 10.1.0 - 2024-06-27 +* [#1353](https://github.com/stripe/stripe-python/pull/1353) Update generated code + * Add support for `email_type` on parameter classes `stripe.CreditNote.CreateParams`, `stripe.CreditNote.PreviewLinesParams`, and `stripe.CreditNote.PreviewParams` + * Add support for `filters` on parameter classes `stripe.Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`, and `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections` and resource classes `stripe.Invoice.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections`, `stripe.PaymentIntent.PaymentMethodOptions.UsBankAccount.FinancialConnections`, `stripe.SetupIntent.PaymentMethodOptions.UsBankAccount.FinancialConnections`, `stripe.Subscription.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections`, and `stripe.checkout.Session.PaymentMethodOptions.UsBankAccount.FinancialConnections` + * Add support for `account_subcategories` on parameter class `stripe.financial_connections.Session.CreateParamsFilters` and resource class `stripe.financial_connections.Session.Filters` + * Add support for `reboot_window` on parameter classes `stripe.terminal.Configuration.CreateParams` and `stripe.terminal.Configuration.ModifyParams` and resource `stripe.terminal.Configuration` + * Add support for `day` on enum `stripe.billing.Meter.ListEventSummariesParams.value_grouping_window` + * Add support for `multibanco` on enums `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, and `stripe.PaymentLink.ModifyParams.payment_method_types` + * Add support for `twint` on enums `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, and `stripe.PaymentLink.ModifyParams.payment_method_types` + * Add support for `zip` on enums `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, and `stripe.PaymentLink.ModifyParams.payment_method_types` + ## 10.0.0 - 2024-06-24 * [#1350](https://github.com/stripe/stripe-python/pull/1350) Update generated code diff --git a/VERSION b/VERSION index a13e7b9c8..4149c39ee 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.0.0 +10.1.0 diff --git a/stripe/_version.py b/stripe/_version.py index b91ab216f..906fdd39a 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.0.0" +VERSION = "10.1.0" From 4037269008bafa185b9be5930d076a8578405a43 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:35:01 -0400 Subject: [PATCH 082/179] Update generated code (#1354) * Update generated code for v1105 * Update generated code for v1106 * Update generated code for v1111 * Update generated code for v1112 * Update generated code for v1113 * Update generated code for v1115 * Update generated code for v1116 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_customer.py | 2 +- stripe/_customer_session.py | 18 +- stripe/_customer_session_service.py | 6 +- stripe/_invoice.py | 927 ++++++++++++++++-- stripe/_invoice_line_item.py | 2 +- stripe/_invoice_line_item_service.py | 2 +- stripe/_invoice_service.py | 584 +++++++++++ stripe/_payment_intent.py | 1 + stripe/_setup_attempt.py | 1 + stripe/_setup_intent.py | 1 + stripe/billing/_meter.py | 4 +- stripe/billing/_meter_event_summary.py | 4 +- .../billing/_meter_event_summary_service.py | 4 +- stripe/tax/_transaction.py | 8 + stripe/tax/_transaction_service.py | 4 + 16 files changed, 1471 insertions(+), 99 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 1129f2eb6..dbdf3c1cb 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1103 \ No newline at end of file +v1116 \ No newline at end of file diff --git a/stripe/_customer.py b/stripe/_customer.py index 28d8ff286..012fcbad8 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -1395,7 +1395,7 @@ class SearchParams(RequestOptions): """ next_invoice_sequence: Optional[int] """ - The suffix of the customer's next invoice number (for example, 0001). + The suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses. """ object: Literal["customer"] """ diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index 296199474..f7c8a41ce 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -19,8 +19,8 @@ class CustomerSession(CreateableAPIResource["CustomerSession"]): """ - A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs) - control over a customer. + A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access + control over a Customer. """ OBJECT_NAME: ClassVar[Literal["customer_session"]] = "customer_session" @@ -58,7 +58,7 @@ class CreateParams(RequestOptions): """ customer: str """ - The ID of an existing customer for which to create the customer session. + The ID of an existing customer for which to create the Customer Session. """ expand: NotRequired[List[str]] """ @@ -93,13 +93,13 @@ class CreateParamsComponentsPricingTable(TypedDict): client_secret: str """ - The client secret of this customer session. Used on the client to set up secure access to the given `customer`. + The client secret of this Customer Session. Used on the client to set up secure access to the given `customer`. The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret. """ components: Optional[Components] """ - Configuration for the components supported by this customer session. + Configuration for the components supported by this Customer Session. """ created: int """ @@ -107,11 +107,11 @@ class CreateParamsComponentsPricingTable(TypedDict): """ customer: ExpandableField["Customer"] """ - The customer the customer session was created for. + The Customer the Customer Session was created for. """ expires_at: int """ - The timestamp at which this customer session will expire. + The timestamp at which this Customer Session will expire. """ livemode: bool """ @@ -127,7 +127,7 @@ def create( cls, **params: Unpack["CustomerSession.CreateParams"] ) -> "CustomerSession": """ - Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. + Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. """ return cast( "CustomerSession", @@ -143,7 +143,7 @@ async def create_async( cls, **params: Unpack["CustomerSession.CreateParams"] ) -> "CustomerSession": """ - Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. + Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. """ return cast( "CustomerSession", diff --git a/stripe/_customer_session_service.py b/stripe/_customer_session_service.py index 737e6f775..1bcb652fc 100644 --- a/stripe/_customer_session_service.py +++ b/stripe/_customer_session_service.py @@ -15,7 +15,7 @@ class CreateParams(TypedDict): """ customer: str """ - The ID of an existing customer for which to create the customer session. + The ID of an existing customer for which to create the Customer Session. """ expand: NotRequired[List[str]] """ @@ -54,7 +54,7 @@ def create( options: RequestOptions = {}, ) -> CustomerSession: """ - Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. + Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. """ return cast( CustomerSession, @@ -74,7 +74,7 @@ async def create_async( options: RequestOptions = {}, ) -> CustomerSession: """ - Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. + Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. """ return cast( CustomerSession, diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 0f7a80139..719273d7b 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -418,6 +418,7 @@ class LastFinalizationError(StripeObject): "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", + "payment_intent_fx_quote_invalid", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", @@ -1006,6 +1007,215 @@ class TransferData(StripeObject): The account where funds from the payment will be transferred to upon payment success. """ + class AddLinesParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + invoice_metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + lines: List["Invoice.AddLinesParamsLine"] + """ + The line items to add. + """ + + class AddLinesParamsLine(TypedDict): + amount: NotRequired[int] + """ + The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. + """ + description: NotRequired[str] + """ + An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + """ + discountable: NotRequired[bool] + """ + Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. + """ + discounts: NotRequired[ + "Literal['']|List[Invoice.AddLinesParamsLineDiscount]" + ] + """ + The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + """ + invoice_item: NotRequired[str] + """ + ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + period: NotRequired["Invoice.AddLinesParamsLinePeriod"] + """ + The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + """ + price: NotRequired[str] + """ + The ID of the price object. One of `price` or `price_data` is required. + """ + price_data: NotRequired["Invoice.AddLinesParamsLinePriceData"] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + """ + quantity: NotRequired[int] + """ + Non-negative integer. The quantity of units for the line item. + """ + tax_amounts: NotRequired[ + "Literal['']|List[Invoice.AddLinesParamsLineTaxAmount]" + ] + """ + A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. + """ + + class AddLinesParamsLineDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class AddLinesParamsLinePeriod(TypedDict): + end: int + """ + The end of the period, which must be greater than or equal to the start. This value is inclusive. + """ + start: int + """ + The start of the period. This value is inclusive. + """ + + class AddLinesParamsLinePriceData(TypedDict): + 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). + """ + product: NotRequired[str] + """ + The ID of the product that this price will belong to. One of `product` or `product_data` is required. + """ + product_data: NotRequired[ + "Invoice.AddLinesParamsLinePriceDataProductData" + ] + """ + Data used to generate a new product object inline. One of `product` or `product_data` is required. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class AddLinesParamsLinePriceDataProductData(TypedDict): + description: NotRequired[str] + """ + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + """ + images: NotRequired[List[str]] + """ + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + name: str + """ + The product's name, meant to be displayable to the customer. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + + class AddLinesParamsLineTaxAmount(TypedDict): + amount: int + """ + The amount, in cents (or local equivalent), of the tax. + """ + tax_rate_data: "Invoice.AddLinesParamsLineTaxAmountTaxRateData" + """ + Data to find or create a TaxRate object. + + Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. + """ + taxable_amount: int + """ + The amount on which tax is calculated, in cents (or local equivalent). + """ + + class AddLinesParamsLineTaxAmountTaxRateData(TypedDict): + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + description: NotRequired[str] + """ + An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + """ + display_name: str + """ + The display name of the tax rate, which will be shown to users. + """ + inclusive: bool + """ + This specifies if the tax rate is inclusive or exclusive. + """ + jurisdiction: NotRequired[str] + """ + The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. + """ + percentage: float + """ + The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. + """ + state: NotRequired[str] + """ + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + """ + tax_type: NotRequired[ + Literal[ + "amusement_tax", + "communications_tax", + "gst", + "hst", + "igst", + "jct", + "lease_tax", + "pst", + "qst", + "rst", + "sales_tax", + "vat", + ] + ] + """ + The high-level tax type, such as `vat` or `sales_tax`. + """ + class CreateParams(RequestOptions): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -3342,6 +3552,30 @@ class PayParams(RequestOptions): A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. """ + class RemoveLinesParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + invoice_metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + lines: List["Invoice.RemoveLinesParamsLine"] + """ + The line items to remove. + """ + + class RemoveLinesParamsLine(TypedDict): + behavior: Literal["delete", "unassign"] + """ + Either `delete` or `unassign`. Deleted line items are permanently deleted. Unassigned line items can be reassigned to an invoice. + """ + id: str + """ + ID of an existing line item to remove from this invoice. + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -5640,89 +5874,298 @@ class UpcomingParamsSubscriptionItemPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ - class VoidInvoiceParams(RequestOptions): + class UpdateLinesParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ + invoice_metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. + """ + lines: List["Invoice.UpdateLinesParamsLine"] + """ + The line items to update. + """ - account_country: Optional[str] - """ - The country of the business associated with this invoice, most often the business creating the invoice. - """ - account_name: Optional[str] - """ - The public name of the business associated with this invoice, most often the business creating the invoice. - """ - account_tax_ids: Optional[List[ExpandableField["TaxId"]]] - """ - The account tax IDs associated with the invoice. Only editable when the invoice is a draft. - """ - amount_due: int - """ - Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`. - """ - amount_paid: int - """ - The amount, in cents (or local equivalent), that was paid. - """ - amount_remaining: int - """ - The difference between amount_due and amount_paid, in cents (or local equivalent). - """ - amount_shipping: int - """ - This is the sum of all the shipping amounts. - """ - application: Optional[ExpandableField["Application"]] - """ - ID of the Connect Application that created the invoice. - """ - application_fee_amount: Optional[int] - """ - The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. - """ - attempt_count: int - """ - Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. - """ - attempted: bool - """ - Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. - """ - auto_advance: Optional[bool] - """ - Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. - """ - automatic_tax: AutomaticTax - billing_reason: Optional[ - Literal[ - "automatic_pending_invoice_item_invoice", - "manual", - "quote_accept", - "subscription", - "subscription_create", - "subscription_cycle", - "subscription_threshold", - "subscription_update", - "upcoming", + class UpdateLinesParamsLine(TypedDict): + amount: NotRequired[int] + """ + The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. + """ + description: NotRequired[str] + """ + An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + """ + discountable: NotRequired[bool] + """ + Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. + """ + discounts: NotRequired[ + "Literal['']|List[Invoice.UpdateLinesParamsLineDiscount]" ] - ] - """ - Indicates the reason why the invoice was created. - - * `manual`: Unrelated to a subscription, for example, created via the invoice editor. - * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. - * `subscription_create`: A new subscription was created. - * `subscription_cycle`: A subscription advanced into a new period. - * `subscription_threshold`: A subscription reached a billing threshold. - * `subscription_update`: A subscription was updated. - * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. - """ - charge: Optional[ExpandableField["Charge"]] - """ - ID of the latest charge generated for this invoice, if any. - """ + """ + The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + """ + id: str + """ + ID of an existing line item on the invoice. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. + """ + period: NotRequired["Invoice.UpdateLinesParamsLinePeriod"] + """ + The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + """ + price: NotRequired[str] + """ + The ID of the price object. One of `price` or `price_data` is required. + """ + price_data: NotRequired["Invoice.UpdateLinesParamsLinePriceData"] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + """ + quantity: NotRequired[int] + """ + Non-negative integer. The quantity of units for the line item. + """ + tax_amounts: NotRequired[ + "Literal['']|List[Invoice.UpdateLinesParamsLineTaxAmount]" + ] + """ + A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. + """ + + class UpdateLinesParamsLineDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class UpdateLinesParamsLinePeriod(TypedDict): + end: int + """ + The end of the period, which must be greater than or equal to the start. This value is inclusive. + """ + start: int + """ + The start of the period. This value is inclusive. + """ + + class UpdateLinesParamsLinePriceData(TypedDict): + 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). + """ + product: NotRequired[str] + """ + The ID of the product that this price will belong to. One of `product` or `product_data` is required. + """ + product_data: NotRequired[ + "Invoice.UpdateLinesParamsLinePriceDataProductData" + ] + """ + Data used to generate a new product object inline. One of `product` or `product_data` is required. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class UpdateLinesParamsLinePriceDataProductData(TypedDict): + description: NotRequired[str] + """ + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + """ + images: NotRequired[List[str]] + """ + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + name: str + """ + The product's name, meant to be displayable to the customer. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + + class UpdateLinesParamsLineTaxAmount(TypedDict): + amount: int + """ + The amount, in cents (or local equivalent), of the tax. + """ + tax_rate_data: "Invoice.UpdateLinesParamsLineTaxAmountTaxRateData" + """ + Data to find or create a TaxRate object. + + Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. + """ + taxable_amount: int + """ + The amount on which tax is calculated, in cents (or local equivalent). + """ + + class UpdateLinesParamsLineTaxAmountTaxRateData(TypedDict): + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + description: NotRequired[str] + """ + An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + """ + display_name: str + """ + The display name of the tax rate, which will be shown to users. + """ + inclusive: bool + """ + This specifies if the tax rate is inclusive or exclusive. + """ + jurisdiction: NotRequired[str] + """ + The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. + """ + percentage: float + """ + The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. + """ + state: NotRequired[str] + """ + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + """ + tax_type: NotRequired[ + Literal[ + "amusement_tax", + "communications_tax", + "gst", + "hst", + "igst", + "jct", + "lease_tax", + "pst", + "qst", + "rst", + "sales_tax", + "vat", + ] + ] + """ + The high-level tax type, such as `vat` or `sales_tax`. + """ + + class VoidInvoiceParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + account_country: Optional[str] + """ + The country of the business associated with this invoice, most often the business creating the invoice. + """ + account_name: Optional[str] + """ + The public name of the business associated with this invoice, most often the business creating the invoice. + """ + account_tax_ids: Optional[List[ExpandableField["TaxId"]]] + """ + The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + """ + amount_due: int + """ + Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`. + """ + amount_paid: int + """ + The amount, in cents (or local equivalent), that was paid. + """ + amount_remaining: int + """ + The difference between amount_due and amount_paid, in cents (or local equivalent). + """ + amount_shipping: int + """ + This is the sum of all the shipping amounts. + """ + application: Optional[ExpandableField["Application"]] + """ + ID of the Connect Application that created the invoice. + """ + application_fee_amount: Optional[int] + """ + The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. + """ + attempt_count: int + """ + Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. + """ + attempted: bool + """ + Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. + """ + auto_advance: Optional[bool] + """ + Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. + """ + automatic_tax: AutomaticTax + billing_reason: Optional[ + Literal[ + "automatic_pending_invoice_item_invoice", + "manual", + "quote_accept", + "subscription", + "subscription_create", + "subscription_cycle", + "subscription_threshold", + "subscription_update", + "upcoming", + ] + ] + """ + Indicates the reason why the invoice was created. + + * `manual`: Unrelated to a subscription, for example, created via the invoice editor. + * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. + * `subscription_create`: A new subscription was created. + * `subscription_cycle`: A subscription advanced into a new period. + * `subscription_threshold`: A subscription reached a billing threshold. + * `subscription_update`: A subscription was updated. + * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. + """ + charge: Optional[ExpandableField["Charge"]] + """ + ID of the latest charge generated for this invoice, if any. + """ collection_method: Literal["charge_automatically", "send_invoice"] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. @@ -5988,6 +6431,116 @@ class VoidInvoiceParams(RequestOptions): Always true for a deleted object """ + @classmethod + def _cls_add_lines( + cls, invoice: str, **params: Unpack["Invoice.AddLinesParams"] + ) -> "Invoice": + """ + Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + "Invoice", + cls._static_request( + "post", + "/v1/invoices/{invoice}/add_lines".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + + @overload + @staticmethod + def add_lines( + invoice: str, **params: Unpack["Invoice.AddLinesParams"] + ) -> "Invoice": + """ + Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. + """ + ... + + @overload + def add_lines( + self, **params: Unpack["Invoice.AddLinesParams"] + ) -> "Invoice": + """ + Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. + """ + ... + + @class_method_variant("_cls_add_lines") + def add_lines( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Invoice.AddLinesParams"] + ) -> "Invoice": + """ + Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + "Invoice", + self._request( + "post", + "/v1/invoices/{invoice}/add_lines".format( + invoice=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_add_lines_async( + cls, invoice: str, **params: Unpack["Invoice.AddLinesParams"] + ) -> "Invoice": + """ + Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + "Invoice", + await cls._static_request_async( + "post", + "/v1/invoices/{invoice}/add_lines".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def add_lines_async( + invoice: str, **params: Unpack["Invoice.AddLinesParams"] + ) -> "Invoice": + """ + Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. + """ + ... + + @overload + async def add_lines_async( + self, **params: Unpack["Invoice.AddLinesParams"] + ) -> "Invoice": + """ + Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. + """ + ... + + @class_method_variant("_cls_add_lines_async") + async def add_lines_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Invoice.AddLinesParams"] + ) -> "Invoice": + """ + Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + "Invoice", + await self._request_async( + "post", + "/v1/invoices/{invoice}/add_lines".format( + invoice=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create(cls, **params: Unpack["Invoice.CreateParams"]) -> "Invoice": """ @@ -6568,6 +7121,116 @@ async def pay_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def _cls_remove_lines( + cls, invoice: str, **params: Unpack["Invoice.RemoveLinesParams"] + ) -> "Invoice": + """ + Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + "Invoice", + cls._static_request( + "post", + "/v1/invoices/{invoice}/remove_lines".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + + @overload + @staticmethod + def remove_lines( + invoice: str, **params: Unpack["Invoice.RemoveLinesParams"] + ) -> "Invoice": + """ + Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. + """ + ... + + @overload + def remove_lines( + self, **params: Unpack["Invoice.RemoveLinesParams"] + ) -> "Invoice": + """ + Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. + """ + ... + + @class_method_variant("_cls_remove_lines") + def remove_lines( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Invoice.RemoveLinesParams"] + ) -> "Invoice": + """ + Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + "Invoice", + self._request( + "post", + "/v1/invoices/{invoice}/remove_lines".format( + invoice=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_remove_lines_async( + cls, invoice: str, **params: Unpack["Invoice.RemoveLinesParams"] + ) -> "Invoice": + """ + Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + "Invoice", + await cls._static_request_async( + "post", + "/v1/invoices/{invoice}/remove_lines".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def remove_lines_async( + invoice: str, **params: Unpack["Invoice.RemoveLinesParams"] + ) -> "Invoice": + """ + Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. + """ + ... + + @overload + async def remove_lines_async( + self, **params: Unpack["Invoice.RemoveLinesParams"] + ) -> "Invoice": + """ + Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. + """ + ... + + @class_method_variant("_cls_remove_lines_async") + async def remove_lines_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Invoice.RemoveLinesParams"] + ) -> "Invoice": + """ + Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + "Invoice", + await self._request_async( + "post", + "/v1/invoices/{invoice}/remove_lines".format( + invoice=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Invoice.RetrieveParams"] @@ -6790,6 +7453,116 @@ async def upcoming_lines_async( ), ) + @classmethod + def _cls_update_lines( + cls, invoice: str, **params: Unpack["Invoice.UpdateLinesParams"] + ) -> "Invoice": + """ + Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + "Invoice", + cls._static_request( + "post", + "/v1/invoices/{invoice}/update_lines".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + + @overload + @staticmethod + def update_lines( + invoice: str, **params: Unpack["Invoice.UpdateLinesParams"] + ) -> "Invoice": + """ + Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. + """ + ... + + @overload + def update_lines( + self, **params: Unpack["Invoice.UpdateLinesParams"] + ) -> "Invoice": + """ + Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. + """ + ... + + @class_method_variant("_cls_update_lines") + def update_lines( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Invoice.UpdateLinesParams"] + ) -> "Invoice": + """ + Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + "Invoice", + self._request( + "post", + "/v1/invoices/{invoice}/update_lines".format( + invoice=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_update_lines_async( + cls, invoice: str, **params: Unpack["Invoice.UpdateLinesParams"] + ) -> "Invoice": + """ + Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + "Invoice", + await cls._static_request_async( + "post", + "/v1/invoices/{invoice}/update_lines".format( + invoice=sanitize_id(invoice) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def update_lines_async( + invoice: str, **params: Unpack["Invoice.UpdateLinesParams"] + ) -> "Invoice": + """ + Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. + """ + ... + + @overload + async def update_lines_async( + self, **params: Unpack["Invoice.UpdateLinesParams"] + ) -> "Invoice": + """ + Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. + """ + ... + + @class_method_variant("_cls_update_lines_async") + async def update_lines_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Invoice.UpdateLinesParams"] + ) -> "Invoice": + """ + Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + "Invoice", + await self._request_async( + "post", + "/v1/invoices/{invoice}/update_lines".format( + invoice=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_void_invoice( cls, invoice: str, **params: Unpack["Invoice.VoidInvoiceParams"] diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 4ebc11c7f..cf6691f38 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -129,7 +129,7 @@ class ModifyParams(RequestOptions): """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ - Set of [key-value pairs](https://stripe.com/docs/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=recurring` line items, the incoming metadata specified on the request is directly used to set this value, in contrast to `type=invoiceitem` line items, where any existing metadata on the invoice line is merged with the incoming data. + Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. """ period: NotRequired["InvoiceLineItem.ModifyParamsPeriod"] """ diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index 21be17673..b17ba4214 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -53,7 +53,7 @@ class UpdateParams(TypedDict): """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ - Set of [key-value pairs](https://stripe.com/docs/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=recurring` line items, the incoming metadata specified on the request is directly used to set this value, in contrast to `type=invoiceitem` line items, where any existing metadata on the invoice line is merged with the incoming data. + Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. """ period: NotRequired["InvoiceLineItemService.UpdateParamsPeriod"] """ diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 6c654de69..ec8fa7c77 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -18,6 +18,215 @@ def __init__(self, requestor): self.line_items = InvoiceLineItemService(self._requestor) self.upcoming_lines = InvoiceUpcomingLinesService(self._requestor) + class AddLinesParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + invoice_metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + lines: List["InvoiceService.AddLinesParamsLine"] + """ + The line items to add. + """ + + class AddLinesParamsLine(TypedDict): + amount: NotRequired[int] + """ + The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. + """ + description: NotRequired[str] + """ + An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + """ + discountable: NotRequired[bool] + """ + Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceService.AddLinesParamsLineDiscount]" + ] + """ + The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + """ + invoice_item: NotRequired[str] + """ + ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + period: NotRequired["InvoiceService.AddLinesParamsLinePeriod"] + """ + The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + """ + price: NotRequired[str] + """ + The ID of the price object. One of `price` or `price_data` is required. + """ + price_data: NotRequired["InvoiceService.AddLinesParamsLinePriceData"] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + """ + quantity: NotRequired[int] + """ + Non-negative integer. The quantity of units for the line item. + """ + tax_amounts: NotRequired[ + "Literal['']|List[InvoiceService.AddLinesParamsLineTaxAmount]" + ] + """ + A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. + """ + + class AddLinesParamsLineDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class AddLinesParamsLinePeriod(TypedDict): + end: int + """ + The end of the period, which must be greater than or equal to the start. This value is inclusive. + """ + start: int + """ + The start of the period. This value is inclusive. + """ + + class AddLinesParamsLinePriceData(TypedDict): + 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). + """ + product: NotRequired[str] + """ + The ID of the product that this price will belong to. One of `product` or `product_data` is required. + """ + product_data: NotRequired[ + "InvoiceService.AddLinesParamsLinePriceDataProductData" + ] + """ + Data used to generate a new product object inline. One of `product` or `product_data` is required. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class AddLinesParamsLinePriceDataProductData(TypedDict): + description: NotRequired[str] + """ + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + """ + images: NotRequired[List[str]] + """ + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + name: str + """ + The product's name, meant to be displayable to the customer. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + + class AddLinesParamsLineTaxAmount(TypedDict): + amount: int + """ + The amount, in cents (or local equivalent), of the tax. + """ + tax_rate_data: "InvoiceService.AddLinesParamsLineTaxAmountTaxRateData" + """ + Data to find or create a TaxRate object. + + Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. + """ + taxable_amount: int + """ + The amount on which tax is calculated, in cents (or local equivalent). + """ + + class AddLinesParamsLineTaxAmountTaxRateData(TypedDict): + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + description: NotRequired[str] + """ + An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + """ + display_name: str + """ + The display name of the tax rate, which will be shown to users. + """ + inclusive: bool + """ + This specifies if the tax rate is inclusive or exclusive. + """ + jurisdiction: NotRequired[str] + """ + The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. + """ + percentage: float + """ + The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. + """ + state: NotRequired[str] + """ + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + """ + tax_type: NotRequired[ + Literal[ + "amusement_tax", + "communications_tax", + "gst", + "hst", + "igst", + "jct", + "lease_tax", + "pst", + "qst", + "rst", + "sales_tax", + "vat", + ] + ] + """ + The high-level tax type, such as `vat` or `sales_tax`. + """ + class CreateParams(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -1759,6 +1968,30 @@ class PayParams(TypedDict): A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. """ + class RemoveLinesParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + invoice_metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + lines: List["InvoiceService.RemoveLinesParamsLine"] + """ + The line items to remove. + """ + + class RemoveLinesParamsLine(TypedDict): + behavior: Literal["delete", "unassign"] + """ + Either `delete` or `unassign`. Deleted line items are permanently deleted. Unassigned line items can be reassigned to an invoice. + """ + id: str + """ + ID of an existing line item to remove from this invoice. + """ + class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ @@ -2915,6 +3148,219 @@ class UpcomingParamsSubscriptionItemPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class UpdateLinesParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + invoice_metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. + """ + lines: List["InvoiceService.UpdateLinesParamsLine"] + """ + The line items to update. + """ + + class UpdateLinesParamsLine(TypedDict): + amount: NotRequired[int] + """ + The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. + """ + description: NotRequired[str] + """ + An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + """ + discountable: NotRequired[bool] + """ + Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceService.UpdateLinesParamsLineDiscount]" + ] + """ + The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + """ + id: str + """ + ID of an existing line item on the invoice. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. + """ + period: NotRequired["InvoiceService.UpdateLinesParamsLinePeriod"] + """ + The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + """ + price: NotRequired[str] + """ + The ID of the price object. One of `price` or `price_data` is required. + """ + price_data: NotRequired[ + "InvoiceService.UpdateLinesParamsLinePriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + """ + quantity: NotRequired[int] + """ + Non-negative integer. The quantity of units for the line item. + """ + tax_amounts: NotRequired[ + "Literal['']|List[InvoiceService.UpdateLinesParamsLineTaxAmount]" + ] + """ + A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. + """ + + class UpdateLinesParamsLineDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class UpdateLinesParamsLinePeriod(TypedDict): + end: int + """ + The end of the period, which must be greater than or equal to the start. This value is inclusive. + """ + start: int + """ + The start of the period. This value is inclusive. + """ + + class UpdateLinesParamsLinePriceData(TypedDict): + 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). + """ + product: NotRequired[str] + """ + The ID of the product that this price will belong to. One of `product` or `product_data` is required. + """ + product_data: NotRequired[ + "InvoiceService.UpdateLinesParamsLinePriceDataProductData" + ] + """ + Data used to generate a new product object inline. One of `product` or `product_data` is required. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class UpdateLinesParamsLinePriceDataProductData(TypedDict): + description: NotRequired[str] + """ + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + """ + images: NotRequired[List[str]] + """ + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + name: str + """ + The product's name, meant to be displayable to the customer. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + + class UpdateLinesParamsLineTaxAmount(TypedDict): + amount: int + """ + The amount, in cents (or local equivalent), of the tax. + """ + tax_rate_data: ( + "InvoiceService.UpdateLinesParamsLineTaxAmountTaxRateData" + ) + """ + Data to find or create a TaxRate object. + + Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. + """ + taxable_amount: int + """ + The amount on which tax is calculated, in cents (or local equivalent). + """ + + class UpdateLinesParamsLineTaxAmountTaxRateData(TypedDict): + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + description: NotRequired[str] + """ + An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + """ + display_name: str + """ + The display name of the tax rate, which will be shown to users. + """ + inclusive: bool + """ + This specifies if the tax rate is inclusive or exclusive. + """ + jurisdiction: NotRequired[str] + """ + The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. + """ + percentage: float + """ + The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. + """ + state: NotRequired[str] + """ + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + """ + tax_type: NotRequired[ + Literal[ + "amusement_tax", + "communications_tax", + "gst", + "hst", + "igst", + "jct", + "lease_tax", + "pst", + "qst", + "rst", + "sales_tax", + "vat", + ] + ] + """ + The high-level tax type, such as `vat` or `sales_tax`. + """ + class UpdateParams(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -3832,6 +4278,52 @@ async def upcoming_async( ), ) + def add_lines( + self, + invoice: str, + params: "InvoiceService.AddLinesParams", + options: RequestOptions = {}, + ) -> Invoice: + """ + Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + Invoice, + self._request( + "post", + "/v1/invoices/{invoice}/add_lines".format( + invoice=sanitize_id(invoice), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def add_lines_async( + self, + invoice: str, + params: "InvoiceService.AddLinesParams", + options: RequestOptions = {}, + ) -> Invoice: + """ + Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + Invoice, + await self._request_async( + "post", + "/v1/invoices/{invoice}/add_lines".format( + invoice=sanitize_id(invoice), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def finalize_invoice( self, invoice: str, @@ -3970,6 +4462,52 @@ async def pay_async( ), ) + def remove_lines( + self, + invoice: str, + params: "InvoiceService.RemoveLinesParams", + options: RequestOptions = {}, + ) -> Invoice: + """ + Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + Invoice, + self._request( + "post", + "/v1/invoices/{invoice}/remove_lines".format( + invoice=sanitize_id(invoice), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def remove_lines_async( + self, + invoice: str, + params: "InvoiceService.RemoveLinesParams", + options: RequestOptions = {}, + ) -> Invoice: + """ + Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + Invoice, + await self._request_async( + "post", + "/v1/invoices/{invoice}/remove_lines".format( + invoice=sanitize_id(invoice), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def send_invoice( self, invoice: str, @@ -4020,6 +4558,52 @@ async def send_invoice_async( ), ) + def update_lines( + self, + invoice: str, + params: "InvoiceService.UpdateLinesParams", + options: RequestOptions = {}, + ) -> Invoice: + """ + Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + Invoice, + self._request( + "post", + "/v1/invoices/{invoice}/update_lines".format( + invoice=sanitize_id(invoice), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def update_lines_async( + self, + invoice: str, + params: "InvoiceService.UpdateLinesParams", + options: RequestOptions = {}, + ) -> Invoice: + """ + Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. + """ + return cast( + Invoice, + await self._request_async( + "post", + "/v1/invoices/{invoice}/update_lines".format( + invoice=sanitize_id(invoice), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def void_invoice( self, invoice: str, diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 5c8d804c3..1873cbe0b 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -195,6 +195,7 @@ class LastPaymentError(StripeObject): "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", + "payment_intent_fx_quote_invalid", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 7aedd8bb3..e9e72c760 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -527,6 +527,7 @@ class SetupError(StripeObject): "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", + "payment_intent_fx_quote_invalid", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index dedeefd03..610c46d7d 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -180,6 +180,7 @@ class LastSetupError(StripeObject): "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", + "payment_intent_fx_quote_invalid", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index f2fe0f0ee..e857a9950 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -126,7 +126,7 @@ class ListEventSummariesParams(RequestOptions): """ end_time: int """ - The timestamp from when to stop aggregating meter events (exclusive). + The timestamp from when to stop aggregating meter events (exclusive). Must be aligned with minute boundaries. """ ending_before: NotRequired[str] """ @@ -142,7 +142,7 @@ class ListEventSummariesParams(RequestOptions): """ start_time: int """ - The timestamp from when to start aggregating meter events (inclusive). + The timestamp from when to start aggregating meter events (inclusive). Must be aligned with minute boundaries. """ starting_after: NotRequired[str] """ diff --git a/stripe/billing/_meter_event_summary.py b/stripe/billing/_meter_event_summary.py index a6b1e23fc..d613e0a0c 100644 --- a/stripe/billing/_meter_event_summary.py +++ b/stripe/billing/_meter_event_summary.py @@ -20,7 +20,7 @@ class MeterEventSummary(StripeObject): """ end_time: int """ - End timestamp for this event summary (inclusive). + End timestamp for this event summary (exclusive). Must be aligned with minute boundaries. """ id: str """ @@ -40,5 +40,5 @@ class MeterEventSummary(StripeObject): """ start_time: int """ - Start timestamp for this event summary (inclusive). + Start timestamp for this event summary (inclusive). Must be aligned with minute boundaries. """ diff --git a/stripe/billing/_meter_event_summary_service.py b/stripe/billing/_meter_event_summary_service.py index 48b2cacb5..9f61f603a 100644 --- a/stripe/billing/_meter_event_summary_service.py +++ b/stripe/billing/_meter_event_summary_service.py @@ -17,7 +17,7 @@ class ListParams(TypedDict): """ end_time: int """ - The timestamp from when to stop aggregating meter events (exclusive). + The timestamp from when to stop aggregating meter events (exclusive). Must be aligned with minute boundaries. """ ending_before: NotRequired[str] """ @@ -33,7 +33,7 @@ class ListParams(TypedDict): """ start_time: int """ - The timestamp from when to start aggregating meter events (inclusive). + The timestamp from when to start aggregating meter events (inclusive). Must be aligned with minute boundaries. """ starting_after: NotRequired[str] """ diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index c4f5b90a3..4ae3ba540 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -329,6 +329,10 @@ class CreateFromCalculationParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + posted_at: NotRequired[int] + """ + The Unix timestamp representing when the tax liability is assumed or reduced, which determines the liability posting period and handling in tax liability reports. The timestamp must fall within the `tax_date` and the current time, unless the `tax_date` is scheduled in advance. Defaults to the current time. + """ reference: str """ A custom order or sale identifier, such as 'myOrder_123'. Must be unique across all transactions, including reversals. @@ -465,6 +469,10 @@ class RetrieveParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ + posted_at: int + """ + The Unix timestamp representing when the tax liability is assumed or reduced. + """ reference: str """ A custom unique identifier, such as 'myOrder_123'. diff --git a/stripe/tax/_transaction_service.py b/stripe/tax/_transaction_service.py index de7ec3187..d76151cb0 100644 --- a/stripe/tax/_transaction_service.py +++ b/stripe/tax/_transaction_service.py @@ -29,6 +29,10 @@ class CreateFromCalculationParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + posted_at: NotRequired[int] + """ + The Unix timestamp representing when the tax liability is assumed or reduced, which determines the liability posting period and handling in tax liability reports. The timestamp must fall within the `tax_date` and the current time, unless the `tax_date` is scheduled in advance. Defaults to the current time. + """ reference: str """ A custom order or sale identifier, such as 'myOrder_123'. Must be unique across all transactions, including reversals. From f1e13b2a5de95c00d04344f8793615e65b79f99a Mon Sep 17 00:00:00 2001 From: Prathmesh Ranaut Date: Fri, 5 Jul 2024 14:52:36 -0400 Subject: [PATCH 083/179] Bump version to 10.2.0 --- CHANGELOG.md | 6 ++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69075a3e0..dc855633b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 10.2.0 - 2024-07-05 +* [#1354](https://github.com/stripe/stripe-python/pull/1354) Update generated code + * Add support for `_cls_add_lines`, `_cls_remove_lines`, `_cls_update_lines`, `add_lines`, `remove_lines`, `update_lines` on resource `stripe.Invoice` + * Add support for `posted_at` on parameter class `stripe.tax.Transaction.CreateFromCalculationParams` and resource `stripe.tax.Transaction` + * Add support for `payment_intent_fx_quote_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + ## 10.1.0 - 2024-06-27 * [#1353](https://github.com/stripe/stripe-python/pull/1353) Update generated code * Add support for `email_type` on parameter classes `stripe.CreditNote.CreateParams`, `stripe.CreditNote.PreviewLinesParams`, and `stripe.CreditNote.PreviewParams` diff --git a/VERSION b/VERSION index 4149c39ee..2bd6f7e39 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.1.0 +10.2.0 diff --git a/stripe/_version.py b/stripe/_version.py index 906fdd39a..e2277d63a 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.1.0" +VERSION = "10.2.0" From 2686322223b1cb127449ea18017d63660df520f8 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:07:54 -0700 Subject: [PATCH 084/179] don't auto-organize imports (#1357) --- .vscode/settings.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 324c33a9a..24c60026c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,7 +19,10 @@ // Formatting "editor.formatOnSave": true, "[python]": { - "editor.defaultFormatter": "charliermarsh.ruff" + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.codeActionsOnSave": { + "source.organizeImports": "never" + } }, // Tests From a2fd69af55e34e884c8f77f6592e1a47435ca558 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:31:18 -0700 Subject: [PATCH 085/179] Update generated code (#1358) * Update generated code for v1117 * Update generated code for v1118 * Update generated code for v1120 * Update generated code for v1121 * Update generated code for v1123 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_confirmation_token.py | 18 ++++ stripe/_customer_session.py | 110 ++++++++++++++++++++ stripe/_customer_session_service.py | 58 ++++++++++- stripe/_invoice.py | 5 - stripe/_payment_intent.py | 5 - stripe/_setup_attempt.py | 5 - stripe/_setup_intent.py | 5 - stripe/_subscription.py | 12 +-- stripe/_subscription_service.py | 12 +-- stripe/billing_portal/_session.py | 2 +- stripe/issuing/_card.py | 155 +++++++++++++++++++++++++++- stripe/issuing/_card_service.py | 94 +++++++++++++++++ 13 files changed, 447 insertions(+), 36 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index dbdf3c1cb..af6e36838 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1116 \ No newline at end of file +v1123 \ No newline at end of file diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 9364a3fc0..37d8e0045 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -61,6 +61,19 @@ class Online(StripeObject): """ _inner_class_types = {"customer_acceptance": CustomerAcceptance} + class PaymentMethodOptions(StripeObject): + class Card(StripeObject): + cvc_token: Optional[str] + """ + The `cvc_update` Token collected from the Payment Element. + """ + + card: Optional[Card] + """ + This hash contains the card payment method options. + """ + _inner_class_types = {"card": Card} + class PaymentMethodPreview(StripeObject): class AcssDebit(StripeObject): bank_name: Optional[str] @@ -2105,6 +2118,10 @@ class RetrieveParams(RequestOptions): """ ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. """ + payment_method_options: Optional[PaymentMethodOptions] + """ + Payment-method-specific configuration for this ConfirmationToken. + """ payment_method_preview: Optional[PaymentMethodPreview] """ Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. @@ -2195,6 +2212,7 @@ def test_helpers(self): _inner_class_types = { "mandate_data": MandateData, + "payment_method_options": PaymentMethodOptions, "payment_method_preview": PaymentMethodPreview, "shipping": Shipping, } diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index f7c8a41ce..99fbfdb46 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -32,6 +32,55 @@ class BuyButton(StripeObject): Whether the buy button is enabled. """ + class PaymentElement(StripeObject): + class Features(StripeObject): + payment_method_allow_redisplay_filters: List[ + Literal["always", "limited", "unspecified"] + ] + """ + A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. + + If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. + """ + payment_method_redisplay: Literal["disabled", "enabled"] + """ + Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. + """ + payment_method_redisplay_limit: Optional[int] + """ + Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`. + """ + payment_method_remove: Literal["disabled", "enabled"] + """ + Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`. + + Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). + """ + payment_method_save: Literal["disabled", "enabled"] + """ + Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`. + + If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. + """ + payment_method_save_usage: Optional[ + Literal["off_session", "on_session"] + ] + """ + When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. + + When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation. + """ + + enabled: bool + """ + Whether the Payment Element is enabled. + """ + features: Optional[Features] + """ + This hash defines whether the Payment Element supports certain features. + """ + _inner_class_types = {"features": Features} + class PricingTable(StripeObject): enabled: bool """ @@ -42,12 +91,17 @@ class PricingTable(StripeObject): """ This hash contains whether the buy button is enabled. """ + payment_element: PaymentElement + """ + This hash contains whether the Payment Element is enabled and the features it supports. + """ pricing_table: PricingTable """ This hash contains whether the pricing table is enabled. """ _inner_class_types = { "buy_button": BuyButton, + "payment_element": PaymentElement, "pricing_table": PricingTable, } @@ -72,6 +126,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for buy button. """ + payment_element: NotRequired[ + "CustomerSession.CreateParamsComponentsPaymentElement" + ] + """ + Configuration for the Payment Element. + """ pricing_table: NotRequired[ "CustomerSession.CreateParamsComponentsPricingTable" ] @@ -85,6 +145,56 @@ class CreateParamsComponentsBuyButton(TypedDict): Whether the buy button is enabled. """ + class CreateParamsComponentsPaymentElement(TypedDict): + enabled: bool + """ + Whether the Payment Element is enabled. + """ + features: NotRequired[ + "CustomerSession.CreateParamsComponentsPaymentElementFeatures" + ] + """ + This hash defines whether the Payment Element supports certain features. + """ + + class CreateParamsComponentsPaymentElementFeatures(TypedDict): + payment_method_allow_redisplay_filters: NotRequired[ + List[Literal["always", "limited", "unspecified"]] + ] + """ + A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. + + If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. + """ + payment_method_redisplay: NotRequired[Literal["disabled", "enabled"]] + """ + Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. + """ + payment_method_redisplay_limit: NotRequired[int] + """ + Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`. + """ + payment_method_remove: NotRequired[Literal["disabled", "enabled"]] + """ + Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`. + + Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). + """ + payment_method_save: NotRequired[Literal["disabled", "enabled"]] + """ + Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`. + + If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. + """ + payment_method_save_usage: NotRequired[ + Literal["off_session", "on_session"] + ] + """ + When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. + + When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation. + """ + class CreateParamsComponentsPricingTable(TypedDict): enabled: bool """ diff --git a/stripe/_customer_session_service.py b/stripe/_customer_session_service.py index 1bcb652fc..126782ae3 100644 --- a/stripe/_customer_session_service.py +++ b/stripe/_customer_session_service.py @@ -4,7 +4,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from typing import List, cast -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Literal, NotRequired, TypedDict class CustomerSessionService(StripeService): @@ -29,6 +29,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for buy button. """ + payment_element: NotRequired[ + "CustomerSessionService.CreateParamsComponentsPaymentElement" + ] + """ + Configuration for the Payment Element. + """ pricing_table: NotRequired[ "CustomerSessionService.CreateParamsComponentsPricingTable" ] @@ -42,6 +48,56 @@ class CreateParamsComponentsBuyButton(TypedDict): Whether the buy button is enabled. """ + class CreateParamsComponentsPaymentElement(TypedDict): + enabled: bool + """ + Whether the Payment Element is enabled. + """ + features: NotRequired[ + "CustomerSessionService.CreateParamsComponentsPaymentElementFeatures" + ] + """ + This hash defines whether the Payment Element supports certain features. + """ + + class CreateParamsComponentsPaymentElementFeatures(TypedDict): + payment_method_allow_redisplay_filters: NotRequired[ + List[Literal["always", "limited", "unspecified"]] + ] + """ + A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. + + If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. + """ + payment_method_redisplay: NotRequired[Literal["disabled", "enabled"]] + """ + Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. + """ + payment_method_redisplay_limit: NotRequired[int] + """ + Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`. + """ + payment_method_remove: NotRequired[Literal["disabled", "enabled"]] + """ + Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`. + + Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). + """ + payment_method_save: NotRequired[Literal["disabled", "enabled"]] + """ + Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`. + + If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. + """ + payment_method_save_usage: NotRequired[ + Literal["off_session", "on_session"] + ] + """ + When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. + + When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation. + """ + class CreateParamsComponentsPricingTable(TypedDict): enabled: bool """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 719273d7b..b08e395b2 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -341,10 +341,6 @@ class LastFinalizationError(StripeObject): "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", - "billing_policy_remote_function_response_invalid", - "billing_policy_remote_function_timeout", - "billing_policy_remote_function_unexpected_status_code", - "billing_policy_remote_function_unreachable", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", @@ -418,7 +414,6 @@ class LastFinalizationError(StripeObject): "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", - "payment_intent_fx_quote_invalid", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 1873cbe0b..c49856642 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -118,10 +118,6 @@ class LastPaymentError(StripeObject): "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", - "billing_policy_remote_function_response_invalid", - "billing_policy_remote_function_timeout", - "billing_policy_remote_function_unexpected_status_code", - "billing_policy_remote_function_unreachable", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", @@ -195,7 +191,6 @@ class LastPaymentError(StripeObject): "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", - "payment_intent_fx_quote_invalid", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index e9e72c760..67d21c1cc 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -450,10 +450,6 @@ class SetupError(StripeObject): "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", - "billing_policy_remote_function_response_invalid", - "billing_policy_remote_function_timeout", - "billing_policy_remote_function_unexpected_status_code", - "billing_policy_remote_function_unreachable", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", @@ -527,7 +523,6 @@ class SetupError(StripeObject): "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", - "payment_intent_fx_quote_invalid", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 610c46d7d..eb1ef447d 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -103,10 +103,6 @@ class LastSetupError(StripeObject): "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", - "billing_policy_remote_function_response_invalid", - "billing_policy_remote_function_timeout", - "billing_policy_remote_function_unexpected_status_code", - "billing_policy_remote_function_unreachable", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", @@ -180,7 +176,6 @@ class LastSetupError(StripeObject): "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", - "payment_intent_fx_quote_invalid", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 218f56c86..cc3fdd500 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -2616,7 +2616,7 @@ def modify( """ Updates an existing subscription to match the specified parameters. When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. - To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. + To preview how the proration is calculated, use the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint. By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. @@ -2624,11 +2624,11 @@ def modify( The billing interval is changed (for example, from monthly to yearly). - The subscription moves from free to paid, or paid to free. + The subscription moves from free to paid. A trial starts or ends. - In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. + In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment). If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). @@ -2653,7 +2653,7 @@ async def modify_async( """ Updates an existing subscription to match the specified parameters. When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. - To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. + To preview how the proration is calculated, use the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint. By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. @@ -2661,11 +2661,11 @@ async def modify_async( The billing interval is changed (for example, from monthly to yearly). - The subscription moves from free to paid, or paid to free. + The subscription moves from free to paid. A trial starts or ends. - In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. + In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment). If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index c853c8aad..7d124a20c 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -1749,7 +1749,7 @@ def update( """ Updates an existing subscription to match the specified parameters. When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. - To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. + To preview how the proration is calculated, use the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint. By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. @@ -1757,11 +1757,11 @@ def update( The billing interval is changed (for example, from monthly to yearly). - The subscription moves from free to paid, or paid to free. + The subscription moves from free to paid. A trial starts or ends. - In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. + In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment). If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). @@ -1794,7 +1794,7 @@ async def update_async( """ Updates an existing subscription to match the specified parameters. When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. - To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. + To preview how the proration is calculated, use the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint. By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. @@ -1802,11 +1802,11 @@ async def update_async( The billing interval is changed (for example, from monthly to yearly). - The subscription moves from free to paid, or paid to free. + The subscription moves from free to paid. A trial starts or ends. - In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. + In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment). If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index 608d06d04..797bde930 100644 --- a/stripe/billing_portal/_session.py +++ b/stripe/billing_portal/_session.py @@ -32,7 +32,7 @@ class Session(CreateableAPIResource["Session"]): Create sessions on-demand when customers intend to manage their subscriptions and billing details. - Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal). + Related guide: [Customer management](https://stripe.com/customer-management) """ OBJECT_NAME: ClassVar[Literal["billing_portal.session"]] = ( diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index 86507a293..f4c190958 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -62,6 +62,57 @@ class Address(StripeObject): State, county, province, or region. """ + class AddressValidation(StripeObject): + class NormalizedAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + mode: Literal[ + "disabled", + "normalization_only", + "validation_and_normalization", + ] + """ + The address validation capabilities to use. + """ + normalized_address: Optional[NormalizedAddress] + """ + The normalized shipping address. + """ + result: Optional[ + Literal[ + "indeterminate", + "likely_deliverable", + "likely_undeliverable", + ] + ] + """ + The validation result for the shipping address. + """ + _inner_class_types = {"normalized_address": NormalizedAddress} + class Customs(StripeObject): eori_number: Optional[str] """ @@ -69,6 +120,10 @@ class Customs(StripeObject): """ address: Address + address_validation: Optional[AddressValidation] + """ + Address validation details for the shipment. + """ carrier: Optional[Literal["dhl", "fedex", "royal_mail", "usps"]] """ The delivery company that shipped a card. @@ -122,7 +177,11 @@ class Customs(StripeObject): """ Packaging options. """ - _inner_class_types = {"address": Address, "customs": Customs} + _inner_class_types = { + "address": Address, + "address_validation": AddressValidation, + "customs": Customs, + } class SpendingControls(StripeObject): class SpendingLimit(StripeObject): @@ -1181,6 +1240,12 @@ class CreateParamsShipping(TypedDict): """ The address that the card is shipped to. """ + address_validation: NotRequired[ + "Card.CreateParamsShippingAddressValidation" + ] + """ + Address validation settings. + """ customs: NotRequired["Card.CreateParamsShippingCustoms"] """ Customs information for the shipment. @@ -1232,6 +1297,14 @@ class CreateParamsShippingAddress(TypedDict): State, county, province, or region. """ + class CreateParamsShippingAddressValidation(TypedDict): + mode: Literal[ + "disabled", "normalization_only", "validation_and_normalization" + ] + """ + The address validation capabilities to use. + """ + class CreateParamsShippingCustoms(TypedDict): eori_number: NotRequired[str] """ @@ -2278,6 +2351,10 @@ class ModifyParams(RequestOptions): """ The desired new PIN for this card. """ + shipping: NotRequired["Card.ModifyParamsShipping"] + """ + Updated shipping information for the card. + """ spending_controls: NotRequired["Card.ModifyParamsSpendingControls"] """ Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. @@ -2293,6 +2370,82 @@ class ModifyParamsPin(TypedDict): The card's desired new PIN, encrypted under Stripe's public key. """ + class ModifyParamsShipping(TypedDict): + address: "Card.ModifyParamsShippingAddress" + """ + The address that the card is shipped to. + """ + address_validation: NotRequired[ + "Card.ModifyParamsShippingAddressValidation" + ] + """ + Address validation settings. + """ + customs: NotRequired["Card.ModifyParamsShippingCustoms"] + """ + Customs information for the shipment. + """ + name: str + """ + The name printed on the shipping label when shipping the card. + """ + phone_number: NotRequired[str] + """ + Phone number of the recipient of the shipment. + """ + require_signature: NotRequired[bool] + """ + Whether a signature is required for card delivery. + """ + service: NotRequired[Literal["express", "priority", "standard"]] + """ + Shipment service. + """ + type: NotRequired[Literal["bulk", "individual"]] + """ + Packaging options. + """ + + class ModifyParamsShippingAddress(TypedDict): + city: 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: str + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: str + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class ModifyParamsShippingAddressValidation(TypedDict): + mode: Literal[ + "disabled", "normalization_only", "validation_and_normalization" + ] + """ + The address validation capabilities to use. + """ + + class ModifyParamsShippingCustoms(TypedDict): + eori_number: NotRequired[str] + """ + The Economic Operators Registration and Identification (EORI) number to use for Customs. Required for bulk shipments to Europe. + """ + class ModifyParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ List[ diff --git a/stripe/issuing/_card_service.py b/stripe/issuing/_card_service.py index b823ab070..d4b46520d 100644 --- a/stripe/issuing/_card_service.py +++ b/stripe/issuing/_card_service.py @@ -80,6 +80,12 @@ class CreateParamsShipping(TypedDict): """ The address that the card is shipped to. """ + address_validation: NotRequired[ + "CardService.CreateParamsShippingAddressValidation" + ] + """ + Address validation settings. + """ customs: NotRequired["CardService.CreateParamsShippingCustoms"] """ Customs information for the shipment. @@ -131,6 +137,14 @@ class CreateParamsShippingAddress(TypedDict): State, county, province, or region. """ + class CreateParamsShippingAddressValidation(TypedDict): + mode: Literal[ + "disabled", "normalization_only", "validation_and_normalization" + ] + """ + The address validation capabilities to use. + """ + class CreateParamsShippingCustoms(TypedDict): eori_number: NotRequired[str] """ @@ -1171,6 +1185,10 @@ class UpdateParams(TypedDict): """ The desired new PIN for this card. """ + shipping: NotRequired["CardService.UpdateParamsShipping"] + """ + Updated shipping information for the card. + """ spending_controls: NotRequired[ "CardService.UpdateParamsSpendingControls" ] @@ -1188,6 +1206,82 @@ class UpdateParamsPin(TypedDict): The card's desired new PIN, encrypted under Stripe's public key. """ + class UpdateParamsShipping(TypedDict): + address: "CardService.UpdateParamsShippingAddress" + """ + The address that the card is shipped to. + """ + address_validation: NotRequired[ + "CardService.UpdateParamsShippingAddressValidation" + ] + """ + Address validation settings. + """ + customs: NotRequired["CardService.UpdateParamsShippingCustoms"] + """ + Customs information for the shipment. + """ + name: str + """ + The name printed on the shipping label when shipping the card. + """ + phone_number: NotRequired[str] + """ + Phone number of the recipient of the shipment. + """ + require_signature: NotRequired[bool] + """ + Whether a signature is required for card delivery. + """ + service: NotRequired[Literal["express", "priority", "standard"]] + """ + Shipment service. + """ + type: NotRequired[Literal["bulk", "individual"]] + """ + Packaging options. + """ + + class UpdateParamsShippingAddress(TypedDict): + city: 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: str + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: str + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class UpdateParamsShippingAddressValidation(TypedDict): + mode: Literal[ + "disabled", "normalization_only", "validation_and_normalization" + ] + """ + The address validation capabilities to use. + """ + + class UpdateParamsShippingCustoms(TypedDict): + eori_number: NotRequired[str] + """ + The Economic Operators Registration and Identification (EORI) number to use for Customs. Required for bulk shipments to Europe. + """ + class UpdateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ List[ From b0555c2655112d88a35b112962d063746d44373f Mon Sep 17 00:00:00 2001 From: David Brownman Date: Thu, 11 Jul 2024 11:47:20 -0700 Subject: [PATCH 086/179] Bump version to 10.3.0 --- CHANGELOG.md | 13 +++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc855633b..2c2646e15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## 10.3.0 - 2024-07-11 +* [#1358](https://github.com/stripe/stripe-python/pull/1358) Update generated code + * Add support for `payment_method_options` on resource `stripe.ConfirmationToken` + * Add support for `payment_element` on resource class `stripe.CustomerSession.Components` and parameter class `stripe.CustomerSession.CreateParamsComponents` + * Add support for `address_validation` on parameter class `stripe.issuing.Card.CreateParamsShipping` and resource class `stripe.issuing.Card.Shipping` + * Add support for `shipping` on parameter class `stripe.issuing.Card.ModifyParams` + * Remove support for `billing_policy_remote_function_response_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Remove support for `billing_policy_remote_function_timeout` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Remove support for `billing_policy_remote_function_unexpected_status_code` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Remove support for `billing_policy_remote_function_unreachable` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Remove support for `payment_intent_fx_quote_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` +* [#1357](https://github.com/stripe/stripe-python/pull/1357) don't auto-organize imports + ## 10.2.0 - 2024-07-05 * [#1354](https://github.com/stripe/stripe-python/pull/1354) Update generated code * Add support for `_cls_add_lines`, `_cls_remove_lines`, `_cls_update_lines`, `add_lines`, `remove_lines`, `update_lines` on resource `stripe.Invoice` diff --git a/VERSION b/VERSION index 2bd6f7e39..0719d8102 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.2.0 +10.3.0 diff --git a/stripe/_version.py b/stripe/_version.py index e2277d63a..cfa60a396 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.2.0" +VERSION = "10.3.0" From 773fb511e20ae36e9a76f721b89a1920a00f10b9 Mon Sep 17 00:00:00 2001 From: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:54:29 -0400 Subject: [PATCH 087/179] Update changelog (#1360) --- CHANGELOG.md | 59 +++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c2646e15..c300d2154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,18 +4,15 @@ * Add support for `payment_element` on resource class `stripe.CustomerSession.Components` and parameter class `stripe.CustomerSession.CreateParamsComponents` * Add support for `address_validation` on parameter class `stripe.issuing.Card.CreateParamsShipping` and resource class `stripe.issuing.Card.Shipping` * Add support for `shipping` on parameter class `stripe.issuing.Card.ModifyParams` - * Remove support for `billing_policy_remote_function_response_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` - * Remove support for `billing_policy_remote_function_timeout` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` - * Remove support for `billing_policy_remote_function_unexpected_status_code` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` - * Remove support for `billing_policy_remote_function_unreachable` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` - * Remove support for `payment_intent_fx_quote_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` -* [#1357](https://github.com/stripe/stripe-python/pull/1357) don't auto-organize imports + * ⚠️ Remove support for `billing_policy_remote_function_response_invalid`, `billing_policy_remote_function_timeout`, `billing_policy_remote_function_unexpected_status_code`, and `billing_policy_remote_function_unreachable` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * ⚠️ Remove support for `payment_intent_fx_quote_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code`. The property was mistakenly released last week. + * [#1357](https://github.com/stripe/stripe-python/pull/1357) don't auto-organize imports ## 10.2.0 - 2024-07-05 * [#1354](https://github.com/stripe/stripe-python/pull/1354) Update generated code - * Add support for `_cls_add_lines`, `_cls_remove_lines`, `_cls_update_lines`, `add_lines`, `remove_lines`, `update_lines` on resource `stripe.Invoice` - * Add support for `posted_at` on parameter class `stripe.tax.Transaction.CreateFromCalculationParams` and resource `stripe.tax.Transaction` - * Add support for `payment_intent_fx_quote_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Add support for `_cls_add_lines`, `_cls_remove_lines`, `_cls_update_lines`, `add_lines`, `remove_lines`, `update_lines` on resource `stripe.Invoice` + * Add support for `posted_at` on parameter class `stripe.tax.Transaction.CreateFromCalculationParams` and resource `stripe.tax.Transaction` + * Add support for `payment_intent_fx_quote_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` ## 10.1.0 - 2024-06-27 * [#1353](https://github.com/stripe/stripe-python/pull/1353) Update generated code @@ -30,28 +27,28 @@ ## 10.0.0 - 2024-06-24 * [#1350](https://github.com/stripe/stripe-python/pull/1350) Update generated code - - This release changes the pinned API version to 2024-06-20. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-06-20) and carefully review the API changes before upgrading. - - ### ⚠️ Breaking changes - - * Remove the unused resource `PlatformTaxFee` - * Rename `volume_decimal` to `quantity_decimal` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel` and resource class `stripe.issuing.Transaction.PurchaseDetails.Fuel` - - ### Additions - - * Add support for `fleet` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetails`, `stripe.issuing.Authorization.CreateParams`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetails`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetails`, resource `stripe.issuing.Authorization`, and resource class `stripe.issuing.Transaction.PurchaseDetails` - * Add support for new values `platform_disabled`, `paused.inactivity` and `other` on enums `Capability.Requirements.disabled_reason` and `Capability.FutureRequirements.disabled_reason` - * Add support for `industry_product_code` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel` and resource class `stripe.issuing.Transaction.PurchaseDetails.Fuel` - * Add support for `quantity_decimal` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel` and resource class `stripe.issuing.Transaction.PurchaseDetails.Fuel` - * Add support for `fuel` on parameter class `stripe.issuing.Authorization.CreateParams` and resource `stripe.issuing.Authorization` - * Add support for `_cls_finalize_amount` on resource `stripe.issuing.Authorization` - * Add support for `finalize_amount` on resource `stripe.issuing.Authorization` - * Change type of `disabled_reason` on `stripe.Capability.FutureRequirements` and `stripe.Capability.Requirements` from `str` to `Literal['other', 'paused.inactivity', 'pending.onboarding', 'pending.review', 'platform_disabled', 'platform_paused', 'rejected.inactivity', 'rejected.other', 'rejected.unsupported_business', 'requirements.fields_needed']` - * Add support for `ch_uid` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` - * Add support for `card_canceled`, `card_expired`, `cardholder_blocked`, `insecure_authorization_method` and `pin_blocked` on enum `stripe.issuing.Authorization.RequestHistory.reason` - * Add support for `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `pound`, on enums `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel.unit`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel.unit`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel.unit` - * Add support for `2024-06-20` on enum `stripe.WebhookEndpoint.CreateParams.api_version` + + This release changes the pinned API version to 2024-06-20. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-06-20) and carefully review the API changes before upgrading. + + ### ⚠️ Breaking changes + + * Remove the unused resource `PlatformTaxFee` + * Rename `volume_decimal` to `quantity_decimal` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel` and resource class `stripe.issuing.Transaction.PurchaseDetails.Fuel` + + ### Additions + + * Add support for `fleet` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetails`, `stripe.issuing.Authorization.CreateParams`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetails`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetails`, resource `stripe.issuing.Authorization`, and resource class `stripe.issuing.Transaction.PurchaseDetails` + * Add support for new values `platform_disabled`, `paused.inactivity` and `other` on enums `Capability.Requirements.disabled_reason` and `Capability.FutureRequirements.disabled_reason` + * Add support for `industry_product_code` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel` and resource class `stripe.issuing.Transaction.PurchaseDetails.Fuel` + * Add support for `quantity_decimal` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel` and resource class `stripe.issuing.Transaction.PurchaseDetails.Fuel` + * Add support for `fuel` on parameter class `stripe.issuing.Authorization.CreateParams` and resource `stripe.issuing.Authorization` + * Add support for `_cls_finalize_amount` on resource `stripe.issuing.Authorization` + * Add support for `finalize_amount` on resource `stripe.issuing.Authorization` + * Change type of `disabled_reason` on `stripe.Capability.FutureRequirements` and `stripe.Capability.Requirements` from `str` to `Literal['other', 'paused.inactivity', 'pending.onboarding', 'pending.review', 'platform_disabled', 'platform_paused', 'rejected.inactivity', 'rejected.other', 'rejected.unsupported_business', 'requirements.fields_needed']` + * Add support for `ch_uid` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `card_canceled`, `card_expired`, `cardholder_blocked`, `insecure_authorization_method` and `pin_blocked` on enum `stripe.issuing.Authorization.RequestHistory.reason` + * Add support for `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `pound`, on enums `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel.unit`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel.unit`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel.unit` + * Add support for `2024-06-20` on enum `stripe.WebhookEndpoint.CreateParams.api_version` ## 9.12.0 - 2024-06-17 * [#1348](https://github.com/stripe/stripe-python/pull/1348) Update generated code From ddcc1e5ad309ac4fc4ee5337545bc773fe19317f Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:54:49 -0400 Subject: [PATCH 088/179] Update generated code (#1362) * Update generated code for v1126 * Update generated code for v1127 * Update generated code for v1128 * Update generated code for v1131 * Update generated code for v1132 * Update generated code for v1134 * Update generated code for v1135 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_confirmation_token.py | 5 +++++ stripe/_dispute.py | 3 +++ stripe/_dispute_service.py | 3 +++ stripe/_event.py | 5 +++-- stripe/_event_service.py | 4 ++-- stripe/_invoice.py | 5 +++-- stripe/_invoice_service.py | 4 ++-- stripe/_payment_method_domain.py | 2 +- stripe/_subscription.py | 11 ++++++----- stripe/_subscription_service.py | 8 ++++---- stripe/_webhook_endpoint.py | 2 ++ stripe/_webhook_endpoint_service.py | 2 ++ stripe/identity/_verification_report.py | 2 +- stripe/terminal/_reader.py | 4 +++- stripe/terminal/_reader_service.py | 1 + 16 files changed, 42 insertions(+), 21 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index af6e36838..6e73fe685 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1123 \ No newline at end of file +v1135 \ No newline at end of file diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 37d8e0045..f8cca02c5 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -17,6 +17,7 @@ if TYPE_CHECKING: from stripe._charge import Charge + from stripe._customer import Customer from stripe._setup_attempt import SetupAttempt @@ -1233,6 +1234,10 @@ class Zip(StripeObject): card: Optional[Card] card_present: Optional[CardPresent] cashapp: Optional[Cashapp] + customer: Optional[ExpandableField["Customer"]] + """ + The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. + """ customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] diff --git a/stripe/_dispute.py b/stripe/_dispute.py index 092b2986b..7ee593ed2 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -212,6 +212,9 @@ class ListParams(RequestOptions): Only return disputes associated to the charge specified by this charge ID. """ created: NotRequired["Dispute.ListParamsCreated|int"] + """ + Only return disputes that were created during the given date interval. + """ 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. diff --git a/stripe/_dispute_service.py b/stripe/_dispute_service.py index fb5c273b4..1502f1e50 100644 --- a/stripe/_dispute_service.py +++ b/stripe/_dispute_service.py @@ -22,6 +22,9 @@ class ListParams(TypedDict): Only return disputes associated to the charge specified by this charge ID. """ created: NotRequired["DisputeService.ListParamsCreated|int"] + """ + Only return disputes that were created during the given date interval. + """ 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. diff --git a/stripe/_event.py b/stripe/_event.py index 40164c169..3720b47c5 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -263,6 +263,7 @@ class RetrieveParams(RequestOptions): "issuing_dispute.closed", "issuing_dispute.created", "issuing_dispute.funds_reinstated", + "issuing_dispute.funds_rescinded", "issuing_dispute.submitted", "issuing_dispute.updated", "issuing_personalization_design.activated", @@ -437,7 +438,7 @@ def retrieve( cls, id: str, **params: Unpack["Event.RetrieveParams"] ) -> "Event": """ - Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. + Retrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook. """ instance = cls(id, **params) instance.refresh() @@ -448,7 +449,7 @@ async def retrieve_async( cls, id: str, **params: Unpack["Event.RetrieveParams"] ) -> "Event": """ - Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. + Retrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook. """ instance = cls(id, **params) await instance.refresh_async() diff --git a/stripe/_event_service.py b/stripe/_event_service.py index 2cdaf6709..89d21c043 100644 --- a/stripe/_event_service.py +++ b/stripe/_event_service.py @@ -115,7 +115,7 @@ def retrieve( options: RequestOptions = {}, ) -> Event: """ - Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. + Retrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook. """ return cast( Event, @@ -136,7 +136,7 @@ async def retrieve_async( options: RequestOptions = {}, ) -> Event: """ - Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. + Retrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook. """ return cast( Event, diff --git a/stripe/_invoice.py b/stripe/_invoice.py index b08e395b2..44b6d10ea 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -753,6 +753,7 @@ class Filters(StripeObject): "ideal", "konbini", "link", + "multibanco", "p24", "paynow", "paypal", @@ -1421,7 +1422,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -3106,7 +3107,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index ec8fa7c77..d11af31dd 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -443,7 +443,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -3549,7 +3549,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/_payment_method_domain.py b/stripe/_payment_method_domain.py index 60e544186..533bdf5ba 100644 --- a/stripe/_payment_method_domain.py +++ b/stripe/_payment_method_domain.py @@ -20,7 +20,7 @@ class PaymentMethodDomain( A payment method domain represents a web domain that you have registered with Stripe. Stripe Elements use registered payment method domains to control where certain payment methods are shown. - Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). + Related guide: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ OBJECT_NAME: ClassVar[Literal["payment_method_domain"]] = ( diff --git a/stripe/_subscription.py b/stripe/_subscription.py index cc3fdd500..5f2478489 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -373,6 +373,7 @@ class Filters(StripeObject): "ideal", "konbini", "link", + "multibanco", "p24", "paynow", "paypal", @@ -394,7 +395,7 @@ class Filters(StripeObject): Literal["off", "on_subscription"] ] """ - Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off`. """ _inner_class_types = {"payment_method_options": PaymentMethodOptions} @@ -920,7 +921,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -929,7 +930,7 @@ class CreateParamsPaymentSettings(TypedDict): Literal["off", "on_subscription"] ] """ - Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified. """ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): @@ -1749,7 +1750,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -1758,7 +1759,7 @@ class ModifyParamsPaymentSettings(TypedDict): Literal["off", "on_subscription"] ] """ - Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified. """ class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 7d124a20c..77483b8d7 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -487,7 +487,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -496,7 +496,7 @@ class CreateParamsPaymentSettings(TypedDict): Literal["off", "on_subscription"] ] """ - Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified. """ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): @@ -1372,7 +1372,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -1381,7 +1381,7 @@ class UpdateParamsPaymentSettings(TypedDict): Literal["off", "on_subscription"] ] """ - Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified. """ class UpdateParamsPaymentSettingsPaymentMethodOptions(TypedDict): diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index a8d934cb8..acc5dcca6 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -257,6 +257,7 @@ class CreateParams(RequestOptions): "issuing_dispute.closed", "issuing_dispute.created", "issuing_dispute.funds_reinstated", + "issuing_dispute.funds_rescinded", "issuing_dispute.submitted", "issuing_dispute.updated", "issuing_personalization_design.activated", @@ -542,6 +543,7 @@ class ModifyParams(RequestOptions): "issuing_dispute.closed", "issuing_dispute.created", "issuing_dispute.funds_reinstated", + "issuing_dispute.funds_rescinded", "issuing_dispute.submitted", "issuing_dispute.updated", "issuing_personalization_design.activated", diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 7b3c2c745..22525b41e 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -238,6 +238,7 @@ class CreateParams(TypedDict): "issuing_dispute.closed", "issuing_dispute.created", "issuing_dispute.funds_reinstated", + "issuing_dispute.funds_rescinded", "issuing_dispute.submitted", "issuing_dispute.updated", "issuing_personalization_design.activated", @@ -529,6 +530,7 @@ class UpdateParams(TypedDict): "issuing_dispute.closed", "issuing_dispute.created", "issuing_dispute.funds_reinstated", + "issuing_dispute.funds_rescinded", "issuing_dispute.submitted", "issuing_dispute.updated", "issuing_personalization_design.activated", diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index a8e721ac7..9846ed5bd 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -20,7 +20,7 @@ class VerificationReport(ListableAPIResource["VerificationReport"]): API. To configure and create VerificationReports, use the [VerificationSession](https://stripe.com/docs/api/identity/verification_sessions) API. - Related guides: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results). + Related guide: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results). """ OBJECT_NAME: ClassVar[Literal["identity.verification_report"]] = ( diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index d7e455aa4..eaf24cf5a 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -271,6 +271,7 @@ class ListParams(RequestOptions): "mobile_phone_reader", "simulated_wisepos_e", "stripe_m2", + "stripe_s700", "verifone_P400", ] ] @@ -531,10 +532,11 @@ class SetReaderDisplayParamsCartLineItem(TypedDict): "mobile_phone_reader", "simulated_wisepos_e", "stripe_m2", + "stripe_s700", "verifone_P400", ] """ - Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, `simulated_wisepos_e`, or `mobile_phone_reader`. + Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `stripe_s700`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, `simulated_wisepos_e`, or `mobile_phone_reader`. """ id: str """ diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 3019e4843..89aec481e 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -50,6 +50,7 @@ class ListParams(TypedDict): "mobile_phone_reader", "simulated_wisepos_e", "stripe_m2", + "stripe_s700", "verifone_P400", ] ] From beff98ebe1dbbe839481e0782c6b5e00f31121ed Mon Sep 17 00:00:00 2001 From: Prathmesh Ranaut Date: Thu, 18 Jul 2024 16:09:34 -0400 Subject: [PATCH 089/179] Bump version to 10.4.0 --- CHANGELOG.md | 8 ++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c300d2154..7311318e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 10.4.0 - 2024-07-18 +* [#1362](https://github.com/stripe/stripe-python/pull/1362) Update generated code + * Add support for `customer` on resource class `stripe.ConfirmationToken.PaymentMethodPreview` + * Add support for `issuing_dispute.funds_rescinded` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `multibanco` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Add support for `stripe_s700` on enums `stripe.terminal.Reader.device_type` and `stripe.terminal.Reader.ListParams.device_type` +* [#1360](https://github.com/stripe/stripe-python/pull/1360) Update changelog + ## 10.3.0 - 2024-07-11 * [#1358](https://github.com/stripe/stripe-python/pull/1358) Update generated code * Add support for `payment_method_options` on resource `stripe.ConfirmationToken` diff --git a/VERSION b/VERSION index 0719d8102..816c0711a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.3.0 +10.4.0 diff --git a/stripe/_version.py b/stripe/_version.py index cfa60a396..f4c800f9b 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.3.0" +VERSION = "10.4.0" From aa5287f720a76ecf43450f15f61d0580f6b58b16 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 13:34:35 -0700 Subject: [PATCH 090/179] Update generated code (#1364) * Update generated code for v1137 * Update generated code for v1138 * Update generated code for v1140 * Update generated code for v1141 * Update generated code for v1142 * Update generated code for v1144 * Update generated code for v1145 * Update generated code for v1146 * Update generated code for v1147 * Update generated code for v1149 * Update generated code for v1153 * Update generated code for v1154 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 32 +++++----- stripe/_account_service.py | 52 ++++++++-------- stripe/_charge.py | 32 +++++++++- stripe/_confirmation_token.py | 15 +++++ stripe/_dispute.py | 4 ++ stripe/_event.py | 2 + stripe/_payment_intent.py | 2 +- stripe/_payment_method.py | 15 +++++ stripe/_payment_method_configuration.py | 60 +++++++++++++++++++ .../_payment_method_configuration_service.py | 40 +++++++++++++ stripe/_refund.py | 4 +- stripe/_refund_service.py | 4 +- stripe/_token.py | 14 ++--- stripe/_token_service.py | 14 ++--- stripe/_webhook_endpoint.py | 4 ++ stripe/_webhook_endpoint_service.py | 4 ++ stripe/checkout/_session.py | 49 ++++++++++++++- stripe/checkout/_session_service.py | 56 +++++++++++++++++ stripe/tax/_calculation.py | 6 +- stripe/tax/_calculation_service.py | 4 +- 21 files changed, 343 insertions(+), 72 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 6e73fe685..793cc6975 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1135 \ No newline at end of file +v1154 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 69b146b5f..0936cf435 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -61,7 +61,7 @@ class BusinessProfile(StripeObject): class AnnualRevenue(StripeObject): amount: Optional[int] """ - A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/currencies#zero-decimal). """ currency: Optional[str] """ @@ -75,7 +75,7 @@ class AnnualRevenue(StripeObject): class MonthlyEstimatedRevenue(StripeObject): amount: int """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/currencies#zero-decimal). """ currency: str """ @@ -118,7 +118,7 @@ class SupportAddress(StripeObject): """ mcc: Optional[str] """ - [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. + [The merchant category code for the account](https://stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ monthly_estimated_revenue: Optional[MonthlyEstimatedRevenue] name: Optional[str] @@ -1351,7 +1351,7 @@ class CreateParamsBusinessProfile(TypedDict): """ mcc: NotRequired[str] """ - [The merchant category code for the account](https://docs.stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. + [The merchant category code for the account](https://stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ monthly_estimated_revenue: NotRequired[ "Account.CreateParamsBusinessProfileMonthlyEstimatedRevenue" @@ -1393,7 +1393,7 @@ class CreateParamsBusinessProfile(TypedDict): class CreateParamsBusinessProfileAnnualRevenue(TypedDict): amount: int """ - A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/currencies#zero-decimal). """ currency: str """ @@ -1407,7 +1407,7 @@ class CreateParamsBusinessProfileAnnualRevenue(TypedDict): class CreateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict): amount: int """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/currencies#zero-decimal). """ currency: str """ @@ -2042,11 +2042,11 @@ class CreateParamsCompany(TypedDict): """ directors_provided: NotRequired[bool] """ - Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ - Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. + Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ @@ -2070,7 +2070,7 @@ class CreateParamsCompany(TypedDict): """ owners_provided: NotRequired[bool] """ - Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. + Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "Account.CreateParamsCompanyOwnershipDeclaration" @@ -2090,7 +2090,7 @@ class CreateParamsCompany(TypedDict): "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ - The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. + The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ @@ -2396,11 +2396,11 @@ class CreateParamsIndividual(TypedDict): """ id_number: NotRequired[str] """ - The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ @@ -2692,7 +2692,7 @@ class CreateParamsSettingsCardIssuing(TypedDict): "Account.CreateParamsSettingsCardIssuingTosAcceptance" ] """ - Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://docs.stripe.com/issuing/connect/tos_acceptance). + Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/issuing/connect/tos_acceptance). """ class CreateParamsSettingsCardIssuingTosAcceptance(TypedDict): @@ -2756,11 +2756,11 @@ class CreateParamsSettingsPayments(TypedDict): class CreateParamsSettingsPayouts(TypedDict): debit_negative_balances: NotRequired[bool] """ - A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://docs.stripe.com/connect/account-balances). + A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/connect/account-balances). """ schedule: NotRequired["Account.CreateParamsSettingsPayoutsSchedule"] """ - Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://docs.stripe.com/connect/bank-transfers#payout-information) documentation. + Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/connect/bank-transfers#payout-information) documentation. """ statement_descriptor: NotRequired[str] """ @@ -2770,7 +2770,7 @@ class CreateParamsSettingsPayouts(TypedDict): class CreateParamsSettingsPayoutsSchedule(TypedDict): delay_days: NotRequired["Literal['minimum']|int"] """ - The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://docs.stripe.com/connect/manage-payout-schedule). + The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://stripe.com/connect/manage-payout-schedule). """ interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 9a1924794..bc4171d37 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -148,7 +148,7 @@ class CreateParamsBusinessProfile(TypedDict): """ mcc: NotRequired[str] """ - [The merchant category code for the account](https://docs.stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. + [The merchant category code for the account](https://stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ monthly_estimated_revenue: NotRequired[ "AccountService.CreateParamsBusinessProfileMonthlyEstimatedRevenue" @@ -190,7 +190,7 @@ class CreateParamsBusinessProfile(TypedDict): class CreateParamsBusinessProfileAnnualRevenue(TypedDict): amount: int """ - A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/currencies#zero-decimal). """ currency: str """ @@ -204,7 +204,7 @@ class CreateParamsBusinessProfileAnnualRevenue(TypedDict): class CreateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict): amount: int """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/currencies#zero-decimal). """ currency: str """ @@ -847,11 +847,11 @@ class CreateParamsCompany(TypedDict): """ directors_provided: NotRequired[bool] """ - Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ - Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. + Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ @@ -875,7 +875,7 @@ class CreateParamsCompany(TypedDict): """ owners_provided: NotRequired[bool] """ - Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. + Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "AccountService.CreateParamsCompanyOwnershipDeclaration" @@ -895,7 +895,7 @@ class CreateParamsCompany(TypedDict): "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ - The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. + The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ @@ -1207,11 +1207,11 @@ class CreateParamsIndividual(TypedDict): """ id_number: NotRequired[str] """ - The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ @@ -1511,7 +1511,7 @@ class CreateParamsSettingsCardIssuing(TypedDict): "AccountService.CreateParamsSettingsCardIssuingTosAcceptance" ] """ - Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://docs.stripe.com/issuing/connect/tos_acceptance). + Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/issuing/connect/tos_acceptance). """ class CreateParamsSettingsCardIssuingTosAcceptance(TypedDict): @@ -1575,13 +1575,13 @@ class CreateParamsSettingsPayments(TypedDict): class CreateParamsSettingsPayouts(TypedDict): debit_negative_balances: NotRequired[bool] """ - A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://docs.stripe.com/connect/account-balances). + A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/connect/account-balances). """ schedule: NotRequired[ "AccountService.CreateParamsSettingsPayoutsSchedule" ] """ - Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://docs.stripe.com/connect/bank-transfers#payout-information) documentation. + Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/connect/bank-transfers#payout-information) documentation. """ statement_descriptor: NotRequired[str] """ @@ -1591,7 +1591,7 @@ class CreateParamsSettingsPayouts(TypedDict): class CreateParamsSettingsPayoutsSchedule(TypedDict): delay_days: NotRequired["Literal['minimum']|int"] """ - The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://docs.stripe.com/connect/manage-payout-schedule). + The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://stripe.com/connect/manage-payout-schedule). """ interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] """ @@ -1834,7 +1834,7 @@ class UpdateParamsBusinessProfile(TypedDict): """ mcc: NotRequired[str] """ - [The merchant category code for the account](https://docs.stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. + [The merchant category code for the account](https://stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ monthly_estimated_revenue: NotRequired[ "AccountService.UpdateParamsBusinessProfileMonthlyEstimatedRevenue" @@ -1876,7 +1876,7 @@ class UpdateParamsBusinessProfile(TypedDict): class UpdateParamsBusinessProfileAnnualRevenue(TypedDict): amount: int """ - A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/currencies#zero-decimal). """ currency: str """ @@ -1890,7 +1890,7 @@ class UpdateParamsBusinessProfileAnnualRevenue(TypedDict): class UpdateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict): amount: int """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/currencies#zero-decimal). """ currency: str """ @@ -2533,11 +2533,11 @@ class UpdateParamsCompany(TypedDict): """ directors_provided: NotRequired[bool] """ - Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ - Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. + Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ @@ -2561,7 +2561,7 @@ class UpdateParamsCompany(TypedDict): """ owners_provided: NotRequired[bool] """ - Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. + Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "AccountService.UpdateParamsCompanyOwnershipDeclaration" @@ -2581,7 +2581,7 @@ class UpdateParamsCompany(TypedDict): "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ - The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. + The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ @@ -2855,11 +2855,11 @@ class UpdateParamsIndividual(TypedDict): """ id_number: NotRequired[str] """ - The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ @@ -3163,7 +3163,7 @@ class UpdateParamsSettingsCardIssuing(TypedDict): "AccountService.UpdateParamsSettingsCardIssuingTosAcceptance" ] """ - Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://docs.stripe.com/issuing/connect/tos_acceptance). + Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/issuing/connect/tos_acceptance). """ class UpdateParamsSettingsCardIssuingTosAcceptance(TypedDict): @@ -3233,13 +3233,13 @@ class UpdateParamsSettingsPayments(TypedDict): class UpdateParamsSettingsPayouts(TypedDict): debit_negative_balances: NotRequired[bool] """ - A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://docs.stripe.com/connect/account-balances). + A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/connect/account-balances). """ schedule: NotRequired[ "AccountService.UpdateParamsSettingsPayoutsSchedule" ] """ - Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://docs.stripe.com/connect/bank-transfers#payout-information) documentation. + Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/connect/bank-transfers#payout-information) documentation. """ statement_descriptor: NotRequired[str] """ @@ -3249,7 +3249,7 @@ class UpdateParamsSettingsPayouts(TypedDict): class UpdateParamsSettingsPayoutsSchedule(TypedDict): delay_days: NotRequired["Literal['minimum']|int"] """ - The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://docs.stripe.com/connect/manage-payout-schedule). + The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://stripe.com/connect/manage-payout-schedule). """ interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] """ diff --git a/stripe/_charge.py b/stripe/_charge.py index d7cdc0084..f85fe819a 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -253,7 +253,10 @@ class AcssDebit(StripeObject): """ class Affirm(StripeObject): - pass + transaction_id: Optional[str] + """ + The Affirm transaction ID associated with this payment. + """ class AfterpayClearpay(StripeObject): order_id: Optional[str] @@ -355,7 +358,10 @@ class Bancontact(StripeObject): """ class Blik(StripeObject): - pass + buyer_id: Optional[str] + """ + A unique and immutable identifier assigned by BLIK to every buyer. + """ class Boleto(StripeObject): tax_id: str @@ -697,6 +703,10 @@ class ShippingAddress(StripeObject): """ The authorized amount. """ + authorization_code: Optional[str] + """ + Authorization code on the charge. + """ brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. @@ -848,6 +858,10 @@ class Receipt(StripeObject): """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + """ capture_before: Optional[int] """ When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. @@ -910,6 +924,13 @@ class Receipt(StripeObject): """ Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + network_transaction_id: Optional[str] + """ + This is used by the financial networks to identify a transaction. + Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. + The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). + This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + """ offline: Optional[Offline] """ Details about payments collected offline. @@ -1224,6 +1245,13 @@ class Receipt(StripeObject): """ Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + network_transaction_id: Optional[str] + """ + This is used by the financial networks to identify a transaction. + Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. + The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). + This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + """ preferred_locales: Optional[List[str]] """ EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index f8cca02c5..0011236f3 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -269,6 +269,10 @@ class Receipt(StripeObject): """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + """ capture_before: Optional[int] """ When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. @@ -331,6 +335,13 @@ class Receipt(StripeObject): """ Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + network_transaction_id: Optional[str] + """ + This is used by the financial networks to identify a transaction. + Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. + The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). + This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + """ offline: Optional[Offline] """ Details about payments collected offline. @@ -689,6 +700,10 @@ class Networks(StripeObject): """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + """ cardholder_name: Optional[str] """ The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. diff --git a/stripe/_dispute.py b/stripe/_dispute.py index 7ee593ed2..a7110e941 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -170,6 +170,10 @@ class Card(StripeObject): """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + case_type: Literal["chargeback", "inquiry"] + """ + The type of dispute opened. Different case types may have varying fees and financial impact. + """ network_reason_code: Optional[str] """ The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network. diff --git a/stripe/_event.py b/stripe/_event.py index 3720b47c5..289246991 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -243,6 +243,7 @@ class RetrieveParams(RequestOptions): "invoice.finalization_failed", "invoice.finalized", "invoice.marked_uncollectible", + "invoice.overdue", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", @@ -251,6 +252,7 @@ class RetrieveParams(RequestOptions): "invoice.upcoming", "invoice.updated", "invoice.voided", + "invoice.will_be_due", "invoiceitem.created", "invoiceitem.deleted", "issuing_authorization.created", diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index c49856642..351db4d60 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -8889,7 +8889,7 @@ class VerifyMicrodepositsParams(RequestOptions): """ latest_charge: Optional[ExpandableField["Charge"]] """ - The latest charge created by this PaymentIntent. + ID of the latest [Charge object](https://stripe.com/docs/api/charges) created by this PaymentIntent. This property is `null` until PaymentIntent confirmation is attempted. """ livemode: bool """ diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index aadc504f9..bdb34ba0f 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -229,6 +229,10 @@ class Receipt(StripeObject): """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + """ capture_before: Optional[int] """ When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. @@ -291,6 +295,13 @@ class Receipt(StripeObject): """ Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + network_transaction_id: Optional[str] + """ + This is used by the financial networks to identify a transaction. + Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. + The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). + This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + """ offline: Optional[Offline] """ Details about payments collected offline. @@ -649,6 +660,10 @@ class Networks(StripeObject): """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + """ cardholder_name: Optional[str] """ The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 39b67ac54..033ac855a 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -829,6 +829,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Twint(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] @@ -1088,6 +1110,10 @@ class CreateParams(RequestOptions): """ Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. Check this [page](https://stripe.com/docs/payments/swish) for more details. """ + twint: NotRequired["PaymentMethodConfiguration.CreateParamsTwint"] + """ + 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. + """ us_bank_account: NotRequired[ "PaymentMethodConfiguration.CreateParamsUsBankAccount" ] @@ -1623,6 +1649,20 @@ class CreateParamsSwishDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsTwint(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsTwintDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsTwintDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsUsBankAccountDisplayPreference" @@ -1880,6 +1920,10 @@ class ModifyParams(RequestOptions): """ Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. Check this [page](https://stripe.com/docs/payments/swish) for more details. """ + twint: NotRequired["PaymentMethodConfiguration.ModifyParamsTwint"] + """ + 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. + """ us_bank_account: NotRequired[ "PaymentMethodConfiguration.ModifyParamsUsBankAccount" ] @@ -2415,6 +2459,20 @@ class ModifyParamsSwishDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsTwint(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsTwintDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsTwintDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsUsBankAccountDisplayPreference" @@ -2531,6 +2589,7 @@ class RetrieveParams(RequestOptions): sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] + twint: Optional[Twint] us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] @@ -2708,6 +2767,7 @@ async def retrieve_async( "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, + "twint": Twint, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index 3b639f873..4b36c7c66 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -229,6 +229,12 @@ class CreateParams(TypedDict): """ Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. Check this [page](https://stripe.com/docs/payments/swish) for more details. """ + twint: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsTwint" + ] + """ + 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. + """ us_bank_account: NotRequired[ "PaymentMethodConfigurationService.CreateParamsUsBankAccount" ] @@ -764,6 +770,20 @@ class CreateParamsSwishDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsTwint(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsTwintDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsTwintDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsUsBankAccountDisplayPreference" @@ -1053,6 +1073,12 @@ class UpdateParams(TypedDict): """ Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. Check this [page](https://stripe.com/docs/payments/swish) for more details. """ + twint: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsTwint" + ] + """ + 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. + """ us_bank_account: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsUsBankAccount" ] @@ -1588,6 +1614,20 @@ class UpdateParamsSwishDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsTwint(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsTwintDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsTwintDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsUsBankAccountDisplayPreference" diff --git a/stripe/_refund.py b/stripe/_refund.py index bb2449bf7..6dae4382a 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -710,7 +710,7 @@ def list( cls, **params: Unpack["Refund.ListParams"] ) -> ListObject["Refund"]: """ - Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. + Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object. """ result = cls._static_request( "get", @@ -730,7 +730,7 @@ async def list_async( cls, **params: Unpack["Refund.ListParams"] ) -> ListObject["Refund"]: """ - Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. + Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object. """ result = await cls._static_request_async( "get", diff --git a/stripe/_refund_service.py b/stripe/_refund_service.py index 42a240ea5..9608e8af7 100644 --- a/stripe/_refund_service.py +++ b/stripe/_refund_service.py @@ -137,7 +137,7 @@ def list( options: RequestOptions = {}, ) -> ListObject[Refund]: """ - Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. + Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object. """ return cast( ListObject[Refund], @@ -157,7 +157,7 @@ async def list_async( options: RequestOptions = {}, ) -> ListObject[Refund]: """ - Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. + Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object. """ return cast( ListObject[Refund], diff --git a/stripe/_token.py b/stripe/_token.py index 6292b4395..2d405fbdf 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -93,7 +93,7 @@ class CreateParamsAccount(TypedDict): """ tos_shown_and_accepted: NotRequired[bool] """ - Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://docs.stripe.com/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. + Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. """ class CreateParamsAccountCompany(TypedDict): @@ -115,11 +115,11 @@ class CreateParamsAccountCompany(TypedDict): """ directors_provided: NotRequired[bool] """ - Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ - Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. + Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ @@ -143,7 +143,7 @@ class CreateParamsAccountCompany(TypedDict): """ owners_provided: NotRequired[bool] """ - Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. + Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "Token.CreateParamsAccountCompanyOwnershipDeclaration" @@ -167,7 +167,7 @@ class CreateParamsAccountCompany(TypedDict): "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ - The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. + The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ @@ -353,11 +353,11 @@ class CreateParamsAccountIndividual(TypedDict): """ id_number: NotRequired[str] """ - The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 841017566..fd82b1ab1 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -60,7 +60,7 @@ class CreateParamsAccount(TypedDict): """ tos_shown_and_accepted: NotRequired[bool] """ - Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://docs.stripe.com/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. + Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. """ class CreateParamsAccountCompany(TypedDict): @@ -82,11 +82,11 @@ class CreateParamsAccountCompany(TypedDict): """ directors_provided: NotRequired[bool] """ - Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ - Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. + Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ @@ -110,7 +110,7 @@ class CreateParamsAccountCompany(TypedDict): """ owners_provided: NotRequired[bool] """ - Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. + Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "TokenService.CreateParamsAccountCompanyOwnershipDeclaration" @@ -134,7 +134,7 @@ class CreateParamsAccountCompany(TypedDict): "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ - The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. + The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ @@ -324,11 +324,11 @@ class CreateParamsAccountIndividual(TypedDict): """ id_number: NotRequired[str] """ - The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ - The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index acc5dcca6..7a9666047 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -237,6 +237,7 @@ class CreateParams(RequestOptions): "invoice.finalization_failed", "invoice.finalized", "invoice.marked_uncollectible", + "invoice.overdue", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", @@ -245,6 +246,7 @@ class CreateParams(RequestOptions): "invoice.upcoming", "invoice.updated", "invoice.voided", + "invoice.will_be_due", "invoiceitem.created", "invoiceitem.deleted", "issuing_authorization.created", @@ -523,6 +525,7 @@ class ModifyParams(RequestOptions): "invoice.finalization_failed", "invoice.finalized", "invoice.marked_uncollectible", + "invoice.overdue", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", @@ -531,6 +534,7 @@ class ModifyParams(RequestOptions): "invoice.upcoming", "invoice.updated", "invoice.voided", + "invoice.will_be_due", "invoiceitem.created", "invoiceitem.deleted", "issuing_authorization.created", diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 22525b41e..dbaaeff57 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -218,6 +218,7 @@ class CreateParams(TypedDict): "invoice.finalization_failed", "invoice.finalized", "invoice.marked_uncollectible", + "invoice.overdue", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", @@ -226,6 +227,7 @@ class CreateParams(TypedDict): "invoice.upcoming", "invoice.updated", "invoice.voided", + "invoice.will_be_due", "invoiceitem.created", "invoiceitem.deleted", "issuing_authorization.created", @@ -510,6 +512,7 @@ class UpdateParams(TypedDict): "invoice.finalization_failed", "invoice.finalized", "invoice.marked_uncollectible", + "invoice.overdue", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", @@ -518,6 +521,7 @@ class UpdateParams(TypedDict): "invoice.upcoming", "invoice.updated", "invoice.voided", + "invoice.will_be_due", "invoiceitem.created", "invoiceitem.deleted", "issuing_authorization.created", diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 9fcb892bc..abe5cbb98 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -6,6 +6,7 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject +from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( @@ -32,7 +33,9 @@ class Session( - CreateableAPIResource["Session"], ListableAPIResource["Session"] + CreateableAPIResource["Session"], + ListableAPIResource["Session"], + UpdateableAPIResource["Session"], ): """ A Checkout Session represents your customer's session as they pay for @@ -3761,6 +3764,16 @@ class ListParamsCustomerDetails(TypedDict): Customer's email address. """ + class ModifyParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -4342,6 +4355,40 @@ async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def modify( + cls, id: str, **params: Unpack["Session.ModifyParams"] + ) -> "Session": + """ + Updates a Session object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Session", + cls._static_request( + "post", + url, + params=params, + ), + ) + + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Session.ModifyParams"] + ) -> "Session": + """ + Updates a Session object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Session", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Session.RetrieveParams"] diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index a2b09b0eb..cff7f1756 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -2261,6 +2261,16 @@ class RetrieveParams(TypedDict): Specifies which fields in the response should be expanded. """ + class UpdateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + def list( self, params: "SessionService.ListParams" = {}, @@ -2387,6 +2397,52 @@ async def retrieve_async( ), ) + def update( + self, + session: str, + params: "SessionService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Session: + """ + Updates a Session object. + """ + return cast( + Session, + self._request( + "post", + "/v1/checkout/sessions/{session}".format( + session=sanitize_id(session), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + session: str, + params: "SessionService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Session: + """ + Updates a Session object. + """ + return cast( + Session, + await self._request_async( + "post", + "/v1/checkout/sessions/{session}".format( + session=sanitize_id(session), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def expire( self, session: str, diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 0acc9b5ca..ade6b71e5 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -556,9 +556,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): class CreateParamsLineItem(TypedDict): amount: int """ - A positive integer representing the line item's total price in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - The minimum amount is $0.0 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - The amount value supports up to twelve digits (e.g., a value of 999999999999 for a USD charge of $9,999,999,999.99). + A positive integer representing the line item's total price in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ product: NotRequired[str] @@ -652,7 +650,7 @@ class ListLineItemsParams(RequestOptions): amount_total: int """ - Total after taxes. + Total amount after taxes in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ currency: str """ diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index 0ae2bb045..aad073403 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -196,9 +196,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): class CreateParamsLineItem(TypedDict): amount: int """ - A positive integer representing the line item's total price in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - The minimum amount is $0.0 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - The amount value supports up to twelve digits (e.g., a value of 999999999999 for a USD charge of $9,999,999,999.99). + A positive integer representing the line item's total price in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ product: NotRequired[str] From 7c5f7144bf364b9c1538d6e5512784a934955db5 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 13:57:41 -0700 Subject: [PATCH 091/179] Update generated code for v1155 (#1368) Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account_session.py | 68 ++++++++++++++++++++++++++++++ stripe/_account_session_service.py | 42 ++++++++++++++++++ 3 files changed, 111 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 793cc6975..0692ea662 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1154 \ No newline at end of file +v1155 \ No newline at end of file diff --git a/stripe/_account_session.py b/stripe/_account_session.py index c4ae483f8..4b844424d 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -189,6 +189,28 @@ class Features(StripeObject): features: Features _inner_class_types = {"features": Features} + class TaxRegistrations(StripeObject): + class Features(StripeObject): + pass + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + + class TaxSettings(StripeObject): + class Features(StripeObject): + pass + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + account_management: AccountManagement account_onboarding: AccountOnboarding balances: Balances @@ -198,6 +220,8 @@ class Features(StripeObject): payments: Payments payouts: Payouts payouts_list: PayoutsList + tax_registrations: TaxRegistrations + tax_settings: TaxSettings _inner_class_types = { "account_management": AccountManagement, "account_onboarding": AccountOnboarding, @@ -208,6 +232,8 @@ class Features(StripeObject): "payments": Payments, "payouts": Payouts, "payouts_list": PayoutsList, + "tax_registrations": TaxRegistrations, + "tax_settings": TaxSettings, } class CreateParams(RequestOptions): @@ -273,6 +299,18 @@ class CreateParamsComponents(TypedDict): """ Configuration for the payouts list embedded component. """ + tax_registrations: NotRequired[ + "AccountSession.CreateParamsComponentsTaxRegistrations" + ] + """ + Configuration for the tax registrations embedded component. + """ + tax_settings: NotRequired[ + "AccountSession.CreateParamsComponentsTaxSettings" + ] + """ + Configuration for the tax settings embedded component. + """ class CreateParamsComponentsAccountManagement(TypedDict): enabled: bool @@ -478,6 +516,36 @@ class CreateParamsComponentsPayoutsList(TypedDict): class CreateParamsComponentsPayoutsListFeatures(TypedDict): pass + class CreateParamsComponentsTaxRegistrations(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsTaxRegistrationsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsTaxRegistrationsFeatures(TypedDict): + pass + + class CreateParamsComponentsTaxSettings(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsTaxSettingsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsTaxSettingsFeatures(TypedDict): + pass + account: str """ The ID of the account the AccountSession was created for diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 39b7f6407..be5fb0dc0 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -77,6 +77,18 @@ class CreateParamsComponents(TypedDict): """ Configuration for the payouts list embedded component. """ + tax_registrations: NotRequired[ + "AccountSessionService.CreateParamsComponentsTaxRegistrations" + ] + """ + Configuration for the tax registrations embedded component. + """ + tax_settings: NotRequired[ + "AccountSessionService.CreateParamsComponentsTaxSettings" + ] + """ + Configuration for the tax settings embedded component. + """ class CreateParamsComponentsAccountManagement(TypedDict): enabled: bool @@ -282,6 +294,36 @@ class CreateParamsComponentsPayoutsList(TypedDict): class CreateParamsComponentsPayoutsListFeatures(TypedDict): pass + class CreateParamsComponentsTaxRegistrations(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsTaxRegistrationsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsTaxRegistrationsFeatures(TypedDict): + pass + + class CreateParamsComponentsTaxSettings(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsTaxSettingsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsTaxSettingsFeatures(TypedDict): + pass + def create( self, params: "AccountSessionService.CreateParams", From 5e5eb48993c8c964abb7a93d37a817bfdf674d9e Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Thu, 25 Jul 2024 13:59:54 -0700 Subject: [PATCH 092/179] Bump version to 10.5.0 --- CHANGELOG.md | 16 ++++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7311318e2..5370b8d90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## 10.5.0 - 2024-07-25 +* [#1368](https://github.com/stripe/stripe-python/pull/1368) Update generated code + * Add support for `tax_registrations` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `tax_settings` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` +* [#1364](https://github.com/stripe/stripe-python/pull/1364) Update generated code + * Add support for `transaction_id` on resource class `stripe.Charge.PaymentMethodDetails.Affirm` + * Add support for `buyer_id` on resource class `stripe.Charge.PaymentMethodDetails.Blik` + * Add support for `authorization_code` on resource class `stripe.Charge.PaymentMethodDetails.Card` + * Add support for `brand_product` on resource classes `stripe.Charge.PaymentMethodDetails.CardPresent`, `stripe.ConfirmationToken.PaymentMethodPreview.Card.GeneratedFrom.PaymentMethodDetails.CardPresent`, `stripe.ConfirmationToken.PaymentMethodPreview.CardPresent`, `stripe.PaymentMethod.Card.GeneratedFrom.PaymentMethodDetails.CardPresent`, and `stripe.PaymentMethod.CardPresent` + * Add support for `network_transaction_id` on resource classes `stripe.Charge.PaymentMethodDetails.CardPresent`, `stripe.Charge.PaymentMethodDetails.InteracPresent`, `stripe.ConfirmationToken.PaymentMethodPreview.Card.GeneratedFrom.PaymentMethodDetails.CardPresent`, and `stripe.PaymentMethod.Card.GeneratedFrom.PaymentMethodDetails.CardPresent` + * Add support for `case_type` on resource class `stripe.Dispute.PaymentMethodDetails.Card` + * Add support for `twint` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` + * Add support for `modify` on resource `stripe.checkout.Session` + * Add support for `invoice.overdue` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `invoice.will_be_due` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + ## 10.4.0 - 2024-07-18 * [#1362](https://github.com/stripe/stripe-python/pull/1362) Update generated code * Add support for `customer` on resource class `stripe.ConfirmationToken.PaymentMethodPreview` diff --git a/VERSION b/VERSION index 816c0711a..2cf514e36 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.4.0 +10.5.0 diff --git a/stripe/_version.py b/stripe/_version.py index f4c800f9b..0a8379cd6 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.4.0" +VERSION = "10.5.0" From 626a182340e3fe3e448d0ac4630320891fa87788 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 17:18:12 -0400 Subject: [PATCH 093/179] Update generated code (#1369) * Update generated code for v1157 * Update generated code for v1158 * Update generated code for v1159 * Update generated code for v1160 * Update generated code for v1162 * Update generated code for v1163 * Update generated code for v1166 * Update generated code for v1167 * Update generated code for v1169 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_charge.py | 6 +- stripe/_event.py | 1 + stripe/_invoice.py | 1 + stripe/_object_classes.py | 2 + stripe/_payment_intent.py | 527 ++++++++++++++---- stripe/_payment_intent_service.py | 448 +++++++++++---- stripe/_setup_attempt.py | 1 + stripe/_setup_intent.py | 5 +- stripe/_setup_intent_service.py | 2 +- stripe/_subscription.py | 4 +- stripe/_subscription_item.py | 2 +- stripe/_subscription_item_service.py | 2 +- stripe/_subscription_service.py | 4 +- stripe/_webhook_endpoint.py | 2 + stripe/_webhook_endpoint_service.py | 2 + stripe/api_resources/billing/__init__.py | 2 + stripe/api_resources/billing/alert.py | 21 + .../api_resources/billing/alert_triggered.py | 21 + stripe/billing/__init__.py | 2 + stripe/billing/_alert.py | 75 +++ stripe/billing/_alert_triggered.py | 38 ++ stripe/checkout/_session.py | 126 ++++- stripe/checkout/_session_service.py | 64 ++- stripe/financial_connections/_account.py | 4 +- 25 files changed, 1123 insertions(+), 241 deletions(-) create mode 100644 stripe/api_resources/billing/alert.py create mode 100644 stripe/api_resources/billing/alert_triggered.py create mode 100644 stripe/billing/_alert.py create mode 100644 stripe/billing/_alert_triggered.py diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 0692ea662..03029e1c8 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1155 \ No newline at end of file +v1169 \ No newline at end of file diff --git a/stripe/_charge.py b/stripe/_charge.py index f85fe819a..1e8eb2fe2 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -703,10 +703,6 @@ class ShippingAddress(StripeObject): """ The authorized amount. """ - authorization_code: Optional[str] - """ - Authorization code on the charge. - """ brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. @@ -2182,7 +2178,7 @@ class SearchParams(RequestOptions): billing_details: BillingDetails calculated_statement_descriptor: Optional[str] """ - The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. + The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This only works for card payments. """ captured: bool """ diff --git a/stripe/_event.py b/stripe/_event.py index 289246991..a54c62909 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -166,6 +166,7 @@ class RetrieveParams(RequestOptions): "application_fee.refund.updated", "application_fee.refunded", "balance.available", + "billing.alert.triggered", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 44b6d10ea..060db3786 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -351,6 +351,7 @@ class LastFinalizationError(StripeObject): "charge_already_refunded", "charge_disputed", "charge_exceeds_source_limit", + "charge_exceeds_transaction_limit", "charge_expired_for_capture", "charge_invalid_parameter", "charge_not_refundable", diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 62daa5bf0..c1d9e20d1 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -20,6 +20,8 @@ stripe.BankAccount.OBJECT_NAME: stripe.BankAccount, stripe.billing_portal.Configuration.OBJECT_NAME: stripe.billing_portal.Configuration, stripe.billing_portal.Session.OBJECT_NAME: stripe.billing_portal.Session, + stripe.billing.Alert.OBJECT_NAME: stripe.billing.Alert, + stripe.billing.AlertTriggered.OBJECT_NAME: stripe.billing.AlertTriggered, stripe.billing.Meter.OBJECT_NAME: stripe.billing.Meter, stripe.billing.MeterEvent.OBJECT_NAME: stripe.billing.MeterEvent, stripe.billing.MeterEventAdjustment.OBJECT_NAME: stripe.billing.MeterEventAdjustment, diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 351db4d60..ab4123d8d 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -128,6 +128,7 @@ class LastPaymentError(StripeObject): "charge_already_refunded", "charge_disputed", "charge_exceeds_source_limit", + "charge_exceeds_transaction_limit", "charge_expired_for_capture", "charge_invalid_parameter", "charge_not_refundable", @@ -987,6 +988,8 @@ class MandateOptions(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: Optional[ @@ -1012,6 +1015,8 @@ class Affirm(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1031,6 +1036,8 @@ class AfterpayClearpay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1041,6 +1048,8 @@ class Alipay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1055,6 +1064,8 @@ class AmazonPay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1067,6 +1078,8 @@ class AuBecsDebit(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1079,6 +1092,8 @@ class BacsDebit(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1093,6 +1108,8 @@ class Bancontact(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1103,6 +1120,8 @@ class Blik(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1119,6 +1138,8 @@ class Boleto(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1279,6 +1300,8 @@ class MandateOptions(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ statement_descriptor_suffix_kana: Optional[str] @@ -1327,6 +1350,8 @@ class Cashapp(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1382,6 +1407,8 @@ class EuBankTransfer(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ _inner_class_types = {"bank_transfer": BankTransfer} @@ -1393,6 +1420,8 @@ class Eps(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1403,6 +1432,8 @@ class Fpx(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1413,6 +1444,8 @@ class Giropay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1423,6 +1456,8 @@ class Grabpay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1433,6 +1468,8 @@ class Ideal(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1454,6 +1491,8 @@ class Klarna(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1480,6 +1519,8 @@ class Konbini(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1498,6 +1539,8 @@ class Link(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1512,6 +1555,8 @@ class Mobilepay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1522,6 +1567,8 @@ class Multibanco(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1536,6 +1583,8 @@ class Oxxo(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1546,6 +1595,8 @@ class P24(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1556,6 +1607,8 @@ class Paynow(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1578,6 +1631,8 @@ class Paypal(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1596,6 +1651,8 @@ class Pix(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1606,6 +1663,8 @@ class Promptpay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1620,6 +1679,8 @@ class RevolutPay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1636,6 +1697,8 @@ class MandateOptions(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ _inner_class_types = {"mandate_options": MandateOptions} @@ -1653,6 +1716,8 @@ class Sofort(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1667,6 +1732,8 @@ class Swish(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1677,6 +1744,8 @@ class Twint(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1738,6 +1807,8 @@ class MandateOptions(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: Optional[ @@ -1766,6 +1837,8 @@ class WechatPay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1776,6 +1849,8 @@ class Zip(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2093,9 +2168,11 @@ class ConfirmParams(RequestOptions): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ shipping: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsShipping" @@ -3020,9 +3097,11 @@ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -3072,9 +3151,11 @@ class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -3097,9 +3178,11 @@ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): @@ -3111,9 +3194,11 @@ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -3133,6 +3218,8 @@ class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -3145,9 +3232,11 @@ class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -3159,9 +3248,11 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): @@ -3177,9 +3268,11 @@ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): @@ -3193,9 +3286,11 @@ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): @@ -3211,9 +3306,11 @@ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): @@ -3305,9 +3402,11 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ @@ -3512,9 +3611,11 @@ class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -3534,9 +3635,11 @@ class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -3592,9 +3695,11 @@ class ConfirmParamsPaymentMethodOptionsEps(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): @@ -3604,9 +3709,11 @@ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): @@ -3616,9 +3723,11 @@ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -3628,9 +3737,11 @@ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): @@ -3642,9 +3753,11 @@ class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): @@ -3718,9 +3831,11 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): @@ -3746,9 +3861,11 @@ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): @@ -3772,9 +3889,11 @@ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -3792,9 +3911,11 @@ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -3804,9 +3925,11 @@ class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): @@ -3820,9 +3943,11 @@ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): @@ -3832,9 +3957,11 @@ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ @@ -3848,9 +3975,11 @@ class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): @@ -3902,9 +4031,11 @@ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): @@ -3922,9 +4053,11 @@ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): @@ -3934,9 +4067,11 @@ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): @@ -3956,6 +4091,8 @@ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -3974,9 +4111,11 @@ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): @@ -3997,9 +4136,11 @@ class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): @@ -4013,9 +4154,11 @@ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): @@ -4025,9 +4168,11 @@ class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): @@ -4063,9 +4208,11 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -4143,9 +4290,11 @@ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): @@ -4155,9 +4304,11 @@ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsRadarOptions(TypedDict): @@ -4259,7 +4410,7 @@ class CreateParams(RequestOptions): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ description: NotRequired[str] """ @@ -4341,6 +4492,8 @@ class CreateParams(RequestOptions): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ shipping: NotRequired["PaymentIntent.CreateParamsShipping"] @@ -5293,9 +5446,11 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -5345,9 +5500,11 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -5370,9 +5527,11 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): @@ -5384,9 +5543,11 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -5406,6 +5567,8 @@ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -5418,9 +5581,11 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -5432,9 +5597,11 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): @@ -5450,9 +5617,11 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBlik(TypedDict): @@ -5466,9 +5635,11 @@ class CreateParamsPaymentMethodOptionsBlik(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): @@ -5484,9 +5655,11 @@ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCard(TypedDict): @@ -5578,9 +5751,11 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ @@ -5785,9 +5960,11 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -5807,9 +5984,11 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -5865,9 +6044,11 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): @@ -5877,9 +6058,11 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): @@ -5889,9 +6072,11 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -5901,9 +6086,11 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): @@ -5915,9 +6102,11 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): @@ -5991,9 +6180,11 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): @@ -6019,9 +6210,11 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsLink(TypedDict): @@ -6045,9 +6238,11 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -6065,9 +6260,11 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -6077,9 +6274,11 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): @@ -6093,9 +6292,11 @@ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsP24(TypedDict): @@ -6105,9 +6306,11 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ @@ -6121,9 +6324,11 @@ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): @@ -6175,9 +6380,11 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPix(TypedDict): @@ -6195,9 +6402,11 @@ class CreateParamsPaymentMethodOptionsPix(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): @@ -6207,9 +6416,11 @@ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): @@ -6229,6 +6440,8 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -6247,9 +6460,11 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): @@ -6270,9 +6485,11 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsSwish(TypedDict): @@ -6286,9 +6503,11 @@ class CreateParamsPaymentMethodOptionsSwish(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsTwint(TypedDict): @@ -6298,9 +6517,11 @@ class CreateParamsPaymentMethodOptionsTwint(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): @@ -6336,9 +6557,11 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -6416,9 +6639,11 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsZip(TypedDict): @@ -6428,9 +6653,11 @@ class CreateParamsPaymentMethodOptionsZip(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsRadarOptions(TypedDict): @@ -6614,7 +6841,7 @@ class ModifyParams(RequestOptions): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ description: NotRequired[str] """ @@ -6630,7 +6857,7 @@ class ModifyParams(RequestOptions): """ payment_method: NotRequired[str] """ - ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. + ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. To unset this field to null, pass in an empty string. """ payment_method_configuration: NotRequired[str] """ @@ -6666,9 +6893,11 @@ class ModifyParams(RequestOptions): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ shipping: NotRequired["Literal['']|PaymentIntent.ModifyParamsShipping"] """ @@ -7560,9 +7789,11 @@ class ModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -7612,9 +7843,11 @@ class ModifyParamsPaymentMethodOptionsAffirm(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -7637,9 +7870,11 @@ class ModifyParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsAlipay(TypedDict): @@ -7651,9 +7886,11 @@ class ModifyParamsPaymentMethodOptionsAlipay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -7673,6 +7910,8 @@ class ModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -7685,9 +7924,11 @@ class ModifyParamsPaymentMethodOptionsAuBecsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -7699,9 +7940,11 @@ class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsBancontact(TypedDict): @@ -7717,9 +7960,11 @@ class ModifyParamsPaymentMethodOptionsBancontact(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsBlik(TypedDict): @@ -7733,9 +7978,11 @@ class ModifyParamsPaymentMethodOptionsBlik(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsBoleto(TypedDict): @@ -7751,9 +7998,11 @@ class ModifyParamsPaymentMethodOptionsBoleto(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsCard(TypedDict): @@ -7845,9 +8094,11 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ @@ -8052,9 +8303,11 @@ class ModifyParamsPaymentMethodOptionsCashapp(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -8074,9 +8327,11 @@ class ModifyParamsPaymentMethodOptionsCustomerBalance(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -8132,9 +8387,11 @@ class ModifyParamsPaymentMethodOptionsEps(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsFpx(TypedDict): @@ -8144,9 +8401,11 @@ class ModifyParamsPaymentMethodOptionsFpx(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsGiropay(TypedDict): @@ -8156,9 +8415,11 @@ class ModifyParamsPaymentMethodOptionsGiropay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -8168,9 +8429,11 @@ class ModifyParamsPaymentMethodOptionsGrabpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsIdeal(TypedDict): @@ -8182,9 +8445,11 @@ class ModifyParamsPaymentMethodOptionsIdeal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsInteracPresent(TypedDict): @@ -8258,9 +8523,11 @@ class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsKonbini(TypedDict): @@ -8286,9 +8553,11 @@ class ModifyParamsPaymentMethodOptionsKonbini(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsLink(TypedDict): @@ -8312,9 +8581,11 @@ class ModifyParamsPaymentMethodOptionsLink(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -8332,9 +8603,11 @@ class ModifyParamsPaymentMethodOptionsMobilepay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -8344,9 +8617,11 @@ class ModifyParamsPaymentMethodOptionsMultibanco(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsOxxo(TypedDict): @@ -8360,9 +8635,11 @@ class ModifyParamsPaymentMethodOptionsOxxo(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsP24(TypedDict): @@ -8372,9 +8649,11 @@ class ModifyParamsPaymentMethodOptionsP24(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ @@ -8388,9 +8667,11 @@ class ModifyParamsPaymentMethodOptionsPaynow(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): @@ -8442,9 +8723,11 @@ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsPix(TypedDict): @@ -8462,9 +8745,11 @@ class ModifyParamsPaymentMethodOptionsPix(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsPromptpay(TypedDict): @@ -8474,9 +8759,11 @@ class ModifyParamsPaymentMethodOptionsPromptpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsRevolutPay(TypedDict): @@ -8496,6 +8783,8 @@ class ModifyParamsPaymentMethodOptionsRevolutPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -8514,9 +8803,11 @@ class ModifyParamsPaymentMethodOptionsSepaDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): @@ -8537,9 +8828,11 @@ class ModifyParamsPaymentMethodOptionsSofort(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsSwish(TypedDict): @@ -8553,9 +8846,11 @@ class ModifyParamsPaymentMethodOptionsSwish(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsTwint(TypedDict): @@ -8565,9 +8860,11 @@ class ModifyParamsPaymentMethodOptionsTwint(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): @@ -8603,9 +8900,11 @@ class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -8683,9 +8982,11 @@ class ModifyParamsPaymentMethodOptionsWechatPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsZip(TypedDict): @@ -8695,9 +8996,11 @@ class ModifyParamsPaymentMethodOptionsZip(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsShipping(TypedDict): @@ -8869,7 +9172,7 @@ class VerifyMicrodepositsParams(RequestOptions): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ description: Optional[str] """ @@ -8947,6 +9250,8 @@ class VerifyMicrodepositsParams(RequestOptions): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ shipping: Optional[Shipping] diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 23fd5c18d..01ab18d7d 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -166,9 +166,11 @@ class ConfirmParams(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ shipping: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsShipping" @@ -1115,9 +1117,11 @@ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -1167,9 +1171,11 @@ class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -1192,9 +1198,11 @@ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): @@ -1206,9 +1214,11 @@ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -1228,6 +1238,8 @@ class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1240,9 +1252,11 @@ class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -1254,9 +1268,11 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): @@ -1272,9 +1288,11 @@ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): @@ -1288,9 +1306,11 @@ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): @@ -1306,9 +1326,11 @@ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): @@ -1400,9 +1422,11 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ @@ -1607,9 +1631,11 @@ class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -1629,9 +1655,11 @@ class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -1687,9 +1715,11 @@ class ConfirmParamsPaymentMethodOptionsEps(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): @@ -1699,9 +1729,11 @@ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): @@ -1711,9 +1743,11 @@ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -1723,9 +1757,11 @@ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): @@ -1737,9 +1773,11 @@ class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): @@ -1813,9 +1851,11 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): @@ -1841,9 +1881,11 @@ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): @@ -1867,9 +1909,11 @@ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -1887,9 +1931,11 @@ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -1899,9 +1945,11 @@ class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): @@ -1915,9 +1963,11 @@ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): @@ -1927,9 +1977,11 @@ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ @@ -1943,9 +1995,11 @@ class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): @@ -1997,9 +2051,11 @@ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): @@ -2017,9 +2073,11 @@ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): @@ -2029,9 +2087,11 @@ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): @@ -2051,6 +2111,8 @@ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2069,9 +2131,11 @@ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): @@ -2092,9 +2156,11 @@ class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): @@ -2108,9 +2174,11 @@ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): @@ -2120,9 +2188,11 @@ class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): @@ -2158,9 +2228,11 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -2238,9 +2310,11 @@ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): @@ -2250,9 +2324,11 @@ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsRadarOptions(TypedDict): @@ -2354,7 +2430,7 @@ class CreateParams(TypedDict): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ description: NotRequired[str] """ @@ -2438,6 +2514,8 @@ class CreateParams(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ shipping: NotRequired["PaymentIntentService.CreateParamsShipping"] @@ -3414,9 +3492,11 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -3466,9 +3546,11 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -3491,9 +3573,11 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): @@ -3505,9 +3589,11 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -3527,6 +3613,8 @@ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -3539,9 +3627,11 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -3553,9 +3643,11 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): @@ -3571,9 +3663,11 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBlik(TypedDict): @@ -3587,9 +3681,11 @@ class CreateParamsPaymentMethodOptionsBlik(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): @@ -3605,9 +3701,11 @@ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCard(TypedDict): @@ -3699,9 +3797,11 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ @@ -3906,9 +4006,11 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -3928,9 +4030,11 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -3986,9 +4090,11 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): @@ -3998,9 +4104,11 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): @@ -4010,9 +4118,11 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -4022,9 +4132,11 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): @@ -4036,9 +4148,11 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): @@ -4112,9 +4226,11 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): @@ -4140,9 +4256,11 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsLink(TypedDict): @@ -4166,9 +4284,11 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -4186,9 +4306,11 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -4198,9 +4320,11 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): @@ -4214,9 +4338,11 @@ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsP24(TypedDict): @@ -4226,9 +4352,11 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ @@ -4242,9 +4370,11 @@ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): @@ -4296,9 +4426,11 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPix(TypedDict): @@ -4316,9 +4448,11 @@ class CreateParamsPaymentMethodOptionsPix(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): @@ -4328,9 +4462,11 @@ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): @@ -4350,6 +4486,8 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -4368,9 +4506,11 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): @@ -4391,9 +4531,11 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsSwish(TypedDict): @@ -4407,9 +4549,11 @@ class CreateParamsPaymentMethodOptionsSwish(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsTwint(TypedDict): @@ -4419,9 +4563,11 @@ class CreateParamsPaymentMethodOptionsTwint(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): @@ -4457,9 +4603,11 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -4537,9 +4685,11 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsZip(TypedDict): @@ -4549,9 +4699,11 @@ class CreateParamsPaymentMethodOptionsZip(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsRadarOptions(TypedDict): @@ -4763,7 +4915,7 @@ class UpdateParams(TypedDict): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ description: NotRequired[str] """ @@ -4779,7 +4931,7 @@ class UpdateParams(TypedDict): """ payment_method: NotRequired[str] """ - ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. + ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. To unset this field to null, pass in an empty string. """ payment_method_configuration: NotRequired[str] """ @@ -4815,9 +4967,11 @@ class UpdateParams(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ shipping: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsShipping" @@ -5735,9 +5889,11 @@ class UpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -5787,9 +5943,11 @@ class UpdateParamsPaymentMethodOptionsAffirm(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -5812,9 +5970,11 @@ class UpdateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsAlipay(TypedDict): @@ -5826,9 +5986,11 @@ class UpdateParamsPaymentMethodOptionsAlipay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -5848,6 +6010,8 @@ class UpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -5860,9 +6024,11 @@ class UpdateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -5874,9 +6040,11 @@ class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsBancontact(TypedDict): @@ -5892,9 +6060,11 @@ class UpdateParamsPaymentMethodOptionsBancontact(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsBlik(TypedDict): @@ -5908,9 +6078,11 @@ class UpdateParamsPaymentMethodOptionsBlik(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsBoleto(TypedDict): @@ -5926,9 +6098,11 @@ class UpdateParamsPaymentMethodOptionsBoleto(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsCard(TypedDict): @@ -6020,9 +6194,11 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ @@ -6227,9 +6403,11 @@ class UpdateParamsPaymentMethodOptionsCashapp(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -6249,9 +6427,11 @@ class UpdateParamsPaymentMethodOptionsCustomerBalance(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -6307,9 +6487,11 @@ class UpdateParamsPaymentMethodOptionsEps(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsFpx(TypedDict): @@ -6319,9 +6501,11 @@ class UpdateParamsPaymentMethodOptionsFpx(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsGiropay(TypedDict): @@ -6331,9 +6515,11 @@ class UpdateParamsPaymentMethodOptionsGiropay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -6343,9 +6529,11 @@ class UpdateParamsPaymentMethodOptionsGrabpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsIdeal(TypedDict): @@ -6357,9 +6545,11 @@ class UpdateParamsPaymentMethodOptionsIdeal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsInteracPresent(TypedDict): @@ -6433,9 +6623,11 @@ class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsKonbini(TypedDict): @@ -6461,9 +6653,11 @@ class UpdateParamsPaymentMethodOptionsKonbini(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsLink(TypedDict): @@ -6487,9 +6681,11 @@ class UpdateParamsPaymentMethodOptionsLink(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -6507,9 +6703,11 @@ class UpdateParamsPaymentMethodOptionsMobilepay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -6519,9 +6717,11 @@ class UpdateParamsPaymentMethodOptionsMultibanco(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsOxxo(TypedDict): @@ -6535,9 +6735,11 @@ class UpdateParamsPaymentMethodOptionsOxxo(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsP24(TypedDict): @@ -6547,9 +6749,11 @@ class UpdateParamsPaymentMethodOptionsP24(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ @@ -6563,9 +6767,11 @@ class UpdateParamsPaymentMethodOptionsPaynow(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): @@ -6617,9 +6823,11 @@ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsPix(TypedDict): @@ -6637,9 +6845,11 @@ class UpdateParamsPaymentMethodOptionsPix(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsPromptpay(TypedDict): @@ -6649,9 +6859,11 @@ class UpdateParamsPaymentMethodOptionsPromptpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsRevolutPay(TypedDict): @@ -6671,6 +6883,8 @@ class UpdateParamsPaymentMethodOptionsRevolutPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -6689,9 +6903,11 @@ class UpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): @@ -6712,9 +6928,11 @@ class UpdateParamsPaymentMethodOptionsSofort(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsSwish(TypedDict): @@ -6728,9 +6946,11 @@ class UpdateParamsPaymentMethodOptionsSwish(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsTwint(TypedDict): @@ -6740,9 +6960,11 @@ class UpdateParamsPaymentMethodOptionsTwint(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): @@ -6778,9 +7000,11 @@ class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -6858,9 +7082,11 @@ class UpdateParamsPaymentMethodOptionsWechatPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsZip(TypedDict): @@ -6870,9 +7096,11 @@ class UpdateParamsPaymentMethodOptionsZip(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsShipping(TypedDict): diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 67d21c1cc..153f6d797 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -460,6 +460,7 @@ class SetupError(StripeObject): "charge_already_refunded", "charge_disputed", "charge_exceeds_source_limit", + "charge_exceeds_transaction_limit", "charge_expired_for_capture", "charge_invalid_parameter", "charge_not_refundable", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index eb1ef447d..2fe740b1c 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -113,6 +113,7 @@ class LastSetupError(StripeObject): "charge_already_refunded", "charge_disputed", "charge_exceeds_source_limit", + "charge_exceeds_transaction_limit", "charge_expired_for_capture", "charge_invalid_parameter", "charge_not_refundable", @@ -2904,7 +2905,7 @@ class ModifyParams(RequestOptions): """ payment_method: NotRequired[str] """ - ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. + ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. To unset this field to null, pass in an empty string. """ payment_method_configuration: NotRequired[str] """ @@ -4000,7 +4001,7 @@ class VerifyMicrodepositsParams(RequestOptions): """ payment_method: Optional[ExpandableField["PaymentMethod"]] """ - ID of the payment method used with this SetupIntent. + ID of the payment method used with this SetupIntent. If the payment method is `card_present` and isn't a digital wallet, then the [generated_card](https://docs.corp.stripe.com/api/setup_attempts/object#setup_attempt_object-payment_method_details-card_present-generated_card) associated with the `latest_attempt` is attached to the Customer instead. """ payment_method_configuration_details: Optional[ PaymentMethodConfigurationDetails diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index f08d7e158..17a3e170a 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -2370,7 +2370,7 @@ class UpdateParams(TypedDict): """ payment_method: NotRequired[str] """ - ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. + ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. To unset this field to null, pass in an empty string. """ payment_method_configuration: NotRequired[str] """ diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 5f2478489..dd621444f 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -595,7 +595,7 @@ class CreateParams(RequestOptions): """ off_session: NotRequired[bool] """ - Indicates if a customer is on or off-session while an invoice payment is attempted. + Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session). """ on_behalf_of: NotRequired["Literal['']|str"] """ @@ -1408,7 +1408,7 @@ class ModifyParams(RequestOptions): """ off_session: NotRequired[bool] """ - Indicates if a customer is on or off-session while an invoice payment is attempted. + Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session). """ on_behalf_of: NotRequired["Literal['']|str"] """ diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index 4614d3a90..b6264fe12 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -277,7 +277,7 @@ class ModifyParams(RequestOptions): """ off_session: NotRequired[bool] """ - Indicates if a customer is on or off-session while an invoice payment is attempted. + Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session). """ payment_behavior: NotRequired[ Literal[ diff --git a/stripe/_subscription_item_service.py b/stripe/_subscription_item_service.py index e8f520ec7..ae5d8232e 100644 --- a/stripe/_subscription_item_service.py +++ b/stripe/_subscription_item_service.py @@ -227,7 +227,7 @@ class UpdateParams(TypedDict): """ off_session: NotRequired[bool] """ - Indicates if a customer is on or off-session while an invoice payment is attempted. + Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session). """ payment_behavior: NotRequired[ Literal[ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 77483b8d7..c14e40f3a 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -153,7 +153,7 @@ class CreateParams(TypedDict): """ off_session: NotRequired[bool] """ - Indicates if a customer is on or off-session while an invoice payment is attempted. + Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session). """ on_behalf_of: NotRequired["Literal['']|str"] """ @@ -1024,7 +1024,7 @@ class UpdateParams(TypedDict): """ off_session: NotRequired[bool] """ - Indicates if a customer is on or off-session while an invoice payment is attempted. + Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session). """ on_behalf_of: NotRequired["Literal['']|str"] """ diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 7a9666047..9fc7bcb79 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -160,6 +160,7 @@ class CreateParams(RequestOptions): "application_fee.refund.updated", "application_fee.refunded", "balance.available", + "billing.alert.triggered", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", @@ -448,6 +449,7 @@ class ModifyParams(RequestOptions): "application_fee.refund.updated", "application_fee.refunded", "balance.available", + "billing.alert.triggered", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index dbaaeff57..0fc6698fc 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -141,6 +141,7 @@ class CreateParams(TypedDict): "application_fee.refund.updated", "application_fee.refunded", "balance.available", + "billing.alert.triggered", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", @@ -435,6 +436,7 @@ class UpdateParams(TypedDict): "application_fee.refund.updated", "application_fee.refunded", "balance.available", + "billing.alert.triggered", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", diff --git a/stripe/api_resources/billing/__init__.py b/stripe/api_resources/billing/__init__.py index 8ce8db1e8..e469ff8d7 100644 --- a/stripe/api_resources/billing/__init__.py +++ b/stripe/api_resources/billing/__init__.py @@ -16,6 +16,8 @@ stacklevel=2, ) if not TYPE_CHECKING: + from stripe.api_resources.billing.alert import Alert + from stripe.api_resources.billing.alert_triggered import AlertTriggered from stripe.api_resources.billing.meter import Meter from stripe.api_resources.billing.meter_event import MeterEvent from stripe.api_resources.billing.meter_event_adjustment import ( diff --git a/stripe/api_resources/billing/alert.py b/stripe/api_resources/billing/alert.py new file mode 100644 index 000000000..09ccecff9 --- /dev/null +++ b/stripe/api_resources/billing/alert.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.billing.alert package is deprecated, please change your + imports to import from stripe.billing directly. + From: + from stripe.api_resources.billing.alert import Alert + To: + from stripe.billing import Alert + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.billing._alert import ( # noqa + Alert, + ) diff --git a/stripe/api_resources/billing/alert_triggered.py b/stripe/api_resources/billing/alert_triggered.py new file mode 100644 index 000000000..c967783e7 --- /dev/null +++ b/stripe/api_resources/billing/alert_triggered.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.billing.alert_triggered package is deprecated, please change your + imports to import from stripe.billing directly. + From: + from stripe.api_resources.billing.alert_triggered import AlertTriggered + To: + from stripe.billing import AlertTriggered + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.billing._alert_triggered import ( # noqa + AlertTriggered, + ) diff --git a/stripe/billing/__init__.py b/stripe/billing/__init__.py index 45172d78a..728f48113 100644 --- a/stripe/billing/__init__.py +++ b/stripe/billing/__init__.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.billing._alert import Alert as Alert +from stripe.billing._alert_triggered import AlertTriggered as AlertTriggered from stripe.billing._meter import Meter as Meter from stripe.billing._meter_event import MeterEvent as MeterEvent from stripe.billing._meter_event_adjustment import ( diff --git a/stripe/billing/_alert.py b/stripe/billing/_alert.py new file mode 100644 index 000000000..1119101b5 --- /dev/null +++ b/stripe/billing/_alert.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._expandable_field import ExpandableField +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._customer import Customer + from stripe.billing._meter import Meter + + +class Alert(StripeObject): + """ + A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests. + """ + + OBJECT_NAME: ClassVar[Literal["billing.alert"]] = "billing.alert" + + class Filter(StripeObject): + customer: Optional[ExpandableField["Customer"]] + """ + Limit the scope of the alert to this customer ID + """ + + class UsageThresholdConfig(StripeObject): + gte: int + """ + The value at which this alert will trigger. + """ + meter: ExpandableField["Meter"] + """ + The [Billing Meter](https://stripe.com/api/billing/meter) ID whose usage is monitored. + """ + recurrence: Literal["one_time"] + """ + Defines how the alert will behave. + """ + + alert_type: Literal["usage_threshold"] + """ + Defines the type of the alert. + """ + filter: Optional[Filter] + """ + Limits the scope of the alert to a specific [customer](https://stripe.com/docs/api/customers). + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["billing.alert"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + status: Optional[Literal["active", "archived", "inactive"]] + """ + Status of the alert. This can be active, inactive or archived. + """ + title: str + """ + Title of the alert. + """ + usage_threshold_config: Optional[UsageThresholdConfig] + """ + Encapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://stripe.com/docs/api/billing/meter). + """ + _inner_class_types = { + "filter": Filter, + "usage_threshold_config": UsageThresholdConfig, + } diff --git a/stripe/billing/_alert_triggered.py b/stripe/billing/_alert_triggered.py new file mode 100644 index 000000000..3e33e9406 --- /dev/null +++ b/stripe/billing/_alert_triggered.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar +from typing_extensions import Literal, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.billing._alert import Alert + + +class AlertTriggered(StripeObject): + OBJECT_NAME: ClassVar[Literal["billing.alert_triggered"]] = ( + "billing.alert_triggered" + ) + alert: "Alert" + """ + A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + customer: str + """ + ID of customer for which the alert triggered + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["billing.alert_triggered"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + value: int + """ + The value triggering the alert + """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index abe5cbb98..56152c957 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -566,6 +566,8 @@ class MandateOptions(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: Optional[ @@ -583,6 +585,8 @@ class Affirm(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -593,6 +597,8 @@ class AfterpayClearpay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -603,6 +609,8 @@ class Alipay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -613,6 +621,8 @@ class AmazonPay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -623,6 +633,8 @@ class AuBecsDebit(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -635,6 +647,8 @@ class BacsDebit(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -645,6 +659,8 @@ class Bancontact(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -661,6 +677,8 @@ class Boleto(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -684,6 +702,8 @@ class Installments(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ statement_descriptor_suffix_kana: Optional[str] @@ -703,6 +723,8 @@ class Cashapp(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -758,6 +780,8 @@ class EuBankTransfer(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ _inner_class_types = {"bank_transfer": BankTransfer} @@ -769,6 +793,8 @@ class Eps(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -779,6 +805,8 @@ class Fpx(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -789,6 +817,8 @@ class Giropay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -799,6 +829,8 @@ class Grabpay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -809,6 +841,8 @@ class Ideal(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -821,6 +855,8 @@ class Klarna(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -835,6 +871,8 @@ class Konbini(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -845,6 +883,8 @@ class Link(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -855,6 +895,8 @@ class Mobilepay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -865,6 +907,8 @@ class Multibanco(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -879,6 +923,8 @@ class Oxxo(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -889,6 +935,8 @@ class P24(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -899,6 +947,8 @@ class Paynow(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -921,6 +971,8 @@ class Paypal(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -937,6 +989,8 @@ class RevolutPay(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -949,6 +1003,8 @@ class SepaDebit(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -959,6 +1015,8 @@ class Sofort(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1013,6 +1071,8 @@ class Filters(StripeObject): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: Optional[Literal["automatic", "instant"]] @@ -2621,6 +2681,8 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: NotRequired[ @@ -2663,6 +2725,8 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2673,6 +2737,8 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2683,6 +2749,8 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2693,6 +2761,8 @@ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2703,6 +2773,8 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2715,6 +2787,8 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2725,6 +2799,8 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2741,6 +2817,8 @@ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2763,6 +2841,8 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ statement_descriptor_suffix_kana: NotRequired[str] @@ -2790,6 +2870,8 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2810,6 +2892,8 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2866,6 +2950,8 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2876,6 +2962,8 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2886,6 +2974,8 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2896,6 +2986,8 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2906,6 +2998,8 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2916,6 +3010,8 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2930,6 +3026,8 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2940,6 +3038,8 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2950,6 +3050,8 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2960,6 +3062,8 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2974,6 +3078,8 @@ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -2984,6 +3090,8 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ tos_shown_and_accepted: NotRequired[bool] @@ -2998,6 +3106,8 @@ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -3050,9 +3160,11 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPix(TypedDict): @@ -3068,6 +3180,8 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -3080,6 +3194,8 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -3090,6 +3206,8 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -3114,6 +3232,8 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: NotRequired[Literal["automatic", "instant"]] @@ -3156,6 +3276,8 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -3833,7 +3955,7 @@ class RetrieveParams(RequestOptions): """ currency_conversion: Optional[CurrencyConversion] """ - Currency conversion details for automatic currency conversion sessions + Currency conversion details for [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing) sessions """ custom_fields: List[CustomField] """ diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index cff7f1756..fd6f7586b 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -1130,6 +1130,8 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: NotRequired[ @@ -1172,6 +1174,8 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1182,6 +1186,8 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1192,6 +1198,8 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1202,6 +1210,8 @@ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1212,6 +1222,8 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1224,6 +1236,8 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1234,6 +1248,8 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1250,6 +1266,8 @@ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1272,6 +1290,8 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ statement_descriptor_suffix_kana: NotRequired[str] @@ -1299,6 +1319,8 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1319,6 +1341,8 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1375,6 +1399,8 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1385,6 +1411,8 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1395,6 +1423,8 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1405,6 +1435,8 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1415,6 +1447,8 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1425,6 +1459,8 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1439,6 +1475,8 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1449,6 +1487,8 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1459,6 +1499,8 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1469,6 +1511,8 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1483,6 +1527,8 @@ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1493,6 +1539,8 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ tos_shown_and_accepted: NotRequired[bool] @@ -1507,6 +1555,8 @@ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1559,9 +1609,11 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPix(TypedDict): @@ -1577,6 +1629,8 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1589,6 +1643,8 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1599,6 +1655,8 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ @@ -1623,6 +1681,8 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: NotRequired[Literal["automatic", "instant"]] @@ -1665,6 +1725,8 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ diff --git a/stripe/financial_connections/_account.py b/stripe/financial_connections/_account.py index 4cda93ad7..5760bc3b8 100644 --- a/stripe/financial_connections/_account.py +++ b/stripe/financial_connections/_account.py @@ -51,7 +51,7 @@ class Balance(StripeObject): class Cash(StripeObject): available: Optional[Dict[str, int]] """ - The funds available to the account holder. Typically this is the current balance less any holds. + The funds available to the account holder. Typically this is the current balance after subtracting any outbound pending transactions and adding any inbound pending transactions. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. @@ -76,7 +76,7 @@ class Credit(StripeObject): credit: Optional[Credit] current: Dict[str, int] """ - The balances owed to (or by) the account holder. + The balances owed to (or by) the account holder, before subtracting any outbound pending transactions or adding any inbound pending transactions. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. From 8598672eafa4917613eb15552f0216f5aedd9e9d Mon Sep 17 00:00:00 2001 From: Prathmesh Ranaut Date: Thu, 1 Aug 2024 17:24:22 -0400 Subject: [PATCH 094/179] Bump version to 10.6.0 --- CHANGELOG.md | 7 +++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5370b8d90..a310adb94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 10.6.0 - 2024-08-01 +* [#1369](https://github.com/stripe/stripe-python/pull/1369) Update generated code + * Add support for resource `stripe.billing.Alert` + * ⚠️ Remove support for `authorization_code` on resource class `stripe.Charge.PaymentMethodDetails.Card`. This was accidentally released last week. + * Add support for `billing.alert.triggered` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `charge_exceeds_transaction_limit` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + ## 10.5.0 - 2024-07-25 * [#1368](https://github.com/stripe/stripe-python/pull/1368) Update generated code * Add support for `tax_registrations` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` diff --git a/VERSION b/VERSION index 2cf514e36..d1dd3f904 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.5.0 +10.6.0 diff --git a/stripe/_version.py b/stripe/_version.py index 0a8379cd6..8f89d8205 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.5.0" +VERSION = "10.6.0" From 7990f90efde051a793e087270b7654f6e4e789d9 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:52:51 -0700 Subject: [PATCH 095/179] Update generated code (#1371) * Update generated code for v1170 * Update generated code for v1171 * Update generated code for v1172 * Update generated code for v1173 * Update generated code for v1174 * Update generated code for v1175 * Update generated code for v1176 * Update generated code for v1177 * Update generated code for v1179 * Update generated code for v1180 * Update generated code for v1182 * Update generated code for v1183 * Update generated code for v1184 * Update generated code for v1186 * Update generated code for v1187 * Update generated code for v1188 * Update generated code for v1189 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 14 +- stripe/_account_service.py | 12 +- stripe/_billing_service.py | 2 + stripe/_card.py | 4 +- stripe/_charge.py | 20 +- stripe/_charge_service.py | 10 +- stripe/_confirmation_token.py | 20 +- stripe/_customer_session.py | 4 +- stripe/_customer_session_service.py | 2 +- stripe/_invoice.py | 27 +- stripe/_invoice_service.py | 22 +- stripe/_invoice_upcoming_lines_service.py | 4 +- stripe/_payment_intent.py | 1173 +++++++++-------- stripe/_payment_intent_service.py | 939 ++++++------- stripe/_payment_link.py | 12 +- stripe/_payment_link_service.py | 8 +- stripe/_payment_method.py | 20 +- stripe/_person.py | 5 +- stripe/_setup_attempt.py | 5 + stripe/_setup_intent.py | 5 + stripe/_setup_intent_service.py | 3 + stripe/_subscription.py | 13 +- stripe/_subscription_service.py | 10 +- stripe/_transfer.py | 2 +- stripe/_transfer_service.py | 2 +- stripe/billing/__init__.py | 1 + stripe/billing/_alert.py | 516 +++++++- stripe/billing/_alert_service.py | 353 +++++ stripe/checkout/_session.py | 375 +++--- stripe/checkout/_session_service.py | 195 ++- stripe/identity/_verification_session.py | 9 + .../identity/_verification_session_service.py | 5 + stripe/tax/_calculation.py | 28 + stripe/tax/_calculation_service.py | 53 + stripe/terminal/_reader.py | 2 +- stripe/treasury/_financial_account.py | 3 + 37 files changed, 2454 insertions(+), 1426 deletions(-) create mode 100644 stripe/billing/_alert_service.py diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 03029e1c8..1af8caa5d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1169 \ No newline at end of file +v1189 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 0936cf435..ad20ec69f 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -1038,19 +1038,19 @@ class Payments(StripeObject): """ statement_descriptor_kana: Optional[str] """ - The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only) + The Kana variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). """ statement_descriptor_kanji: Optional[str] """ - The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only) + The Kanji variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). """ statement_descriptor_prefix_kana: Optional[str] """ - The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + The Kana variation of `statement_descriptor_prefix` used for card charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). """ statement_descriptor_prefix_kanji: Optional[str] """ - The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + The Kanji variation of `statement_descriptor_prefix` used for card charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). """ class Payouts(StripeObject): @@ -2742,15 +2742,15 @@ class CreateParamsSettingsCardPaymentsDeclineOn(TypedDict): class CreateParamsSettingsPayments(TypedDict): statement_descriptor: NotRequired[str] """ - The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. + The default text that appears on statements for non-card charges outside of Japan. For card charges, if you don't set a `statement_descriptor_prefix`, this text is also used as the statement descriptor prefix. In that case, if concatenating the statement descriptor suffix causes the combined statement descriptor to exceed 22 characters, we truncate the `statement_descriptor` text to limit the full descriptor to 22 characters. For more information about statement descriptors and their requirements, see the [account settings documentation](https://docs.stripe.com/get-started/account/statement-descriptors). """ statement_descriptor_kana: NotRequired[str] """ - The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + The Kana variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). """ statement_descriptor_kanji: NotRequired[str] """ - The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + The Kanji variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). """ class CreateParamsSettingsPayouts(TypedDict): diff --git a/stripe/_account_service.py b/stripe/_account_service.py index bc4171d37..2aa902006 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -1561,15 +1561,15 @@ class CreateParamsSettingsCardPaymentsDeclineOn(TypedDict): class CreateParamsSettingsPayments(TypedDict): statement_descriptor: NotRequired[str] """ - The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. + The default text that appears on statements for non-card charges outside of Japan. For card charges, if you don't set a `statement_descriptor_prefix`, this text is also used as the statement descriptor prefix. In that case, if concatenating the statement descriptor suffix causes the combined statement descriptor to exceed 22 characters, we truncate the `statement_descriptor` text to limit the full descriptor to 22 characters. For more information about statement descriptors and their requirements, see the [account settings documentation](https://docs.stripe.com/get-started/account/statement-descriptors). """ statement_descriptor_kana: NotRequired[str] """ - The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + The Kana variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). """ statement_descriptor_kanji: NotRequired[str] """ - The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + The Kanji variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). """ class CreateParamsSettingsPayouts(TypedDict): @@ -3219,15 +3219,15 @@ class UpdateParamsSettingsInvoices(TypedDict): class UpdateParamsSettingsPayments(TypedDict): statement_descriptor: NotRequired[str] """ - The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. + The default text that appears on statements for non-card charges outside of Japan. For card charges, if you don't set a `statement_descriptor_prefix`, this text is also used as the statement descriptor prefix. In that case, if concatenating the statement descriptor suffix causes the combined statement descriptor to exceed 22 characters, we truncate the `statement_descriptor` text to limit the full descriptor to 22 characters. For more information about statement descriptors and their requirements, see the [account settings documentation](https://docs.stripe.com/get-started/account/statement-descriptors). """ statement_descriptor_kana: NotRequired[str] """ - The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + The Kana variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). """ statement_descriptor_kanji: NotRequired[str] """ - The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + The Kanji variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). """ class UpdateParamsSettingsPayouts(TypedDict): diff --git a/stripe/_billing_service.py b/stripe/_billing_service.py index 8d4f279e7..e30f30081 100644 --- a/stripe/_billing_service.py +++ b/stripe/_billing_service.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService +from stripe.billing._alert_service import AlertService from stripe.billing._meter_event_adjustment_service import ( MeterEventAdjustmentService, ) @@ -11,6 +12,7 @@ class BillingService(StripeService): def __init__(self, requestor): super().__init__(requestor) + self.alerts = AlertService(self._requestor) self.meters = MeterService(self._requestor) self.meter_events = MeterEventService(self._requestor) self.meter_event_adjustments = MeterEventAdjustmentService( diff --git a/stripe/_card.py b/stripe/_card.py index 434bad80a..631da0c36 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -78,7 +78,7 @@ class DeleteParams(RequestOptions): """ brand: str """ - Card brand. Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. + Card brand. Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `Girocard`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. """ country: Optional[str] """ @@ -86,7 +86,7 @@ class DeleteParams(RequestOptions): """ currency: Optional[str] """ - Three-letter [ISO code for currency](https://stripe.com/docs/payouts). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + Three-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. Must be a [supported currency](https://docs.stripe.com/currencies). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ customer: Optional[ExpandableField["Customer"]] """ diff --git a/stripe/_charge.py b/stripe/_charge.py index 1e8eb2fe2..7ab12a247 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -805,6 +805,10 @@ class Offline(StripeObject): """ Time at which the payment was collected while offline """ + type: Optional[Literal["deferred"]] + """ + The method used to process this payment method offline. Only deferred is allowed. + """ class Receipt(StripeObject): account_type: Optional[ @@ -1788,11 +1792,11 @@ class CaptureParams(RequestOptions): """ statement_descriptor: NotRequired[str] """ - For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. + For a non-card charge, text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors). This value overrides the account's default statement descriptor. For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. """ transfer_data: NotRequired["Charge.CaptureParamsTransferData"] """ @@ -1866,11 +1870,11 @@ class CreateParams(RequestOptions): """ statement_descriptor: NotRequired[str] """ - For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. + For a non-card charge, text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors). This value overrides the account's default statement descriptor. For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. """ transfer_data: NotRequired["Charge.CreateParamsTransferData"] """ @@ -1986,7 +1990,7 @@ class ListParams(RequestOptions): """ transfer_group: NotRequired[str] """ - Only return charges for this transfer group. + Only return charges for this transfer group, limited to 100. """ class ListParamsCreated(TypedDict): @@ -2178,7 +2182,7 @@ class SearchParams(RequestOptions): billing_details: BillingDetails calculated_statement_descriptor: Optional[str] """ - The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This only works for card payments. + The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This value only exists for card payments. """ captured: bool """ @@ -2309,11 +2313,11 @@ class SearchParams(RequestOptions): """ statement_descriptor: Optional[str] """ - For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. + For a non-card charge, text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors). This value overrides the account's default statement descriptor. For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. """ statement_descriptor_suffix: Optional[str] """ - Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. """ status: Literal["failed", "pending", "succeeded"] """ diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index eeb199f83..f21605715 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -34,11 +34,11 @@ class CaptureParams(TypedDict): """ statement_descriptor: NotRequired[str] """ - For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. + For a non-card charge, text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors). This value overrides the account's default statement descriptor. For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. """ transfer_data: NotRequired["ChargeService.CaptureParamsTransferData"] """ @@ -112,11 +112,11 @@ class CreateParams(TypedDict): """ statement_descriptor: NotRequired[str] """ - For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. + For a non-card charge, text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors). This value overrides the account's default statement descriptor. For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. """ transfer_data: NotRequired["ChargeService.CreateParamsTransferData"] """ @@ -232,7 +232,7 @@ class ListParams(TypedDict): """ transfer_group: NotRequired[str] """ - Only return charges for this transfer group. + Only return charges for this transfer group, limited to 100. """ class ListParamsCreated(TypedDict): diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 0011236f3..2d9cec16d 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -218,6 +218,10 @@ class Offline(StripeObject): """ Time at which the payment was collected while offline """ + type: Optional[Literal["deferred"]] + """ + The method used to process this payment method offline. Only deferred is allowed. + """ class Receipt(StripeObject): account_type: Optional[ @@ -696,6 +700,16 @@ class Networks(StripeObject): The preferred network for the card. """ + class Offline(StripeObject): + stored_at: Optional[int] + """ + Time at which the payment was collected while offline + """ + type: Optional[Literal["deferred"]] + """ + The method used to process this payment method offline. Only deferred is allowed. + """ + brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. @@ -750,6 +764,10 @@ class Networks(StripeObject): """ Contains information about card networks that can be used to process the payment. """ + offline: Optional[Offline] + """ + Details about payment methods collected offline. + """ preferred_locales: Optional[List[str]] """ EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. @@ -766,7 +784,7 @@ class Networks(StripeObject): """ How card details were read in this transaction. """ - _inner_class_types = {"networks": Networks} + _inner_class_types = {"networks": Networks, "offline": Offline} class Cashapp(StripeObject): buyer_id: Optional[str] diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index 99fbfdb46..1e7791109 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -48,7 +48,7 @@ class Features(StripeObject): """ payment_method_redisplay_limit: Optional[int] """ - Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`. + Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. """ payment_method_remove: Literal["disabled", "enabled"] """ @@ -172,7 +172,7 @@ class CreateParamsComponentsPaymentElementFeatures(TypedDict): """ payment_method_redisplay_limit: NotRequired[int] """ - Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`. + Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. """ payment_method_remove: NotRequired[Literal["disabled", "enabled"]] """ diff --git a/stripe/_customer_session_service.py b/stripe/_customer_session_service.py index 126782ae3..f2c01ec87 100644 --- a/stripe/_customer_session_service.py +++ b/stripe/_customer_session_service.py @@ -75,7 +75,7 @@ class CreateParamsComponentsPaymentElementFeatures(TypedDict): """ payment_method_redisplay_limit: NotRequired[int] """ - Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`. + Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. """ payment_method_remove: NotRequired[Literal["disabled", "enabled"]] """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 060db3786..29a1a9640 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -389,6 +389,7 @@ class LastFinalizationError(StripeObject): "invalid_cvc", "invalid_expiry_month", "invalid_expiry_year", + "invalid_mandate_reference_prefix_format", "invalid_number", "invalid_source_usage", "invalid_tax_location", @@ -1535,13 +1536,13 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallments( class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( TypedDict, ): - count: int + count: NotRequired[int] """ - For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. """ - interval: Literal["month"] + interval: NotRequired[Literal["month"]] """ - For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] @@ -2655,7 +2656,7 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): """ cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancel_now: NotRequired[bool] """ @@ -3220,13 +3221,13 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallments( class ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( TypedDict, ): - count: int + count: NotRequired[int] """ - For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. """ - interval: Literal["month"] + interval: NotRequired[Literal["month"]] """ - For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] @@ -3692,7 +3693,7 @@ class UpcomingLinesParams(RequestOptions): """ subscription_cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. """ subscription_cancel_now: NotRequired[bool] """ @@ -4492,7 +4493,7 @@ class UpcomingLinesParamsSubscriptionDetails(TypedDict): """ cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancel_now: NotRequired[bool] """ @@ -4828,7 +4829,7 @@ class UpcomingParams(RequestOptions): """ subscription_cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. """ subscription_cancel_now: NotRequired[bool] """ @@ -5610,7 +5611,7 @@ class UpcomingParamsSubscriptionDetails(TypedDict): """ cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancel_now: NotRequired[bool] """ diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index d11af31dd..6981cdccd 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -555,13 +555,13 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallments( class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( TypedDict, ): - count: int + count: NotRequired[int] """ - For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. """ - interval: Literal["month"] + interval: NotRequired[Literal["month"]] """ - For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] @@ -1685,7 +1685,7 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): """ cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancel_now: NotRequired[bool] """ @@ -2099,7 +2099,7 @@ class UpcomingParams(TypedDict): """ subscription_cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. """ subscription_cancel_now: NotRequired[bool] """ @@ -2887,7 +2887,7 @@ class UpcomingParamsSubscriptionDetails(TypedDict): """ cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancel_now: NotRequired[bool] """ @@ -3661,13 +3661,13 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallments( class UpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( TypedDict, ): - count: int + count: NotRequired[int] """ - For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. """ - interval: Literal["month"] + interval: NotRequired[Literal["month"]] """ - For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index a8b353801..23216c534 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -100,7 +100,7 @@ class ListParams(TypedDict): """ subscription_cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. """ subscription_cancel_now: NotRequired[bool] """ @@ -894,7 +894,7 @@ class ListParamsSubscriptionDetails(TypedDict): """ cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancel_now: NotRequired[bool] """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index ab4123d8d..d6bed7af9 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -166,6 +166,7 @@ class LastPaymentError(StripeObject): "invalid_cvc", "invalid_expiry_month", "invalid_expiry_year", + "invalid_mandate_reference_prefix_format", "invalid_number", "invalid_source_usage", "invalid_tax_location", @@ -986,11 +987,11 @@ class MandateOptions(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] @@ -1013,11 +1014,11 @@ class Affirm(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class AfterpayClearpay(StripeObject): @@ -1034,11 +1035,11 @@ class AfterpayClearpay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Alipay(StripeObject): @@ -1046,11 +1047,11 @@ class Alipay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class AmazonPay(StripeObject): @@ -1062,11 +1063,11 @@ class AmazonPay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class AuBecsDebit(StripeObject): @@ -1076,11 +1077,11 @@ class AuBecsDebit(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class BacsDebit(StripeObject): @@ -1090,11 +1091,11 @@ class BacsDebit(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Bancontact(StripeObject): @@ -1106,11 +1107,11 @@ class Bancontact(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Blik(StripeObject): @@ -1118,11 +1119,11 @@ class Blik(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Boleto(StripeObject): @@ -1136,11 +1137,11 @@ class Boleto(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Card(StripeObject): @@ -1251,6 +1252,7 @@ class MandateOptions(StripeObject): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -1298,11 +1300,11 @@ class MandateOptions(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ statement_descriptor_suffix_kana: Optional[str] """ @@ -1348,11 +1350,11 @@ class Cashapp(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CustomerBalance(StripeObject): @@ -1405,11 +1407,11 @@ class EuBankTransfer(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ _inner_class_types = {"bank_transfer": BankTransfer} @@ -1418,11 +1420,11 @@ class Eps(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Fpx(StripeObject): @@ -1430,11 +1432,11 @@ class Fpx(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Giropay(StripeObject): @@ -1442,11 +1444,11 @@ class Giropay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Grabpay(StripeObject): @@ -1454,11 +1456,11 @@ class Grabpay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Ideal(StripeObject): @@ -1466,11 +1468,11 @@ class Ideal(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class InteracPresent(StripeObject): @@ -1489,11 +1491,11 @@ class Klarna(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Konbini(StripeObject): @@ -1517,11 +1519,11 @@ class Konbini(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Link(StripeObject): @@ -1537,11 +1539,11 @@ class Link(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Mobilepay(StripeObject): @@ -1553,11 +1555,11 @@ class Mobilepay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Multibanco(StripeObject): @@ -1565,11 +1567,11 @@ class Multibanco(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Oxxo(StripeObject): @@ -1581,11 +1583,11 @@ class Oxxo(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class P24(StripeObject): @@ -1593,11 +1595,11 @@ class P24(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Paynow(StripeObject): @@ -1605,11 +1607,11 @@ class Paynow(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Paypal(StripeObject): @@ -1629,11 +1631,11 @@ class Paypal(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Pix(StripeObject): @@ -1649,11 +1651,11 @@ class Pix(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Promptpay(StripeObject): @@ -1661,11 +1663,11 @@ class Promptpay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class RevolutPay(StripeObject): @@ -1677,11 +1679,11 @@ class RevolutPay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class SepaDebit(StripeObject): @@ -1695,11 +1697,11 @@ class MandateOptions(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ _inner_class_types = {"mandate_options": MandateOptions} @@ -1714,11 +1716,11 @@ class Sofort(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Swish(StripeObject): @@ -1730,11 +1732,11 @@ class Swish(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Twint(StripeObject): @@ -1742,11 +1744,11 @@ class Twint(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class UsBankAccount(StripeObject): @@ -1805,11 +1807,11 @@ class MandateOptions(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] @@ -1835,11 +1837,11 @@ class WechatPay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Zip(StripeObject): @@ -1847,11 +1849,11 @@ class Zip(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ acss_debit: Optional[AcssDebit] @@ -2074,11 +2076,11 @@ class CaptureParams(RequestOptions): """ statement_descriptor: NotRequired[str] """ - For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must be 1-22 characters long. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired["PaymentIntent.CaptureParamsTransferData"] """ @@ -2166,13 +2168,13 @@ class ConfirmParams(RequestOptions): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ shipping: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsShipping" @@ -3095,13 +3097,13 @@ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -3149,13 +3151,13 @@ class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -3176,13 +3178,13 @@ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): @@ -3192,13 +3194,13 @@ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -3216,11 +3218,11 @@ class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): @@ -3230,13 +3232,13 @@ class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -3246,13 +3248,13 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): @@ -3266,13 +3268,13 @@ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): @@ -3284,13 +3286,13 @@ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): @@ -3304,13 +3306,13 @@ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): @@ -3353,6 +3355,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -3400,13 +3403,13 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ @@ -3440,13 +3443,13 @@ class ConfirmParamsPaymentMethodOptionsCardInstallments(TypedDict): """ class ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): - count: int + count: NotRequired[int] """ - For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. """ - interval: Literal["month"] + interval: NotRequired[Literal["month"]] """ - For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] @@ -3609,13 +3612,13 @@ class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -3633,13 +3636,13 @@ class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -3693,13 +3696,13 @@ class ConfirmParamsPaymentMethodOptionsEps(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): @@ -3707,13 +3710,13 @@ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): @@ -3721,13 +3724,13 @@ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -3735,13 +3738,13 @@ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): @@ -3751,13 +3754,13 @@ class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): @@ -3829,13 +3832,13 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): @@ -3859,13 +3862,13 @@ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): @@ -3887,13 +3890,13 @@ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -3909,13 +3912,13 @@ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -3923,13 +3926,13 @@ class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): @@ -3941,13 +3944,13 @@ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): @@ -3955,13 +3958,13 @@ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ @@ -3973,13 +3976,13 @@ class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): @@ -4029,13 +4032,13 @@ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): @@ -4051,13 +4054,13 @@ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): @@ -4065,13 +4068,13 @@ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): @@ -4089,11 +4092,11 @@ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): @@ -4109,13 +4112,13 @@ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): @@ -4134,13 +4137,13 @@ class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): @@ -4152,13 +4155,13 @@ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): @@ -4166,13 +4169,13 @@ class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): @@ -4206,13 +4209,13 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -4288,13 +4291,13 @@ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): @@ -4302,13 +4305,13 @@ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsRadarOptions(TypedDict): @@ -4490,11 +4493,11 @@ class CreateParams(RequestOptions): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ shipping: NotRequired["PaymentIntent.CreateParamsShipping"] """ @@ -4502,11 +4505,11 @@ class CreateParams(RequestOptions): """ statement_descriptor: NotRequired[str] """ - For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must contain 1-22 characters. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired["PaymentIntent.CreateParamsTransferData"] """ @@ -5444,13 +5447,13 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -5498,13 +5501,13 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -5525,13 +5528,13 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): @@ -5541,13 +5544,13 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -5565,11 +5568,11 @@ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): @@ -5579,13 +5582,13 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -5595,13 +5598,13 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): @@ -5615,13 +5618,13 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBlik(TypedDict): @@ -5633,13 +5636,13 @@ class CreateParamsPaymentMethodOptionsBlik(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): @@ -5653,13 +5656,13 @@ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCard(TypedDict): @@ -5702,6 +5705,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -5749,13 +5753,13 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ @@ -5789,13 +5793,13 @@ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): """ class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): - count: int + count: NotRequired[int] """ - For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. """ - interval: Literal["month"] + interval: NotRequired[Literal["month"]] """ - For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] @@ -5958,13 +5962,13 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -5982,13 +5986,13 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -6042,13 +6046,13 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): @@ -6056,13 +6060,13 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): @@ -6070,13 +6074,13 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -6084,13 +6088,13 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): @@ -6100,13 +6104,13 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): @@ -6178,13 +6182,13 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): @@ -6208,13 +6212,13 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsLink(TypedDict): @@ -6236,13 +6240,13 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -6258,13 +6262,13 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -6272,13 +6276,13 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): @@ -6290,13 +6294,13 @@ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsP24(TypedDict): @@ -6304,13 +6308,13 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ @@ -6322,13 +6326,13 @@ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): @@ -6378,13 +6382,13 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPix(TypedDict): @@ -6400,13 +6404,13 @@ class CreateParamsPaymentMethodOptionsPix(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): @@ -6414,13 +6418,13 @@ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): @@ -6438,11 +6442,11 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): @@ -6458,13 +6462,13 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): @@ -6483,13 +6487,13 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsSwish(TypedDict): @@ -6501,13 +6505,13 @@ class CreateParamsPaymentMethodOptionsSwish(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsTwint(TypedDict): @@ -6515,13 +6519,13 @@ class CreateParamsPaymentMethodOptionsTwint(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): @@ -6555,13 +6559,13 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -6637,13 +6641,13 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsZip(TypedDict): @@ -6651,13 +6655,13 @@ class CreateParamsPaymentMethodOptionsZip(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsRadarOptions(TypedDict): @@ -6756,7 +6760,7 @@ class IncrementAuthorizationParams(RequestOptions): """ statement_descriptor: NotRequired[str] """ - For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ transfer_data: NotRequired[ "PaymentIntent.IncrementAuthorizationParamsTransferData" @@ -6891,13 +6895,13 @@ class ModifyParams(RequestOptions): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ shipping: NotRequired["Literal['']|PaymentIntent.ModifyParamsShipping"] """ @@ -6905,11 +6909,11 @@ class ModifyParams(RequestOptions): """ statement_descriptor: NotRequired[str] """ - For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired["PaymentIntent.ModifyParamsTransferData"] """ @@ -7787,13 +7791,13 @@ class ModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -7841,13 +7845,13 @@ class ModifyParamsPaymentMethodOptionsAffirm(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -7868,13 +7872,13 @@ class ModifyParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsAlipay(TypedDict): @@ -7884,13 +7888,13 @@ class ModifyParamsPaymentMethodOptionsAlipay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -7908,11 +7912,11 @@ class ModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class ModifyParamsPaymentMethodOptionsAuBecsDebit(TypedDict): @@ -7922,13 +7926,13 @@ class ModifyParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -7938,13 +7942,13 @@ class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsBancontact(TypedDict): @@ -7958,13 +7962,13 @@ class ModifyParamsPaymentMethodOptionsBancontact(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsBlik(TypedDict): @@ -7976,13 +7980,13 @@ class ModifyParamsPaymentMethodOptionsBlik(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsBoleto(TypedDict): @@ -7996,13 +8000,13 @@ class ModifyParamsPaymentMethodOptionsBoleto(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsCard(TypedDict): @@ -8045,6 +8049,7 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -8092,13 +8097,13 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ @@ -8132,13 +8137,13 @@ class ModifyParamsPaymentMethodOptionsCardInstallments(TypedDict): """ class ModifyParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): - count: int + count: NotRequired[int] """ - For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. """ - interval: Literal["month"] + interval: NotRequired[Literal["month"]] """ - For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] @@ -8301,13 +8306,13 @@ class ModifyParamsPaymentMethodOptionsCashapp(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -8325,13 +8330,13 @@ class ModifyParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -8385,13 +8390,13 @@ class ModifyParamsPaymentMethodOptionsEps(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsFpx(TypedDict): @@ -8399,13 +8404,13 @@ class ModifyParamsPaymentMethodOptionsFpx(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsGiropay(TypedDict): @@ -8413,13 +8418,13 @@ class ModifyParamsPaymentMethodOptionsGiropay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -8427,13 +8432,13 @@ class ModifyParamsPaymentMethodOptionsGrabpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsIdeal(TypedDict): @@ -8443,13 +8448,13 @@ class ModifyParamsPaymentMethodOptionsIdeal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsInteracPresent(TypedDict): @@ -8521,13 +8526,13 @@ class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsKonbini(TypedDict): @@ -8551,13 +8556,13 @@ class ModifyParamsPaymentMethodOptionsKonbini(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsLink(TypedDict): @@ -8579,13 +8584,13 @@ class ModifyParamsPaymentMethodOptionsLink(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -8601,13 +8606,13 @@ class ModifyParamsPaymentMethodOptionsMobilepay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -8615,13 +8620,13 @@ class ModifyParamsPaymentMethodOptionsMultibanco(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsOxxo(TypedDict): @@ -8633,13 +8638,13 @@ class ModifyParamsPaymentMethodOptionsOxxo(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsP24(TypedDict): @@ -8647,13 +8652,13 @@ class ModifyParamsPaymentMethodOptionsP24(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ @@ -8665,13 +8670,13 @@ class ModifyParamsPaymentMethodOptionsPaynow(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): @@ -8721,13 +8726,13 @@ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsPix(TypedDict): @@ -8743,13 +8748,13 @@ class ModifyParamsPaymentMethodOptionsPix(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsPromptpay(TypedDict): @@ -8757,13 +8762,13 @@ class ModifyParamsPaymentMethodOptionsPromptpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsRevolutPay(TypedDict): @@ -8781,11 +8786,11 @@ class ModifyParamsPaymentMethodOptionsRevolutPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class ModifyParamsPaymentMethodOptionsSepaDebit(TypedDict): @@ -8801,13 +8806,13 @@ class ModifyParamsPaymentMethodOptionsSepaDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): @@ -8826,13 +8831,13 @@ class ModifyParamsPaymentMethodOptionsSofort(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsSwish(TypedDict): @@ -8844,13 +8849,13 @@ class ModifyParamsPaymentMethodOptionsSwish(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsTwint(TypedDict): @@ -8858,13 +8863,13 @@ class ModifyParamsPaymentMethodOptionsTwint(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): @@ -8898,13 +8903,13 @@ class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -8980,13 +8985,13 @@ class ModifyParamsPaymentMethodOptionsWechatPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsZip(TypedDict): @@ -8994,13 +8999,13 @@ class ModifyParamsPaymentMethodOptionsZip(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ModifyParamsShipping(TypedDict): @@ -9248,11 +9253,11 @@ class VerifyMicrodepositsParams(RequestOptions): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ shipping: Optional[Shipping] """ @@ -9268,11 +9273,11 @@ class VerifyMicrodepositsParams(RequestOptions): """ statement_descriptor: Optional[str] """ - For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: Optional[str] """ - Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ status: Literal[ "canceled", diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 01ab18d7d..89591eb10 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -68,11 +68,11 @@ class CaptureParams(TypedDict): """ statement_descriptor: NotRequired[str] """ - For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must be 1-22 characters long. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired[ "PaymentIntentService.CaptureParamsTransferData" @@ -164,13 +164,13 @@ class ConfirmParams(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ shipping: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsShipping" @@ -1115,13 +1115,13 @@ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -1169,13 +1169,13 @@ class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -1196,13 +1196,13 @@ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): @@ -1212,13 +1212,13 @@ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -1236,11 +1236,11 @@ class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): @@ -1250,13 +1250,13 @@ class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -1266,13 +1266,13 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): @@ -1286,13 +1286,13 @@ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): @@ -1304,13 +1304,13 @@ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): @@ -1324,13 +1324,13 @@ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): @@ -1373,6 +1373,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -1420,13 +1421,13 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ @@ -1460,13 +1461,13 @@ class ConfirmParamsPaymentMethodOptionsCardInstallments(TypedDict): """ class ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): - count: int + count: NotRequired[int] """ - For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. """ - interval: Literal["month"] + interval: NotRequired[Literal["month"]] """ - For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] @@ -1629,13 +1630,13 @@ class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -1653,13 +1654,13 @@ class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -1713,13 +1714,13 @@ class ConfirmParamsPaymentMethodOptionsEps(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): @@ -1727,13 +1728,13 @@ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): @@ -1741,13 +1742,13 @@ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -1755,13 +1756,13 @@ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): @@ -1771,13 +1772,13 @@ class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): @@ -1849,13 +1850,13 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): @@ -1879,13 +1880,13 @@ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): @@ -1907,13 +1908,13 @@ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -1929,13 +1930,13 @@ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -1943,13 +1944,13 @@ class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): @@ -1961,13 +1962,13 @@ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): @@ -1975,13 +1976,13 @@ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ @@ -1993,13 +1994,13 @@ class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): @@ -2049,13 +2050,13 @@ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): @@ -2071,13 +2072,13 @@ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): @@ -2085,13 +2086,13 @@ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): @@ -2109,11 +2110,11 @@ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): @@ -2129,13 +2130,13 @@ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): @@ -2154,13 +2155,13 @@ class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): @@ -2172,13 +2173,13 @@ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): @@ -2186,13 +2187,13 @@ class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): @@ -2226,13 +2227,13 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -2308,13 +2309,13 @@ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): @@ -2322,13 +2323,13 @@ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class ConfirmParamsRadarOptions(TypedDict): @@ -2512,11 +2513,11 @@ class CreateParams(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ shipping: NotRequired["PaymentIntentService.CreateParamsShipping"] """ @@ -2524,11 +2525,11 @@ class CreateParams(TypedDict): """ statement_descriptor: NotRequired[str] """ - For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must contain 1-22 characters. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired[ "PaymentIntentService.CreateParamsTransferData" @@ -3490,13 +3491,13 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -3544,13 +3545,13 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -3571,13 +3572,13 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): @@ -3587,13 +3588,13 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -3611,11 +3612,11 @@ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): @@ -3625,13 +3626,13 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -3641,13 +3642,13 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): @@ -3661,13 +3662,13 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBlik(TypedDict): @@ -3679,13 +3680,13 @@ class CreateParamsPaymentMethodOptionsBlik(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): @@ -3699,13 +3700,13 @@ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCard(TypedDict): @@ -3748,6 +3749,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -3795,13 +3797,13 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ @@ -3835,13 +3837,13 @@ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): """ class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): - count: int + count: NotRequired[int] """ - For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. """ - interval: Literal["month"] + interval: NotRequired[Literal["month"]] """ - For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] @@ -4004,13 +4006,13 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -4028,13 +4030,13 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -4088,13 +4090,13 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): @@ -4102,13 +4104,13 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): @@ -4116,13 +4118,13 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -4130,13 +4132,13 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): @@ -4146,13 +4148,13 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): @@ -4224,13 +4226,13 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): @@ -4254,13 +4256,13 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsLink(TypedDict): @@ -4282,13 +4284,13 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -4304,13 +4306,13 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -4318,13 +4320,13 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): @@ -4336,13 +4338,13 @@ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsP24(TypedDict): @@ -4350,13 +4352,13 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ @@ -4368,13 +4370,13 @@ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): @@ -4424,13 +4426,13 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPix(TypedDict): @@ -4446,13 +4448,13 @@ class CreateParamsPaymentMethodOptionsPix(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): @@ -4460,13 +4462,13 @@ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): @@ -4484,11 +4486,11 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): @@ -4504,13 +4506,13 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): @@ -4529,13 +4531,13 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsSwish(TypedDict): @@ -4547,13 +4549,13 @@ class CreateParamsPaymentMethodOptionsSwish(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsTwint(TypedDict): @@ -4561,13 +4563,13 @@ class CreateParamsPaymentMethodOptionsTwint(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): @@ -4601,13 +4603,13 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -4683,13 +4685,13 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsZip(TypedDict): @@ -4697,13 +4699,13 @@ class CreateParamsPaymentMethodOptionsZip(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsRadarOptions(TypedDict): @@ -4802,7 +4804,7 @@ class IncrementAuthorizationParams(TypedDict): """ statement_descriptor: NotRequired[str] """ - For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ transfer_data: NotRequired[ "PaymentIntentService.IncrementAuthorizationParamsTransferData" @@ -4965,13 +4967,13 @@ class UpdateParams(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ shipping: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsShipping" @@ -4981,11 +4983,11 @@ class UpdateParams(TypedDict): """ statement_descriptor: NotRequired[str] """ - For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired[ "PaymentIntentService.UpdateParamsTransferData" @@ -5887,13 +5889,13 @@ class UpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -5941,13 +5943,13 @@ class UpdateParamsPaymentMethodOptionsAffirm(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -5968,13 +5970,13 @@ class UpdateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsAlipay(TypedDict): @@ -5984,13 +5986,13 @@ class UpdateParamsPaymentMethodOptionsAlipay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -6008,11 +6010,11 @@ class UpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class UpdateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): @@ -6022,13 +6024,13 @@ class UpdateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -6038,13 +6040,13 @@ class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsBancontact(TypedDict): @@ -6058,13 +6060,13 @@ class UpdateParamsPaymentMethodOptionsBancontact(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsBlik(TypedDict): @@ -6076,13 +6078,13 @@ class UpdateParamsPaymentMethodOptionsBlik(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsBoleto(TypedDict): @@ -6096,13 +6098,13 @@ class UpdateParamsPaymentMethodOptionsBoleto(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsCard(TypedDict): @@ -6145,6 +6147,7 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -6192,13 +6195,13 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ @@ -6232,13 +6235,13 @@ class UpdateParamsPaymentMethodOptionsCardInstallments(TypedDict): """ class UpdateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): - count: int + count: NotRequired[int] """ - For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. """ - interval: Literal["month"] + interval: NotRequired[Literal["month"]] """ - For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] @@ -6401,13 +6404,13 @@ class UpdateParamsPaymentMethodOptionsCashapp(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -6425,13 +6428,13 @@ class UpdateParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -6485,13 +6488,13 @@ class UpdateParamsPaymentMethodOptionsEps(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsFpx(TypedDict): @@ -6499,13 +6502,13 @@ class UpdateParamsPaymentMethodOptionsFpx(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsGiropay(TypedDict): @@ -6513,13 +6516,13 @@ class UpdateParamsPaymentMethodOptionsGiropay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -6527,13 +6530,13 @@ class UpdateParamsPaymentMethodOptionsGrabpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsIdeal(TypedDict): @@ -6543,13 +6546,13 @@ class UpdateParamsPaymentMethodOptionsIdeal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsInteracPresent(TypedDict): @@ -6621,13 +6624,13 @@ class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsKonbini(TypedDict): @@ -6651,13 +6654,13 @@ class UpdateParamsPaymentMethodOptionsKonbini(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsLink(TypedDict): @@ -6679,13 +6682,13 @@ class UpdateParamsPaymentMethodOptionsLink(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -6701,13 +6704,13 @@ class UpdateParamsPaymentMethodOptionsMobilepay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -6715,13 +6718,13 @@ class UpdateParamsPaymentMethodOptionsMultibanco(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsOxxo(TypedDict): @@ -6733,13 +6736,13 @@ class UpdateParamsPaymentMethodOptionsOxxo(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsP24(TypedDict): @@ -6747,13 +6750,13 @@ class UpdateParamsPaymentMethodOptionsP24(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ @@ -6765,13 +6768,13 @@ class UpdateParamsPaymentMethodOptionsPaynow(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): @@ -6821,13 +6824,13 @@ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsPix(TypedDict): @@ -6843,13 +6846,13 @@ class UpdateParamsPaymentMethodOptionsPix(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsPromptpay(TypedDict): @@ -6857,13 +6860,13 @@ class UpdateParamsPaymentMethodOptionsPromptpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsRevolutPay(TypedDict): @@ -6881,11 +6884,11 @@ class UpdateParamsPaymentMethodOptionsRevolutPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class UpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): @@ -6901,13 +6904,13 @@ class UpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): @@ -6926,13 +6929,13 @@ class UpdateParamsPaymentMethodOptionsSofort(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsSwish(TypedDict): @@ -6944,13 +6947,13 @@ class UpdateParamsPaymentMethodOptionsSwish(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsTwint(TypedDict): @@ -6958,13 +6961,13 @@ class UpdateParamsPaymentMethodOptionsTwint(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): @@ -6998,13 +7001,13 @@ class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -7080,13 +7083,13 @@ class UpdateParamsPaymentMethodOptionsWechatPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsZip(TypedDict): @@ -7094,13 +7097,13 @@ class UpdateParamsPaymentMethodOptionsZip(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class UpdateParamsShipping(TypedDict): diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 7cd67469d..5d384e435 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -322,11 +322,11 @@ class PaymentIntentData(StripeObject): """ statement_descriptor: Optional[str] """ - Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. + For a non-card payment, information about the charge that appears on the customer's statement when this payment succeeds in creating a charge. """ statement_descriptor_suffix: Optional[str] """ - Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + For a card payment, information about the charge that appears on the customer's statement when this payment succeeds in creating a charge. Concatenated with the account's statement descriptor prefix to form the complete statement descriptor. """ transfer_group: Optional[str] """ @@ -1194,11 +1194,11 @@ class CreateParamsPaymentIntentData(TypedDict): """ statement_descriptor: NotRequired[str] """ - Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_group: NotRequired[str] """ @@ -1994,11 +1994,11 @@ class ModifyParamsPaymentIntentData(TypedDict): """ statement_descriptor: NotRequired["Literal['']|str"] """ - Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired["Literal['']|str"] """ - Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_group: NotRequired["Literal['']|str"] """ diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 026046830..f6ee75608 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -548,11 +548,11 @@ class CreateParamsPaymentIntentData(TypedDict): """ statement_descriptor: NotRequired[str] """ - Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_group: NotRequired[str] """ @@ -1346,11 +1346,11 @@ class UpdateParamsPaymentIntentData(TypedDict): """ statement_descriptor: NotRequired["Literal['']|str"] """ - Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired["Literal['']|str"] """ - Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_group: NotRequired["Literal['']|str"] """ diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index bdb34ba0f..8f8497b43 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -180,6 +180,10 @@ class Offline(StripeObject): """ Time at which the payment was collected while offline """ + type: Optional[Literal["deferred"]] + """ + The method used to process this payment method offline. Only deferred is allowed. + """ class Receipt(StripeObject): account_type: Optional[ @@ -656,6 +660,16 @@ class Networks(StripeObject): The preferred network for the card. """ + class Offline(StripeObject): + stored_at: Optional[int] + """ + Time at which the payment was collected while offline + """ + type: Optional[Literal["deferred"]] + """ + The method used to process this payment method offline. Only deferred is allowed. + """ + brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. @@ -710,6 +724,10 @@ class Networks(StripeObject): """ Contains information about card networks that can be used to process the payment. """ + offline: Optional[Offline] + """ + Details about payment methods collected offline. + """ preferred_locales: Optional[List[str]] """ EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. @@ -726,7 +744,7 @@ class Networks(StripeObject): """ How card details were read in this transaction. """ - _inner_class_types = {"networks": Networks} + _inner_class_types = {"networks": Networks, "offline": Offline} class Cashapp(StripeObject): buyer_id: Optional[str] diff --git a/stripe/_person.py b/stripe/_person.py index 399a97f2f..33b573801 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -38,7 +38,10 @@ class Account(StripeObject): The user agent of the browser from which the legal guardian accepted the service agreement. """ - account: Account + account: Optional[Account] + """ + Details on the legal guardian's acceptance of the main Stripe service agreement. + """ _inner_class_types = {"account": Account} class Address(StripeObject): diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 153f6d797..1745937ef 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -245,6 +245,10 @@ class Offline(StripeObject): """ Time at which the payment was collected while offline """ + type: Optional[Literal["deferred"]] + """ + The method used to process this payment method offline. Only deferred is allowed. + """ generated_card: Optional[ExpandableField["PaymentMethod"]] """ @@ -498,6 +502,7 @@ class SetupError(StripeObject): "invalid_cvc", "invalid_expiry_month", "invalid_expiry_year", + "invalid_mandate_reference_prefix_format", "invalid_number", "invalid_source_usage", "invalid_tax_location", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 2fe740b1c..86bc2c2fd 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -151,6 +151,7 @@ class LastSetupError(StripeObject): "invalid_cvc", "invalid_expiry_month", "invalid_expiry_year", + "invalid_mandate_reference_prefix_format", "invalid_number", "invalid_source_usage", "invalid_tax_location", @@ -514,6 +515,7 @@ class MandateOptions(StripeObject): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -1441,6 +1443,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -2559,6 +2562,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -3644,6 +3648,7 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 17a3e170a..f768a1e5e 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -864,6 +864,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -2014,6 +2015,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -3141,6 +3143,7 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", diff --git a/stripe/_subscription.py b/stripe/_subscription.py index dd621444f..a1e841553 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -220,6 +220,7 @@ class MandateOptions(StripeObject): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -529,7 +530,7 @@ class CreateParams(RequestOptions): """ cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] @@ -636,7 +637,7 @@ class CreateParams(RequestOptions): """ promotion_code: NotRequired[str] """ - The ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] @@ -1019,6 +1020,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -1344,7 +1346,7 @@ class ModifyParams(RequestOptions): """ cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancellation_details: NotRequired[ "Subscription.ModifyParamsCancellationDetails" @@ -1451,7 +1453,7 @@ class ModifyParams(RequestOptions): """ promotion_code: NotRequired[str] """ - The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. + The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] @@ -1848,6 +1850,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -2079,7 +2082,7 @@ class SearchParams(RequestOptions): """ cancel_at_period_end: bool """ - If the subscription has been canceled with the `at_period_end` flag set to `true`, `cancel_at_period_end` on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period. + Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. """ canceled_at: Optional[int] """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index c14e40f3a..527d44d93 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -87,7 +87,7 @@ class CreateParams(TypedDict): """ cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] @@ -194,7 +194,7 @@ class CreateParams(TypedDict): """ promotion_code: NotRequired[str] """ - The ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] @@ -585,6 +585,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", @@ -960,7 +961,7 @@ class UpdateParams(TypedDict): """ cancel_at_period_end: NotRequired[bool] """ - Boolean indicating whether this subscription should cancel at the end of the current period. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancellation_details: NotRequired[ "SubscriptionService.UpdateParamsCancellationDetails" @@ -1067,7 +1068,7 @@ class UpdateParams(TypedDict): """ promotion_code: NotRequired[str] """ - The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. + The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] @@ -1470,6 +1471,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "diners", "discover", "eftpos_au", + "girocard", "interac", "jcb", "mastercard", diff --git a/stripe/_transfer.py b/stripe/_transfer.py index d8b59f2f1..75512a1c9 100644 --- a/stripe/_transfer.py +++ b/stripe/_transfer.py @@ -52,7 +52,7 @@ class CreateParams(RequestOptions): """ currency: str """ - 3-letter [ISO code for currency](https://stripe.com/docs/payouts). + Three-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. Must be a [supported currency](https://docs.stripe.com/currencies). """ description: NotRequired[str] """ diff --git a/stripe/_transfer_service.py b/stripe/_transfer_service.py index a78d77486..df63bcd02 100644 --- a/stripe/_transfer_service.py +++ b/stripe/_transfer_service.py @@ -22,7 +22,7 @@ class CreateParams(TypedDict): """ currency: str """ - 3-letter [ISO code for currency](https://stripe.com/docs/payouts). + Three-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. Must be a [supported currency](https://docs.stripe.com/currencies). """ description: NotRequired[str] """ diff --git a/stripe/billing/__init__.py b/stripe/billing/__init__.py index 728f48113..a6aea1532 100644 --- a/stripe/billing/__init__.py +++ b/stripe/billing/__init__.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.billing._alert import Alert as Alert +from stripe.billing._alert_service import AlertService as AlertService from stripe.billing._alert_triggered import AlertTriggered as AlertTriggered from stripe.billing._meter import Meter as Meter from stripe.billing._meter_event import MeterEvent as MeterEvent diff --git a/stripe/billing/_alert.py b/stripe/billing/_alert.py index 1119101b5..d2a2ddbac 100644 --- a/stripe/billing/_alert.py +++ b/stripe/billing/_alert.py @@ -1,16 +1,27 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional -from typing_extensions import Literal, TYPE_CHECKING +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, List, Optional, cast, overload +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) if TYPE_CHECKING: from stripe._customer import Customer from stripe.billing._meter import Meter -class Alert(StripeObject): +class Alert(CreateableAPIResource["Alert"], ListableAPIResource["Alert"]): """ A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests. """ @@ -37,6 +48,100 @@ class UsageThresholdConfig(StripeObject): Defines how the alert will behave. """ + class ActivateParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ArchiveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class CreateParams(RequestOptions): + alert_type: Literal["usage_threshold"] + """ + The type of alert to create. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + filter: NotRequired["Alert.CreateParamsFilter"] + """ + Filters to limit the scope of an alert. + """ + title: str + """ + The title of the alert. + """ + usage_threshold_config: NotRequired[ + "Alert.CreateParamsUsageThresholdConfig" + ] + """ + The configuration of the usage threshold. + """ + + class CreateParamsFilter(TypedDict): + customer: NotRequired[str] + """ + Limit the scope to this alert only to this customer. + """ + + class CreateParamsUsageThresholdConfig(TypedDict): + gte: int + """ + Defines at which value the alert will fire. + """ + meter: NotRequired[str] + """ + The [Billing Meter](https://stripe.com/api/billing/meter) ID whose usage is monitored. + """ + recurrence: Literal["one_time"] + """ + Whether the alert should only fire only once, or once per billing cycle. + """ + + class DeactivateParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ListParams(RequestOptions): + alert_type: NotRequired[Literal["usage_threshold"]] + """ + Filter results to only include this type of alert. + """ + 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. + """ + meter: NotRequired[str] + """ + Filter results to only include alerts with the given meter. + """ + 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. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + alert_type: Literal["usage_threshold"] """ Defines the type of the alert. @@ -69,6 +174,411 @@ class UsageThresholdConfig(StripeObject): """ Encapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://stripe.com/docs/api/billing/meter). """ + + @classmethod + def _cls_activate( + cls, id: str, **params: Unpack["Alert.ActivateParams"] + ) -> "Alert": + """ + Reactivates this alert, allowing it to trigger again. + """ + return cast( + "Alert", + cls._static_request( + "post", + "/v1/billing/alerts/{id}/activate".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + def activate(id: str, **params: Unpack["Alert.ActivateParams"]) -> "Alert": + """ + Reactivates this alert, allowing it to trigger again. + """ + ... + + @overload + def activate(self, **params: Unpack["Alert.ActivateParams"]) -> "Alert": + """ + Reactivates this alert, allowing it to trigger again. + """ + ... + + @class_method_variant("_cls_activate") + def activate( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Alert.ActivateParams"] + ) -> "Alert": + """ + Reactivates this alert, allowing it to trigger again. + """ + return cast( + "Alert", + self._request( + "post", + "/v1/billing/alerts/{id}/activate".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_activate_async( + cls, id: str, **params: Unpack["Alert.ActivateParams"] + ) -> "Alert": + """ + Reactivates this alert, allowing it to trigger again. + """ + return cast( + "Alert", + await cls._static_request_async( + "post", + "/v1/billing/alerts/{id}/activate".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + async def activate_async( + id: str, **params: Unpack["Alert.ActivateParams"] + ) -> "Alert": + """ + Reactivates this alert, allowing it to trigger again. + """ + ... + + @overload + async def activate_async( + self, **params: Unpack["Alert.ActivateParams"] + ) -> "Alert": + """ + Reactivates this alert, allowing it to trigger again. + """ + ... + + @class_method_variant("_cls_activate_async") + async def activate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Alert.ActivateParams"] + ) -> "Alert": + """ + Reactivates this alert, allowing it to trigger again. + """ + return cast( + "Alert", + await self._request_async( + "post", + "/v1/billing/alerts/{id}/activate".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def _cls_archive( + cls, id: str, **params: Unpack["Alert.ArchiveParams"] + ) -> "Alert": + """ + Archives this alert, removing it from the list view and APIs. This is non-reversible. + """ + return cast( + "Alert", + cls._static_request( + "post", + "/v1/billing/alerts/{id}/archive".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + def archive(id: str, **params: Unpack["Alert.ArchiveParams"]) -> "Alert": + """ + Archives this alert, removing it from the list view and APIs. This is non-reversible. + """ + ... + + @overload + def archive(self, **params: Unpack["Alert.ArchiveParams"]) -> "Alert": + """ + Archives this alert, removing it from the list view and APIs. This is non-reversible. + """ + ... + + @class_method_variant("_cls_archive") + def archive( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Alert.ArchiveParams"] + ) -> "Alert": + """ + Archives this alert, removing it from the list view and APIs. This is non-reversible. + """ + return cast( + "Alert", + self._request( + "post", + "/v1/billing/alerts/{id}/archive".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_archive_async( + cls, id: str, **params: Unpack["Alert.ArchiveParams"] + ) -> "Alert": + """ + Archives this alert, removing it from the list view and APIs. This is non-reversible. + """ + return cast( + "Alert", + await cls._static_request_async( + "post", + "/v1/billing/alerts/{id}/archive".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + async def archive_async( + id: str, **params: Unpack["Alert.ArchiveParams"] + ) -> "Alert": + """ + Archives this alert, removing it from the list view and APIs. This is non-reversible. + """ + ... + + @overload + async def archive_async( + self, **params: Unpack["Alert.ArchiveParams"] + ) -> "Alert": + """ + Archives this alert, removing it from the list view and APIs. This is non-reversible. + """ + ... + + @class_method_variant("_cls_archive_async") + async def archive_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Alert.ArchiveParams"] + ) -> "Alert": + """ + Archives this alert, removing it from the list view and APIs. This is non-reversible. + """ + return cast( + "Alert", + await self._request_async( + "post", + "/v1/billing/alerts/{id}/archive".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def create(cls, **params: Unpack["Alert.CreateParams"]) -> "Alert": + """ + Creates a billing alert + """ + return cast( + "Alert", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["Alert.CreateParams"] + ) -> "Alert": + """ + Creates a billing alert + """ + return cast( + "Alert", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def _cls_deactivate( + cls, id: str, **params: Unpack["Alert.DeactivateParams"] + ) -> "Alert": + """ + Deactivates this alert, preventing it from triggering. + """ + return cast( + "Alert", + cls._static_request( + "post", + "/v1/billing/alerts/{id}/deactivate".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def deactivate( + id: str, **params: Unpack["Alert.DeactivateParams"] + ) -> "Alert": + """ + Deactivates this alert, preventing it from triggering. + """ + ... + + @overload + def deactivate( + self, **params: Unpack["Alert.DeactivateParams"] + ) -> "Alert": + """ + Deactivates this alert, preventing it from triggering. + """ + ... + + @class_method_variant("_cls_deactivate") + def deactivate( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Alert.DeactivateParams"] + ) -> "Alert": + """ + Deactivates this alert, preventing it from triggering. + """ + return cast( + "Alert", + self._request( + "post", + "/v1/billing/alerts/{id}/deactivate".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_deactivate_async( + cls, id: str, **params: Unpack["Alert.DeactivateParams"] + ) -> "Alert": + """ + Deactivates this alert, preventing it from triggering. + """ + return cast( + "Alert", + await cls._static_request_async( + "post", + "/v1/billing/alerts/{id}/deactivate".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def deactivate_async( + id: str, **params: Unpack["Alert.DeactivateParams"] + ) -> "Alert": + """ + Deactivates this alert, preventing it from triggering. + """ + ... + + @overload + async def deactivate_async( + self, **params: Unpack["Alert.DeactivateParams"] + ) -> "Alert": + """ + Deactivates this alert, preventing it from triggering. + """ + ... + + @class_method_variant("_cls_deactivate_async") + async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Alert.DeactivateParams"] + ) -> "Alert": + """ + Deactivates this alert, preventing it from triggering. + """ + return cast( + "Alert", + await self._request_async( + "post", + "/v1/billing/alerts/{id}/deactivate".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def list(cls, **params: Unpack["Alert.ListParams"]) -> ListObject["Alert"]: + """ + Lists billing active and inactive alerts + """ + 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["Alert.ListParams"] + ) -> ListObject["Alert"]: + """ + Lists billing active and inactive alerts + """ + 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["Alert.RetrieveParams"] + ) -> "Alert": + """ + Retrieves a billing alert given an ID + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Alert.RetrieveParams"] + ) -> "Alert": + """ + Retrieves a billing alert given an ID + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "filter": Filter, "usage_threshold_config": UsageThresholdConfig, diff --git a/stripe/billing/_alert_service.py b/stripe/billing/_alert_service.py new file mode 100644 index 000000000..b3952ac19 --- /dev/null +++ b/stripe/billing/_alert_service.py @@ -0,0 +1,353 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.billing._alert import Alert +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class AlertService(StripeService): + class ActivateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ArchiveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class CreateParams(TypedDict): + alert_type: Literal["usage_threshold"] + """ + The type of alert to create. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + filter: NotRequired["AlertService.CreateParamsFilter"] + """ + Filters to limit the scope of an alert. + """ + title: str + """ + The title of the alert. + """ + usage_threshold_config: NotRequired[ + "AlertService.CreateParamsUsageThresholdConfig" + ] + """ + The configuration of the usage threshold. + """ + + class CreateParamsFilter(TypedDict): + customer: NotRequired[str] + """ + Limit the scope to this alert only to this customer. + """ + + class CreateParamsUsageThresholdConfig(TypedDict): + gte: int + """ + Defines at which value the alert will fire. + """ + meter: NotRequired[str] + """ + The [Billing Meter](https://stripe.com/api/billing/meter) ID whose usage is monitored. + """ + recurrence: Literal["one_time"] + """ + Whether the alert should only fire only once, or once per billing cycle. + """ + + class DeactivateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ListParams(TypedDict): + alert_type: NotRequired[Literal["usage_threshold"]] + """ + Filter results to only include this type of alert. + """ + 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. + """ + meter: NotRequired[str] + """ + Filter results to only include alerts with the given meter. + """ + 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. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "AlertService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Alert]: + """ + Lists billing active and inactive alerts + """ + return cast( + ListObject[Alert], + self._request( + "get", + "/v1/billing/alerts", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "AlertService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Alert]: + """ + Lists billing active and inactive alerts + """ + return cast( + ListObject[Alert], + await self._request_async( + "get", + "/v1/billing/alerts", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, params: "AlertService.CreateParams", options: RequestOptions = {} + ) -> Alert: + """ + Creates a billing alert + """ + return cast( + Alert, + self._request( + "post", + "/v1/billing/alerts", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, params: "AlertService.CreateParams", options: RequestOptions = {} + ) -> Alert: + """ + Creates a billing alert + """ + return cast( + Alert, + await self._request_async( + "post", + "/v1/billing/alerts", + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "AlertService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Alert: + """ + Retrieves a billing alert given an ID + """ + return cast( + Alert, + self._request( + "get", + "/v1/billing/alerts/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "AlertService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Alert: + """ + Retrieves a billing alert given an ID + """ + return cast( + Alert, + await self._request_async( + "get", + "/v1/billing/alerts/{id}".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def activate( + self, + id: str, + params: "AlertService.ActivateParams" = {}, + options: RequestOptions = {}, + ) -> Alert: + """ + Reactivates this alert, allowing it to trigger again. + """ + return cast( + Alert, + self._request( + "post", + "/v1/billing/alerts/{id}/activate".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def activate_async( + self, + id: str, + params: "AlertService.ActivateParams" = {}, + options: RequestOptions = {}, + ) -> Alert: + """ + Reactivates this alert, allowing it to trigger again. + """ + return cast( + Alert, + await self._request_async( + "post", + "/v1/billing/alerts/{id}/activate".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def archive( + self, + id: str, + params: "AlertService.ArchiveParams" = {}, + options: RequestOptions = {}, + ) -> Alert: + """ + Archives this alert, removing it from the list view and APIs. This is non-reversible. + """ + return cast( + Alert, + self._request( + "post", + "/v1/billing/alerts/{id}/archive".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def archive_async( + self, + id: str, + params: "AlertService.ArchiveParams" = {}, + options: RequestOptions = {}, + ) -> Alert: + """ + Archives this alert, removing it from the list view and APIs. This is non-reversible. + """ + return cast( + Alert, + await self._request_async( + "post", + "/v1/billing/alerts/{id}/archive".format(id=sanitize_id(id)), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + def deactivate( + self, + id: str, + params: "AlertService.DeactivateParams" = {}, + options: RequestOptions = {}, + ) -> Alert: + """ + Deactivates this alert, preventing it from triggering. + """ + return cast( + Alert, + self._request( + "post", + "/v1/billing/alerts/{id}/deactivate".format( + id=sanitize_id(id) + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def deactivate_async( + self, + id: str, + params: "AlertService.DeactivateParams" = {}, + options: RequestOptions = {}, + ) -> Alert: + """ + Deactivates this alert, preventing it from triggering. + """ + return cast( + Alert, + await self._request_async( + "post", + "/v1/billing/alerts/{id}/deactivate".format( + id=sanitize_id(id) + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 56152c957..f30e84f17 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -564,11 +564,11 @@ class MandateOptions(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] @@ -583,11 +583,11 @@ class Affirm(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class AfterpayClearpay(StripeObject): @@ -595,11 +595,11 @@ class AfterpayClearpay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Alipay(StripeObject): @@ -607,11 +607,11 @@ class Alipay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class AmazonPay(StripeObject): @@ -619,11 +619,11 @@ class AmazonPay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class AuBecsDebit(StripeObject): @@ -631,11 +631,11 @@ class AuBecsDebit(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class BacsDebit(StripeObject): @@ -645,11 +645,11 @@ class BacsDebit(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Bancontact(StripeObject): @@ -657,11 +657,11 @@ class Bancontact(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Boleto(StripeObject): @@ -675,11 +675,11 @@ class Boleto(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Card(StripeObject): @@ -700,11 +700,11 @@ class Installments(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ statement_descriptor_suffix_kana: Optional[str] """ @@ -721,11 +721,11 @@ class Cashapp(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CustomerBalance(StripeObject): @@ -778,11 +778,11 @@ class EuBankTransfer(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ _inner_class_types = {"bank_transfer": BankTransfer} @@ -791,11 +791,11 @@ class Eps(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Fpx(StripeObject): @@ -803,11 +803,11 @@ class Fpx(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Giropay(StripeObject): @@ -815,11 +815,11 @@ class Giropay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Grabpay(StripeObject): @@ -827,11 +827,11 @@ class Grabpay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Ideal(StripeObject): @@ -839,11 +839,11 @@ class Ideal(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Klarna(StripeObject): @@ -853,11 +853,11 @@ class Klarna(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Konbini(StripeObject): @@ -869,11 +869,11 @@ class Konbini(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Link(StripeObject): @@ -881,11 +881,11 @@ class Link(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Mobilepay(StripeObject): @@ -893,11 +893,11 @@ class Mobilepay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Multibanco(StripeObject): @@ -905,11 +905,11 @@ class Multibanco(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Oxxo(StripeObject): @@ -921,11 +921,11 @@ class Oxxo(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class P24(StripeObject): @@ -933,11 +933,11 @@ class P24(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Paynow(StripeObject): @@ -945,11 +945,11 @@ class Paynow(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Paypal(StripeObject): @@ -969,11 +969,11 @@ class Paypal(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Pix(StripeObject): @@ -987,11 +987,11 @@ class RevolutPay(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class SepaDebit(StripeObject): @@ -1001,11 +1001,11 @@ class SepaDebit(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Sofort(StripeObject): @@ -1013,11 +1013,11 @@ class Sofort(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class Swish(StripeObject): @@ -1069,11 +1069,11 @@ class Filters(StripeObject): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ verification_method: Optional[Literal["automatic", "instant"]] """ @@ -2412,14 +2412,11 @@ class CreateParamsPaymentIntentData(TypedDict): """ statement_descriptor: NotRequired[str] """ - Extra information about the payment. This will appear on your - customer's statement when this payment succeeds in creating a charge. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about the charge that customers see on their statements. Concatenated with the - prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete - statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired[ "Session.CreateParamsPaymentIntentDataTransferData" @@ -2679,11 +2676,11 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -2723,11 +2720,11 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -2735,11 +2732,11 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): @@ -2747,11 +2744,11 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -2759,11 +2756,11 @@ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): @@ -2771,11 +2768,11 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -2785,11 +2782,11 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): @@ -2797,11 +2794,11 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): @@ -2815,11 +2812,11 @@ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsCard(TypedDict): @@ -2839,11 +2836,11 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ statement_descriptor_suffix_kana: NotRequired[str] """ @@ -2868,11 +2865,11 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -2890,11 +2887,11 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -2948,11 +2945,11 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): @@ -2960,11 +2957,11 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): @@ -2972,11 +2969,11 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -2984,11 +2981,11 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): @@ -2996,11 +2993,11 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): @@ -3008,11 +3005,11 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): @@ -3024,11 +3021,11 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsLink(TypedDict): @@ -3036,11 +3033,11 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -3048,11 +3045,11 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -3060,11 +3057,11 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): @@ -3076,11 +3073,11 @@ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsP24(TypedDict): @@ -3088,11 +3085,11 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ tos_shown_and_accepted: NotRequired[bool] """ @@ -3104,11 +3101,11 @@ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): @@ -3158,13 +3155,13 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPix(TypedDict): @@ -3178,11 +3175,11 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): @@ -3192,11 +3189,11 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSofort(TypedDict): @@ -3204,11 +3201,11 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSwish(TypedDict): @@ -3230,11 +3227,11 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ verification_method: NotRequired[Literal["automatic", "instant"]] """ @@ -3274,11 +3271,11 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPhoneNumberCollection(TypedDict): diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index fd6f7586b..ad754f660 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -829,14 +829,11 @@ class CreateParamsPaymentIntentData(TypedDict): """ statement_descriptor: NotRequired[str] """ - Extra information about the payment. This will appear on your - customer's statement when this payment succeeds in creating a charge. + Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about the charge that customers see on their statements. Concatenated with the - prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete - statement descriptor. Maximum 22 characters for the concatenated descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired[ "SessionService.CreateParamsPaymentIntentDataTransferData" @@ -1128,11 +1125,11 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] @@ -1172,11 +1169,11 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): @@ -1184,11 +1181,11 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): @@ -1196,11 +1193,11 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): @@ -1208,11 +1205,11 @@ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): @@ -1220,11 +1217,11 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): @@ -1234,11 +1231,11 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): @@ -1246,11 +1243,11 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): @@ -1264,11 +1261,11 @@ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsCard(TypedDict): @@ -1288,11 +1285,11 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ statement_descriptor_suffix_kana: NotRequired[str] """ @@ -1317,11 +1314,11 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -1339,11 +1336,11 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( @@ -1397,11 +1394,11 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): @@ -1409,11 +1406,11 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): @@ -1421,11 +1418,11 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): @@ -1433,11 +1430,11 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): @@ -1445,11 +1442,11 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): @@ -1457,11 +1454,11 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): @@ -1473,11 +1470,11 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsLink(TypedDict): @@ -1485,11 +1482,11 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): @@ -1497,11 +1494,11 @@ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): @@ -1509,11 +1506,11 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): @@ -1525,11 +1522,11 @@ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsP24(TypedDict): @@ -1537,11 +1534,11 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ tos_shown_and_accepted: NotRequired[bool] """ @@ -1553,11 +1550,11 @@ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): @@ -1607,13 +1604,13 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). - If `setup_future_usage` is already set and you are performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPix(TypedDict): @@ -1627,11 +1624,11 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): @@ -1641,11 +1638,11 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSofort(TypedDict): @@ -1653,11 +1650,11 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSwish(TypedDict): @@ -1679,11 +1676,11 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ verification_method: NotRequired[Literal["automatic", "instant"]] """ @@ -1723,11 +1720,11 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ Indicates that you intend to make future payments with this PaymentIntent's payment method. - Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://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://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, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://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 also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ class CreateParamsPhoneNumberCollection(TypedDict): diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 277141df8..506924ed9 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -243,6 +243,10 @@ class CreateParams(RequestOptions): """ Details provided about the user being verified. These details may be shown to the user. """ + related_customer: NotRequired[str] + """ + Token referencing a Customer resource. + """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. @@ -315,6 +319,7 @@ class ListParams(RequestOptions): """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ + related_customer: NotRequired[str] 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. @@ -466,6 +471,10 @@ class RetrieveParams(RequestOptions): """ Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. """ + related_customer: Optional[str] + """ + Token referencing a Customer resource. + """ status: Literal["canceled", "processing", "requires_input", "verified"] """ Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index f615b461e..7cbe57bd0 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -39,6 +39,10 @@ class CreateParams(TypedDict): """ Details provided about the user being verified. These details may be shown to the user. """ + related_customer: NotRequired[str] + """ + Token referencing a Customer resource. + """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. @@ -113,6 +117,7 @@ class ListParams(TypedDict): """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ + related_customer: NotRequired[str] 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. diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index ade6b71e5..69157e32b 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -648,6 +648,12 @@ class ListLineItemsParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + amount_total: int """ Total amount after taxes in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). @@ -852,6 +858,28 @@ async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def retrieve( + cls, id: str, **params: Unpack["Calculation.RetrieveParams"] + ) -> "Calculation": + """ + Retrieves a Tax Calculation object, if the calculation hasn't expired. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Calculation.RetrieveParams"] + ) -> "Calculation": + """ + Retrieves a Tax Calculation object, if the calculation hasn't expired. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = { "customer_details": CustomerDetails, "ship_from_details": ShipFromDetails, diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index aad073403..ced36501f 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -2,6 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService +from stripe._util import sanitize_id from stripe.tax._calculation import Calculation from stripe.tax._calculation_line_item_service import ( CalculationLineItemService, @@ -270,6 +271,58 @@ class CreateParamsShippingCost(TypedDict): The [tax code](https://stripe.com/docs/tax/tax-categories) used to calculate tax on shipping. If not provided, the default shipping tax code from your [Tax Settings](https://stripe.com/settings/tax) is used. """ + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def retrieve( + self, + calculation: str, + params: "CalculationService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Calculation: + """ + Retrieves a Tax Calculation object, if the calculation hasn't expired. + """ + return cast( + Calculation, + self._request( + "get", + "/v1/tax/calculations/{calculation}".format( + calculation=sanitize_id(calculation), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + calculation: str, + params: "CalculationService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Calculation: + """ + Retrieves a Tax Calculation object, if the calculation hasn't expired. + """ + return cast( + Calculation, + await self._request_async( + "get", + "/v1/tax/calculations/{calculation}".format( + calculation=sanitize_id(calculation), + ), + api_mode="V1", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "CalculationService.CreateParams", diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index eaf24cf5a..867dd6fe4 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -572,7 +572,7 @@ class SetReaderDisplayParamsCartLineItem(TypedDict): """ status: Optional[Literal["offline", "online"]] """ - The networking status of the reader. + The networking status of the reader. We do not recommend using this field in flows that may block taking payments. """ deleted: Optional[Literal[True]] """ diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index 52299c702..3afd750e4 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -664,6 +664,7 @@ class UpdateFeaturesParamsOutboundTransfersUsDomesticWire(TypedDict): "card_issuing", "deposit_insurance", "financial_addresses.aba", + "financial_addresses.aba.forwarding", "inbound_transfers.ach", "intra_stripe_flows", "outbound_payments.ach", @@ -720,6 +721,7 @@ class UpdateFeaturesParamsOutboundTransfersUsDomesticWire(TypedDict): "card_issuing", "deposit_insurance", "financial_addresses.aba", + "financial_addresses.aba.forwarding", "inbound_transfers.ach", "intra_stripe_flows", "outbound_payments.ach", @@ -743,6 +745,7 @@ class UpdateFeaturesParamsOutboundTransfersUsDomesticWire(TypedDict): "card_issuing", "deposit_insurance", "financial_addresses.aba", + "financial_addresses.aba.forwarding", "inbound_transfers.ach", "intra_stripe_flows", "outbound_payments.ach", From b869940b0e3fe00fe643eaadc6b9bf91cc5bccd0 Mon Sep 17 00:00:00 2001 From: David Brownman Date: Thu, 8 Aug 2024 16:57:26 -0700 Subject: [PATCH 096/179] Bump version to 10.7.0 --- CHANGELOG.md | 21 +++++++++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a310adb94..d055d730e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +## 10.7.0 - 2024-08-08 +* [#1371](https://github.com/stripe/stripe-python/pull/1371) Update generated code + * Add support for `type` on resource classes `stripe.Charge.PaymentMethodDetails.CardPresent.Offline`, `stripe.ConfirmationToken.PaymentMethodPreview.Card.GeneratedFrom.PaymentMethodDetails.CardPresent.Offline`, `stripe.PaymentMethod.Card.GeneratedFrom.PaymentMethodDetails.CardPresent.Offline`, and `stripe.SetupAttempt.PaymentMethodDetails.CardPresent.Offline` + * Add support for `offline` on resource classes `stripe.ConfirmationToken.PaymentMethodPreview.CardPresent` and `stripe.PaymentMethod.CardPresent` + * Add support for `_cls_activate` on resource `stripe.billing.Alert` + * Add support for `_cls_archive` on resource `stripe.billing.Alert` + * Add support for `_cls_deactivate` on resource `stripe.billing.Alert` + * Add support for `activate` on resource `stripe.billing.Alert` + * Add support for `archive` on resource `stripe.billing.Alert` + * Add support for `create` on resource `stripe.billing.Alert` + * Add support for `deactivate` on resource `stripe.billing.Alert` + * Add support for `list` on resource `stripe.billing.Alert` + * Add support for `retrieve` on resources `stripe.billing.Alert` and `stripe.tax.Calculation` + * Add support for `related_customer` on parameter classes `stripe.identity.VerificationSession.CreateParams` and `stripe.identity.VerificationSession.ListParams` and resource `stripe.identity.VerificationSession` + * Add support for `invalid_mandate_reference_prefix_format` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Add support for `girocard` on enums `stripe.PaymentIntent.PaymentMethodOptions.Card.network`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsCard.network`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsCard.network`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsCard.network`, `stripe.SetupIntent.PaymentMethodOptions.Card.network`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptionsCard.network`, `stripe.SetupIntent.CreateParamsPaymentMethodOptionsCard.network`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptionsCard.network`, `stripe.Subscription.PaymentSettings.PaymentMethodOptions.Card.network`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsCard.network`, and `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsCard.network` + * Add support for `financial_addresses.aba.forwarding` on enums `stripe.treasury.FinancialAccount.active_features`, `stripe.treasury.FinancialAccount.pending_features`, and `stripe.treasury.FinancialAccount.restricted_features` + * Change type of `count` on `stripe.Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan`, `stripe.Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsCardInstallmentsPlan`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsCardInstallmentsPlan` from `int` to `NotRequired[int]` + * Change type of `interval` on `stripe.Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan`, `stripe.Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsCardInstallmentsPlan`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsCardInstallmentsPlan` from `Literal['month']` to `NotRequired[Literal['month']]` + * Change type of `account` on `stripe.Person.AdditionalTosAcceptances` from `Account` to `Optional[Account]` + ## 10.6.0 - 2024-08-01 * [#1369](https://github.com/stripe/stripe-python/pull/1369) Update generated code * Add support for resource `stripe.billing.Alert` diff --git a/VERSION b/VERSION index d1dd3f904..1bcdaf5fe 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.6.0 +10.7.0 diff --git a/stripe/_version.py b/stripe/_version.py index 8f89d8205..f052486b9 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.6.0" +VERSION = "10.7.0" From bfe1175fb77301192921c2dbf7e8aa2522309119 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:31:34 -0700 Subject: [PATCH 097/179] Update generated code (#1373) * Update generated code for v1190 * Update generated code for v1192 * Update generated code for v1194 * Update generated code for v1195 * Update generated code for v1196 * Update generated code for v1198 * Update generated code for v1199 * Update generated code for v1200 * Update generated code for v1201 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 24 +++---- stripe/_account_external_account_service.py | 2 +- stripe/_account_person_service.py | 4 +- stripe/_account_service.py | 8 +-- stripe/_charge.py | 37 +++++++---- stripe/_charge_service.py | 4 +- stripe/_confirmation_token.py | 33 ++++++++-- stripe/_payment_intent.py | 46 +++++++++++--- stripe/_payment_intent_service.py | 37 +++++++++-- stripe/_payment_method.py | 28 +++++++-- stripe/_quote.py | 16 ++--- stripe/_quote_service.py | 4 +- stripe/_setup_intent.py | 62 ++++++++++++++++++- stripe/_setup_intent_service.py | 51 +++++++++++++++ stripe/_token.py | 2 +- stripe/_token_service.py | 2 +- stripe/checkout/_session.py | 2 +- stripe/checkout/_session_service.py | 2 +- .../treasury/_outbound_payment_service.py | 4 ++ .../treasury/_outbound_transfer_service.py | 4 ++ stripe/treasury/_outbound_payment.py | 10 ++- stripe/treasury/_outbound_transfer.py | 10 ++- 23 files changed, 320 insertions(+), 74 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 1af8caa5d..82e4a49f9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1189 \ No newline at end of file +v1201 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index ad20ec69f..f5246a701 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -2270,7 +2270,7 @@ class CreateParamsDocuments(TypedDict): "Account.CreateParamsDocumentsBankAccountOwnershipVerification" ] """ - One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. + One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. """ company_license: NotRequired[ "Account.CreateParamsDocumentsCompanyLicense" @@ -2840,7 +2840,7 @@ class CreatePersonParams(RequestOptions): "Account.CreatePersonParamsAdditionalTosAcceptances" ] """ - Details on the legal guardian's acceptance of the required Stripe agreements. + Details on the legal guardian's or authorizer's acceptance of the required Stripe agreements. """ address: NotRequired["Account.CreatePersonParamsAddress"] """ @@ -3405,7 +3405,7 @@ class ModifyExternalAccountParamsDocuments(TypedDict): "Account.ModifyExternalAccountParamsDocumentsBankAccountOwnershipVerification" ] """ - One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. + One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a check. """ class ModifyExternalAccountParamsDocumentsBankAccountOwnershipVerification( @@ -3421,7 +3421,7 @@ class ModifyPersonParams(RequestOptions): "Account.ModifyPersonParamsAdditionalTosAcceptances" ] """ - Details on the legal guardian's acceptance of the required Stripe agreements. + Details on the legal guardian's or authorizer's acceptance of the required Stripe agreements. """ address: NotRequired["Account.ModifyPersonParamsAddress"] """ @@ -3980,7 +3980,7 @@ def _cls_delete( Test-mode accounts can be deleted at any time. - Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -4004,7 +4004,7 @@ def delete( Test-mode accounts can be deleted at any time. - Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -4017,7 +4017,7 @@ def delete(self, **params: Unpack["Account.DeleteParams"]) -> "Account": Test-mode accounts can be deleted at any time. - Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -4032,7 +4032,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] Test-mode accounts can be deleted at any time. - Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -4051,7 +4051,7 @@ async def _cls_delete_async( Test-mode accounts can be deleted at any time. - Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -4075,7 +4075,7 @@ async def delete_async( Test-mode accounts can be deleted at any time. - Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -4090,7 +4090,7 @@ async def delete_async( Test-mode accounts can be deleted at any time. - Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -4105,7 +4105,7 @@ async def delete_async( # pyright: ignore[reportGeneralTypeIssues] Test-mode accounts can be deleted at any time. - Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ diff --git a/stripe/_account_external_account_service.py b/stripe/_account_external_account_service.py index 06a2b7e77..a048e69d5 100644 --- a/stripe/_account_external_account_service.py +++ b/stripe/_account_external_account_service.py @@ -193,7 +193,7 @@ class UpdateParamsDocuments(TypedDict): "AccountExternalAccountService.UpdateParamsDocumentsBankAccountOwnershipVerification" ] """ - One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. + One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a check. """ class UpdateParamsDocumentsBankAccountOwnershipVerification(TypedDict): diff --git a/stripe/_account_person_service.py b/stripe/_account_person_service.py index 363ea0130..0fe82b820 100644 --- a/stripe/_account_person_service.py +++ b/stripe/_account_person_service.py @@ -15,7 +15,7 @@ class CreateParams(TypedDict): "AccountPersonService.CreateParamsAdditionalTosAcceptances" ] """ - Details on the legal guardian's acceptance of the required Stripe agreements. + Details on the legal guardian's or authorizer's acceptance of the required Stripe agreements. """ address: NotRequired["AccountPersonService.CreateParamsAddress"] """ @@ -444,7 +444,7 @@ class UpdateParams(TypedDict): "AccountPersonService.UpdateParamsAdditionalTosAcceptances" ] """ - Details on the legal guardian's acceptance of the required Stripe agreements. + Details on the legal guardian's or authorizer's acceptance of the required Stripe agreements. """ address: NotRequired["AccountPersonService.UpdateParamsAddress"] """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 2aa902006..11ccec68e 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -1077,7 +1077,7 @@ class CreateParamsDocuments(TypedDict): "AccountService.CreateParamsDocumentsBankAccountOwnershipVerification" ] """ - One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. + One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. """ company_license: NotRequired[ "AccountService.CreateParamsDocumentsCompanyLicense" @@ -2725,7 +2725,7 @@ class UpdateParamsDocuments(TypedDict): "AccountService.UpdateParamsDocumentsBankAccountOwnershipVerification" ] """ - One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. + One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. """ company_license: NotRequired[ "AccountService.UpdateParamsDocumentsCompanyLicense" @@ -3325,7 +3325,7 @@ def delete( Test-mode accounts can be deleted at any time. - Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ @@ -3352,7 +3352,7 @@ async def delete_async( Test-mode accounts can be deleted at any time. - Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. + Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ diff --git a/stripe/_charge.py b/stripe/_charge.py index 7ab12a247..a1dd7cf1c 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -703,6 +703,10 @@ class ShippingAddress(StripeObject): """ The authorized amount. """ + authorization_code: Optional[str] + """ + Authorization code on the charge. + """ brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. @@ -850,6 +854,14 @@ class Receipt(StripeObject): An indication of various EMV functions performed during the transaction. """ + class Wallet(StripeObject): + type: Literal[ + "apple_pay", "google_pay", "samsung_pay", "unknown" + ] + """ + The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + """ + amount_authorized: Optional[int] """ The authorized amount @@ -926,10 +938,7 @@ class Receipt(StripeObject): """ network_transaction_id: Optional[str] """ - This is used by the financial networks to identify a transaction. - Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. - The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). - This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. """ offline: Optional[Offline] """ @@ -959,7 +968,12 @@ class Receipt(StripeObject): """ A collection of fields required to be displayed on receipts. Only required for EMV transactions. """ - _inner_class_types = {"offline": Offline, "receipt": Receipt} + wallet: Optional[Wallet] + _inner_class_types = { + "offline": Offline, + "receipt": Receipt, + "wallet": Wallet, + } class Cashapp(StripeObject): buyer_id: Optional[str] @@ -1247,10 +1261,7 @@ class Receipt(StripeObject): """ network_transaction_id: Optional[str] """ - This is used by the financial networks to identify a transaction. - Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. - The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). - This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. """ preferred_locales: Optional[List[str]] """ @@ -1796,7 +1807,7 @@ class CaptureParams(RequestOptions): """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. """ transfer_data: NotRequired["Charge.CaptureParamsTransferData"] """ @@ -1874,7 +1885,7 @@ class CreateParams(RequestOptions): """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. """ transfer_data: NotRequired["Charge.CreateParamsTransferData"] """ @@ -2309,7 +2320,7 @@ class SearchParams(RequestOptions): """ source_transfer: Optional[ExpandableField["Transfer"]] """ - The transfer ID which created this charge. Only present if the charge came from another Stripe account. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + The transfer ID which created this charge. Only present if the charge came from another Stripe account. [See the Connect documentation](https://docs.stripe.com/connect/destination-charges) for details. """ statement_descriptor: Optional[str] """ @@ -2317,7 +2328,7 @@ class SearchParams(RequestOptions): """ statement_descriptor_suffix: Optional[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. """ status: Literal["failed", "pending", "succeeded"] """ diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index f21605715..a079598a3 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -38,7 +38,7 @@ class CaptureParams(TypedDict): """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. """ transfer_data: NotRequired["ChargeService.CaptureParamsTransferData"] """ @@ -116,7 +116,7 @@ class CreateParams(TypedDict): """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. """ transfer_data: NotRequired["ChargeService.CreateParamsTransferData"] """ diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 2d9cec16d..239f20322 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -265,6 +265,17 @@ class Receipt(StripeObject): An indication of various EMV functions performed during the transaction. """ + class Wallet(StripeObject): + type: Literal[ + "apple_pay", + "google_pay", + "samsung_pay", + "unknown", + ] + """ + The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + """ + amount_authorized: Optional[int] """ The authorized amount @@ -341,10 +352,7 @@ class Receipt(StripeObject): """ network_transaction_id: Optional[str] """ - This is used by the financial networks to identify a transaction. - Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. - The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). - This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. """ offline: Optional[Offline] """ @@ -374,9 +382,11 @@ class Receipt(StripeObject): """ A collection of fields required to be displayed on receipts. Only required for EMV transactions. """ + wallet: Optional[Wallet] _inner_class_types = { "offline": Offline, "receipt": Receipt, + "wallet": Wallet, } card_present: Optional[CardPresent] @@ -710,6 +720,14 @@ class Offline(StripeObject): The method used to process this payment method offline. Only deferred is allowed. """ + class Wallet(StripeObject): + type: Literal[ + "apple_pay", "google_pay", "samsung_pay", "unknown" + ] + """ + The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + """ + brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. @@ -784,7 +802,12 @@ class Offline(StripeObject): """ How card details were read in this transaction. """ - _inner_class_types = {"networks": Networks, "offline": Offline} + wallet: Optional[Wallet] + _inner_class_types = { + "networks": Networks, + "offline": Offline, + "wallet": Wallet, + } class Cashapp(StripeObject): buyer_id: Optional[str] diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index d6bed7af9..7ddf264ba 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1085,6 +1085,10 @@ class AuBecsDebit(StripeObject): """ class BacsDebit(StripeObject): + class MandateOptions(StripeObject): + pass + + mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] @@ -1097,6 +1101,7 @@ class BacsDebit(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + _inner_class_types = {"mandate_options": MandateOptions} class Bancontact(StripeObject): preferred_language: Literal["de", "en", "fr", "nl"] @@ -2080,7 +2085,7 @@ class CaptureParams(RequestOptions): """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired["PaymentIntent.CaptureParamsTransferData"] """ @@ -3242,6 +3247,12 @@ class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] @@ -3257,6 +3268,9 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ @@ -4413,7 +4427,7 @@ class CreateParams(RequestOptions): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ description: NotRequired[str] """ @@ -4509,7 +4523,7 @@ class CreateParams(RequestOptions): """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired["PaymentIntent.CreateParamsTransferData"] """ @@ -5592,6 +5606,12 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] @@ -5607,6 +5627,9 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class CreateParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ @@ -6845,7 +6868,7 @@ class ModifyParams(RequestOptions): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ description: NotRequired[str] """ @@ -6913,7 +6936,7 @@ class ModifyParams(RequestOptions): """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired["PaymentIntent.ModifyParamsTransferData"] """ @@ -7936,6 +7959,12 @@ class ModifyParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] @@ -7951,6 +7980,9 @@ class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class ModifyParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ @@ -9177,7 +9209,7 @@ class VerifyMicrodepositsParams(RequestOptions): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ description: Optional[str] """ @@ -9277,7 +9309,7 @@ class VerifyMicrodepositsParams(RequestOptions): """ statement_descriptor_suffix: Optional[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ status: Literal[ "canceled", diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 89591eb10..7e005149d 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -72,7 +72,7 @@ class CaptureParams(TypedDict): """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired[ "PaymentIntentService.CaptureParamsTransferData" @@ -1260,6 +1260,12 @@ class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] @@ -1275,6 +1281,9 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ @@ -2431,7 +2440,7 @@ class CreateParams(TypedDict): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ description: NotRequired[str] """ @@ -2529,7 +2538,7 @@ class CreateParams(TypedDict): """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired[ "PaymentIntentService.CreateParamsTransferData" @@ -3636,6 +3645,12 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] @@ -3651,6 +3666,9 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class CreateParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ @@ -4917,7 +4935,7 @@ class UpdateParams(TypedDict): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ description: NotRequired[str] """ @@ -4987,7 +5005,7 @@ class UpdateParams(TypedDict): """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired[ "PaymentIntentService.UpdateParamsTransferData" @@ -6034,6 +6052,12 @@ class UpdateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] @@ -6049,6 +6073,9 @@ class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class UpdateParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 8f8497b43..992ccf063 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -225,6 +225,14 @@ class Receipt(StripeObject): An indication of various EMV functions performed during the transaction. """ + class Wallet(StripeObject): + type: Literal[ + "apple_pay", "google_pay", "samsung_pay", "unknown" + ] + """ + The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + """ + amount_authorized: Optional[int] """ The authorized amount @@ -301,10 +309,7 @@ class Receipt(StripeObject): """ network_transaction_id: Optional[str] """ - This is used by the financial networks to identify a transaction. - Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. - The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). - This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. """ offline: Optional[Offline] """ @@ -334,9 +339,11 @@ class Receipt(StripeObject): """ A collection of fields required to be displayed on receipts. Only required for EMV transactions. """ + wallet: Optional[Wallet] _inner_class_types = { "offline": Offline, "receipt": Receipt, + "wallet": Wallet, } card_present: Optional[CardPresent] @@ -670,6 +677,12 @@ class Offline(StripeObject): The method used to process this payment method offline. Only deferred is allowed. """ + class Wallet(StripeObject): + type: Literal["apple_pay", "google_pay", "samsung_pay", "unknown"] + """ + The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + """ + brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. @@ -744,7 +757,12 @@ class Offline(StripeObject): """ How card details were read in this transaction. """ - _inner_class_types = {"networks": Networks, "offline": Offline} + wallet: Optional[Wallet] + _inner_class_types = { + "networks": Networks, + "offline": Offline, + "wallet": Wallet, + } class Cashapp(StripeObject): buyer_id: Optional[str] diff --git a/stripe/_quote.py b/stripe/_quote.py index fc7dc4df7..89da6af2d 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -1791,7 +1791,7 @@ async def modify_async( @classmethod def _cls_pdf(cls, quote: str, **params: Unpack["Quote.PdfParams"]) -> Any: """ - Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, @@ -1807,14 +1807,14 @@ def _cls_pdf(cls, quote: str, **params: Unpack["Quote.PdfParams"]) -> Any: @staticmethod def pdf(quote: str, **params: Unpack["Quote.PdfParams"]) -> Any: """ - Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ ... @overload def pdf(self, **params: Unpack["Quote.PdfParams"]) -> Any: """ - Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ ... @@ -1823,7 +1823,7 @@ def pdf( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.PdfParams"] ) -> Any: """ - Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, @@ -1842,7 +1842,7 @@ async def _cls_pdf_async( cls, quote: str, **params: Unpack["Quote.PdfParams"] ) -> Any: """ - Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, @@ -1860,14 +1860,14 @@ async def pdf_async( quote: str, **params: Unpack["Quote.PdfParams"] ) -> Any: """ - Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ ... @overload async def pdf_async(self, **params: Unpack["Quote.PdfParams"]) -> Any: """ - Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ ... @@ -1876,7 +1876,7 @@ async def pdf_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.PdfParams"] ) -> Any: """ - Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index d1e256ebf..8db87912b 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -910,7 +910,7 @@ def pdf( options: RequestOptions = {}, ) -> Any: """ - Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, @@ -931,7 +931,7 @@ async def pdf_async( options: RequestOptions = {}, ) -> Any: """ - Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) + Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 86bc2c2fd..b19a36352 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -461,6 +461,13 @@ class MandateOptions(StripeObject): class AmazonPay(StripeObject): pass + class BacsDebit(StripeObject): + class MandateOptions(StripeObject): + pass + + mandate_options: Optional[MandateOptions] + _inner_class_types = {"mandate_options": MandateOptions} + class Card(StripeObject): class MandateOptions(StripeObject): amount: int @@ -614,6 +621,7 @@ class MandateOptions(StripeObject): acss_debit: Optional[AcssDebit] amazon_pay: Optional[AmazonPay] + bacs_debit: Optional[BacsDebit] card: Optional[Card] card_present: Optional[CardPresent] link: Optional[Link] @@ -623,6 +631,7 @@ class MandateOptions(StripeObject): _inner_class_types = { "acss_debit": AcssDebit, "amazon_pay": AmazonPay, + "bacs_debit": BacsDebit, "card": Card, "card_present": CardPresent, "link": Link, @@ -1343,6 +1352,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. """ + bacs_debit: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsBacsDebit" + ] + """ + If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options. + """ card: NotRequired["SetupIntent.ConfirmParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. @@ -1423,6 +1438,17 @@ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): pass + class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + + class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class ConfirmParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsCardMandateOptions" @@ -2462,6 +2488,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. """ + bacs_debit: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsBacsDebit" + ] + """ + If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options. + """ card: NotRequired["SetupIntent.CreateParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. @@ -2542,6 +2574,17 @@ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): pass + class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + + class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class CreateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsCardMandateOptions" @@ -3548,6 +3591,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. """ + bacs_debit: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsBacsDebit" + ] + """ + If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options. + """ card: NotRequired["SetupIntent.ModifyParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. @@ -3628,6 +3677,17 @@ class ModifyParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): class ModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): pass + class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + + class ModifyParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class ModifyParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsCardMandateOptions" @@ -4006,7 +4066,7 @@ class VerifyMicrodepositsParams(RequestOptions): """ payment_method: Optional[ExpandableField["PaymentMethod"]] """ - ID of the payment method used with this SetupIntent. If the payment method is `card_present` and isn't a digital wallet, then the [generated_card](https://docs.corp.stripe.com/api/setup_attempts/object#setup_attempt_object-payment_method_details-card_present-generated_card) associated with the `latest_attempt` is attached to the Customer instead. + ID of the payment method used with this SetupIntent. If the payment method is `card_present` and isn't a digital wallet, then the [generated_card](https://docs.stripe.com/api/setup_attempts/object#setup_attempt_object-payment_method_details-card_present-generated_card) associated with the `latest_attempt` is attached to the Customer instead. """ payment_method_configuration_details: Optional[ PaymentMethodConfigurationDetails diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index f768a1e5e..fb4dda1ee 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -760,6 +760,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. """ + bacs_debit: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodOptionsBacsDebit" + ] + """ + If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options. + """ card: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsCard" ] @@ -844,6 +850,17 @@ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): pass + class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + + class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class ConfirmParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsCardMandateOptions" @@ -1911,6 +1928,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. """ + bacs_debit: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodOptionsBacsDebit" + ] + """ + If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options. + """ card: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsCard" ] @@ -1995,6 +2018,17 @@ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): pass + class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + + class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class CreateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsCardMandateOptions" @@ -3039,6 +3073,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. """ + bacs_debit: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodOptionsBacsDebit" + ] + """ + If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options. + """ card: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsCard" ] @@ -3123,6 +3163,17 @@ class UpdateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): class UpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): pass + class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + + class UpdateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class UpdateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsCardMandateOptions" diff --git a/stripe/_token.py b/stripe/_token.py index 2d405fbdf..11558266a 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -703,7 +703,7 @@ class CreateParamsPerson(TypedDict): "Token.CreateParamsPersonAdditionalTosAcceptances" ] """ - Details on the legal guardian's acceptance of the required Stripe agreements. + Details on the legal guardian's or authorizer's acceptance of the required Stripe agreements. """ address: NotRequired["Token.CreateParamsPersonAddress"] """ diff --git a/stripe/_token_service.py b/stripe/_token_service.py index fd82b1ab1..422b953dd 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -674,7 +674,7 @@ class CreateParamsPerson(TypedDict): "TokenService.CreateParamsPersonAdditionalTosAcceptances" ] """ - Details on the legal guardian's acceptance of the required Stripe agreements. + Details on the legal guardian's or authorizer's acceptance of the required Stripe agreements. """ address: NotRequired["TokenService.CreateParamsPersonAddress"] """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index f30e84f17..644112811 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1639,7 +1639,7 @@ class CreateParams(RequestOptions): """ cancel_url: NotRequired[str] """ - If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. + If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. This parameter is not allowed if ui_mode is `embedded`. """ client_reference_id: NotRequired[str] """ diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index ad754f660..59750df82 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -36,7 +36,7 @@ class CreateParams(TypedDict): """ cancel_url: NotRequired[str] """ - If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. + If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. This parameter is not allowed if ui_mode is `embedded`. """ client_reference_id: NotRequired[str] """ diff --git a/stripe/test_helpers/treasury/_outbound_payment_service.py b/stripe/test_helpers/treasury/_outbound_payment_service.py index 754c7cba2..8299fc12a 100644 --- a/stripe/test_helpers/treasury/_outbound_payment_service.py +++ b/stripe/test_helpers/treasury/_outbound_payment_service.py @@ -87,6 +87,10 @@ class UpdateParamsTrackingDetailsAch(TypedDict): """ class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): + chips: NotRequired[str] + """ + CHIPS System Sequence Number (SSN) for funds sent over the `us_domestic_wire` network. + """ imad: NotRequired[str] """ IMAD for funds sent over the `us_domestic_wire` network. diff --git a/stripe/test_helpers/treasury/_outbound_transfer_service.py b/stripe/test_helpers/treasury/_outbound_transfer_service.py index 6bc5760bb..185038a5b 100644 --- a/stripe/test_helpers/treasury/_outbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_outbound_transfer_service.py @@ -87,6 +87,10 @@ class UpdateParamsTrackingDetailsAch(TypedDict): """ class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): + chips: NotRequired[str] + """ + CHIPS System Sequence Number (SSN) for funds sent over the `us_domestic_wire` network. + """ imad: NotRequired[str] """ IMAD for funds sent over the `us_domestic_wire` network. diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index 36d468169..db206c833 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -190,7 +190,11 @@ class Ach(StripeObject): """ class UsDomesticWire(StripeObject): - imad: str + chips: Optional[str] + """ + CHIPS System Sequence Number (SSN) of the OutboundPayment for payments sent over the `us_domestic_wire` network. + """ + imad: Optional[str] """ IMAD of the OutboundPayment for payments sent over the `us_domestic_wire` network. """ @@ -525,6 +529,10 @@ class UpdateParamsTrackingDetailsAch(TypedDict): """ class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): + chips: NotRequired[str] + """ + CHIPS System Sequence Number (SSN) for funds sent over the `us_domestic_wire` network. + """ imad: NotRequired[str] """ IMAD for funds sent over the `us_domestic_wire` network. diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index 794a444e1..db574845d 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -168,7 +168,11 @@ class Ach(StripeObject): """ class UsDomesticWire(StripeObject): - imad: str + chips: Optional[str] + """ + CHIPS System Sequence Number (SSN) of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. + """ + imad: Optional[str] """ IMAD of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. """ @@ -355,6 +359,10 @@ class UpdateParamsTrackingDetailsAch(TypedDict): """ class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): + chips: NotRequired[str] + """ + CHIPS System Sequence Number (SSN) for funds sent over the `us_domestic_wire` network. + """ imad: NotRequired[str] """ IMAD for funds sent over the `us_domestic_wire` network. From 5ff3d4b5730737399db2eeaae47e0a5d7772db1d Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Thu, 15 Aug 2024 14:16:42 -0700 Subject: [PATCH 098/179] Bump version to 10.8.0 --- CHANGELOG.md | 9 +++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d055d730e..11ef47a0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 10.8.0 - 2024-08-15 +* [#1373](https://github.com/stripe/stripe-python/pull/1373) Update generated code + * Add support for `authorization_code` on resource class `stripe.Charge.PaymentMethodDetails.Card` + * Add support for `wallet` on resource classes `stripe.Charge.PaymentMethodDetails.CardPresent`, `stripe.ConfirmationToken.PaymentMethodPreview.Card.GeneratedFrom.PaymentMethodDetails.CardPresent`, `stripe.ConfirmationToken.PaymentMethodPreview.CardPresent`, `stripe.PaymentMethod.Card.GeneratedFrom.PaymentMethodDetails.CardPresent`, and `stripe.PaymentMethod.CardPresent` + * Add support for `mandate_options` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsBacsDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsBacsDebit`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsBacsDebit` and resource class `stripe.PaymentIntent.PaymentMethodOptions.BacsDebit` + * Add support for `bacs_debit` on parameter classes `stripe.SetupIntent.ConfirmParamsPaymentMethodOptions`, `stripe.SetupIntent.CreateParamsPaymentMethodOptions`, and `stripe.SetupIntent.ModifyParamsPaymentMethodOptions` and resource class `stripe.SetupIntent.PaymentMethodOptions` + * Add support for `chips` on resource classes `stripe.treasury.OutboundPayment.TrackingDetails.UsDomesticWire` and `stripe.treasury.OutboundTransfer.TrackingDetails.UsDomesticWire` and parameter classes `stripe.treasury.OutboundPayment.UpdateParamsTrackingDetailsUsDomesticWire` and `stripe.treasury.OutboundTransfer.UpdateParamsTrackingDetailsUsDomesticWire` + * Change type of `imad` on `stripe.treasury.OutboundPayment.TrackingDetails.UsDomesticWire` and `stripe.treasury.OutboundTransfer.TrackingDetails.UsDomesticWire` from `str` to `Optional[str]` + ## 10.7.0 - 2024-08-08 * [#1371](https://github.com/stripe/stripe-python/pull/1371) Update generated code * Add support for `type` on resource classes `stripe.Charge.PaymentMethodDetails.CardPresent.Offline`, `stripe.ConfirmationToken.PaymentMethodPreview.Card.GeneratedFrom.PaymentMethodDetails.CardPresent.Offline`, `stripe.PaymentMethod.Card.GeneratedFrom.PaymentMethodDetails.CardPresent.Offline`, and `stripe.SetupAttempt.PaymentMethodDetails.CardPresent.Offline` diff --git a/VERSION b/VERSION index 1bcdaf5fe..2a3262d8a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.7.0 +10.8.0 diff --git a/stripe/_version.py b/stripe/_version.py index f052486b9..aa24b7374 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.7.0" +VERSION = "10.8.0" From 86c9f2307a528f838cca0a449bf8697cfcdff063 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Mon, 26 Aug 2024 19:24:40 +0200 Subject: [PATCH 099/179] Chain exceptions when reraising them (#1366) This makes debugging easier, since the original exception's details and traceback aren't just flattened to a string --- stripe/_http_client.py | 24 ++++++++++++------------ stripe/_stripe_object.py | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/stripe/_http_client.py b/stripe/_http_client.py index a936dd654..af7a16cff 100644 --- a/stripe/_http_client.py +++ b/stripe/_http_client.py @@ -713,7 +713,7 @@ def _request_internal( return content, status_code, result.headers - def _handle_request_error(self, e) -> NoReturn: + def _handle_request_error(self, e: Exception) -> NoReturn: # Catch SSL error first as it belongs to ConnectionError, # but we don't want to retry if isinstance(e, self.requests.exceptions.SSLError): @@ -764,7 +764,7 @@ def _handle_request_error(self, e) -> NoReturn: should_retry = False msg = textwrap.fill(msg) + "\n\n(Network error: %s)" % (err,) - raise APIConnectionError(msg, should_retry=should_retry) + raise APIConnectionError(msg, should_retry=should_retry) from e def close(self): if getattr(self._thread_local, "session", None) is not None: @@ -869,7 +869,7 @@ def _request_internal( return content, result.status_code, result.headers - def _handle_request_error(self, e, url) -> NoReturn: + def _handle_request_error(self, e: Exception, url: str) -> NoReturn: if isinstance(e, self.urlfetch.InvalidURLError): msg = ( "The Stripe library attempted to fetch an " @@ -892,7 +892,7 @@ def _handle_request_error(self, e, url) -> NoReturn: ) msg = textwrap.fill(msg) + "\n\n(Network error: " + str(e) + ")" - raise APIConnectionError(msg) + raise APIConnectionError(msg) from e def close(self): pass @@ -1046,7 +1046,7 @@ def _request_internal( return rcontent, rcode, headers - def _handle_request_error(self, e) -> NoReturn: + def _handle_request_error(self, e: Exception) -> NoReturn: if e.args[0] in [ self.pycurl.E_COULDNT_CONNECT, self.pycurl.E_COULDNT_RESOLVE_HOST, @@ -1079,7 +1079,7 @@ def _handle_request_error(self, e) -> NoReturn: should_retry = False msg = textwrap.fill(msg) + "\n\n(Network error: " + e.args[1] + ")" - raise APIConnectionError(msg, should_retry=should_retry) + raise APIConnectionError(msg, should_retry=should_retry) from e def _get_proxy(self, url) -> Optional[ParseResult]: if self._parsed_proxy: @@ -1194,13 +1194,13 @@ def _request_internal( lh = dict((k.lower(), v) for k, v in iter(dict(headers).items())) return rcontent, rcode, lh - def _handle_request_error(self, e) -> NoReturn: + def _handle_request_error(self, e: Exception) -> NoReturn: msg = ( "Unexpected error communicating with Stripe. " "If this problem persists, let us know at support@stripe.com." ) msg = textwrap.fill(msg) + "\n\n(Network error: " + str(e) + ")" - raise APIConnectionError(msg) + raise APIConnectionError(msg) from e def close(self): pass @@ -1307,7 +1307,7 @@ async def request_async( response_headers = response.headers return content, status_code, response_headers - def _handle_request_error(self, e) -> NoReturn: + def _handle_request_error(self, e: Exception) -> NoReturn: msg = ( "Unexpected error communicating with Stripe. If this " "problem persists, let us know at support@stripe.com." @@ -1316,7 +1316,7 @@ def _handle_request_error(self, e) -> NoReturn: should_retry = True msg = textwrap.fill(msg) + "\n\n(Network error: %s)" % (err,) - raise APIConnectionError(msg, should_retry=should_retry) + raise APIConnectionError(msg, should_retry=should_retry) from e def request_stream( self, method: str, url: str, headers: Mapping[str, str], post_data=None @@ -1446,7 +1446,7 @@ async def request_async( return (await content.read()), status_code, response_headers - def _handle_request_error(self, e) -> NoReturn: + def _handle_request_error(self, e: Exception) -> NoReturn: msg = ( "Unexpected error communicating with Stripe. If this " "problem persists, let us know at support@stripe.com." @@ -1455,7 +1455,7 @@ def _handle_request_error(self, e) -> NoReturn: should_retry = True msg = textwrap.fill(msg) + "\n\n(Network error: %s)" % (err,) - raise APIConnectionError(msg, should_retry=should_retry) + raise APIConnectionError(msg, should_retry=should_retry) from e def request_stream(self) -> Tuple[Iterable[bytes], int, Mapping[str, str]]: raise NotImplementedError( diff --git a/stripe/_stripe_object.py b/stripe/_stripe_object.py index d0b2230f0..1e7bff5d9 100644 --- a/stripe/_stripe_object.py +++ b/stripe/_stripe_object.py @@ -171,7 +171,7 @@ def __getattr__(self, k): k = self._field_remappings[k] return self[k] except KeyError as err: - raise AttributeError(*err.args) + raise AttributeError(*err.args) from err def __delattr__(self, k): if k[0] == "_" or k in self.__dict__: From cf7bb8b23eb0537fa86710f821a30dc2757f0869 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:03:36 -0700 Subject: [PATCH 100/179] Update http client comment (#1381) --- stripe/_http_client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/stripe/_http_client.py b/stripe/_http_client.py index af7a16cff..459b40ae5 100644 --- a/stripe/_http_client.py +++ b/stripe/_http_client.py @@ -39,10 +39,12 @@ Never, ) -# - Requests is the preferred HTTP library -# - Google App Engine has urlfetch -# - Use Pycurl if it's there (at least it verifies SSL certs) -# - Fall back to urllib2 with a warning if needed + +# The precedence of HTTP libraries is +# - Urlfetch (this is provided by Google App Engine, so if it's present you probably want it) +# - Requests (popular library, the top priority for all environments outside Google App Engine, but not always present) +# - Pycurl (another library, not always present, not as preferred as Requests but at least it verifies SSL certs) +# - urllib2 with a warning (basically always present, fallback if needed) try: import urllib.request as urllibrequest import urllib.error as urlliberror From 45264108355919405ee72f8590f37d6c40f62246 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Wed, 28 Aug 2024 04:26:21 +0300 Subject: [PATCH 101/179] Do not share RequestorOptions between APIRequestor instances if not passed (#1365) --- stripe/_api_requestor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index cc75eb516..dd91278b5 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -72,9 +72,11 @@ class _APIRequestor(object): def __init__( self, - options: RequestorOptions = RequestorOptions(), + options: Optional[RequestorOptions] = None, client: Optional[HTTPClient] = None, ): + if options is None: + options = RequestorOptions() self._options = options self._client = client From 2326675cba34941acdd0881ac7c8026e90b374bc Mon Sep 17 00:00:00 2001 From: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> Date: Wed, 28 Aug 2024 14:29:29 -0400 Subject: [PATCH 102/179] Changed V1File implementation to pass content_type in options (#1382) --- stripe/_api_mode.py | 2 +- stripe/_api_requestor.py | 5 ++++- stripe/_file.py | 8 ++++++-- stripe/_file_service.py | 6 ++++-- stripe/_request_options.py | 4 ++++ 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/stripe/_api_mode.py b/stripe/_api_mode.py index 37e5530bd..1503e56e0 100644 --- a/stripe/_api_mode.py +++ b/stripe/_api_mode.py @@ -1,4 +1,4 @@ from typing_extensions import Literal -ApiMode = Literal["V1", "V1FILES"] +ApiMode = Literal["V1"] diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index dd91278b5..62951eed8 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -509,7 +509,10 @@ def _args_for_request_with_retries( abs_url = urlunsplit((scheme, netloc, path, query, fragment)) post_data = None elif method == "post": - if api_mode == "V1FILES": + if ( + options is not None + and options.get("content_type") == "multipart/form-data" + ): generator = MultipartDataGenerator() generator.add_params(params or {}) post_data = generator.get_post_data() diff --git a/stripe/_file.py b/stripe/_file.py index 72e4c82e7..20cf02120 100644 --- a/stripe/_file.py +++ b/stripe/_file.py @@ -209,6 +209,8 @@ def create(cls, **params: Unpack["File.CreateParams"]) -> "File": All of Stripe's officially supported Client libraries support sending multipart/form-data. """ + params["content_type"] = "multipart/form-data" + return cast( "File", cls._static_request( @@ -216,7 +218,7 @@ def create(cls, **params: Unpack["File.CreateParams"]) -> "File": cls.class_url(), params=params, base_address="files", - api_mode="V1FILES", + api_mode="V1", ), ) @@ -229,6 +231,8 @@ async def create_async( All of Stripe's officially supported Client libraries support sending multipart/form-data. """ + params["content_type"] = "multipart/form-data" + return cast( "File", await cls._static_request_async( @@ -236,7 +240,7 @@ async def create_async( cls.class_url(), params=params, base_address="files", - api_mode="V1FILES", + api_mode="V1", ), ) diff --git a/stripe/_file_service.py b/stripe/_file_service.py index 9d11bdfab..12162f285 100644 --- a/stripe/_file_service.py +++ b/stripe/_file_service.py @@ -169,12 +169,13 @@ def create( All of Stripe's officially supported Client libraries support sending multipart/form-data. """ + options["content_type"] = "multipart/form-data" return cast( File, self._request( "post", "/v1/files", - api_mode="V1FILES", + api_mode="V1", base_address="files", params=params, options=options, @@ -189,12 +190,13 @@ async def create_async( All of Stripe's officially supported Client libraries support sending multipart/form-data. """ + options["content_type"] = "multipart/form-data" return cast( File, await self._request_async( "post", "/v1/files", - api_mode="V1FILES", + api_mode="V1", base_address="files", params=params, options=options, diff --git a/stripe/_request_options.py b/stripe/_request_options.py index d188818f8..caa26fa50 100644 --- a/stripe/_request_options.py +++ b/stripe/_request_options.py @@ -9,6 +9,7 @@ class RequestOptions(TypedDict): stripe_account: NotRequired["str|None"] max_network_retries: NotRequired["int|None"] idempotency_key: NotRequired["str|None"] + content_type: NotRequired["str|None"] headers: NotRequired["Mapping[str, str]|None"] @@ -27,6 +28,7 @@ def merge_options( "stripe_version": requestor.stripe_version, "max_network_retries": requestor.max_network_retries, "idempotency_key": None, + "content_type": None, "headers": None, } @@ -40,6 +42,7 @@ def merge_options( if request.get("max_network_retries") is not None else requestor.max_network_retries, "idempotency_key": request.get("idempotency_key"), + "content_type": request.get("content_type"), "headers": request.get("headers"), } @@ -61,6 +64,7 @@ def extract_options_from_dict( "stripe_account", "max_network_retries", "idempotency_key", + "content_type", "headers", ]: if key in d_copy: From 25343ed46996de2144b4cc4a9a72f94f2ac5db95 Mon Sep 17 00:00:00 2001 From: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> Date: Wed, 28 Aug 2024 14:41:44 -0700 Subject: [PATCH 103/179] No need for api_mode to be passed around from individual API methods (#1383) --- stripe/_account_capability_service.py | 6 - stripe/_account_external_account_service.py | 10 -- stripe/_account_link_service.py | 2 - stripe/_account_login_link_service.py | 2 - stripe/_account_person_service.py | 10 -- stripe/_account_service.py | 14 --- stripe/_account_session_service.py | 2 - stripe/_api_requestor.py | 8 +- stripe/_api_resource.py | 15 +-- stripe/_apple_pay_domain_service.py | 8 -- stripe/_application_fee_refund_service.py | 8 -- stripe/_application_fee_service.py | 4 - stripe/_balance_service.py | 2 - stripe/_balance_transaction_service.py | 4 - stripe/_charge_service.py | 12 -- stripe/_confirmation_token_service.py | 2 - stripe/_country_spec_service.py | 4 - stripe/_coupon_service.py | 10 -- stripe/_credit_note_line_item_service.py | 2 - stripe/_credit_note_preview_lines_service.py | 2 - stripe/_credit_note_service.py | 12 -- .../_customer_balance_transaction_service.py | 8 -- stripe/_customer_cash_balance_service.py | 4 - ...stomer_cash_balance_transaction_service.py | 4 - .../_customer_funding_instructions_service.py | 2 - stripe/_customer_payment_method_service.py | 4 - stripe/_customer_payment_source_service.py | 12 -- stripe/_customer_service.py | 14 --- stripe/_customer_session_service.py | 2 - stripe/_customer_tax_id_service.py | 8 -- stripe/_dispute_service.py | 8 -- stripe/_ephemeral_key.py | 1 - stripe/_ephemeral_key_service.py | 4 - stripe/_event_service.py | 4 - stripe/_exchange_rate_service.py | 4 - stripe/_file.py | 2 - stripe/_file_link_service.py | 8 -- stripe/_file_service.py | 6 - stripe/_invoice_item_service.py | 10 -- stripe/_invoice_line_item_service.py | 4 - stripe/_invoice_service.py | 32 ------ stripe/_invoice_upcoming_lines_service.py | 2 - stripe/_list_object.py | 4 - stripe/_mandate_service.py | 2 - stripe/_oauth.py | 2 - stripe/_oauth_service.py | 2 - stripe/_payment_intent_service.py | 22 ---- stripe/_payment_link_line_item_service.py | 2 - stripe/_payment_link_service.py | 8 -- .../_payment_method_configuration_service.py | 8 -- stripe/_payment_method_domain_service.py | 10 -- stripe/_payment_method_service.py | 12 -- stripe/_payout_service.py | 12 -- stripe/_plan_service.py | 10 -- stripe/_price_service.py | 10 -- stripe/_product_feature_service.py | 8 -- stripe/_product_service.py | 12 -- stripe/_promotion_code_service.py | 8 -- ...ote_computed_upfront_line_items_service.py | 2 - stripe/_quote_line_item_service.py | 2 - stripe/_quote_service.py | 16 --- stripe/_refund_service.py | 10 -- stripe/_review_service.py | 6 - stripe/_search_result_object.py | 2 - stripe/_setup_attempt_service.py | 2 - stripe/_setup_intent_service.py | 14 --- stripe/_shipping_rate_service.py | 8 -- stripe/_source_service.py | 10 -- stripe/_source_transaction_service.py | 2 - stripe/_stripe_object.py | 10 -- stripe/_stripe_service.py | 9 -- stripe/_subscription_item_service.py | 10 -- ..._subscription_item_usage_record_service.py | 2 - ...ption_item_usage_record_summary_service.py | 2 - stripe/_subscription_schedule_service.py | 12 -- stripe/_subscription_service.py | 16 --- stripe/_tax_code_service.py | 4 - stripe/_tax_id_service.py | 8 -- stripe/_tax_rate_service.py | 8 -- stripe/_token_service.py | 4 - stripe/_topup_service.py | 10 -- stripe/_transfer_reversal_service.py | 8 -- stripe/_transfer_service.py | 8 -- stripe/_usage_record.py | 1 - stripe/_webhook_endpoint_service.py | 10 -- stripe/apps/_secret_service.py | 8 -- stripe/billing/_alert_service.py | 12 -- .../_meter_event_adjustment_service.py | 2 - stripe/billing/_meter_event_service.py | 2 - .../billing/_meter_event_summary_service.py | 2 - stripe/billing/_meter_service.py | 12 -- .../billing_portal/_configuration_service.py | 8 -- stripe/billing_portal/_session_service.py | 2 - stripe/checkout/_session_line_item_service.py | 2 - stripe/checkout/_session_service.py | 10 -- stripe/climate/_order_service.py | 10 -- stripe/climate/_product_service.py | 4 - stripe/climate/_supplier_service.py | 4 - .../_active_entitlement_service.py | 4 - stripe/entitlements/_feature_service.py | 8 -- .../_account_owner_service.py | 2 - .../financial_connections/_account_service.py | 12 -- .../financial_connections/_session_service.py | 4 - .../_transaction_service.py | 4 - stripe/forwarding/_request_service.py | 6 - .../identity/_verification_report_service.py | 4 - .../identity/_verification_session_service.py | 12 -- stripe/issuing/_authorization_service.py | 10 -- stripe/issuing/_card_service.py | 8 -- stripe/issuing/_cardholder_service.py | 8 -- stripe/issuing/_dispute_service.py | 10 -- .../_personalization_design_service.py | 8 -- stripe/issuing/_physical_bundle_service.py | 4 - stripe/issuing/_token_service.py | 6 - stripe/issuing/_transaction_service.py | 6 - stripe/radar/_early_fraud_warning_service.py | 4 - stripe/radar/_value_list_item_service.py | 8 -- stripe/radar/_value_list_service.py | 10 -- stripe/reporting/_report_run_service.py | 6 - stripe/reporting/_report_type_service.py | 4 - stripe/sigma/_scheduled_query_run_service.py | 4 - stripe/tax/_calculation_line_item_service.py | 2 - stripe/tax/_calculation_service.py | 4 - stripe/tax/_registration_service.py | 8 -- stripe/tax/_settings_service.py | 4 - stripe/tax/_transaction_line_item_service.py | 2 - stripe/tax/_transaction_service.py | 6 - stripe/terminal/_configuration_service.py | 10 -- stripe/terminal/_connection_token_service.py | 2 - stripe/terminal/_location_service.py | 10 -- stripe/terminal/_reader_service.py | 20 ---- .../_confirmation_token_service.py | 2 - stripe/test_helpers/_customer_service.py | 2 - stripe/test_helpers/_refund_service.py | 2 - stripe/test_helpers/_test_clock_service.py | 10 -- .../issuing/_authorization_service.py | 12 -- stripe/test_helpers/issuing/_card_service.py | 8 -- .../_personalization_design_service.py | 6 - .../issuing/_transaction_service.py | 6 - .../test_helpers/terminal/_reader_service.py | 2 - .../treasury/_inbound_transfer_service.py | 6 - .../treasury/_outbound_payment_service.py | 8 -- .../treasury/_outbound_transfer_service.py | 8 -- .../treasury/_received_credit_service.py | 2 - .../treasury/_received_debit_service.py | 2 - stripe/treasury/_credit_reversal_service.py | 6 - stripe/treasury/_debit_reversal_service.py | 6 - .../_financial_account_features_service.py | 4 - stripe/treasury/_financial_account_service.py | 8 -- stripe/treasury/_inbound_transfer_service.py | 8 -- stripe/treasury/_outbound_payment_service.py | 8 -- stripe/treasury/_outbound_transfer_service.py | 8 -- stripe/treasury/_received_credit_service.py | 4 - stripe/treasury/_received_debit_service.py | 4 - stripe/treasury/_transaction_entry_service.py | 4 - stripe/treasury/_transaction_service.py | 4 - tests/test_api_requestor.py | 103 +++++------------- tests/test_stripe_object.py | 8 +- 158 files changed, 34 insertions(+), 1125 deletions(-) diff --git a/stripe/_account_capability_service.py b/stripe/_account_capability_service.py index 184b97c10..1c969b759 100644 --- a/stripe/_account_capability_service.py +++ b/stripe/_account_capability_service.py @@ -50,7 +50,6 @@ def list( "/v1/accounts/{account}/capabilities".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -73,7 +72,6 @@ async def list_async( "/v1/accounts/{account}/capabilities".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -98,7 +96,6 @@ def retrieve( account=sanitize_id(account), capability=sanitize_id(capability), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -123,7 +120,6 @@ async def retrieve_async( account=sanitize_id(account), capability=sanitize_id(capability), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -148,7 +144,6 @@ def update( account=sanitize_id(account), capability=sanitize_id(capability), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -173,7 +168,6 @@ async def update_async( account=sanitize_id(account), capability=sanitize_id(capability), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_account_external_account_service.py b/stripe/_account_external_account_service.py index a048e69d5..e708b784b 100644 --- a/stripe/_account_external_account_service.py +++ b/stripe/_account_external_account_service.py @@ -220,7 +220,6 @@ def delete( account=sanitize_id(account), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -245,7 +244,6 @@ async def delete_async( account=sanitize_id(account), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -270,7 +268,6 @@ def retrieve( account=sanitize_id(account), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -295,7 +292,6 @@ async def retrieve_async( account=sanitize_id(account), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -327,7 +323,6 @@ def update( account=sanitize_id(account), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -359,7 +354,6 @@ async def update_async( account=sanitize_id(account), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -382,7 +376,6 @@ def list( "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -405,7 +398,6 @@ async def list_async( "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -428,7 +420,6 @@ def create( "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -451,7 +442,6 @@ async def create_async( "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_account_link_service.py b/stripe/_account_link_service.py index a24f1e788..da1cddd79 100644 --- a/stripe/_account_link_service.py +++ b/stripe/_account_link_service.py @@ -63,7 +63,6 @@ def create( self._request( "post", "/v1/account_links", - api_mode="V1", base_address="api", params=params, options=options, @@ -83,7 +82,6 @@ async def create_async( await self._request_async( "post", "/v1/account_links", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_account_login_link_service.py b/stripe/_account_login_link_service.py index d46d42165..aa3d3dc7d 100644 --- a/stripe/_account_login_link_service.py +++ b/stripe/_account_login_link_service.py @@ -33,7 +33,6 @@ def create( "/v1/accounts/{account}/login_links".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -58,7 +57,6 @@ async def create_async( "/v1/accounts/{account}/login_links".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_account_person_service.py b/stripe/_account_person_service.py index 0fe82b820..903d8e370 100644 --- a/stripe/_account_person_service.py +++ b/stripe/_account_person_service.py @@ -831,7 +831,6 @@ def delete( account=sanitize_id(account), person=sanitize_id(person), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -856,7 +855,6 @@ async def delete_async( account=sanitize_id(account), person=sanitize_id(person), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -881,7 +879,6 @@ def retrieve( account=sanitize_id(account), person=sanitize_id(person), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -906,7 +903,6 @@ async def retrieve_async( account=sanitize_id(account), person=sanitize_id(person), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -931,7 +927,6 @@ def update( account=sanitize_id(account), person=sanitize_id(person), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -956,7 +951,6 @@ async def update_async( account=sanitize_id(account), person=sanitize_id(person), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -979,7 +973,6 @@ def list( "/v1/accounts/{account}/persons".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1002,7 +995,6 @@ async def list_async( "/v1/accounts/{account}/persons".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1025,7 +1017,6 @@ def create( "/v1/accounts/{account}/persons".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1048,7 +1039,6 @@ async def create_async( "/v1/accounts/{account}/persons".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 11ccec68e..bf8142bc8 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -3334,7 +3334,6 @@ def delete( self._request( "delete", "/v1/accounts/{account}".format(account=sanitize_id(account)), - api_mode="V1", base_address="api", params=params, options=options, @@ -3361,7 +3360,6 @@ async def delete_async( await self._request_async( "delete", "/v1/accounts/{account}".format(account=sanitize_id(account)), - api_mode="V1", base_address="api", params=params, options=options, @@ -3382,7 +3380,6 @@ def retrieve( self._request( "get", "/v1/accounts/{account}".format(account=sanitize_id(account)), - api_mode="V1", base_address="api", params=params, options=options, @@ -3403,7 +3400,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/accounts/{account}".format(account=sanitize_id(account)), - api_mode="V1", base_address="api", params=params, options=options, @@ -3436,7 +3432,6 @@ def update( self._request( "post", "/v1/accounts/{account}".format(account=sanitize_id(account)), - api_mode="V1", base_address="api", params=params, options=options, @@ -3469,7 +3464,6 @@ async def update_async( await self._request_async( "post", "/v1/accounts/{account}".format(account=sanitize_id(account)), - api_mode="V1", base_address="api", params=params, options=options, @@ -3489,7 +3483,6 @@ def retrieve_current( self._request( "get", "/v1/account", - api_mode="V1", base_address="api", params=params, options=options, @@ -3509,7 +3502,6 @@ async def retrieve_current_async( await self._request_async( "get", "/v1/account", - api_mode="V1", base_address="api", params=params, options=options, @@ -3529,7 +3521,6 @@ def list( self._request( "get", "/v1/accounts", - api_mode="V1", base_address="api", params=params, options=options, @@ -3549,7 +3540,6 @@ async def list_async( await self._request_async( "get", "/v1/accounts", - api_mode="V1", base_address="api", params=params, options=options, @@ -3574,7 +3564,6 @@ def create( self._request( "post", "/v1/accounts", - api_mode="V1", base_address="api", params=params, options=options, @@ -3599,7 +3588,6 @@ async def create_async( await self._request_async( "post", "/v1/accounts", - api_mode="V1", base_address="api", params=params, options=options, @@ -3624,7 +3612,6 @@ def reject( "/v1/accounts/{account}/reject".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -3649,7 +3636,6 @@ async def reject_async( "/v1/accounts/{account}/reject".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index be5fb0dc0..52ea8afa3 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -337,7 +337,6 @@ def create( self._request( "post", "/v1/account_sessions", - api_mode="V1", base_address="api", params=params, options=options, @@ -357,7 +356,6 @@ async def create_async( await self._request_async( "post", "/v1/account_sessions", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index 62951eed8..61f3085eb 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -181,10 +181,10 @@ def request( options: Optional[RequestOptions] = None, *, base_address: BaseAddress, - api_mode: ApiMode, usage: Optional[List[str]] = None, ) -> "StripeObject": requestor = self._replace_options(options) + api_mode = "V1" rbody, rcode, rheaders = requestor.request_raw( method.lower(), url, @@ -212,9 +212,9 @@ async def request_async( options: Optional[RequestOptions] = None, *, base_address: BaseAddress, - api_mode: ApiMode, usage: Optional[List[str]] = None, ) -> "StripeObject": + api_mode = "V1" requestor = self._replace_options(options) rbody, rcode, rheaders = await requestor.request_raw_async( method.lower(), @@ -243,9 +243,9 @@ def request_stream( options: Optional[RequestOptions] = None, *, base_address: BaseAddress, - api_mode: ApiMode, usage: Optional[List[str]] = None, ) -> StripeStreamResponse: + api_mode = "V1" stream, rcode, rheaders = self.request_raw( method.lower(), url, @@ -273,9 +273,9 @@ async def request_stream_async( options: Optional[RequestOptions] = None, *, base_address: BaseAddress, - api_mode: ApiMode, usage: Optional[List[str]] = None, ) -> StripeStreamResponseAsync: + api_mode = "V1" stream, rcode, rheaders = await self.request_raw_async( method.lower(), url, diff --git a/stripe/_api_resource.py b/stripe/_api_resource.py index ea456719a..1fb402ab8 100644 --- a/stripe/_api_resource.py +++ b/stripe/_api_resource.py @@ -84,7 +84,6 @@ def _request( url, params=params, base_address=base_address, - api_mode=api_mode, ) if type(self) is type(obj): @@ -100,7 +99,6 @@ async def _request_async( params=None, *, base_address: BaseAddress = "api", - api_mode: ApiMode = "V1", ) -> StripeObject: obj = await StripeObject._request_async( self, @@ -108,11 +106,10 @@ async def _request_async( url, params=params, base_address=base_address, - api_mode=api_mode, ) if type(self) is type(obj): - self._refresh_from(values=obj, api_mode=api_mode) + self._refresh_from(values=obj, api_mode="V1") return self else: return obj @@ -133,7 +130,6 @@ def _request_and_refresh( url, params=params, base_address=base_address, - api_mode=api_mode, usage=usage, ) @@ -156,7 +152,6 @@ async def _request_and_refresh_async( url, params=params, base_address=base_address, - api_mode=api_mode, usage=usage, ) @@ -171,7 +166,6 @@ def _static_request( params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", - api_mode: ApiMode = "V1", ): request_options, request_params = extract_options_from_dict(params) return _APIRequestor._global_instance().request( @@ -180,7 +174,6 @@ def _static_request( params=request_params, options=request_options, base_address=base_address, - api_mode=api_mode, ) @classmethod @@ -191,7 +184,6 @@ async def _static_request_async( params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", - api_mode: ApiMode = "V1", ): request_options, request_params = extract_options_from_dict(params) return await _APIRequestor._global_instance().request_async( @@ -200,7 +192,6 @@ async def _static_request_async( params=request_params, options=request_options, base_address=base_address, - api_mode=api_mode, ) @classmethod @@ -211,7 +202,6 @@ def _static_request_stream( params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", - api_mode: ApiMode = "V1", ): request_options, request_params = extract_options_from_dict(params) return _APIRequestor._global_instance().request_stream( @@ -220,7 +210,6 @@ def _static_request_stream( params=request_params, options=request_options, base_address=base_address, - api_mode=api_mode, ) @classmethod @@ -231,7 +220,6 @@ async def _static_request_stream_async( params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", - api_mode: ApiMode = "V1", ): request_options, request_params = extract_options_from_dict(params) return await _APIRequestor._global_instance().request_stream_async( @@ -240,5 +228,4 @@ async def _static_request_stream_async( params=request_params, options=request_options, base_address=base_address, - api_mode=api_mode, ) diff --git a/stripe/_apple_pay_domain_service.py b/stripe/_apple_pay_domain_service.py index 112d8da00..c68c16146 100644 --- a/stripe/_apple_pay_domain_service.py +++ b/stripe/_apple_pay_domain_service.py @@ -61,7 +61,6 @@ def delete( "/v1/apple_pay/domains/{domain}".format( domain=sanitize_id(domain), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -84,7 +83,6 @@ async def delete_async( "/v1/apple_pay/domains/{domain}".format( domain=sanitize_id(domain), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -107,7 +105,6 @@ def retrieve( "/v1/apple_pay/domains/{domain}".format( domain=sanitize_id(domain), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -130,7 +127,6 @@ async def retrieve_async( "/v1/apple_pay/domains/{domain}".format( domain=sanitize_id(domain), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -150,7 +146,6 @@ def list( self._request( "get", "/v1/apple_pay/domains", - api_mode="V1", base_address="api", params=params, options=options, @@ -170,7 +165,6 @@ async def list_async( await self._request_async( "get", "/v1/apple_pay/domains", - api_mode="V1", base_address="api", params=params, options=options, @@ -190,7 +184,6 @@ def create( self._request( "post", "/v1/apple_pay/domains", - api_mode="V1", base_address="api", params=params, options=options, @@ -210,7 +203,6 @@ async def create_async( await self._request_async( "post", "/v1/apple_pay/domains", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_application_fee_refund_service.py b/stripe/_application_fee_refund_service.py index 4f620585e..c77b577cf 100644 --- a/stripe/_application_fee_refund_service.py +++ b/stripe/_application_fee_refund_service.py @@ -76,7 +76,6 @@ def retrieve( fee=sanitize_id(fee), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -101,7 +100,6 @@ async def retrieve_async( fee=sanitize_id(fee), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -128,7 +126,6 @@ def update( fee=sanitize_id(fee), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -155,7 +152,6 @@ async def update_async( fee=sanitize_id(fee), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -176,7 +172,6 @@ def list( self._request( "get", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -197,7 +192,6 @@ async def list_async( await self._request_async( "get", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -226,7 +220,6 @@ def create( self._request( "post", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -255,7 +248,6 @@ async def create_async( await self._request_async( "post", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_application_fee_service.py b/stripe/_application_fee_service.py index b3db0ae8b..f142a5c37 100644 --- a/stripe/_application_fee_service.py +++ b/stripe/_application_fee_service.py @@ -78,7 +78,6 @@ def list( self._request( "get", "/v1/application_fees", - api_mode="V1", base_address="api", params=params, options=options, @@ -98,7 +97,6 @@ async def list_async( await self._request_async( "get", "/v1/application_fees", - api_mode="V1", base_address="api", params=params, options=options, @@ -119,7 +117,6 @@ def retrieve( self._request( "get", "/v1/application_fees/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -140,7 +137,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/application_fees/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_balance_service.py b/stripe/_balance_service.py index 7220f5030..f80dee999 100644 --- a/stripe/_balance_service.py +++ b/stripe/_balance_service.py @@ -28,7 +28,6 @@ def retrieve( self._request( "get", "/v1/balance", - api_mode="V1", base_address="api", params=params, options=options, @@ -49,7 +48,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/balance", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_balance_transaction_service.py b/stripe/_balance_transaction_service.py index d6abe402c..06ec1abce 100644 --- a/stripe/_balance_transaction_service.py +++ b/stripe/_balance_transaction_service.py @@ -87,7 +87,6 @@ def list( self._request( "get", "/v1/balance_transactions", - api_mode="V1", base_address="api", params=params, options=options, @@ -109,7 +108,6 @@ async def list_async( await self._request_async( "get", "/v1/balance_transactions", - api_mode="V1", base_address="api", params=params, options=options, @@ -132,7 +130,6 @@ def retrieve( self._request( "get", "/v1/balance_transactions/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -155,7 +152,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/balance_transactions/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index a079598a3..47506a7de 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -378,7 +378,6 @@ def list( self._request( "get", "/v1/charges", - api_mode="V1", base_address="api", params=params, options=options, @@ -398,7 +397,6 @@ async def list_async( await self._request_async( "get", "/v1/charges", - api_mode="V1", base_address="api", params=params, options=options, @@ -420,7 +418,6 @@ def create( self._request( "post", "/v1/charges", - api_mode="V1", base_address="api", params=params, options=options, @@ -442,7 +439,6 @@ async def create_async( await self._request_async( "post", "/v1/charges", - api_mode="V1", base_address="api", params=params, options=options, @@ -463,7 +459,6 @@ def retrieve( self._request( "get", "/v1/charges/{charge}".format(charge=sanitize_id(charge)), - api_mode="V1", base_address="api", params=params, options=options, @@ -484,7 +479,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/charges/{charge}".format(charge=sanitize_id(charge)), - api_mode="V1", base_address="api", params=params, options=options, @@ -505,7 +499,6 @@ def update( self._request( "post", "/v1/charges/{charge}".format(charge=sanitize_id(charge)), - api_mode="V1", base_address="api", params=params, options=options, @@ -526,7 +519,6 @@ async def update_async( await self._request_async( "post", "/v1/charges/{charge}".format(charge=sanitize_id(charge)), - api_mode="V1", base_address="api", params=params, options=options, @@ -549,7 +541,6 @@ def search( self._request( "get", "/v1/charges/search", - api_mode="V1", base_address="api", params=params, options=options, @@ -572,7 +563,6 @@ async def search_async( await self._request_async( "get", "/v1/charges/search", - api_mode="V1", base_address="api", params=params, options=options, @@ -599,7 +589,6 @@ def capture( "/v1/charges/{charge}/capture".format( charge=sanitize_id(charge), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -626,7 +615,6 @@ async def capture_async( "/v1/charges/{charge}/capture".format( charge=sanitize_id(charge), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_confirmation_token_service.py b/stripe/_confirmation_token_service.py index c26ce0038..2f42d4d11 100644 --- a/stripe/_confirmation_token_service.py +++ b/stripe/_confirmation_token_service.py @@ -31,7 +31,6 @@ def retrieve( "/v1/confirmation_tokens/{confirmation_token}".format( confirmation_token=sanitize_id(confirmation_token), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -54,7 +53,6 @@ async def retrieve_async( "/v1/confirmation_tokens/{confirmation_token}".format( confirmation_token=sanitize_id(confirmation_token), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_country_spec_service.py b/stripe/_country_spec_service.py index dbaa2b77b..914f6f62c 100644 --- a/stripe/_country_spec_service.py +++ b/stripe/_country_spec_service.py @@ -47,7 +47,6 @@ def list( self._request( "get", "/v1/country_specs", - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( await self._request_async( "get", "/v1/country_specs", - api_mode="V1", base_address="api", params=params, options=options, @@ -90,7 +88,6 @@ def retrieve( "/v1/country_specs/{country}".format( country=sanitize_id(country), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -113,7 +110,6 @@ async def retrieve_async( "/v1/country_specs/{country}".format( country=sanitize_id(country), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_coupon_service.py b/stripe/_coupon_service.py index 15bda53f1..665088b22 100644 --- a/stripe/_coupon_service.py +++ b/stripe/_coupon_service.py @@ -167,7 +167,6 @@ def delete( self._request( "delete", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), - api_mode="V1", base_address="api", params=params, options=options, @@ -188,7 +187,6 @@ async def delete_async( await self._request_async( "delete", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), - api_mode="V1", base_address="api", params=params, options=options, @@ -209,7 +207,6 @@ def retrieve( self._request( "get", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), - api_mode="V1", base_address="api", params=params, options=options, @@ -230,7 +227,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), - api_mode="V1", base_address="api", params=params, options=options, @@ -251,7 +247,6 @@ def update( self._request( "post", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), - api_mode="V1", base_address="api", params=params, options=options, @@ -272,7 +267,6 @@ async def update_async( await self._request_async( "post", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), - api_mode="V1", base_address="api", params=params, options=options, @@ -292,7 +286,6 @@ def list( self._request( "get", "/v1/coupons", - api_mode="V1", base_address="api", params=params, options=options, @@ -312,7 +305,6 @@ async def list_async( await self._request_async( "get", "/v1/coupons", - api_mode="V1", base_address="api", params=params, options=options, @@ -334,7 +326,6 @@ def create( self._request( "post", "/v1/coupons", - api_mode="V1", base_address="api", params=params, options=options, @@ -356,7 +347,6 @@ async def create_async( await self._request_async( "post", "/v1/coupons", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_credit_note_line_item_service.py b/stripe/_credit_note_line_item_service.py index 094bd3057..ce267b123 100644 --- a/stripe/_credit_note_line_item_service.py +++ b/stripe/_credit_note_line_item_service.py @@ -44,7 +44,6 @@ def list( "/v1/credit_notes/{credit_note}/lines".format( credit_note=sanitize_id(credit_note), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( "/v1/credit_notes/{credit_note}/lines".format( credit_note=sanitize_id(credit_note), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_credit_note_preview_lines_service.py b/stripe/_credit_note_preview_lines_service.py index fa41fb7c0..10cc91426 100644 --- a/stripe/_credit_note_preview_lines_service.py +++ b/stripe/_credit_note_preview_lines_service.py @@ -163,7 +163,6 @@ def list( self._request( "get", "/v1/credit_notes/preview/lines", - api_mode="V1", base_address="api", params=params, options=options, @@ -183,7 +182,6 @@ async def list_async( await self._request_async( "get", "/v1/credit_notes/preview/lines", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index a076ce15b..774b1a8c8 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -360,7 +360,6 @@ def list( self._request( "get", "/v1/credit_notes", - api_mode="V1", base_address="api", params=params, options=options, @@ -380,7 +379,6 @@ async def list_async( await self._request_async( "get", "/v1/credit_notes", - api_mode="V1", base_address="api", params=params, options=options, @@ -413,7 +411,6 @@ def create( self._request( "post", "/v1/credit_notes", - api_mode="V1", base_address="api", params=params, options=options, @@ -446,7 +443,6 @@ async def create_async( await self._request_async( "post", "/v1/credit_notes", - api_mode="V1", base_address="api", params=params, options=options, @@ -467,7 +463,6 @@ def retrieve( self._request( "get", "/v1/credit_notes/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -488,7 +483,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/credit_notes/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -509,7 +503,6 @@ def update( self._request( "post", "/v1/credit_notes/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -530,7 +523,6 @@ async def update_async( await self._request_async( "post", "/v1/credit_notes/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -550,7 +542,6 @@ def preview( self._request( "get", "/v1/credit_notes/preview", - api_mode="V1", base_address="api", params=params, options=options, @@ -570,7 +561,6 @@ async def preview_async( await self._request_async( "get", "/v1/credit_notes/preview", - api_mode="V1", base_address="api", params=params, options=options, @@ -591,7 +581,6 @@ def void_credit_note( self._request( "post", "/v1/credit_notes/{id}/void".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -612,7 +601,6 @@ async def void_credit_note_async( await self._request_async( "post", "/v1/credit_notes/{id}/void".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_customer_balance_transaction_service.py b/stripe/_customer_balance_transaction_service.py index 20291adac..d8b8d1f41 100644 --- a/stripe/_customer_balance_transaction_service.py +++ b/stripe/_customer_balance_transaction_service.py @@ -86,7 +86,6 @@ def list( "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -109,7 +108,6 @@ async def list_async( "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -132,7 +130,6 @@ def create( "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -155,7 +152,6 @@ async def create_async( "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -180,7 +176,6 @@ def retrieve( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -205,7 +200,6 @@ async def retrieve_async( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -230,7 +224,6 @@ def update( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -255,7 +248,6 @@ async def update_async( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_customer_cash_balance_service.py b/stripe/_customer_cash_balance_service.py index 5d50a3302..a3f3cc41e 100644 --- a/stripe/_customer_cash_balance_service.py +++ b/stripe/_customer_cash_balance_service.py @@ -51,7 +51,6 @@ def retrieve( "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -74,7 +73,6 @@ async def retrieve_async( "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -97,7 +95,6 @@ def update( "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -120,7 +117,6 @@ async def update_async( "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_customer_cash_balance_transaction_service.py b/stripe/_customer_cash_balance_transaction_service.py index 5e8a8bbb1..70c09590f 100644 --- a/stripe/_customer_cash_balance_transaction_service.py +++ b/stripe/_customer_cash_balance_transaction_service.py @@ -52,7 +52,6 @@ def list( "/v1/customers/{customer}/cash_balance_transactions".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -75,7 +74,6 @@ async def list_async( "/v1/customers/{customer}/cash_balance_transactions".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -100,7 +98,6 @@ def retrieve( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -125,7 +122,6 @@ async def retrieve_async( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_customer_funding_instructions_service.py b/stripe/_customer_funding_instructions_service.py index 0b287c8e4..6c2614742 100644 --- a/stripe/_customer_funding_instructions_service.py +++ b/stripe/_customer_funding_instructions_service.py @@ -79,7 +79,6 @@ def create( "/v1/customers/{customer}/funding_instructions".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -104,7 +103,6 @@ async def create_async( "/v1/customers/{customer}/funding_instructions".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 31a03d337..e1749bf91 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -100,7 +100,6 @@ def list( "/v1/customers/{customer}/payment_methods".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -123,7 +122,6 @@ async def list_async( "/v1/customers/{customer}/payment_methods".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -148,7 +146,6 @@ def retrieve( customer=sanitize_id(customer), payment_method=sanitize_id(payment_method), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -173,7 +170,6 @@ async def retrieve_async( customer=sanitize_id(customer), payment_method=sanitize_id(payment_method), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_customer_payment_source_service.py b/stripe/_customer_payment_source_service.py index 0c70b7de2..b05bf03cb 100644 --- a/stripe/_customer_payment_source_service.py +++ b/stripe/_customer_payment_source_service.py @@ -189,7 +189,6 @@ def list( "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -212,7 +211,6 @@ async def list_async( "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -239,7 +237,6 @@ def create( "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -266,7 +263,6 @@ async def create_async( "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -291,7 +287,6 @@ def retrieve( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -316,7 +311,6 @@ async def retrieve_async( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -341,7 +335,6 @@ def update( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -366,7 +359,6 @@ async def update_async( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -391,7 +383,6 @@ def delete( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -416,7 +407,6 @@ async def delete_async( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -441,7 +431,6 @@ def verify( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -466,7 +455,6 @@ async def verify_async( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index a3456afc3..16f5f092e 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -666,7 +666,6 @@ def delete( "/v1/customers/{customer}".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -689,7 +688,6 @@ async def delete_async( "/v1/customers/{customer}".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -712,7 +710,6 @@ def retrieve( "/v1/customers/{customer}".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -735,7 +732,6 @@ async def retrieve_async( "/v1/customers/{customer}".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -760,7 +756,6 @@ def update( "/v1/customers/{customer}".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -785,7 +780,6 @@ async def update_async( "/v1/customers/{customer}".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -808,7 +802,6 @@ def delete_discount( "/v1/customers/{customer}/discount".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -831,7 +824,6 @@ async def delete_discount_async( "/v1/customers/{customer}/discount".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -851,7 +843,6 @@ def list( self._request( "get", "/v1/customers", - api_mode="V1", base_address="api", params=params, options=options, @@ -871,7 +862,6 @@ async def list_async( await self._request_async( "get", "/v1/customers", - api_mode="V1", base_address="api", params=params, options=options, @@ -891,7 +881,6 @@ def create( self._request( "post", "/v1/customers", - api_mode="V1", base_address="api", params=params, options=options, @@ -911,7 +900,6 @@ async def create_async( await self._request_async( "post", "/v1/customers", - api_mode="V1", base_address="api", params=params, options=options, @@ -934,7 +922,6 @@ def search( self._request( "get", "/v1/customers/search", - api_mode="V1", base_address="api", params=params, options=options, @@ -957,7 +944,6 @@ async def search_async( await self._request_async( "get", "/v1/customers/search", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_customer_session_service.py b/stripe/_customer_session_service.py index f2c01ec87..820ab18a4 100644 --- a/stripe/_customer_session_service.py +++ b/stripe/_customer_session_service.py @@ -117,7 +117,6 @@ def create( self._request( "post", "/v1/customer_sessions", - api_mode="V1", base_address="api", params=params, options=options, @@ -137,7 +136,6 @@ async def create_async( await self._request_async( "post", "/v1/customer_sessions", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index ed126cdbf..5efa2382e 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -143,7 +143,6 @@ def delete( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -168,7 +167,6 @@ async def delete_async( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -193,7 +191,6 @@ def retrieve( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -218,7 +215,6 @@ async def retrieve_async( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -241,7 +237,6 @@ def list( "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -264,7 +259,6 @@ async def list_async( "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -287,7 +281,6 @@ def create( "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -310,7 +303,6 @@ async def create_async( "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_dispute_service.py b/stripe/_dispute_service.py index 1502f1e50..e55049146 100644 --- a/stripe/_dispute_service.py +++ b/stripe/_dispute_service.py @@ -211,7 +211,6 @@ def list( self._request( "get", "/v1/disputes", - api_mode="V1", base_address="api", params=params, options=options, @@ -231,7 +230,6 @@ async def list_async( await self._request_async( "get", "/v1/disputes", - api_mode="V1", base_address="api", params=params, options=options, @@ -252,7 +250,6 @@ def retrieve( self._request( "get", "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), - api_mode="V1", base_address="api", params=params, options=options, @@ -273,7 +270,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), - api_mode="V1", base_address="api", params=params, options=options, @@ -296,7 +292,6 @@ def update( self._request( "post", "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), - api_mode="V1", base_address="api", params=params, options=options, @@ -319,7 +314,6 @@ async def update_async( await self._request_async( "post", "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), - api_mode="V1", base_address="api", params=params, options=options, @@ -344,7 +338,6 @@ def close( "/v1/disputes/{dispute}/close".format( dispute=sanitize_id(dispute), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -369,7 +362,6 @@ async def close_async( "/v1/disputes/{dispute}/close".format( dispute=sanitize_id(dispute), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_ephemeral_key.py b/stripe/_ephemeral_key.py index 9fd5fd5ca..dca9fd62b 100644 --- a/stripe/_ephemeral_key.py +++ b/stripe/_ephemeral_key.py @@ -157,5 +157,4 @@ def create(cls, **params): url, params=params, base_address="api", - api_mode="V1", ) diff --git a/stripe/_ephemeral_key_service.py b/stripe/_ephemeral_key_service.py index 1e3c139a6..61d5ea7d6 100644 --- a/stripe/_ephemeral_key_service.py +++ b/stripe/_ephemeral_key_service.py @@ -51,7 +51,6 @@ def delete( self._request( "delete", "/v1/ephemeral_keys/{key}".format(key=sanitize_id(key)), - api_mode="V1", base_address="api", params=params, options=options, @@ -72,7 +71,6 @@ async def delete_async( await self._request_async( "delete", "/v1/ephemeral_keys/{key}".format(key=sanitize_id(key)), - api_mode="V1", base_address="api", params=params, options=options, @@ -92,7 +90,6 @@ def create( self._request( "post", "/v1/ephemeral_keys", - api_mode="V1", base_address="api", params=params, options=options, @@ -112,7 +109,6 @@ async def create_async( await self._request_async( "post", "/v1/ephemeral_keys", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_event_service.py b/stripe/_event_service.py index 89d21c043..745512086 100644 --- a/stripe/_event_service.py +++ b/stripe/_event_service.py @@ -81,7 +81,6 @@ def list( self._request( "get", "/v1/events", - api_mode="V1", base_address="api", params=params, options=options, @@ -101,7 +100,6 @@ async def list_async( await self._request_async( "get", "/v1/events", - api_mode="V1", base_address="api", params=params, options=options, @@ -122,7 +120,6 @@ def retrieve( self._request( "get", "/v1/events/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -143,7 +140,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/events/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_exchange_rate_service.py b/stripe/_exchange_rate_service.py index a187e2b36..3df40614c 100644 --- a/stripe/_exchange_rate_service.py +++ b/stripe/_exchange_rate_service.py @@ -47,7 +47,6 @@ def list( self._request( "get", "/v1/exchange_rates", - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( await self._request_async( "get", "/v1/exchange_rates", - api_mode="V1", base_address="api", params=params, options=options, @@ -90,7 +88,6 @@ def retrieve( "/v1/exchange_rates/{rate_id}".format( rate_id=sanitize_id(rate_id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -113,7 +110,6 @@ async def retrieve_async( "/v1/exchange_rates/{rate_id}".format( rate_id=sanitize_id(rate_id), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_file.py b/stripe/_file.py index 20cf02120..65c797a6c 100644 --- a/stripe/_file.py +++ b/stripe/_file.py @@ -218,7 +218,6 @@ def create(cls, **params: Unpack["File.CreateParams"]) -> "File": cls.class_url(), params=params, base_address="files", - api_mode="V1", ), ) @@ -240,7 +239,6 @@ async def create_async( cls.class_url(), params=params, base_address="files", - api_mode="V1", ), ) diff --git a/stripe/_file_link_service.py b/stripe/_file_link_service.py index a7426ea13..41166ff6f 100644 --- a/stripe/_file_link_service.py +++ b/stripe/_file_link_service.py @@ -109,7 +109,6 @@ def list( self._request( "get", "/v1/file_links", - api_mode="V1", base_address="api", params=params, options=options, @@ -129,7 +128,6 @@ async def list_async( await self._request_async( "get", "/v1/file_links", - api_mode="V1", base_address="api", params=params, options=options, @@ -149,7 +147,6 @@ def create( self._request( "post", "/v1/file_links", - api_mode="V1", base_address="api", params=params, options=options, @@ -169,7 +166,6 @@ async def create_async( await self._request_async( "post", "/v1/file_links", - api_mode="V1", base_address="api", params=params, options=options, @@ -190,7 +186,6 @@ def retrieve( self._request( "get", "/v1/file_links/{link}".format(link=sanitize_id(link)), - api_mode="V1", base_address="api", params=params, options=options, @@ -211,7 +206,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/file_links/{link}".format(link=sanitize_id(link)), - api_mode="V1", base_address="api", params=params, options=options, @@ -232,7 +226,6 @@ def update( self._request( "post", "/v1/file_links/{link}".format(link=sanitize_id(link)), - api_mode="V1", base_address="api", params=params, options=options, @@ -253,7 +246,6 @@ async def update_async( await self._request_async( "post", "/v1/file_links/{link}".format(link=sanitize_id(link)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_file_service.py b/stripe/_file_service.py index 12162f285..367109272 100644 --- a/stripe/_file_service.py +++ b/stripe/_file_service.py @@ -134,7 +134,6 @@ def list( self._request( "get", "/v1/files", - api_mode="V1", base_address="api", params=params, options=options, @@ -154,7 +153,6 @@ async def list_async( await self._request_async( "get", "/v1/files", - api_mode="V1", base_address="api", params=params, options=options, @@ -175,7 +173,6 @@ def create( self._request( "post", "/v1/files", - api_mode="V1", base_address="files", params=params, options=options, @@ -196,7 +193,6 @@ async def create_async( await self._request_async( "post", "/v1/files", - api_mode="V1", base_address="files", params=params, options=options, @@ -217,7 +213,6 @@ def retrieve( self._request( "get", "/v1/files/{file}".format(file=sanitize_id(file)), - api_mode="V1", base_address="api", params=params, options=options, @@ -238,7 +233,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/files/{file}".format(file=sanitize_id(file)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_invoice_item_service.py b/stripe/_invoice_item_service.py index aa97cd0c7..7a780a6b9 100644 --- a/stripe/_invoice_item_service.py +++ b/stripe/_invoice_item_service.py @@ -331,7 +331,6 @@ def delete( "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -354,7 +353,6 @@ async def delete_async( "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -377,7 +375,6 @@ def retrieve( "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -400,7 +397,6 @@ async def retrieve_async( "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -423,7 +419,6 @@ def update( "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -446,7 +441,6 @@ async def update_async( "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -466,7 +460,6 @@ def list( self._request( "get", "/v1/invoiceitems", - api_mode="V1", base_address="api", params=params, options=options, @@ -486,7 +479,6 @@ async def list_async( await self._request_async( "get", "/v1/invoiceitems", - api_mode="V1", base_address="api", params=params, options=options, @@ -506,7 +498,6 @@ def create( self._request( "post", "/v1/invoiceitems", - api_mode="V1", base_address="api", params=params, options=options, @@ -526,7 +517,6 @@ async def create_async( await self._request_async( "post", "/v1/invoiceitems", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index b17ba4214..3130ebda8 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -241,7 +241,6 @@ def list( "/v1/invoices/{invoice}/lines".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -264,7 +263,6 @@ async def list_async( "/v1/invoices/{invoice}/lines".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -292,7 +290,6 @@ def update( invoice=sanitize_id(invoice), line_item_id=sanitize_id(line_item_id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -320,7 +317,6 @@ async def update_async( invoice=sanitize_id(invoice), line_item_id=sanitize_id(line_item_id), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 6981cdccd..9ba1ab735 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -3978,7 +3978,6 @@ def delete( self._request( "delete", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), - api_mode="V1", base_address="api", params=params, options=options, @@ -3999,7 +3998,6 @@ async def delete_async( await self._request_async( "delete", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), - api_mode="V1", base_address="api", params=params, options=options, @@ -4020,7 +4018,6 @@ def retrieve( self._request( "get", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), - api_mode="V1", base_address="api", params=params, options=options, @@ -4041,7 +4038,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), - api_mode="V1", base_address="api", params=params, options=options, @@ -4067,7 +4063,6 @@ def update( self._request( "post", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), - api_mode="V1", base_address="api", params=params, options=options, @@ -4093,7 +4088,6 @@ async def update_async( await self._request_async( "post", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), - api_mode="V1", base_address="api", params=params, options=options, @@ -4113,7 +4107,6 @@ def list( self._request( "get", "/v1/invoices", - api_mode="V1", base_address="api", params=params, options=options, @@ -4133,7 +4126,6 @@ async def list_async( await self._request_async( "get", "/v1/invoices", - api_mode="V1", base_address="api", params=params, options=options, @@ -4153,7 +4145,6 @@ def create( self._request( "post", "/v1/invoices", - api_mode="V1", base_address="api", params=params, options=options, @@ -4173,7 +4164,6 @@ async def create_async( await self._request_async( "post", "/v1/invoices", - api_mode="V1", base_address="api", params=params, options=options, @@ -4196,7 +4186,6 @@ def search( self._request( "get", "/v1/invoices/search", - api_mode="V1", base_address="api", params=params, options=options, @@ -4219,7 +4208,6 @@ async def search_async( await self._request_async( "get", "/v1/invoices/search", - api_mode="V1", base_address="api", params=params, options=options, @@ -4245,7 +4233,6 @@ def upcoming( self._request( "get", "/v1/invoices/upcoming", - api_mode="V1", base_address="api", params=params, options=options, @@ -4271,7 +4258,6 @@ async def upcoming_async( await self._request_async( "get", "/v1/invoices/upcoming", - api_mode="V1", base_address="api", params=params, options=options, @@ -4294,7 +4280,6 @@ def add_lines( "/v1/invoices/{invoice}/add_lines".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4317,7 +4302,6 @@ async def add_lines_async( "/v1/invoices/{invoice}/add_lines".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4340,7 +4324,6 @@ def finalize_invoice( "/v1/invoices/{invoice}/finalize".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4363,7 +4346,6 @@ async def finalize_invoice_async( "/v1/invoices/{invoice}/finalize".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4386,7 +4368,6 @@ def mark_uncollectible( "/v1/invoices/{invoice}/mark_uncollectible".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4409,7 +4390,6 @@ async def mark_uncollectible_async( "/v1/invoices/{invoice}/mark_uncollectible".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4432,7 +4412,6 @@ def pay( "/v1/invoices/{invoice}/pay".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4455,7 +4434,6 @@ async def pay_async( "/v1/invoices/{invoice}/pay".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4478,7 +4456,6 @@ def remove_lines( "/v1/invoices/{invoice}/remove_lines".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4501,7 +4478,6 @@ async def remove_lines_async( "/v1/invoices/{invoice}/remove_lines".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4526,7 +4502,6 @@ def send_invoice( "/v1/invoices/{invoice}/send".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4551,7 +4526,6 @@ async def send_invoice_async( "/v1/invoices/{invoice}/send".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4574,7 +4548,6 @@ def update_lines( "/v1/invoices/{invoice}/update_lines".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4597,7 +4570,6 @@ async def update_lines_async( "/v1/invoices/{invoice}/update_lines".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4622,7 +4594,6 @@ def void_invoice( "/v1/invoices/{invoice}/void".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4647,7 +4618,6 @@ async def void_invoice_async( "/v1/invoices/{invoice}/void".format( invoice=sanitize_id(invoice), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -4673,7 +4643,6 @@ def create_preview( self._request( "post", "/v1/invoices/create_preview", - api_mode="V1", base_address="api", params=params, options=options, @@ -4699,7 +4668,6 @@ async def create_preview_async( await self._request_async( "post", "/v1/invoices/create_preview", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index 23216c534..80cb30a6a 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -1168,7 +1168,6 @@ def list( self._request( "get", "/v1/invoices/upcoming/lines", - api_mode="V1", base_address="api", params=params, options=options, @@ -1188,7 +1187,6 @@ async def list_async( await self._request_async( "get", "/v1/invoices/upcoming/lines", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_list_object.py b/stripe/_list_object.py index bb007269f..71814cbcf 100644 --- a/stripe/_list_object.py +++ b/stripe/_list_object.py @@ -48,7 +48,6 @@ def list(self, **params: Mapping[str, Any]) -> Self: self._get_url_for_list(), params=params, base_address="api", - api_mode="V1", ), ) @@ -60,7 +59,6 @@ async def list_async(self, **params: Mapping[str, Any]) -> Self: self._get_url_for_list(), params=params, base_address="api", - api_mode="V1", ), ) @@ -77,7 +75,6 @@ def create(self, **params: Mapping[str, Any]) -> T: url, params=params, base_address="api", - api_mode="V1", ), ) @@ -96,7 +93,6 @@ def retrieve(self, id: str, **params: Mapping[str, Any]): url, params=params, base_address="api", - api_mode="V1", ), ) diff --git a/stripe/_mandate_service.py b/stripe/_mandate_service.py index 52c0c6ca1..a8d603563 100644 --- a/stripe/_mandate_service.py +++ b/stripe/_mandate_service.py @@ -29,7 +29,6 @@ def retrieve( self._request( "get", "/v1/mandates/{mandate}".format(mandate=sanitize_id(mandate)), - api_mode="V1", base_address="api", params=params, options=options, @@ -50,7 +49,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/mandates/{mandate}".format(mandate=sanitize_id(mandate)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_oauth.py b/stripe/_oauth.py index e0050c7e1..c2bd478b0 100644 --- a/stripe/_oauth.py +++ b/stripe/_oauth.py @@ -333,7 +333,6 @@ def token( params=params, options=options, base_address="connect", - api_mode="V1", ), ) @@ -352,6 +351,5 @@ def deauthorize( params=params, options=options, base_address="connect", - api_mode="V1", ), ) diff --git a/stripe/_oauth_service.py b/stripe/_oauth_service.py index 480cd6f12..7c24269f5 100644 --- a/stripe/_oauth_service.py +++ b/stripe/_oauth_service.py @@ -78,7 +78,6 @@ def token( params=params, options=options, base_address="connect", - api_mode="V1", ), ) @@ -96,6 +95,5 @@ def deauthorize( params=params, options=options, base_address="connect", - api_mode="V1", ), ) diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 7e005149d..b63deeff4 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -7214,7 +7214,6 @@ def list( self._request( "get", "/v1/payment_intents", - api_mode="V1", base_address="api", params=params, options=options, @@ -7234,7 +7233,6 @@ async def list_async( await self._request_async( "get", "/v1/payment_intents", - api_mode="V1", base_address="api", params=params, options=options, @@ -7263,7 +7261,6 @@ def create( self._request( "post", "/v1/payment_intents", - api_mode="V1", base_address="api", params=params, options=options, @@ -7292,7 +7289,6 @@ async def create_async( await self._request_async( "post", "/v1/payment_intents", - api_mode="V1", base_address="api", params=params, options=options, @@ -7319,7 +7315,6 @@ def retrieve( "/v1/payment_intents/{intent}".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7346,7 +7341,6 @@ async def retrieve_async( "/v1/payment_intents/{intent}".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7375,7 +7369,6 @@ def update( "/v1/payment_intents/{intent}".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7404,7 +7397,6 @@ async def update_async( "/v1/payment_intents/{intent}".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7427,7 +7419,6 @@ def search( self._request( "get", "/v1/payment_intents/search", - api_mode="V1", base_address="api", params=params, options=options, @@ -7450,7 +7441,6 @@ async def search_async( await self._request_async( "get", "/v1/payment_intents/search", - api_mode="V1", base_address="api", params=params, options=options, @@ -7473,7 +7463,6 @@ def apply_customer_balance( "/v1/payment_intents/{intent}/apply_customer_balance".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7496,7 +7485,6 @@ async def apply_customer_balance_async( "/v1/payment_intents/{intent}/apply_customer_balance".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7523,7 +7511,6 @@ def cancel( "/v1/payment_intents/{intent}/cancel".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7550,7 +7537,6 @@ async def cancel_async( "/v1/payment_intents/{intent}/cancel".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7577,7 +7563,6 @@ def capture( "/v1/payment_intents/{intent}/capture".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7604,7 +7589,6 @@ async def capture_async( "/v1/payment_intents/{intent}/capture".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7648,7 +7632,6 @@ def confirm( "/v1/payment_intents/{intent}/confirm".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7692,7 +7675,6 @@ async def confirm_async( "/v1/payment_intents/{intent}/confirm".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7738,7 +7720,6 @@ def increment_authorization( "/v1/payment_intents/{intent}/increment_authorization".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7784,7 +7765,6 @@ async def increment_authorization_async( "/v1/payment_intents/{intent}/increment_authorization".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7807,7 +7787,6 @@ def verify_microdeposits( "/v1/payment_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -7830,7 +7809,6 @@ async def verify_microdeposits_async( "/v1/payment_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_payment_link_line_item_service.py b/stripe/_payment_link_line_item_service.py index 93bdead2e..8484bd147 100644 --- a/stripe/_payment_link_line_item_service.py +++ b/stripe/_payment_link_line_item_service.py @@ -44,7 +44,6 @@ def list( "/v1/payment_links/{payment_link}/line_items".format( payment_link=sanitize_id(payment_link), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( "/v1/payment_links/{payment_link}/line_items".format( payment_link=sanitize_id(payment_link), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index f6ee75608..b1dacbc1d 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -1685,7 +1685,6 @@ def list( self._request( "get", "/v1/payment_links", - api_mode="V1", base_address="api", params=params, options=options, @@ -1705,7 +1704,6 @@ async def list_async( await self._request_async( "get", "/v1/payment_links", - api_mode="V1", base_address="api", params=params, options=options, @@ -1725,7 +1723,6 @@ def create( self._request( "post", "/v1/payment_links", - api_mode="V1", base_address="api", params=params, options=options, @@ -1745,7 +1742,6 @@ async def create_async( await self._request_async( "post", "/v1/payment_links", - api_mode="V1", base_address="api", params=params, options=options, @@ -1768,7 +1764,6 @@ def retrieve( "/v1/payment_links/{payment_link}".format( payment_link=sanitize_id(payment_link), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1791,7 +1786,6 @@ async def retrieve_async( "/v1/payment_links/{payment_link}".format( payment_link=sanitize_id(payment_link), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1814,7 +1808,6 @@ def update( "/v1/payment_links/{payment_link}".format( payment_link=sanitize_id(payment_link), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1837,7 +1830,6 @@ async def update_async( "/v1/payment_links/{payment_link}".format( payment_link=sanitize_id(payment_link), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index 4b36c7c66..d43649ab1 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -1683,7 +1683,6 @@ def list( self._request( "get", "/v1/payment_method_configurations", - api_mode="V1", base_address="api", params=params, options=options, @@ -1703,7 +1702,6 @@ async def list_async( await self._request_async( "get", "/v1/payment_method_configurations", - api_mode="V1", base_address="api", params=params, options=options, @@ -1723,7 +1721,6 @@ def create( self._request( "post", "/v1/payment_method_configurations", - api_mode="V1", base_address="api", params=params, options=options, @@ -1743,7 +1740,6 @@ async def create_async( await self._request_async( "post", "/v1/payment_method_configurations", - api_mode="V1", base_address="api", params=params, options=options, @@ -1766,7 +1762,6 @@ def retrieve( "/v1/payment_method_configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1789,7 +1784,6 @@ async def retrieve_async( "/v1/payment_method_configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1812,7 +1806,6 @@ def update( "/v1/payment_method_configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1835,7 +1828,6 @@ async def update_async( "/v1/payment_method_configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_payment_method_domain_service.py b/stripe/_payment_method_domain_service.py index 24692f54a..5452daa9b 100644 --- a/stripe/_payment_method_domain_service.py +++ b/stripe/_payment_method_domain_service.py @@ -85,7 +85,6 @@ def list( self._request( "get", "/v1/payment_method_domains", - api_mode="V1", base_address="api", params=params, options=options, @@ -105,7 +104,6 @@ async def list_async( await self._request_async( "get", "/v1/payment_method_domains", - api_mode="V1", base_address="api", params=params, options=options, @@ -125,7 +123,6 @@ def create( self._request( "post", "/v1/payment_method_domains", - api_mode="V1", base_address="api", params=params, options=options, @@ -145,7 +142,6 @@ async def create_async( await self._request_async( "post", "/v1/payment_method_domains", - api_mode="V1", base_address="api", params=params, options=options, @@ -168,7 +164,6 @@ def retrieve( "/v1/payment_method_domains/{payment_method_domain}".format( payment_method_domain=sanitize_id(payment_method_domain), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -191,7 +186,6 @@ async def retrieve_async( "/v1/payment_method_domains/{payment_method_domain}".format( payment_method_domain=sanitize_id(payment_method_domain), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -214,7 +208,6 @@ def update( "/v1/payment_method_domains/{payment_method_domain}".format( payment_method_domain=sanitize_id(payment_method_domain), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -237,7 +230,6 @@ async def update_async( "/v1/payment_method_domains/{payment_method_domain}".format( payment_method_domain=sanitize_id(payment_method_domain), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -265,7 +257,6 @@ def validate( "/v1/payment_method_domains/{payment_method_domain}/validate".format( payment_method_domain=sanitize_id(payment_method_domain), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -293,7 +284,6 @@ async def validate_async( "/v1/payment_method_domains/{payment_method_domain}/validate".format( payment_method_domain=sanitize_id(payment_method_domain), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 8f6a18872..45c33c23e 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -855,7 +855,6 @@ def list( self._request( "get", "/v1/payment_methods", - api_mode="V1", base_address="api", params=params, options=options, @@ -875,7 +874,6 @@ async def list_async( await self._request_async( "get", "/v1/payment_methods", - api_mode="V1", base_address="api", params=params, options=options, @@ -897,7 +895,6 @@ def create( self._request( "post", "/v1/payment_methods", - api_mode="V1", base_address="api", params=params, options=options, @@ -919,7 +916,6 @@ async def create_async( await self._request_async( "post", "/v1/payment_methods", - api_mode="V1", base_address="api", params=params, options=options, @@ -942,7 +938,6 @@ def retrieve( "/v1/payment_methods/{payment_method}".format( payment_method=sanitize_id(payment_method), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -965,7 +960,6 @@ async def retrieve_async( "/v1/payment_methods/{payment_method}".format( payment_method=sanitize_id(payment_method), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -988,7 +982,6 @@ def update( "/v1/payment_methods/{payment_method}".format( payment_method=sanitize_id(payment_method), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1011,7 +1004,6 @@ async def update_async( "/v1/payment_methods/{payment_method}".format( payment_method=sanitize_id(payment_method), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1046,7 +1038,6 @@ def attach( "/v1/payment_methods/{payment_method}/attach".format( payment_method=sanitize_id(payment_method), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1081,7 +1072,6 @@ async def attach_async( "/v1/payment_methods/{payment_method}/attach".format( payment_method=sanitize_id(payment_method), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1104,7 +1094,6 @@ def detach( "/v1/payment_methods/{payment_method}/detach".format( payment_method=sanitize_id(payment_method), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1127,7 +1116,6 @@ async def detach_async( "/v1/payment_methods/{payment_method}/detach".format( payment_method=sanitize_id(payment_method), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_payout_service.py b/stripe/_payout_service.py index 2d579cd7a..e78adee99 100644 --- a/stripe/_payout_service.py +++ b/stripe/_payout_service.py @@ -163,7 +163,6 @@ def list( self._request( "get", "/v1/payouts", - api_mode="V1", base_address="api", params=params, options=options, @@ -183,7 +182,6 @@ async def list_async( await self._request_async( "get", "/v1/payouts", - api_mode="V1", base_address="api", params=params, options=options, @@ -207,7 +205,6 @@ def create( self._request( "post", "/v1/payouts", - api_mode="V1", base_address="api", params=params, options=options, @@ -231,7 +228,6 @@ async def create_async( await self._request_async( "post", "/v1/payouts", - api_mode="V1", base_address="api", params=params, options=options, @@ -252,7 +248,6 @@ def retrieve( self._request( "get", "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), - api_mode="V1", base_address="api", params=params, options=options, @@ -273,7 +268,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), - api_mode="V1", base_address="api", params=params, options=options, @@ -294,7 +288,6 @@ def update( self._request( "post", "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), - api_mode="V1", base_address="api", params=params, options=options, @@ -315,7 +308,6 @@ async def update_async( await self._request_async( "post", "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), - api_mode="V1", base_address="api", params=params, options=options, @@ -338,7 +330,6 @@ def cancel( "/v1/payouts/{payout}/cancel".format( payout=sanitize_id(payout), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -361,7 +352,6 @@ async def cancel_async( "/v1/payouts/{payout}/cancel".format( payout=sanitize_id(payout), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -386,7 +376,6 @@ def reverse( "/v1/payouts/{payout}/reverse".format( payout=sanitize_id(payout), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -411,7 +400,6 @@ async def reverse_async( "/v1/payouts/{payout}/reverse".format( payout=sanitize_id(payout), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_plan_service.py b/stripe/_plan_service.py index 1e6e35759..606b55fce 100644 --- a/stripe/_plan_service.py +++ b/stripe/_plan_service.py @@ -248,7 +248,6 @@ def delete( self._request( "delete", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), - api_mode="V1", base_address="api", params=params, options=options, @@ -269,7 +268,6 @@ async def delete_async( await self._request_async( "delete", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), - api_mode="V1", base_address="api", params=params, options=options, @@ -290,7 +288,6 @@ def retrieve( self._request( "get", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), - api_mode="V1", base_address="api", params=params, options=options, @@ -311,7 +308,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), - api_mode="V1", base_address="api", params=params, options=options, @@ -332,7 +328,6 @@ def update( self._request( "post", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), - api_mode="V1", base_address="api", params=params, options=options, @@ -353,7 +348,6 @@ async def update_async( await self._request_async( "post", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), - api_mode="V1", base_address="api", params=params, options=options, @@ -373,7 +367,6 @@ def list( self._request( "get", "/v1/plans", - api_mode="V1", base_address="api", params=params, options=options, @@ -393,7 +386,6 @@ async def list_async( await self._request_async( "get", "/v1/plans", - api_mode="V1", base_address="api", params=params, options=options, @@ -411,7 +403,6 @@ def create( self._request( "post", "/v1/plans", - api_mode="V1", base_address="api", params=params, options=options, @@ -429,7 +420,6 @@ async def create_async( await self._request_async( "post", "/v1/plans", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_price_service.py b/stripe/_price_service.py index bf2388309..327d66fef 100644 --- a/stripe/_price_service.py +++ b/stripe/_price_service.py @@ -496,7 +496,6 @@ def list( self._request( "get", "/v1/prices", - api_mode="V1", base_address="api", params=params, options=options, @@ -516,7 +515,6 @@ async def list_async( await self._request_async( "get", "/v1/prices", - api_mode="V1", base_address="api", params=params, options=options, @@ -534,7 +532,6 @@ def create( self._request( "post", "/v1/prices", - api_mode="V1", base_address="api", params=params, options=options, @@ -552,7 +549,6 @@ async def create_async( await self._request_async( "post", "/v1/prices", - api_mode="V1", base_address="api", params=params, options=options, @@ -573,7 +569,6 @@ def retrieve( self._request( "get", "/v1/prices/{price}".format(price=sanitize_id(price)), - api_mode="V1", base_address="api", params=params, options=options, @@ -594,7 +589,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/prices/{price}".format(price=sanitize_id(price)), - api_mode="V1", base_address="api", params=params, options=options, @@ -615,7 +609,6 @@ def update( self._request( "post", "/v1/prices/{price}".format(price=sanitize_id(price)), - api_mode="V1", base_address="api", params=params, options=options, @@ -636,7 +629,6 @@ async def update_async( await self._request_async( "post", "/v1/prices/{price}".format(price=sanitize_id(price)), - api_mode="V1", base_address="api", params=params, options=options, @@ -657,7 +649,6 @@ def search( self._request( "get", "/v1/prices/search", - api_mode="V1", base_address="api", params=params, options=options, @@ -678,7 +669,6 @@ async def search_async( await self._request_async( "get", "/v1/prices/search", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_product_feature_service.py b/stripe/_product_feature_service.py index dfda8ed8f..da0cc37ca 100644 --- a/stripe/_product_feature_service.py +++ b/stripe/_product_feature_service.py @@ -65,7 +65,6 @@ def delete( product=sanitize_id(product), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -90,7 +89,6 @@ async def delete_async( product=sanitize_id(product), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -115,7 +113,6 @@ def retrieve( product=sanitize_id(product), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -140,7 +137,6 @@ async def retrieve_async( product=sanitize_id(product), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -163,7 +159,6 @@ def list( "/v1/products/{product}/features".format( product=sanitize_id(product), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -186,7 +181,6 @@ async def list_async( "/v1/products/{product}/features".format( product=sanitize_id(product), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -209,7 +203,6 @@ def create( "/v1/products/{product}/features".format( product=sanitize_id(product), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -232,7 +225,6 @@ async def create_async( "/v1/products/{product}/features".format( product=sanitize_id(product), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_product_service.py b/stripe/_product_service.py index cde4ad8a0..817c190b6 100644 --- a/stripe/_product_service.py +++ b/stripe/_product_service.py @@ -422,7 +422,6 @@ def delete( self._request( "delete", "/v1/products/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -443,7 +442,6 @@ async def delete_async( await self._request_async( "delete", "/v1/products/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -464,7 +462,6 @@ def retrieve( self._request( "get", "/v1/products/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -485,7 +482,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/products/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -506,7 +502,6 @@ def update( self._request( "post", "/v1/products/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -527,7 +522,6 @@ async def update_async( await self._request_async( "post", "/v1/products/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -547,7 +541,6 @@ def list( self._request( "get", "/v1/products", - api_mode="V1", base_address="api", params=params, options=options, @@ -567,7 +560,6 @@ async def list_async( await self._request_async( "get", "/v1/products", - api_mode="V1", base_address="api", params=params, options=options, @@ -587,7 +579,6 @@ def create( self._request( "post", "/v1/products", - api_mode="V1", base_address="api", params=params, options=options, @@ -607,7 +598,6 @@ async def create_async( await self._request_async( "post", "/v1/products", - api_mode="V1", base_address="api", params=params, options=options, @@ -630,7 +620,6 @@ def search( self._request( "get", "/v1/products/search", - api_mode="V1", base_address="api", params=params, options=options, @@ -653,7 +642,6 @@ async def search_async( await self._request_async( "get", "/v1/products/search", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_promotion_code_service.py b/stripe/_promotion_code_service.py index bdd6734b2..b3eeed7b3 100644 --- a/stripe/_promotion_code_service.py +++ b/stripe/_promotion_code_service.py @@ -191,7 +191,6 @@ def list( self._request( "get", "/v1/promotion_codes", - api_mode="V1", base_address="api", params=params, options=options, @@ -211,7 +210,6 @@ async def list_async( await self._request_async( "get", "/v1/promotion_codes", - api_mode="V1", base_address="api", params=params, options=options, @@ -231,7 +229,6 @@ def create( self._request( "post", "/v1/promotion_codes", - api_mode="V1", base_address="api", params=params, options=options, @@ -251,7 +248,6 @@ async def create_async( await self._request_async( "post", "/v1/promotion_codes", - api_mode="V1", base_address="api", params=params, options=options, @@ -274,7 +270,6 @@ def retrieve( "/v1/promotion_codes/{promotion_code}".format( promotion_code=sanitize_id(promotion_code), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -297,7 +292,6 @@ async def retrieve_async( "/v1/promotion_codes/{promotion_code}".format( promotion_code=sanitize_id(promotion_code), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -320,7 +314,6 @@ def update( "/v1/promotion_codes/{promotion_code}".format( promotion_code=sanitize_id(promotion_code), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -343,7 +336,6 @@ async def update_async( "/v1/promotion_codes/{promotion_code}".format( promotion_code=sanitize_id(promotion_code), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_quote_computed_upfront_line_items_service.py b/stripe/_quote_computed_upfront_line_items_service.py index f653aeac3..a32accc96 100644 --- a/stripe/_quote_computed_upfront_line_items_service.py +++ b/stripe/_quote_computed_upfront_line_items_service.py @@ -44,7 +44,6 @@ def list( "/v1/quotes/{quote}/computed_upfront_line_items".format( quote=sanitize_id(quote), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( "/v1/quotes/{quote}/computed_upfront_line_items".format( quote=sanitize_id(quote), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_quote_line_item_service.py b/stripe/_quote_line_item_service.py index b69093b44..1f8b8e3d0 100644 --- a/stripe/_quote_line_item_service.py +++ b/stripe/_quote_line_item_service.py @@ -44,7 +44,6 @@ def list( "/v1/quotes/{quote}/line_items".format( quote=sanitize_id(quote), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( "/v1/quotes/{quote}/line_items".format( quote=sanitize_id(quote), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 8db87912b..c5d72560f 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -626,7 +626,6 @@ def list( self._request( "get", "/v1/quotes", - api_mode="V1", base_address="api", params=params, options=options, @@ -646,7 +645,6 @@ async def list_async( await self._request_async( "get", "/v1/quotes", - api_mode="V1", base_address="api", params=params, options=options, @@ -666,7 +664,6 @@ def create( self._request( "post", "/v1/quotes", - api_mode="V1", base_address="api", params=params, options=options, @@ -686,7 +683,6 @@ async def create_async( await self._request_async( "post", "/v1/quotes", - api_mode="V1", base_address="api", params=params, options=options, @@ -707,7 +703,6 @@ def retrieve( self._request( "get", "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), - api_mode="V1", base_address="api", params=params, options=options, @@ -728,7 +723,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), - api_mode="V1", base_address="api", params=params, options=options, @@ -749,7 +743,6 @@ def update( self._request( "post", "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), - api_mode="V1", base_address="api", params=params, options=options, @@ -770,7 +763,6 @@ async def update_async( await self._request_async( "post", "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), - api_mode="V1", base_address="api", params=params, options=options, @@ -791,7 +783,6 @@ def accept( self._request( "post", "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), - api_mode="V1", base_address="api", params=params, options=options, @@ -812,7 +803,6 @@ async def accept_async( await self._request_async( "post", "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), - api_mode="V1", base_address="api", params=params, options=options, @@ -833,7 +823,6 @@ def cancel( self._request( "post", "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), - api_mode="V1", base_address="api", params=params, options=options, @@ -854,7 +843,6 @@ async def cancel_async( await self._request_async( "post", "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), - api_mode="V1", base_address="api", params=params, options=options, @@ -875,7 +863,6 @@ def finalize_quote( self._request( "post", "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), - api_mode="V1", base_address="api", params=params, options=options, @@ -896,7 +883,6 @@ async def finalize_quote_async( await self._request_async( "post", "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), - api_mode="V1", base_address="api", params=params, options=options, @@ -917,7 +903,6 @@ def pdf( self._request_stream( "get", "/v1/quotes/{quote}/pdf".format(quote=sanitize_id(quote)), - api_mode="V1", base_address="files", params=params, options=options, @@ -938,7 +923,6 @@ async def pdf_async( await self._request_stream_async( "get", "/v1/quotes/{quote}/pdf".format(quote=sanitize_id(quote)), - api_mode="V1", base_address="files", params=params, options=options, diff --git a/stripe/_refund_service.py b/stripe/_refund_service.py index 9608e8af7..ad8d7a418 100644 --- a/stripe/_refund_service.py +++ b/stripe/_refund_service.py @@ -144,7 +144,6 @@ def list( self._request( "get", "/v1/refunds", - api_mode="V1", base_address="api", params=params, options=options, @@ -164,7 +163,6 @@ async def list_async( await self._request_async( "get", "/v1/refunds", - api_mode="V1", base_address="api", params=params, options=options, @@ -194,7 +192,6 @@ def create( self._request( "post", "/v1/refunds", - api_mode="V1", base_address="api", params=params, options=options, @@ -224,7 +221,6 @@ async def create_async( await self._request_async( "post", "/v1/refunds", - api_mode="V1", base_address="api", params=params, options=options, @@ -245,7 +241,6 @@ def retrieve( self._request( "get", "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), - api_mode="V1", base_address="api", params=params, options=options, @@ -266,7 +261,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), - api_mode="V1", base_address="api", params=params, options=options, @@ -289,7 +283,6 @@ def update( self._request( "post", "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), - api_mode="V1", base_address="api", params=params, options=options, @@ -312,7 +305,6 @@ async def update_async( await self._request_async( "post", "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), - api_mode="V1", base_address="api", params=params, options=options, @@ -337,7 +329,6 @@ def cancel( "/v1/refunds/{refund}/cancel".format( refund=sanitize_id(refund), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -362,7 +353,6 @@ async def cancel_async( "/v1/refunds/{refund}/cancel".format( refund=sanitize_id(refund), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_review_service.py b/stripe/_review_service.py index 5d09a3301..b739b3a41 100644 --- a/stripe/_review_service.py +++ b/stripe/_review_service.py @@ -75,7 +75,6 @@ def list( self._request( "get", "/v1/reviews", - api_mode="V1", base_address="api", params=params, options=options, @@ -95,7 +94,6 @@ async def list_async( await self._request_async( "get", "/v1/reviews", - api_mode="V1", base_address="api", params=params, options=options, @@ -116,7 +114,6 @@ def retrieve( self._request( "get", "/v1/reviews/{review}".format(review=sanitize_id(review)), - api_mode="V1", base_address="api", params=params, options=options, @@ -137,7 +134,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/reviews/{review}".format(review=sanitize_id(review)), - api_mode="V1", base_address="api", params=params, options=options, @@ -160,7 +156,6 @@ def approve( "/v1/reviews/{review}/approve".format( review=sanitize_id(review), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -183,7 +178,6 @@ async def approve_async( "/v1/reviews/{review}/approve".format( review=sanitize_id(review), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_search_result_object.py b/stripe/_search_result_object.py index 9b78c848e..73b1329c7 100644 --- a/stripe/_search_result_object.py +++ b/stripe/_search_result_object.py @@ -56,7 +56,6 @@ def search(self, **params: Mapping[str, Any]) -> Self: self._get_url_for_search(), params=params, base_address="api", - api_mode="V1", ), ) @@ -68,7 +67,6 @@ async def _search_async(self, **params: Mapping[str, Any]) -> Self: self._get_url_for_search(), params=params, base_address="api", - api_mode="V1", ), ) diff --git a/stripe/_setup_attempt_service.py b/stripe/_setup_attempt_service.py index ba3ff2065..6be48b135 100644 --- a/stripe/_setup_attempt_service.py +++ b/stripe/_setup_attempt_service.py @@ -69,7 +69,6 @@ def list( self._request( "get", "/v1/setup_attempts", - api_mode="V1", base_address="api", params=params, options=options, @@ -89,7 +88,6 @@ async def list_async( await self._request_async( "get", "/v1/setup_attempts", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index fb4dda1ee..d65aaa4b6 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -3471,7 +3471,6 @@ def list( self._request( "get", "/v1/setup_intents", - api_mode="V1", base_address="api", params=params, options=options, @@ -3491,7 +3490,6 @@ async def list_async( await self._request_async( "get", "/v1/setup_intents", - api_mode="V1", base_address="api", params=params, options=options, @@ -3514,7 +3512,6 @@ def create( self._request( "post", "/v1/setup_intents", - api_mode="V1", base_address="api", params=params, options=options, @@ -3537,7 +3534,6 @@ async def create_async( await self._request_async( "post", "/v1/setup_intents", - api_mode="V1", base_address="api", params=params, options=options, @@ -3564,7 +3560,6 @@ def retrieve( "/v1/setup_intents/{intent}".format( intent=sanitize_id(intent) ), - api_mode="V1", base_address="api", params=params, options=options, @@ -3591,7 +3586,6 @@ async def retrieve_async( "/v1/setup_intents/{intent}".format( intent=sanitize_id(intent) ), - api_mode="V1", base_address="api", params=params, options=options, @@ -3614,7 +3608,6 @@ def update( "/v1/setup_intents/{intent}".format( intent=sanitize_id(intent) ), - api_mode="V1", base_address="api", params=params, options=options, @@ -3637,7 +3630,6 @@ async def update_async( "/v1/setup_intents/{intent}".format( intent=sanitize_id(intent) ), - api_mode="V1", base_address="api", params=params, options=options, @@ -3662,7 +3654,6 @@ def cancel( "/v1/setup_intents/{intent}/cancel".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -3687,7 +3678,6 @@ async def cancel_async( "/v1/setup_intents/{intent}/cancel".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -3723,7 +3713,6 @@ def confirm( "/v1/setup_intents/{intent}/confirm".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -3759,7 +3748,6 @@ async def confirm_async( "/v1/setup_intents/{intent}/confirm".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -3782,7 +3770,6 @@ def verify_microdeposits( "/v1/setup_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -3805,7 +3792,6 @@ async def verify_microdeposits_async( "/v1/setup_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_shipping_rate_service.py b/stripe/_shipping_rate_service.py index 2e6c3f964..10c789582 100644 --- a/stripe/_shipping_rate_service.py +++ b/stripe/_shipping_rate_service.py @@ -231,7 +231,6 @@ def list( self._request( "get", "/v1/shipping_rates", - api_mode="V1", base_address="api", params=params, options=options, @@ -251,7 +250,6 @@ async def list_async( await self._request_async( "get", "/v1/shipping_rates", - api_mode="V1", base_address="api", params=params, options=options, @@ -271,7 +269,6 @@ def create( self._request( "post", "/v1/shipping_rates", - api_mode="V1", base_address="api", params=params, options=options, @@ -291,7 +288,6 @@ async def create_async( await self._request_async( "post", "/v1/shipping_rates", - api_mode="V1", base_address="api", params=params, options=options, @@ -314,7 +310,6 @@ def retrieve( "/v1/shipping_rates/{shipping_rate_token}".format( shipping_rate_token=sanitize_id(shipping_rate_token), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -337,7 +332,6 @@ async def retrieve_async( "/v1/shipping_rates/{shipping_rate_token}".format( shipping_rate_token=sanitize_id(shipping_rate_token), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -360,7 +354,6 @@ def update( "/v1/shipping_rates/{shipping_rate_token}".format( shipping_rate_token=sanitize_id(shipping_rate_token), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -383,7 +376,6 @@ async def update_async( "/v1/shipping_rates/{shipping_rate_token}".format( shipping_rate_token=sanitize_id(shipping_rate_token), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_source_service.py b/stripe/_source_service.py index d5444be03..34e60a857 100644 --- a/stripe/_source_service.py +++ b/stripe/_source_service.py @@ -555,7 +555,6 @@ def detach( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -580,7 +579,6 @@ async def detach_async( customer=sanitize_id(customer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -601,7 +599,6 @@ def retrieve( self._request( "get", "/v1/sources/{source}".format(source=sanitize_id(source)), - api_mode="V1", base_address="api", params=params, options=options, @@ -622,7 +619,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/sources/{source}".format(source=sanitize_id(source)), - api_mode="V1", base_address="api", params=params, options=options, @@ -645,7 +641,6 @@ def update( self._request( "post", "/v1/sources/{source}".format(source=sanitize_id(source)), - api_mode="V1", base_address="api", params=params, options=options, @@ -668,7 +663,6 @@ async def update_async( await self._request_async( "post", "/v1/sources/{source}".format(source=sanitize_id(source)), - api_mode="V1", base_address="api", params=params, options=options, @@ -688,7 +682,6 @@ def create( self._request( "post", "/v1/sources", - api_mode="V1", base_address="api", params=params, options=options, @@ -708,7 +701,6 @@ async def create_async( await self._request_async( "post", "/v1/sources", - api_mode="V1", base_address="api", params=params, options=options, @@ -731,7 +723,6 @@ def verify( "/v1/sources/{source}/verify".format( source=sanitize_id(source), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -754,7 +745,6 @@ async def verify_async( "/v1/sources/{source}/verify".format( source=sanitize_id(source), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_source_transaction_service.py b/stripe/_source_transaction_service.py index 022868032..8bb2db908 100644 --- a/stripe/_source_transaction_service.py +++ b/stripe/_source_transaction_service.py @@ -44,7 +44,6 @@ def list( "/v1/sources/{source}/source_transactions".format( source=sanitize_id(source), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( "/v1/sources/{source}/source_transactions".format( source=sanitize_id(source), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_stripe_object.py b/stripe/_stripe_object.py index 1e7bff5d9..2cc00104d 100644 --- a/stripe/_stripe_object.py +++ b/stripe/_stripe_object.py @@ -382,7 +382,6 @@ def request( params: Optional[Dict[str, Any]] = None, *, base_address: BaseAddress = "api", - api_mode: ApiMode = "V1", ) -> "StripeObject": return StripeObject._request( self, @@ -390,7 +389,6 @@ def request( url, params=params, base_address=base_address, - api_mode=api_mode, ) def _request( @@ -401,7 +399,6 @@ def _request( usage: Optional[List[str]] = None, *, base_address: BaseAddress, - api_mode: ApiMode, ) -> "StripeObject": if params is None: params = self._retrieve_params @@ -414,7 +411,6 @@ def _request( params=request_params, options=request_options, base_address=base_address, - api_mode=api_mode, usage=usage, ) @@ -426,7 +422,6 @@ async def _request_async( usage: Optional[List[str]] = None, *, base_address: BaseAddress, - api_mode: ApiMode, ) -> "StripeObject": if params is None: params = self._retrieve_params @@ -439,7 +434,6 @@ async def _request_async( params=request_params, options=request_options, base_address=base_address, - api_mode=api_mode, usage=usage, ) @@ -450,7 +444,6 @@ def _request_stream( params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", - api_mode: ApiMode = "V1", ) -> StripeStreamResponse: if params is None: params = self._retrieve_params @@ -462,7 +455,6 @@ def _request_stream( params=request_params, options=request_options, base_address=base_address, - api_mode=api_mode, ) async def _request_stream_async( @@ -472,7 +464,6 @@ async def _request_stream_async( params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", - api_mode: ApiMode = "V1", ) -> StripeStreamResponseAsync: if params is None: params = self._retrieve_params @@ -484,7 +475,6 @@ async def _request_stream_async( params=request_params, options=request_options, base_address=base_address, - api_mode=api_mode, ) def __repr__(self) -> str: diff --git a/stripe/_stripe_service.py b/stripe/_stripe_service.py index 218d8b39e..e72279f41 100644 --- a/stripe/_stripe_service.py +++ b/stripe/_stripe_service.py @@ -8,7 +8,6 @@ from stripe._stripe_object import StripeObject from stripe._request_options import RequestOptions from stripe._base_address import BaseAddress -from stripe._api_mode import ApiMode from typing import Any, Mapping, Optional @@ -27,7 +26,6 @@ def _request( options: Optional[RequestOptions] = None, *, base_address: BaseAddress, - api_mode: ApiMode, ) -> StripeObject: return self._requestor.request( method, @@ -35,7 +33,6 @@ def _request( params, options, base_address=base_address, - api_mode=api_mode, usage=["stripe_client"], ) @@ -47,7 +44,6 @@ async def _request_async( options: Optional[RequestOptions] = None, *, base_address: BaseAddress, - api_mode: ApiMode, ) -> StripeObject: return await self._requestor.request_async( method, @@ -55,7 +51,6 @@ async def _request_async( params, options, base_address=base_address, - api_mode=api_mode, usage=["stripe_client"], ) @@ -67,7 +62,6 @@ def _request_stream( options: Optional[RequestOptions] = None, *, base_address: BaseAddress, - api_mode: ApiMode, ) -> StripeStreamResponse: return self._requestor.request_stream( method, @@ -75,7 +69,6 @@ def _request_stream( params, options, base_address=base_address, - api_mode=api_mode, usage=["stripe_client"], ) @@ -87,7 +80,6 @@ async def _request_stream_async( options: Optional[RequestOptions] = None, *, base_address: BaseAddress, - api_mode: ApiMode, ) -> StripeStreamResponseAsync: return await self._requestor.request_stream_async( method, @@ -95,6 +87,5 @@ async def _request_stream_async( params, options, base_address=base_address, - api_mode=api_mode, usage=["stripe_client"], ) diff --git a/stripe/_subscription_item_service.py b/stripe/_subscription_item_service.py index ae5d8232e..2fea81ff9 100644 --- a/stripe/_subscription_item_service.py +++ b/stripe/_subscription_item_service.py @@ -351,7 +351,6 @@ def delete( self._request( "delete", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), - api_mode="V1", base_address="api", params=params, options=options, @@ -372,7 +371,6 @@ async def delete_async( await self._request_async( "delete", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), - api_mode="V1", base_address="api", params=params, options=options, @@ -393,7 +391,6 @@ def retrieve( self._request( "get", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), - api_mode="V1", base_address="api", params=params, options=options, @@ -414,7 +411,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), - api_mode="V1", base_address="api", params=params, options=options, @@ -435,7 +431,6 @@ def update( self._request( "post", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), - api_mode="V1", base_address="api", params=params, options=options, @@ -456,7 +451,6 @@ async def update_async( await self._request_async( "post", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), - api_mode="V1", base_address="api", params=params, options=options, @@ -476,7 +470,6 @@ def list( self._request( "get", "/v1/subscription_items", - api_mode="V1", base_address="api", params=params, options=options, @@ -496,7 +489,6 @@ async def list_async( await self._request_async( "get", "/v1/subscription_items", - api_mode="V1", base_address="api", params=params, options=options, @@ -516,7 +508,6 @@ def create( self._request( "post", "/v1/subscription_items", - api_mode="V1", base_address="api", params=params, options=options, @@ -536,7 +527,6 @@ async def create_async( await self._request_async( "post", "/v1/subscription_items", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_subscription_item_usage_record_service.py b/stripe/_subscription_item_usage_record_service.py index 85c41210d..76826d6f9 100644 --- a/stripe/_subscription_item_usage_record_service.py +++ b/stripe/_subscription_item_usage_record_service.py @@ -49,7 +49,6 @@ def create( "/v1/subscription_items/{subscription_item}/usage_records".format( subscription_item=sanitize_id(subscription_item), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -78,7 +77,6 @@ async def create_async( "/v1/subscription_items/{subscription_item}/usage_records".format( subscription_item=sanitize_id(subscription_item), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_subscription_item_usage_record_summary_service.py b/stripe/_subscription_item_usage_record_summary_service.py index 4eb3cfd31..c5e6d6543 100644 --- a/stripe/_subscription_item_usage_record_summary_service.py +++ b/stripe/_subscription_item_usage_record_summary_service.py @@ -46,7 +46,6 @@ def list( "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( subscription_item=sanitize_id(subscription_item), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -71,7 +70,6 @@ async def list_async( "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( subscription_item=sanitize_id(subscription_item), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index 48bd47bfb..4ec8d5603 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -1197,7 +1197,6 @@ def list( self._request( "get", "/v1/subscription_schedules", - api_mode="V1", base_address="api", params=params, options=options, @@ -1217,7 +1216,6 @@ async def list_async( await self._request_async( "get", "/v1/subscription_schedules", - api_mode="V1", base_address="api", params=params, options=options, @@ -1237,7 +1235,6 @@ def create( self._request( "post", "/v1/subscription_schedules", - api_mode="V1", base_address="api", params=params, options=options, @@ -1257,7 +1254,6 @@ async def create_async( await self._request_async( "post", "/v1/subscription_schedules", - api_mode="V1", base_address="api", params=params, options=options, @@ -1280,7 +1276,6 @@ def retrieve( "/v1/subscription_schedules/{schedule}".format( schedule=sanitize_id(schedule), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1303,7 +1298,6 @@ async def retrieve_async( "/v1/subscription_schedules/{schedule}".format( schedule=sanitize_id(schedule), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1326,7 +1320,6 @@ def update( "/v1/subscription_schedules/{schedule}".format( schedule=sanitize_id(schedule), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1349,7 +1342,6 @@ async def update_async( "/v1/subscription_schedules/{schedule}".format( schedule=sanitize_id(schedule), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1372,7 +1364,6 @@ def cancel( "/v1/subscription_schedules/{schedule}/cancel".format( schedule=sanitize_id(schedule), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1395,7 +1386,6 @@ async def cancel_async( "/v1/subscription_schedules/{schedule}/cancel".format( schedule=sanitize_id(schedule), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1418,7 +1408,6 @@ def release( "/v1/subscription_schedules/{schedule}/release".format( schedule=sanitize_id(schedule), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1441,7 +1430,6 @@ async def release_async( "/v1/subscription_schedules/{schedule}/release".format( schedule=sanitize_id(schedule), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 527d44d93..f183dc291 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -1656,7 +1656,6 @@ def cancel( subscription_exposed_id ), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1685,7 +1684,6 @@ async def cancel_async( subscription_exposed_id ), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1710,7 +1708,6 @@ def retrieve( subscription_exposed_id ), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1735,7 +1732,6 @@ async def retrieve_async( subscription_exposed_id ), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1780,7 +1776,6 @@ def update( subscription_exposed_id ), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1825,7 +1820,6 @@ async def update_async( subscription_exposed_id ), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1850,7 +1844,6 @@ def delete_discount( subscription_exposed_id ), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1875,7 +1868,6 @@ async def delete_discount_async( subscription_exposed_id ), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1895,7 +1887,6 @@ def list( self._request( "get", "/v1/subscriptions", - api_mode="V1", base_address="api", params=params, options=options, @@ -1915,7 +1906,6 @@ async def list_async( await self._request_async( "get", "/v1/subscriptions", - api_mode="V1", base_address="api", params=params, options=options, @@ -1941,7 +1931,6 @@ def create( self._request( "post", "/v1/subscriptions", - api_mode="V1", base_address="api", params=params, options=options, @@ -1967,7 +1956,6 @@ async def create_async( await self._request_async( "post", "/v1/subscriptions", - api_mode="V1", base_address="api", params=params, options=options, @@ -1990,7 +1978,6 @@ def search( self._request( "get", "/v1/subscriptions/search", - api_mode="V1", base_address="api", params=params, options=options, @@ -2013,7 +2000,6 @@ async def search_async( await self._request_async( "get", "/v1/subscriptions/search", - api_mode="V1", base_address="api", params=params, options=options, @@ -2036,7 +2022,6 @@ def resume( "/v1/subscriptions/{subscription}/resume".format( subscription=sanitize_id(subscription), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -2059,7 +2044,6 @@ async def resume_async( "/v1/subscriptions/{subscription}/resume".format( subscription=sanitize_id(subscription), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_tax_code_service.py b/stripe/_tax_code_service.py index 4ed661d52..dfcb9c70b 100644 --- a/stripe/_tax_code_service.py +++ b/stripe/_tax_code_service.py @@ -47,7 +47,6 @@ def list( self._request( "get", "/v1/tax_codes", - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( await self._request_async( "get", "/v1/tax_codes", - api_mode="V1", base_address="api", params=params, options=options, @@ -88,7 +86,6 @@ def retrieve( self._request( "get", "/v1/tax_codes/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -109,7 +106,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/tax_codes/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py index aa6e28c27..c2b1546df 100644 --- a/stripe/_tax_id_service.py +++ b/stripe/_tax_id_service.py @@ -175,7 +175,6 @@ def delete( self._request( "delete", "/v1/tax_ids/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -196,7 +195,6 @@ async def delete_async( await self._request_async( "delete", "/v1/tax_ids/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -217,7 +215,6 @@ def retrieve( self._request( "get", "/v1/tax_ids/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -238,7 +235,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/tax_ids/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -258,7 +254,6 @@ def list( self._request( "get", "/v1/tax_ids", - api_mode="V1", base_address="api", params=params, options=options, @@ -278,7 +273,6 @@ async def list_async( await self._request_async( "get", "/v1/tax_ids", - api_mode="V1", base_address="api", params=params, options=options, @@ -296,7 +290,6 @@ def create( self._request( "post", "/v1/tax_ids", - api_mode="V1", base_address="api", params=params, options=options, @@ -314,7 +307,6 @@ async def create_async( await self._request_async( "post", "/v1/tax_ids", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_tax_rate_service.py b/stripe/_tax_rate_service.py index ffcc6d5ef..61399dec6 100644 --- a/stripe/_tax_rate_service.py +++ b/stripe/_tax_rate_service.py @@ -191,7 +191,6 @@ def list( self._request( "get", "/v1/tax_rates", - api_mode="V1", base_address="api", params=params, options=options, @@ -211,7 +210,6 @@ async def list_async( await self._request_async( "get", "/v1/tax_rates", - api_mode="V1", base_address="api", params=params, options=options, @@ -231,7 +229,6 @@ def create( self._request( "post", "/v1/tax_rates", - api_mode="V1", base_address="api", params=params, options=options, @@ -251,7 +248,6 @@ async def create_async( await self._request_async( "post", "/v1/tax_rates", - api_mode="V1", base_address="api", params=params, options=options, @@ -274,7 +270,6 @@ def retrieve( "/v1/tax_rates/{tax_rate}".format( tax_rate=sanitize_id(tax_rate), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -297,7 +292,6 @@ async def retrieve_async( "/v1/tax_rates/{tax_rate}".format( tax_rate=sanitize_id(tax_rate), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -320,7 +314,6 @@ def update( "/v1/tax_rates/{tax_rate}".format( tax_rate=sanitize_id(tax_rate), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -343,7 +336,6 @@ async def update_async( "/v1/tax_rates/{tax_rate}".format( tax_rate=sanitize_id(tax_rate), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 422b953dd..9fe918393 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -1059,7 +1059,6 @@ def retrieve( self._request( "get", "/v1/tokens/{token}".format(token=sanitize_id(token)), - api_mode="V1", base_address="api", params=params, options=options, @@ -1080,7 +1079,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/tokens/{token}".format(token=sanitize_id(token)), - api_mode="V1", base_address="api", params=params, options=options, @@ -1101,7 +1099,6 @@ def create( self._request( "post", "/v1/tokens", - api_mode="V1", base_address="api", params=params, options=options, @@ -1122,7 +1119,6 @@ async def create_async( await self._request_async( "post", "/v1/tokens", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_topup_service.py b/stripe/_topup_service.py index eeeeae7d9..db18e82a7 100644 --- a/stripe/_topup_service.py +++ b/stripe/_topup_service.py @@ -151,7 +151,6 @@ def list( self._request( "get", "/v1/topups", - api_mode="V1", base_address="api", params=params, options=options, @@ -171,7 +170,6 @@ async def list_async( await self._request_async( "get", "/v1/topups", - api_mode="V1", base_address="api", params=params, options=options, @@ -189,7 +187,6 @@ def create( self._request( "post", "/v1/topups", - api_mode="V1", base_address="api", params=params, options=options, @@ -207,7 +204,6 @@ async def create_async( await self._request_async( "post", "/v1/topups", - api_mode="V1", base_address="api", params=params, options=options, @@ -228,7 +224,6 @@ def retrieve( self._request( "get", "/v1/topups/{topup}".format(topup=sanitize_id(topup)), - api_mode="V1", base_address="api", params=params, options=options, @@ -249,7 +244,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/topups/{topup}".format(topup=sanitize_id(topup)), - api_mode="V1", base_address="api", params=params, options=options, @@ -270,7 +264,6 @@ def update( self._request( "post", "/v1/topups/{topup}".format(topup=sanitize_id(topup)), - api_mode="V1", base_address="api", params=params, options=options, @@ -291,7 +284,6 @@ async def update_async( await self._request_async( "post", "/v1/topups/{topup}".format(topup=sanitize_id(topup)), - api_mode="V1", base_address="api", params=params, options=options, @@ -312,7 +304,6 @@ def cancel( self._request( "post", "/v1/topups/{topup}/cancel".format(topup=sanitize_id(topup)), - api_mode="V1", base_address="api", params=params, options=options, @@ -333,7 +324,6 @@ async def cancel_async( await self._request_async( "post", "/v1/topups/{topup}/cancel".format(topup=sanitize_id(topup)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_transfer_reversal_service.py b/stripe/_transfer_reversal_service.py index 4d083ce14..8b707162d 100644 --- a/stripe/_transfer_reversal_service.py +++ b/stripe/_transfer_reversal_service.py @@ -80,7 +80,6 @@ def list( self._request( "get", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -101,7 +100,6 @@ async def list_async( await self._request_async( "get", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -126,7 +124,6 @@ def create( self._request( "post", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -151,7 +148,6 @@ async def create_async( await self._request_async( "post", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -176,7 +172,6 @@ def retrieve( transfer=sanitize_id(transfer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -201,7 +196,6 @@ async def retrieve_async( transfer=sanitize_id(transfer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -228,7 +222,6 @@ def update( transfer=sanitize_id(transfer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -255,7 +248,6 @@ async def update_async( transfer=sanitize_id(transfer), id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_transfer_service.py b/stripe/_transfer_service.py index df63bcd02..cdf6436c8 100644 --- a/stripe/_transfer_service.py +++ b/stripe/_transfer_service.py @@ -134,7 +134,6 @@ def list( self._request( "get", "/v1/transfers", - api_mode="V1", base_address="api", params=params, options=options, @@ -154,7 +153,6 @@ async def list_async( await self._request_async( "get", "/v1/transfers", - api_mode="V1", base_address="api", params=params, options=options, @@ -174,7 +172,6 @@ def create( self._request( "post", "/v1/transfers", - api_mode="V1", base_address="api", params=params, options=options, @@ -194,7 +191,6 @@ async def create_async( await self._request_async( "post", "/v1/transfers", - api_mode="V1", base_address="api", params=params, options=options, @@ -217,7 +213,6 @@ def retrieve( "/v1/transfers/{transfer}".format( transfer=sanitize_id(transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -240,7 +235,6 @@ async def retrieve_async( "/v1/transfers/{transfer}".format( transfer=sanitize_id(transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -265,7 +259,6 @@ def update( "/v1/transfers/{transfer}".format( transfer=sanitize_id(transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -290,7 +283,6 @@ async def update_async( "/v1/transfers/{transfer}".format( transfer=sanitize_id(transfer), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/_usage_record.py b/stripe/_usage_record.py index fdd9cebd4..a53744404 100644 --- a/stripe/_usage_record.py +++ b/stripe/_usage_record.py @@ -54,5 +54,4 @@ def create(cls, **params): url, params=params, base_address="api", - api_mode="V1", ) diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 0fc6698fc..2acb57b8c 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -698,7 +698,6 @@ def delete( "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -721,7 +720,6 @@ async def delete_async( "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -744,7 +742,6 @@ def retrieve( "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -767,7 +764,6 @@ async def retrieve_async( "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -790,7 +786,6 @@ def update( "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -813,7 +808,6 @@ async def update_async( "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -833,7 +827,6 @@ def list( self._request( "get", "/v1/webhook_endpoints", - api_mode="V1", base_address="api", params=params, options=options, @@ -853,7 +846,6 @@ async def list_async( await self._request_async( "get", "/v1/webhook_endpoints", - api_mode="V1", base_address="api", params=params, options=options, @@ -873,7 +865,6 @@ def create( self._request( "post", "/v1/webhook_endpoints", - api_mode="V1", base_address="api", params=params, options=options, @@ -893,7 +884,6 @@ async def create_async( await self._request_async( "post", "/v1/webhook_endpoints", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/apps/_secret_service.py b/stripe/apps/_secret_service.py index cdc3b0648..5bfc13786 100644 --- a/stripe/apps/_secret_service.py +++ b/stripe/apps/_secret_service.py @@ -132,7 +132,6 @@ def list( self._request( "get", "/v1/apps/secrets", - api_mode="V1", base_address="api", params=params, options=options, @@ -150,7 +149,6 @@ async def list_async( await self._request_async( "get", "/v1/apps/secrets", - api_mode="V1", base_address="api", params=params, options=options, @@ -170,7 +168,6 @@ def create( self._request( "post", "/v1/apps/secrets", - api_mode="V1", base_address="api", params=params, options=options, @@ -190,7 +187,6 @@ async def create_async( await self._request_async( "post", "/v1/apps/secrets", - api_mode="V1", base_address="api", params=params, options=options, @@ -208,7 +204,6 @@ def find( self._request( "get", "/v1/apps/secrets/find", - api_mode="V1", base_address="api", params=params, options=options, @@ -226,7 +221,6 @@ async def find_async( await self._request_async( "get", "/v1/apps/secrets/find", - api_mode="V1", base_address="api", params=params, options=options, @@ -246,7 +240,6 @@ def delete_where( self._request( "post", "/v1/apps/secrets/delete", - api_mode="V1", base_address="api", params=params, options=options, @@ -266,7 +259,6 @@ async def delete_where_async( await self._request_async( "post", "/v1/apps/secrets/delete", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/billing/_alert_service.py b/stripe/billing/_alert_service.py index b3952ac19..31bda7bdb 100644 --- a/stripe/billing/_alert_service.py +++ b/stripe/billing/_alert_service.py @@ -117,7 +117,6 @@ def list( self._request( "get", "/v1/billing/alerts", - api_mode="V1", base_address="api", params=params, options=options, @@ -137,7 +136,6 @@ async def list_async( await self._request_async( "get", "/v1/billing/alerts", - api_mode="V1", base_address="api", params=params, options=options, @@ -155,7 +153,6 @@ def create( self._request( "post", "/v1/billing/alerts", - api_mode="V1", base_address="api", params=params, options=options, @@ -173,7 +170,6 @@ async def create_async( await self._request_async( "post", "/v1/billing/alerts", - api_mode="V1", base_address="api", params=params, options=options, @@ -194,7 +190,6 @@ def retrieve( self._request( "get", "/v1/billing/alerts/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -215,7 +210,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/billing/alerts/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -236,7 +230,6 @@ def activate( self._request( "post", "/v1/billing/alerts/{id}/activate".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -257,7 +250,6 @@ async def activate_async( await self._request_async( "post", "/v1/billing/alerts/{id}/activate".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -278,7 +270,6 @@ def archive( self._request( "post", "/v1/billing/alerts/{id}/archive".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -299,7 +290,6 @@ async def archive_async( await self._request_async( "post", "/v1/billing/alerts/{id}/archive".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -322,7 +312,6 @@ def deactivate( "/v1/billing/alerts/{id}/deactivate".format( id=sanitize_id(id) ), - api_mode="V1", base_address="api", params=params, options=options, @@ -345,7 +334,6 @@ async def deactivate_async( "/v1/billing/alerts/{id}/deactivate".format( id=sanitize_id(id) ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/billing/_meter_event_adjustment_service.py b/stripe/billing/_meter_event_adjustment_service.py index 038c74cc6..383b4a764 100644 --- a/stripe/billing/_meter_event_adjustment_service.py +++ b/stripe/billing/_meter_event_adjustment_service.py @@ -45,7 +45,6 @@ def create( self._request( "post", "/v1/billing/meter_event_adjustments", - api_mode="V1", base_address="api", params=params, options=options, @@ -65,7 +64,6 @@ async def create_async( await self._request_async( "post", "/v1/billing/meter_event_adjustments", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/billing/_meter_event_service.py b/stripe/billing/_meter_event_service.py index a8ad2beba..53214b534 100644 --- a/stripe/billing/_meter_event_service.py +++ b/stripe/billing/_meter_event_service.py @@ -43,7 +43,6 @@ def create( self._request( "post", "/v1/billing/meter_events", - api_mode="V1", base_address="api", params=params, options=options, @@ -63,7 +62,6 @@ async def create_async( await self._request_async( "post", "/v1/billing/meter_events", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/billing/_meter_event_summary_service.py b/stripe/billing/_meter_event_summary_service.py index 9f61f603a..dbfe8d46a 100644 --- a/stripe/billing/_meter_event_summary_service.py +++ b/stripe/billing/_meter_event_summary_service.py @@ -60,7 +60,6 @@ def list( "/v1/billing/meters/{id}/event_summaries".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -83,7 +82,6 @@ async def list_async( "/v1/billing/meters/{id}/event_summaries".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/billing/_meter_service.py b/stripe/billing/_meter_service.py index a2e78e36a..aed7176e0 100644 --- a/stripe/billing/_meter_service.py +++ b/stripe/billing/_meter_service.py @@ -134,7 +134,6 @@ def list( self._request( "get", "/v1/billing/meters", - api_mode="V1", base_address="api", params=params, options=options, @@ -154,7 +153,6 @@ async def list_async( await self._request_async( "get", "/v1/billing/meters", - api_mode="V1", base_address="api", params=params, options=options, @@ -172,7 +170,6 @@ def create( self._request( "post", "/v1/billing/meters", - api_mode="V1", base_address="api", params=params, options=options, @@ -190,7 +187,6 @@ async def create_async( await self._request_async( "post", "/v1/billing/meters", - api_mode="V1", base_address="api", params=params, options=options, @@ -211,7 +207,6 @@ def retrieve( self._request( "get", "/v1/billing/meters/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -232,7 +227,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/billing/meters/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -253,7 +247,6 @@ def update( self._request( "post", "/v1/billing/meters/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -274,7 +267,6 @@ async def update_async( await self._request_async( "post", "/v1/billing/meters/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -297,7 +289,6 @@ def deactivate( "/v1/billing/meters/{id}/deactivate".format( id=sanitize_id(id) ), - api_mode="V1", base_address="api", params=params, options=options, @@ -320,7 +311,6 @@ async def deactivate_async( "/v1/billing/meters/{id}/deactivate".format( id=sanitize_id(id) ), - api_mode="V1", base_address="api", params=params, options=options, @@ -343,7 +333,6 @@ def reactivate( "/v1/billing/meters/{id}/reactivate".format( id=sanitize_id(id) ), - api_mode="V1", base_address="api", params=params, options=options, @@ -366,7 +355,6 @@ async def reactivate_async( "/v1/billing/meters/{id}/reactivate".format( id=sanitize_id(id) ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/billing_portal/_configuration_service.py b/stripe/billing_portal/_configuration_service.py index 6ccf99723..7cbc97444 100644 --- a/stripe/billing_portal/_configuration_service.py +++ b/stripe/billing_portal/_configuration_service.py @@ -418,7 +418,6 @@ def list( self._request( "get", "/v1/billing_portal/configurations", - api_mode="V1", base_address="api", params=params, options=options, @@ -438,7 +437,6 @@ async def list_async( await self._request_async( "get", "/v1/billing_portal/configurations", - api_mode="V1", base_address="api", params=params, options=options, @@ -458,7 +456,6 @@ def create( self._request( "post", "/v1/billing_portal/configurations", - api_mode="V1", base_address="api", params=params, options=options, @@ -478,7 +475,6 @@ async def create_async( await self._request_async( "post", "/v1/billing_portal/configurations", - api_mode="V1", base_address="api", params=params, options=options, @@ -501,7 +497,6 @@ def retrieve( "/v1/billing_portal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -524,7 +519,6 @@ async def retrieve_async( "/v1/billing_portal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -547,7 +541,6 @@ def update( "/v1/billing_portal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -570,7 +563,6 @@ async def update_async( "/v1/billing_portal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/billing_portal/_session_service.py b/stripe/billing_portal/_session_service.py index d34247ae0..d06d54667 100644 --- a/stripe/billing_portal/_session_service.py +++ b/stripe/billing_portal/_session_service.py @@ -246,7 +246,6 @@ def create( self._request( "post", "/v1/billing_portal/sessions", - api_mode="V1", base_address="api", params=params, options=options, @@ -266,7 +265,6 @@ async def create_async( await self._request_async( "post", "/v1/billing_portal/sessions", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/checkout/_session_line_item_service.py b/stripe/checkout/_session_line_item_service.py index dc7317d12..133e884b2 100644 --- a/stripe/checkout/_session_line_item_service.py +++ b/stripe/checkout/_session_line_item_service.py @@ -44,7 +44,6 @@ def list( "/v1/checkout/sessions/{session}/line_items".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( "/v1/checkout/sessions/{session}/line_items".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 59750df82..10c03dcb6 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -2343,7 +2343,6 @@ def list( self._request( "get", "/v1/checkout/sessions", - api_mode="V1", base_address="api", params=params, options=options, @@ -2363,7 +2362,6 @@ async def list_async( await self._request_async( "get", "/v1/checkout/sessions", - api_mode="V1", base_address="api", params=params, options=options, @@ -2383,7 +2381,6 @@ def create( self._request( "post", "/v1/checkout/sessions", - api_mode="V1", base_address="api", params=params, options=options, @@ -2403,7 +2400,6 @@ async def create_async( await self._request_async( "post", "/v1/checkout/sessions", - api_mode="V1", base_address="api", params=params, options=options, @@ -2426,7 +2422,6 @@ def retrieve( "/v1/checkout/sessions/{session}".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -2449,7 +2444,6 @@ async def retrieve_async( "/v1/checkout/sessions/{session}".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -2472,7 +2466,6 @@ def update( "/v1/checkout/sessions/{session}".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -2495,7 +2488,6 @@ async def update_async( "/v1/checkout/sessions/{session}".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -2520,7 +2512,6 @@ def expire( "/v1/checkout/sessions/{session}/expire".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -2545,7 +2536,6 @@ async def expire_async( "/v1/checkout/sessions/{session}/expire".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/climate/_order_service.py b/stripe/climate/_order_service.py index 0df6d6ef3..0c89ff260 100644 --- a/stripe/climate/_order_service.py +++ b/stripe/climate/_order_service.py @@ -112,7 +112,6 @@ def list( self._request( "get", "/v1/climate/orders", - api_mode="V1", base_address="api", params=params, options=options, @@ -133,7 +132,6 @@ async def list_async( await self._request_async( "get", "/v1/climate/orders", - api_mode="V1", base_address="api", params=params, options=options, @@ -152,7 +150,6 @@ def create( self._request( "post", "/v1/climate/orders", - api_mode="V1", base_address="api", params=params, options=options, @@ -171,7 +168,6 @@ async def create_async( await self._request_async( "post", "/v1/climate/orders", - api_mode="V1", base_address="api", params=params, options=options, @@ -192,7 +188,6 @@ def retrieve( self._request( "get", "/v1/climate/orders/{order}".format(order=sanitize_id(order)), - api_mode="V1", base_address="api", params=params, options=options, @@ -213,7 +208,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/climate/orders/{order}".format(order=sanitize_id(order)), - api_mode="V1", base_address="api", params=params, options=options, @@ -234,7 +228,6 @@ def update( self._request( "post", "/v1/climate/orders/{order}".format(order=sanitize_id(order)), - api_mode="V1", base_address="api", params=params, options=options, @@ -255,7 +248,6 @@ async def update_async( await self._request_async( "post", "/v1/climate/orders/{order}".format(order=sanitize_id(order)), - api_mode="V1", base_address="api", params=params, options=options, @@ -281,7 +273,6 @@ def cancel( "/v1/climate/orders/{order}/cancel".format( order=sanitize_id(order), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -307,7 +298,6 @@ async def cancel_async( "/v1/climate/orders/{order}/cancel".format( order=sanitize_id(order), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/climate/_product_service.py b/stripe/climate/_product_service.py index b0c4d230d..feed57549 100644 --- a/stripe/climate/_product_service.py +++ b/stripe/climate/_product_service.py @@ -47,7 +47,6 @@ def list( self._request( "get", "/v1/climate/products", - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( await self._request_async( "get", "/v1/climate/products", - api_mode="V1", base_address="api", params=params, options=options, @@ -90,7 +88,6 @@ def retrieve( "/v1/climate/products/{product}".format( product=sanitize_id(product), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -113,7 +110,6 @@ async def retrieve_async( "/v1/climate/products/{product}".format( product=sanitize_id(product), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/climate/_supplier_service.py b/stripe/climate/_supplier_service.py index 6f4bf0b17..168e2221c 100644 --- a/stripe/climate/_supplier_service.py +++ b/stripe/climate/_supplier_service.py @@ -47,7 +47,6 @@ def list( self._request( "get", "/v1/climate/suppliers", - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( await self._request_async( "get", "/v1/climate/suppliers", - api_mode="V1", base_address="api", params=params, options=options, @@ -90,7 +88,6 @@ def retrieve( "/v1/climate/suppliers/{supplier}".format( supplier=sanitize_id(supplier), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -113,7 +110,6 @@ async def retrieve_async( "/v1/climate/suppliers/{supplier}".format( supplier=sanitize_id(supplier), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/entitlements/_active_entitlement_service.py b/stripe/entitlements/_active_entitlement_service.py index 862b41a6d..fedfb6111 100644 --- a/stripe/entitlements/_active_entitlement_service.py +++ b/stripe/entitlements/_active_entitlement_service.py @@ -51,7 +51,6 @@ def list( self._request( "get", "/v1/entitlements/active_entitlements", - api_mode="V1", base_address="api", params=params, options=options, @@ -71,7 +70,6 @@ async def list_async( await self._request_async( "get", "/v1/entitlements/active_entitlements", - api_mode="V1", base_address="api", params=params, options=options, @@ -94,7 +92,6 @@ def retrieve( "/v1/entitlements/active_entitlements/{id}".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -117,7 +114,6 @@ async def retrieve_async( "/v1/entitlements/active_entitlements/{id}".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/entitlements/_feature_service.py b/stripe/entitlements/_feature_service.py index dea34b0f2..b6e952283 100644 --- a/stripe/entitlements/_feature_service.py +++ b/stripe/entitlements/_feature_service.py @@ -91,7 +91,6 @@ def list( self._request( "get", "/v1/entitlements/features", - api_mode="V1", base_address="api", params=params, options=options, @@ -111,7 +110,6 @@ async def list_async( await self._request_async( "get", "/v1/entitlements/features", - api_mode="V1", base_address="api", params=params, options=options, @@ -131,7 +129,6 @@ def create( self._request( "post", "/v1/entitlements/features", - api_mode="V1", base_address="api", params=params, options=options, @@ -151,7 +148,6 @@ async def create_async( await self._request_async( "post", "/v1/entitlements/features", - api_mode="V1", base_address="api", params=params, options=options, @@ -172,7 +168,6 @@ def retrieve( self._request( "get", "/v1/entitlements/features/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -193,7 +188,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/entitlements/features/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -214,7 +208,6 @@ def update( self._request( "post", "/v1/entitlements/features/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -235,7 +228,6 @@ async def update_async( await self._request_async( "post", "/v1/entitlements/features/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/financial_connections/_account_owner_service.py b/stripe/financial_connections/_account_owner_service.py index 43422e8c8..8369b750c 100644 --- a/stripe/financial_connections/_account_owner_service.py +++ b/stripe/financial_connections/_account_owner_service.py @@ -48,7 +48,6 @@ def list( "/v1/financial_connections/accounts/{account}/owners".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -71,7 +70,6 @@ async def list_async( "/v1/financial_connections/accounts/{account}/owners".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/financial_connections/_account_service.py b/stripe/financial_connections/_account_service.py index 6ab7ac485..18fcd6dd6 100644 --- a/stripe/financial_connections/_account_service.py +++ b/stripe/financial_connections/_account_service.py @@ -108,7 +108,6 @@ def list( self._request( "get", "/v1/financial_connections/accounts", - api_mode="V1", base_address="api", params=params, options=options, @@ -128,7 +127,6 @@ async def list_async( await self._request_async( "get", "/v1/financial_connections/accounts", - api_mode="V1", base_address="api", params=params, options=options, @@ -151,7 +149,6 @@ def retrieve( "/v1/financial_connections/accounts/{account}".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -174,7 +171,6 @@ async def retrieve_async( "/v1/financial_connections/accounts/{account}".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -197,7 +193,6 @@ def disconnect( "/v1/financial_connections/accounts/{account}/disconnect".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -220,7 +215,6 @@ async def disconnect_async( "/v1/financial_connections/accounts/{account}/disconnect".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -243,7 +237,6 @@ def refresh( "/v1/financial_connections/accounts/{account}/refresh".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -266,7 +259,6 @@ async def refresh_async( "/v1/financial_connections/accounts/{account}/refresh".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -289,7 +281,6 @@ def subscribe( "/v1/financial_connections/accounts/{account}/subscribe".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -312,7 +303,6 @@ async def subscribe_async( "/v1/financial_connections/accounts/{account}/subscribe".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -335,7 +325,6 @@ def unsubscribe( "/v1/financial_connections/accounts/{account}/unsubscribe".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -358,7 +347,6 @@ async def unsubscribe_async( "/v1/financial_connections/accounts/{account}/unsubscribe".format( account=sanitize_id(account), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/financial_connections/_session_service.py b/stripe/financial_connections/_session_service.py index 3ca67b8bf..9295cb25f 100644 --- a/stripe/financial_connections/_session_service.py +++ b/stripe/financial_connections/_session_service.py @@ -97,7 +97,6 @@ def retrieve( "/v1/financial_connections/sessions/{session}".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -120,7 +119,6 @@ async def retrieve_async( "/v1/financial_connections/sessions/{session}".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -140,7 +138,6 @@ def create( self._request( "post", "/v1/financial_connections/sessions", - api_mode="V1", base_address="api", params=params, options=options, @@ -160,7 +157,6 @@ async def create_async( await self._request_async( "post", "/v1/financial_connections/sessions", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/financial_connections/_transaction_service.py b/stripe/financial_connections/_transaction_service.py index 362ea579a..66683ae29 100644 --- a/stripe/financial_connections/_transaction_service.py +++ b/stripe/financial_connections/_transaction_service.py @@ -87,7 +87,6 @@ def list( self._request( "get", "/v1/financial_connections/transactions", - api_mode="V1", base_address="api", params=params, options=options, @@ -107,7 +106,6 @@ async def list_async( await self._request_async( "get", "/v1/financial_connections/transactions", - api_mode="V1", base_address="api", params=params, options=options, @@ -130,7 +128,6 @@ def retrieve( "/v1/financial_connections/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -153,7 +150,6 @@ async def retrieve_async( "/v1/financial_connections/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/forwarding/_request_service.py b/stripe/forwarding/_request_service.py index d8e1dffc5..b9049a234 100644 --- a/stripe/forwarding/_request_service.py +++ b/stripe/forwarding/_request_service.py @@ -115,7 +115,6 @@ def list( self._request( "get", "/v1/forwarding/requests", - api_mode="V1", base_address="api", params=params, options=options, @@ -135,7 +134,6 @@ async def list_async( await self._request_async( "get", "/v1/forwarding/requests", - api_mode="V1", base_address="api", params=params, options=options, @@ -155,7 +153,6 @@ def create( self._request( "post", "/v1/forwarding/requests", - api_mode="V1", base_address="api", params=params, options=options, @@ -175,7 +172,6 @@ async def create_async( await self._request_async( "post", "/v1/forwarding/requests", - api_mode="V1", base_address="api", params=params, options=options, @@ -196,7 +192,6 @@ def retrieve( self._request( "get", "/v1/forwarding/requests/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -217,7 +212,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/forwarding/requests/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/identity/_verification_report_service.py b/stripe/identity/_verification_report_service.py index 7554c54e0..95cbb8319 100644 --- a/stripe/identity/_verification_report_service.py +++ b/stripe/identity/_verification_report_service.py @@ -81,7 +81,6 @@ def list( self._request( "get", "/v1/identity/verification_reports", - api_mode="V1", base_address="api", params=params, options=options, @@ -101,7 +100,6 @@ async def list_async( await self._request_async( "get", "/v1/identity/verification_reports", - api_mode="V1", base_address="api", params=params, options=options, @@ -124,7 +122,6 @@ def retrieve( "/v1/identity/verification_reports/{report}".format( report=sanitize_id(report), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -147,7 +144,6 @@ async def retrieve_async( "/v1/identity/verification_reports/{report}".format( report=sanitize_id(report), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index 7cbe57bd0..341b795d6 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -234,7 +234,6 @@ def list( self._request( "get", "/v1/identity/verification_sessions", - api_mode="V1", base_address="api", params=params, options=options, @@ -254,7 +253,6 @@ async def list_async( await self._request_async( "get", "/v1/identity/verification_sessions", - api_mode="V1", base_address="api", params=params, options=options, @@ -280,7 +278,6 @@ def create( self._request( "post", "/v1/identity/verification_sessions", - api_mode="V1", base_address="api", params=params, options=options, @@ -306,7 +303,6 @@ async def create_async( await self._request_async( "post", "/v1/identity/verification_sessions", - api_mode="V1", base_address="api", params=params, options=options, @@ -332,7 +328,6 @@ def retrieve( "/v1/identity/verification_sessions/{session}".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -358,7 +353,6 @@ async def retrieve_async( "/v1/identity/verification_sessions/{session}".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -384,7 +378,6 @@ def update( "/v1/identity/verification_sessions/{session}".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -410,7 +403,6 @@ async def update_async( "/v1/identity/verification_sessions/{session}".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -435,7 +427,6 @@ def cancel( "/v1/identity/verification_sessions/{session}/cancel".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -460,7 +451,6 @@ async def cancel_async( "/v1/identity/verification_sessions/{session}/cancel".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -501,7 +491,6 @@ def redact( "/v1/identity/verification_sessions/{session}/redact".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -542,7 +531,6 @@ async def redact_async( "/v1/identity/verification_sessions/{session}/redact".format( session=sanitize_id(session), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/issuing/_authorization_service.py b/stripe/issuing/_authorization_service.py index 20118487b..ad1c339c4 100644 --- a/stripe/issuing/_authorization_service.py +++ b/stripe/issuing/_authorization_service.py @@ -115,7 +115,6 @@ def list( self._request( "get", "/v1/issuing/authorizations", - api_mode="V1", base_address="api", params=params, options=options, @@ -135,7 +134,6 @@ async def list_async( await self._request_async( "get", "/v1/issuing/authorizations", - api_mode="V1", base_address="api", params=params, options=options, @@ -158,7 +156,6 @@ def retrieve( "/v1/issuing/authorizations/{authorization}".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -181,7 +178,6 @@ async def retrieve_async( "/v1/issuing/authorizations/{authorization}".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -204,7 +200,6 @@ def update( "/v1/issuing/authorizations/{authorization}".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -227,7 +222,6 @@ async def update_async( "/v1/issuing/authorizations/{authorization}".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -251,7 +245,6 @@ def approve( "/v1/issuing/authorizations/{authorization}/approve".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -275,7 +268,6 @@ async def approve_async( "/v1/issuing/authorizations/{authorization}/approve".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -299,7 +291,6 @@ def decline( "/v1/issuing/authorizations/{authorization}/decline".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -323,7 +314,6 @@ async def decline_async( "/v1/issuing/authorizations/{authorization}/decline".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/issuing/_card_service.py b/stripe/issuing/_card_service.py index d4b46520d..3a0dcb9ff 100644 --- a/stripe/issuing/_card_service.py +++ b/stripe/issuing/_card_service.py @@ -2240,7 +2240,6 @@ def list( self._request( "get", "/v1/issuing/cards", - api_mode="V1", base_address="api", params=params, options=options, @@ -2260,7 +2259,6 @@ async def list_async( await self._request_async( "get", "/v1/issuing/cards", - api_mode="V1", base_address="api", params=params, options=options, @@ -2278,7 +2276,6 @@ def create( self._request( "post", "/v1/issuing/cards", - api_mode="V1", base_address="api", params=params, options=options, @@ -2296,7 +2293,6 @@ async def create_async( await self._request_async( "post", "/v1/issuing/cards", - api_mode="V1", base_address="api", params=params, options=options, @@ -2317,7 +2313,6 @@ def retrieve( self._request( "get", "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), - api_mode="V1", base_address="api", params=params, options=options, @@ -2338,7 +2333,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), - api_mode="V1", base_address="api", params=params, options=options, @@ -2359,7 +2353,6 @@ def update( self._request( "post", "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), - api_mode="V1", base_address="api", params=params, options=options, @@ -2380,7 +2373,6 @@ async def update_async( await self._request_async( "post", "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/issuing/_cardholder_service.py b/stripe/issuing/_cardholder_service.py index 02edd720b..34f4c468d 100644 --- a/stripe/issuing/_cardholder_service.py +++ b/stripe/issuing/_cardholder_service.py @@ -2321,7 +2321,6 @@ def list( self._request( "get", "/v1/issuing/cardholders", - api_mode="V1", base_address="api", params=params, options=options, @@ -2341,7 +2340,6 @@ async def list_async( await self._request_async( "get", "/v1/issuing/cardholders", - api_mode="V1", base_address="api", params=params, options=options, @@ -2361,7 +2359,6 @@ def create( self._request( "post", "/v1/issuing/cardholders", - api_mode="V1", base_address="api", params=params, options=options, @@ -2381,7 +2378,6 @@ async def create_async( await self._request_async( "post", "/v1/issuing/cardholders", - api_mode="V1", base_address="api", params=params, options=options, @@ -2404,7 +2400,6 @@ def retrieve( "/v1/issuing/cardholders/{cardholder}".format( cardholder=sanitize_id(cardholder), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -2427,7 +2422,6 @@ async def retrieve_async( "/v1/issuing/cardholders/{cardholder}".format( cardholder=sanitize_id(cardholder), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -2450,7 +2444,6 @@ def update( "/v1/issuing/cardholders/{cardholder}".format( cardholder=sanitize_id(cardholder), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -2473,7 +2466,6 @@ async def update_async( "/v1/issuing/cardholders/{cardholder}".format( cardholder=sanitize_id(cardholder), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/issuing/_dispute_service.py b/stripe/issuing/_dispute_service.py index 66492a871..fc7347bf0 100644 --- a/stripe/issuing/_dispute_service.py +++ b/stripe/issuing/_dispute_service.py @@ -641,7 +641,6 @@ def list( self._request( "get", "/v1/issuing/disputes", - api_mode="V1", base_address="api", params=params, options=options, @@ -661,7 +660,6 @@ async def list_async( await self._request_async( "get", "/v1/issuing/disputes", - api_mode="V1", base_address="api", params=params, options=options, @@ -681,7 +679,6 @@ def create( self._request( "post", "/v1/issuing/disputes", - api_mode="V1", base_address="api", params=params, options=options, @@ -701,7 +698,6 @@ async def create_async( await self._request_async( "post", "/v1/issuing/disputes", - api_mode="V1", base_address="api", params=params, options=options, @@ -724,7 +720,6 @@ def retrieve( "/v1/issuing/disputes/{dispute}".format( dispute=sanitize_id(dispute), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -747,7 +742,6 @@ async def retrieve_async( "/v1/issuing/disputes/{dispute}".format( dispute=sanitize_id(dispute), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -770,7 +764,6 @@ def update( "/v1/issuing/disputes/{dispute}".format( dispute=sanitize_id(dispute), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -793,7 +786,6 @@ async def update_async( "/v1/issuing/disputes/{dispute}".format( dispute=sanitize_id(dispute), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -816,7 +808,6 @@ def submit( "/v1/issuing/disputes/{dispute}/submit".format( dispute=sanitize_id(dispute), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -839,7 +830,6 @@ async def submit_async( "/v1/issuing/disputes/{dispute}/submit".format( dispute=sanitize_id(dispute), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/issuing/_personalization_design_service.py b/stripe/issuing/_personalization_design_service.py index 259746c88..a32c09090 100644 --- a/stripe/issuing/_personalization_design_service.py +++ b/stripe/issuing/_personalization_design_service.py @@ -205,7 +205,6 @@ def list( self._request( "get", "/v1/issuing/personalization_designs", - api_mode="V1", base_address="api", params=params, options=options, @@ -225,7 +224,6 @@ async def list_async( await self._request_async( "get", "/v1/issuing/personalization_designs", - api_mode="V1", base_address="api", params=params, options=options, @@ -245,7 +243,6 @@ def create( self._request( "post", "/v1/issuing/personalization_designs", - api_mode="V1", base_address="api", params=params, options=options, @@ -265,7 +262,6 @@ async def create_async( await self._request_async( "post", "/v1/issuing/personalization_designs", - api_mode="V1", base_address="api", params=params, options=options, @@ -288,7 +284,6 @@ def retrieve( "/v1/issuing/personalization_designs/{personalization_design}".format( personalization_design=sanitize_id(personalization_design), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -311,7 +306,6 @@ async def retrieve_async( "/v1/issuing/personalization_designs/{personalization_design}".format( personalization_design=sanitize_id(personalization_design), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -334,7 +328,6 @@ def update( "/v1/issuing/personalization_designs/{personalization_design}".format( personalization_design=sanitize_id(personalization_design), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -357,7 +350,6 @@ async def update_async( "/v1/issuing/personalization_designs/{personalization_design}".format( personalization_design=sanitize_id(personalization_design), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/issuing/_physical_bundle_service.py b/stripe/issuing/_physical_bundle_service.py index 39722924d..3c9f367ae 100644 --- a/stripe/issuing/_physical_bundle_service.py +++ b/stripe/issuing/_physical_bundle_service.py @@ -55,7 +55,6 @@ def list( self._request( "get", "/v1/issuing/physical_bundles", - api_mode="V1", base_address="api", params=params, options=options, @@ -75,7 +74,6 @@ async def list_async( await self._request_async( "get", "/v1/issuing/physical_bundles", - api_mode="V1", base_address="api", params=params, options=options, @@ -98,7 +96,6 @@ def retrieve( "/v1/issuing/physical_bundles/{physical_bundle}".format( physical_bundle=sanitize_id(physical_bundle), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -121,7 +118,6 @@ async def retrieve_async( "/v1/issuing/physical_bundles/{physical_bundle}".format( physical_bundle=sanitize_id(physical_bundle), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/issuing/_token_service.py b/stripe/issuing/_token_service.py index 6a6b99d20..9bb20e872 100644 --- a/stripe/issuing/_token_service.py +++ b/stripe/issuing/_token_service.py @@ -87,7 +87,6 @@ def list( self._request( "get", "/v1/issuing/tokens", - api_mode="V1", base_address="api", params=params, options=options, @@ -105,7 +104,6 @@ async def list_async( await self._request_async( "get", "/v1/issuing/tokens", - api_mode="V1", base_address="api", params=params, options=options, @@ -126,7 +124,6 @@ def retrieve( self._request( "get", "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), - api_mode="V1", base_address="api", params=params, options=options, @@ -147,7 +144,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), - api_mode="V1", base_address="api", params=params, options=options, @@ -168,7 +164,6 @@ def update( self._request( "post", "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), - api_mode="V1", base_address="api", params=params, options=options, @@ -189,7 +184,6 @@ async def update_async( await self._request_async( "post", "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/issuing/_transaction_service.py b/stripe/issuing/_transaction_service.py index 178c73832..f61d4622a 100644 --- a/stripe/issuing/_transaction_service.py +++ b/stripe/issuing/_transaction_service.py @@ -91,7 +91,6 @@ def list( self._request( "get", "/v1/issuing/transactions", - api_mode="V1", base_address="api", params=params, options=options, @@ -111,7 +110,6 @@ async def list_async( await self._request_async( "get", "/v1/issuing/transactions", - api_mode="V1", base_address="api", params=params, options=options, @@ -134,7 +132,6 @@ def retrieve( "/v1/issuing/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -157,7 +154,6 @@ async def retrieve_async( "/v1/issuing/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -180,7 +176,6 @@ def update( "/v1/issuing/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -203,7 +198,6 @@ async def update_async( "/v1/issuing/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/radar/_early_fraud_warning_service.py b/stripe/radar/_early_fraud_warning_service.py index 2118f15cb..552c95425 100644 --- a/stripe/radar/_early_fraud_warning_service.py +++ b/stripe/radar/_early_fraud_warning_service.py @@ -77,7 +77,6 @@ def list( self._request( "get", "/v1/radar/early_fraud_warnings", - api_mode="V1", base_address="api", params=params, options=options, @@ -97,7 +96,6 @@ async def list_async( await self._request_async( "get", "/v1/radar/early_fraud_warnings", - api_mode="V1", base_address="api", params=params, options=options, @@ -122,7 +120,6 @@ def retrieve( "/v1/radar/early_fraud_warnings/{early_fraud_warning}".format( early_fraud_warning=sanitize_id(early_fraud_warning), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -147,7 +144,6 @@ async def retrieve_async( "/v1/radar/early_fraud_warnings/{early_fraud_warning}".format( early_fraud_warning=sanitize_id(early_fraud_warning), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/radar/_value_list_item_service.py b/stripe/radar/_value_list_item_service.py index 60c54fec2..247d21d3e 100644 --- a/stripe/radar/_value_list_item_service.py +++ b/stripe/radar/_value_list_item_service.py @@ -97,7 +97,6 @@ def delete( "/v1/radar/value_list_items/{item}".format( item=sanitize_id(item), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -120,7 +119,6 @@ async def delete_async( "/v1/radar/value_list_items/{item}".format( item=sanitize_id(item), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -143,7 +141,6 @@ def retrieve( "/v1/radar/value_list_items/{item}".format( item=sanitize_id(item), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -166,7 +163,6 @@ async def retrieve_async( "/v1/radar/value_list_items/{item}".format( item=sanitize_id(item), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -186,7 +182,6 @@ def list( self._request( "get", "/v1/radar/value_list_items", - api_mode="V1", base_address="api", params=params, options=options, @@ -206,7 +201,6 @@ async def list_async( await self._request_async( "get", "/v1/radar/value_list_items", - api_mode="V1", base_address="api", params=params, options=options, @@ -226,7 +220,6 @@ def create( self._request( "post", "/v1/radar/value_list_items", - api_mode="V1", base_address="api", params=params, options=options, @@ -246,7 +239,6 @@ async def create_async( await self._request_async( "post", "/v1/radar/value_list_items", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/radar/_value_list_service.py b/stripe/radar/_value_list_service.py index f0e9e330d..ed270a34f 100644 --- a/stripe/radar/_value_list_service.py +++ b/stripe/radar/_value_list_service.py @@ -136,7 +136,6 @@ def delete( "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -159,7 +158,6 @@ async def delete_async( "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -182,7 +180,6 @@ def retrieve( "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -205,7 +202,6 @@ async def retrieve_async( "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -228,7 +224,6 @@ def update( "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -251,7 +246,6 @@ async def update_async( "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -271,7 +265,6 @@ def list( self._request( "get", "/v1/radar/value_lists", - api_mode="V1", base_address="api", params=params, options=options, @@ -291,7 +284,6 @@ async def list_async( await self._request_async( "get", "/v1/radar/value_lists", - api_mode="V1", base_address="api", params=params, options=options, @@ -311,7 +303,6 @@ def create( self._request( "post", "/v1/radar/value_lists", - api_mode="V1", base_address="api", params=params, options=options, @@ -331,7 +322,6 @@ async def create_async( await self._request_async( "post", "/v1/radar/value_lists", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/reporting/_report_run_service.py b/stripe/reporting/_report_run_service.py index 9e8c86dff..cc4505382 100644 --- a/stripe/reporting/_report_run_service.py +++ b/stripe/reporting/_report_run_service.py @@ -758,7 +758,6 @@ def list( self._request( "get", "/v1/reporting/report_runs", - api_mode="V1", base_address="api", params=params, options=options, @@ -778,7 +777,6 @@ async def list_async( await self._request_async( "get", "/v1/reporting/report_runs", - api_mode="V1", base_address="api", params=params, options=options, @@ -798,7 +796,6 @@ def create( self._request( "post", "/v1/reporting/report_runs", - api_mode="V1", base_address="api", params=params, options=options, @@ -818,7 +815,6 @@ async def create_async( await self._request_async( "post", "/v1/reporting/report_runs", - api_mode="V1", base_address="api", params=params, options=options, @@ -841,7 +837,6 @@ def retrieve( "/v1/reporting/report_runs/{report_run}".format( report_run=sanitize_id(report_run), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -864,7 +859,6 @@ async def retrieve_async( "/v1/reporting/report_runs/{report_run}".format( report_run=sanitize_id(report_run), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/reporting/_report_type_service.py b/stripe/reporting/_report_type_service.py index e50f78037..9f52e3be5 100644 --- a/stripe/reporting/_report_type_service.py +++ b/stripe/reporting/_report_type_service.py @@ -35,7 +35,6 @@ def list( self._request( "get", "/v1/reporting/report_types", - api_mode="V1", base_address="api", params=params, options=options, @@ -55,7 +54,6 @@ async def list_async( await self._request_async( "get", "/v1/reporting/report_types", - api_mode="V1", base_address="api", params=params, options=options, @@ -78,7 +76,6 @@ def retrieve( "/v1/reporting/report_types/{report_type}".format( report_type=sanitize_id(report_type), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -101,7 +98,6 @@ async def retrieve_async( "/v1/reporting/report_types/{report_type}".format( report_type=sanitize_id(report_type), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/sigma/_scheduled_query_run_service.py b/stripe/sigma/_scheduled_query_run_service.py index 55bec997f..4ea7ec6dd 100644 --- a/stripe/sigma/_scheduled_query_run_service.py +++ b/stripe/sigma/_scheduled_query_run_service.py @@ -47,7 +47,6 @@ def list( self._request( "get", "/v1/sigma/scheduled_query_runs", - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( await self._request_async( "get", "/v1/sigma/scheduled_query_runs", - api_mode="V1", base_address="api", params=params, options=options, @@ -90,7 +88,6 @@ def retrieve( "/v1/sigma/scheduled_query_runs/{scheduled_query_run}".format( scheduled_query_run=sanitize_id(scheduled_query_run), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -113,7 +110,6 @@ async def retrieve_async( "/v1/sigma/scheduled_query_runs/{scheduled_query_run}".format( scheduled_query_run=sanitize_id(scheduled_query_run), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/tax/_calculation_line_item_service.py b/stripe/tax/_calculation_line_item_service.py index 08651f8eb..a679bb990 100644 --- a/stripe/tax/_calculation_line_item_service.py +++ b/stripe/tax/_calculation_line_item_service.py @@ -44,7 +44,6 @@ def list( "/v1/tax/calculations/{calculation}/line_items".format( calculation=sanitize_id(calculation), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( "/v1/tax/calculations/{calculation}/line_items".format( calculation=sanitize_id(calculation), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index ced36501f..c1b68be72 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -293,7 +293,6 @@ def retrieve( "/v1/tax/calculations/{calculation}".format( calculation=sanitize_id(calculation), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -316,7 +315,6 @@ async def retrieve_async( "/v1/tax/calculations/{calculation}".format( calculation=sanitize_id(calculation), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -336,7 +334,6 @@ def create( self._request( "post", "/v1/tax/calculations", - api_mode="V1", base_address="api", params=params, options=options, @@ -356,7 +353,6 @@ async def create_async( await self._request_async( "post", "/v1/tax/calculations", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index 538f57e8f..1f9b4ba93 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -1023,7 +1023,6 @@ def list( self._request( "get", "/v1/tax/registrations", - api_mode="V1", base_address="api", params=params, options=options, @@ -1043,7 +1042,6 @@ async def list_async( await self._request_async( "get", "/v1/tax/registrations", - api_mode="V1", base_address="api", params=params, options=options, @@ -1063,7 +1061,6 @@ def create( self._request( "post", "/v1/tax/registrations", - api_mode="V1", base_address="api", params=params, options=options, @@ -1083,7 +1080,6 @@ async def create_async( await self._request_async( "post", "/v1/tax/registrations", - api_mode="V1", base_address="api", params=params, options=options, @@ -1104,7 +1100,6 @@ def retrieve( self._request( "get", "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -1125,7 +1120,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -1148,7 +1142,6 @@ def update( self._request( "post", "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -1171,7 +1164,6 @@ async def update_async( await self._request_async( "post", "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/tax/_settings_service.py b/stripe/tax/_settings_service.py index 63903ccff..84e04a55c 100644 --- a/stripe/tax/_settings_service.py +++ b/stripe/tax/_settings_service.py @@ -85,7 +85,6 @@ def retrieve( self._request( "get", "/v1/tax/settings", - api_mode="V1", base_address="api", params=params, options=options, @@ -105,7 +104,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/tax/settings", - api_mode="V1", base_address="api", params=params, options=options, @@ -125,7 +123,6 @@ def update( self._request( "post", "/v1/tax/settings", - api_mode="V1", base_address="api", params=params, options=options, @@ -145,7 +142,6 @@ async def update_async( await self._request_async( "post", "/v1/tax/settings", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/tax/_transaction_line_item_service.py b/stripe/tax/_transaction_line_item_service.py index 2a50b2fd5..be9927b8d 100644 --- a/stripe/tax/_transaction_line_item_service.py +++ b/stripe/tax/_transaction_line_item_service.py @@ -44,7 +44,6 @@ def list( "/v1/tax/transactions/{transaction}/line_items".format( transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -67,7 +66,6 @@ async def list_async( "/v1/tax/transactions/{transaction}/line_items".format( transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/tax/_transaction_service.py b/stripe/tax/_transaction_service.py index d76151cb0..3ccc0a339 100644 --- a/stripe/tax/_transaction_service.py +++ b/stripe/tax/_transaction_service.py @@ -134,7 +134,6 @@ def retrieve( "/v1/tax/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -157,7 +156,6 @@ async def retrieve_async( "/v1/tax/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -177,7 +175,6 @@ def create_from_calculation( self._request( "post", "/v1/tax/transactions/create_from_calculation", - api_mode="V1", base_address="api", params=params, options=options, @@ -197,7 +194,6 @@ async def create_from_calculation_async( await self._request_async( "post", "/v1/tax/transactions/create_from_calculation", - api_mode="V1", base_address="api", params=params, options=options, @@ -217,7 +213,6 @@ def create_reversal( self._request( "post", "/v1/tax/transactions/create_reversal", - api_mode="V1", base_address="api", params=params, options=options, @@ -237,7 +232,6 @@ async def create_reversal_async( await self._request_async( "post", "/v1/tax/transactions/create_reversal", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index 002f55fb5..a47d12507 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -723,7 +723,6 @@ def delete( "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -746,7 +745,6 @@ async def delete_async( "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -769,7 +767,6 @@ def retrieve( "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -792,7 +789,6 @@ async def retrieve_async( "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -815,7 +811,6 @@ def update( "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -838,7 +833,6 @@ async def update_async( "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -858,7 +852,6 @@ def list( self._request( "get", "/v1/terminal/configurations", - api_mode="V1", base_address="api", params=params, options=options, @@ -878,7 +871,6 @@ async def list_async( await self._request_async( "get", "/v1/terminal/configurations", - api_mode="V1", base_address="api", params=params, options=options, @@ -898,7 +890,6 @@ def create( self._request( "post", "/v1/terminal/configurations", - api_mode="V1", base_address="api", params=params, options=options, @@ -918,7 +909,6 @@ async def create_async( await self._request_async( "post", "/v1/terminal/configurations", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/terminal/_connection_token_service.py b/stripe/terminal/_connection_token_service.py index 536ca8795..0a2db379c 100644 --- a/stripe/terminal/_connection_token_service.py +++ b/stripe/terminal/_connection_token_service.py @@ -31,7 +31,6 @@ def create( self._request( "post", "/v1/terminal/connection_tokens", - api_mode="V1", base_address="api", params=params, options=options, @@ -51,7 +50,6 @@ async def create_async( await self._request_async( "post", "/v1/terminal/connection_tokens", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/terminal/_location_service.py b/stripe/terminal/_location_service.py index 3da89f547..427c395f7 100644 --- a/stripe/terminal/_location_service.py +++ b/stripe/terminal/_location_service.py @@ -149,7 +149,6 @@ def delete( "/v1/terminal/locations/{location}".format( location=sanitize_id(location), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -172,7 +171,6 @@ async def delete_async( "/v1/terminal/locations/{location}".format( location=sanitize_id(location), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -195,7 +193,6 @@ def retrieve( "/v1/terminal/locations/{location}".format( location=sanitize_id(location), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -218,7 +215,6 @@ async def retrieve_async( "/v1/terminal/locations/{location}".format( location=sanitize_id(location), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -241,7 +237,6 @@ def update( "/v1/terminal/locations/{location}".format( location=sanitize_id(location), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -264,7 +259,6 @@ async def update_async( "/v1/terminal/locations/{location}".format( location=sanitize_id(location), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -284,7 +278,6 @@ def list( self._request( "get", "/v1/terminal/locations", - api_mode="V1", base_address="api", params=params, options=options, @@ -304,7 +297,6 @@ async def list_async( await self._request_async( "get", "/v1/terminal/locations", - api_mode="V1", base_address="api", params=params, options=options, @@ -325,7 +317,6 @@ def create( self._request( "post", "/v1/terminal/locations", - api_mode="V1", base_address="api", params=params, options=options, @@ -346,7 +337,6 @@ async def create_async( await self._request_async( "post", "/v1/terminal/locations", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 89aec481e..7b8739b94 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -274,7 +274,6 @@ def delete( "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -297,7 +296,6 @@ async def delete_async( "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -320,7 +318,6 @@ def retrieve( "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -343,7 +340,6 @@ async def retrieve_async( "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -366,7 +362,6 @@ def update( "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -389,7 +384,6 @@ async def update_async( "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -409,7 +403,6 @@ def list( self._request( "get", "/v1/terminal/readers", - api_mode="V1", base_address="api", params=params, options=options, @@ -429,7 +422,6 @@ async def list_async( await self._request_async( "get", "/v1/terminal/readers", - api_mode="V1", base_address="api", params=params, options=options, @@ -449,7 +441,6 @@ def create( self._request( "post", "/v1/terminal/readers", - api_mode="V1", base_address="api", params=params, options=options, @@ -469,7 +460,6 @@ async def create_async( await self._request_async( "post", "/v1/terminal/readers", - api_mode="V1", base_address="api", params=params, options=options, @@ -492,7 +482,6 @@ def cancel_action( "/v1/terminal/readers/{reader}/cancel_action".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -515,7 +504,6 @@ async def cancel_action_async( "/v1/terminal/readers/{reader}/cancel_action".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -538,7 +526,6 @@ def process_payment_intent( "/v1/terminal/readers/{reader}/process_payment_intent".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -561,7 +548,6 @@ async def process_payment_intent_async( "/v1/terminal/readers/{reader}/process_payment_intent".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -584,7 +570,6 @@ def process_setup_intent( "/v1/terminal/readers/{reader}/process_setup_intent".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -607,7 +592,6 @@ async def process_setup_intent_async( "/v1/terminal/readers/{reader}/process_setup_intent".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -630,7 +614,6 @@ def refund_payment( "/v1/terminal/readers/{reader}/refund_payment".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -653,7 +636,6 @@ async def refund_payment_async( "/v1/terminal/readers/{reader}/refund_payment".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -676,7 +658,6 @@ def set_reader_display( "/v1/terminal/readers/{reader}/set_reader_display".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -699,7 +680,6 @@ async def set_reader_display_async( "/v1/terminal/readers/{reader}/set_reader_display".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index 6d3e3473f..c52789f0a 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -731,7 +731,6 @@ def create( self._request( "post", "/v1/test_helpers/confirmation_tokens", - api_mode="V1", base_address="api", params=params, options=options, @@ -751,7 +750,6 @@ async def create_async( await self._request_async( "post", "/v1/test_helpers/confirmation_tokens", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/_customer_service.py b/stripe/test_helpers/_customer_service.py index f9870538b..fc4707179 100644 --- a/stripe/test_helpers/_customer_service.py +++ b/stripe/test_helpers/_customer_service.py @@ -45,7 +45,6 @@ def fund_cash_balance( "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -68,7 +67,6 @@ async def fund_cash_balance_async( "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( customer=sanitize_id(customer), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/_refund_service.py b/stripe/test_helpers/_refund_service.py index 27d0a885f..0e4d2dd1a 100644 --- a/stripe/test_helpers/_refund_service.py +++ b/stripe/test_helpers/_refund_service.py @@ -31,7 +31,6 @@ def expire( "/v1/test_helpers/refunds/{refund}/expire".format( refund=sanitize_id(refund), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -54,7 +53,6 @@ async def expire_async( "/v1/test_helpers/refunds/{refund}/expire".format( refund=sanitize_id(refund), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/_test_clock_service.py b/stripe/test_helpers/_test_clock_service.py index 72e98b2dd..0584c0a4d 100644 --- a/stripe/test_helpers/_test_clock_service.py +++ b/stripe/test_helpers/_test_clock_service.py @@ -77,7 +77,6 @@ def delete( "/v1/test_helpers/test_clocks/{test_clock}".format( test_clock=sanitize_id(test_clock), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -100,7 +99,6 @@ async def delete_async( "/v1/test_helpers/test_clocks/{test_clock}".format( test_clock=sanitize_id(test_clock), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -123,7 +121,6 @@ def retrieve( "/v1/test_helpers/test_clocks/{test_clock}".format( test_clock=sanitize_id(test_clock), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -146,7 +143,6 @@ async def retrieve_async( "/v1/test_helpers/test_clocks/{test_clock}".format( test_clock=sanitize_id(test_clock), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -166,7 +162,6 @@ def list( self._request( "get", "/v1/test_helpers/test_clocks", - api_mode="V1", base_address="api", params=params, options=options, @@ -186,7 +181,6 @@ async def list_async( await self._request_async( "get", "/v1/test_helpers/test_clocks", - api_mode="V1", base_address="api", params=params, options=options, @@ -206,7 +200,6 @@ def create( self._request( "post", "/v1/test_helpers/test_clocks", - api_mode="V1", base_address="api", params=params, options=options, @@ -226,7 +219,6 @@ async def create_async( await self._request_async( "post", "/v1/test_helpers/test_clocks", - api_mode="V1", base_address="api", params=params, options=options, @@ -249,7 +241,6 @@ def advance( "/v1/test_helpers/test_clocks/{test_clock}/advance".format( test_clock=sanitize_id(test_clock), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -272,7 +263,6 @@ async def advance_async( "/v1/test_helpers/test_clocks/{test_clock}/advance".format( test_clock=sanitize_id(test_clock), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/issuing/_authorization_service.py b/stripe/test_helpers/issuing/_authorization_service.py index 7279e4d19..ff3ed6b0e 100644 --- a/stripe/test_helpers/issuing/_authorization_service.py +++ b/stripe/test_helpers/issuing/_authorization_service.py @@ -1068,7 +1068,6 @@ def create( self._request( "post", "/v1/test_helpers/issuing/authorizations", - api_mode="V1", base_address="api", params=params, options=options, @@ -1088,7 +1087,6 @@ async def create_async( await self._request_async( "post", "/v1/test_helpers/issuing/authorizations", - api_mode="V1", base_address="api", params=params, options=options, @@ -1111,7 +1109,6 @@ def capture( "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1134,7 +1131,6 @@ async def capture_async( "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1157,7 +1153,6 @@ def expire( "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1180,7 +1175,6 @@ async def expire_async( "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1203,7 +1197,6 @@ def finalize_amount( "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1226,7 +1219,6 @@ async def finalize_amount_async( "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1249,7 +1241,6 @@ def increment( "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1272,7 +1263,6 @@ async def increment_async( "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1295,7 +1285,6 @@ def reverse( "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1318,7 +1307,6 @@ async def reverse_async( "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( authorization=sanitize_id(authorization), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/issuing/_card_service.py b/stripe/test_helpers/issuing/_card_service.py index 51b742f65..5add490c4 100644 --- a/stripe/test_helpers/issuing/_card_service.py +++ b/stripe/test_helpers/issuing/_card_service.py @@ -49,7 +49,6 @@ def deliver_card( "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( card=sanitize_id(card), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -72,7 +71,6 @@ async def deliver_card_async( "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( card=sanitize_id(card), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -95,7 +93,6 @@ def fail_card( "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( card=sanitize_id(card), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -118,7 +115,6 @@ async def fail_card_async( "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( card=sanitize_id(card), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -141,7 +137,6 @@ def return_card( "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( card=sanitize_id(card), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -164,7 +159,6 @@ async def return_card_async( "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( card=sanitize_id(card), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -187,7 +181,6 @@ def ship_card( "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( card=sanitize_id(card), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -210,7 +203,6 @@ async def ship_card_async( "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( card=sanitize_id(card), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/issuing/_personalization_design_service.py b/stripe/test_helpers/issuing/_personalization_design_service.py index 671952b57..e430d007a 100644 --- a/stripe/test_helpers/issuing/_personalization_design_service.py +++ b/stripe/test_helpers/issuing/_personalization_design_service.py @@ -84,7 +84,6 @@ def activate( "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( personalization_design=sanitize_id(personalization_design), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -107,7 +106,6 @@ async def activate_async( "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( personalization_design=sanitize_id(personalization_design), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -130,7 +128,6 @@ def deactivate( "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( personalization_design=sanitize_id(personalization_design), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -153,7 +150,6 @@ async def deactivate_async( "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( personalization_design=sanitize_id(personalization_design), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -176,7 +172,6 @@ def reject( "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( personalization_design=sanitize_id(personalization_design), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -199,7 +194,6 @@ async def reject_async( "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( personalization_design=sanitize_id(personalization_design), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/issuing/_transaction_service.py b/stripe/test_helpers/issuing/_transaction_service.py index a585ce908..bd92e04b7 100644 --- a/stripe/test_helpers/issuing/_transaction_service.py +++ b/stripe/test_helpers/issuing/_transaction_service.py @@ -1267,7 +1267,6 @@ def refund( "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1290,7 +1289,6 @@ async def refund_async( "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( transaction=sanitize_id(transaction), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -1310,7 +1308,6 @@ def create_force_capture( self._request( "post", "/v1/test_helpers/issuing/transactions/create_force_capture", - api_mode="V1", base_address="api", params=params, options=options, @@ -1330,7 +1327,6 @@ async def create_force_capture_async( await self._request_async( "post", "/v1/test_helpers/issuing/transactions/create_force_capture", - api_mode="V1", base_address="api", params=params, options=options, @@ -1350,7 +1346,6 @@ def create_unlinked_refund( self._request( "post", "/v1/test_helpers/issuing/transactions/create_unlinked_refund", - api_mode="V1", base_address="api", params=params, options=options, @@ -1370,7 +1365,6 @@ async def create_unlinked_refund_async( await self._request_async( "post", "/v1/test_helpers/issuing/transactions/create_unlinked_refund", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/terminal/_reader_service.py b/stripe/test_helpers/terminal/_reader_service.py index 04c64468a..b438dd213 100644 --- a/stripe/test_helpers/terminal/_reader_service.py +++ b/stripe/test_helpers/terminal/_reader_service.py @@ -63,7 +63,6 @@ def present_payment_method( "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -86,7 +85,6 @@ async def present_payment_method_async( "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( reader=sanitize_id(reader), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/treasury/_inbound_transfer_service.py b/stripe/test_helpers/treasury/_inbound_transfer_service.py index 16b16359d..60dcd7b90 100644 --- a/stripe/test_helpers/treasury/_inbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_inbound_transfer_service.py @@ -71,7 +71,6 @@ def fail( "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -94,7 +93,6 @@ async def fail_async( "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -117,7 +115,6 @@ def return_inbound_transfer( "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -140,7 +137,6 @@ async def return_inbound_transfer_async( "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -163,7 +159,6 @@ def succeed( "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -186,7 +181,6 @@ async def succeed_async( "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/treasury/_outbound_payment_service.py b/stripe/test_helpers/treasury/_outbound_payment_service.py index 8299fc12a..33aa4fff5 100644 --- a/stripe/test_helpers/treasury/_outbound_payment_service.py +++ b/stripe/test_helpers/treasury/_outbound_payment_service.py @@ -116,7 +116,6 @@ def update( "/v1/test_helpers/treasury/outbound_payments/{id}".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -139,7 +138,6 @@ async def update_async( "/v1/test_helpers/treasury/outbound_payments/{id}".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -162,7 +160,6 @@ def fail( "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -185,7 +182,6 @@ async def fail_async( "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -208,7 +204,6 @@ def post( "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -231,7 +226,6 @@ async def post_async( "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -254,7 +248,6 @@ def return_outbound_payment( "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -277,7 +270,6 @@ async def return_outbound_payment_async( "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/treasury/_outbound_transfer_service.py b/stripe/test_helpers/treasury/_outbound_transfer_service.py index 185038a5b..b6e48ccf6 100644 --- a/stripe/test_helpers/treasury/_outbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_outbound_transfer_service.py @@ -116,7 +116,6 @@ def update( "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(outbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -139,7 +138,6 @@ async def update_async( "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(outbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -162,7 +160,6 @@ def fail( "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( outbound_transfer=sanitize_id(outbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -185,7 +182,6 @@ async def fail_async( "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( outbound_transfer=sanitize_id(outbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -208,7 +204,6 @@ def post( "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( outbound_transfer=sanitize_id(outbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -231,7 +226,6 @@ async def post_async( "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( outbound_transfer=sanitize_id(outbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -254,7 +248,6 @@ def return_outbound_transfer( "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( outbound_transfer=sanitize_id(outbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -277,7 +270,6 @@ async def return_outbound_transfer_async( "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( outbound_transfer=sanitize_id(outbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/treasury/_received_credit_service.py b/stripe/test_helpers/treasury/_received_credit_service.py index 14ca527c8..2a7033187 100644 --- a/stripe/test_helpers/treasury/_received_credit_service.py +++ b/stripe/test_helpers/treasury/_received_credit_service.py @@ -79,7 +79,6 @@ def create( self._request( "post", "/v1/test_helpers/treasury/received_credits", - api_mode="V1", base_address="api", params=params, options=options, @@ -99,7 +98,6 @@ async def create_async( await self._request_async( "post", "/v1/test_helpers/treasury/received_credits", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/test_helpers/treasury/_received_debit_service.py b/stripe/test_helpers/treasury/_received_debit_service.py index 2b0f761cc..918b269e3 100644 --- a/stripe/test_helpers/treasury/_received_debit_service.py +++ b/stripe/test_helpers/treasury/_received_debit_service.py @@ -79,7 +79,6 @@ def create( self._request( "post", "/v1/test_helpers/treasury/received_debits", - api_mode="V1", base_address="api", params=params, options=options, @@ -99,7 +98,6 @@ async def create_async( await self._request_async( "post", "/v1/test_helpers/treasury/received_debits", - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/treasury/_credit_reversal_service.py b/stripe/treasury/_credit_reversal_service.py index 3ae920b0f..316da77b6 100644 --- a/stripe/treasury/_credit_reversal_service.py +++ b/stripe/treasury/_credit_reversal_service.py @@ -73,7 +73,6 @@ def list( self._request( "get", "/v1/treasury/credit_reversals", - api_mode="V1", base_address="api", params=params, options=options, @@ -93,7 +92,6 @@ async def list_async( await self._request_async( "get", "/v1/treasury/credit_reversals", - api_mode="V1", base_address="api", params=params, options=options, @@ -113,7 +111,6 @@ def create( self._request( "post", "/v1/treasury/credit_reversals", - api_mode="V1", base_address="api", params=params, options=options, @@ -133,7 +130,6 @@ async def create_async( await self._request_async( "post", "/v1/treasury/credit_reversals", - api_mode="V1", base_address="api", params=params, options=options, @@ -156,7 +152,6 @@ def retrieve( "/v1/treasury/credit_reversals/{credit_reversal}".format( credit_reversal=sanitize_id(credit_reversal), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -179,7 +174,6 @@ async def retrieve_async( "/v1/treasury/credit_reversals/{credit_reversal}".format( credit_reversal=sanitize_id(credit_reversal), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/treasury/_debit_reversal_service.py b/stripe/treasury/_debit_reversal_service.py index b8f54471b..a5037bf11 100644 --- a/stripe/treasury/_debit_reversal_service.py +++ b/stripe/treasury/_debit_reversal_service.py @@ -77,7 +77,6 @@ def list( self._request( "get", "/v1/treasury/debit_reversals", - api_mode="V1", base_address="api", params=params, options=options, @@ -97,7 +96,6 @@ async def list_async( await self._request_async( "get", "/v1/treasury/debit_reversals", - api_mode="V1", base_address="api", params=params, options=options, @@ -117,7 +115,6 @@ def create( self._request( "post", "/v1/treasury/debit_reversals", - api_mode="V1", base_address="api", params=params, options=options, @@ -137,7 +134,6 @@ async def create_async( await self._request_async( "post", "/v1/treasury/debit_reversals", - api_mode="V1", base_address="api", params=params, options=options, @@ -160,7 +156,6 @@ def retrieve( "/v1/treasury/debit_reversals/{debit_reversal}".format( debit_reversal=sanitize_id(debit_reversal), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -183,7 +178,6 @@ async def retrieve_async( "/v1/treasury/debit_reversals/{debit_reversal}".format( debit_reversal=sanitize_id(debit_reversal), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/treasury/_financial_account_features_service.py b/stripe/treasury/_financial_account_features_service.py index a165eb7f7..95ffff587 100644 --- a/stripe/treasury/_financial_account_features_service.py +++ b/stripe/treasury/_financial_account_features_service.py @@ -179,7 +179,6 @@ def update( "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -202,7 +201,6 @@ async def update_async( "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -225,7 +223,6 @@ def retrieve( "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -248,7 +245,6 @@ async def retrieve_async( "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index c61f2e46e..87aa3ae03 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -424,7 +424,6 @@ def list( self._request( "get", "/v1/treasury/financial_accounts", - api_mode="V1", base_address="api", params=params, options=options, @@ -444,7 +443,6 @@ async def list_async( await self._request_async( "get", "/v1/treasury/financial_accounts", - api_mode="V1", base_address="api", params=params, options=options, @@ -464,7 +462,6 @@ def create( self._request( "post", "/v1/treasury/financial_accounts", - api_mode="V1", base_address="api", params=params, options=options, @@ -484,7 +481,6 @@ async def create_async( await self._request_async( "post", "/v1/treasury/financial_accounts", - api_mode="V1", base_address="api", params=params, options=options, @@ -507,7 +503,6 @@ def retrieve( "/v1/treasury/financial_accounts/{financial_account}".format( financial_account=sanitize_id(financial_account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -530,7 +525,6 @@ async def retrieve_async( "/v1/treasury/financial_accounts/{financial_account}".format( financial_account=sanitize_id(financial_account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -553,7 +547,6 @@ def update( "/v1/treasury/financial_accounts/{financial_account}".format( financial_account=sanitize_id(financial_account), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -576,7 +569,6 @@ async def update_async( "/v1/treasury/financial_accounts/{financial_account}".format( financial_account=sanitize_id(financial_account), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/treasury/_inbound_transfer_service.py b/stripe/treasury/_inbound_transfer_service.py index 40c7114b3..cf4e166e2 100644 --- a/stripe/treasury/_inbound_transfer_service.py +++ b/stripe/treasury/_inbound_transfer_service.py @@ -97,7 +97,6 @@ def list( self._request( "get", "/v1/treasury/inbound_transfers", - api_mode="V1", base_address="api", params=params, options=options, @@ -117,7 +116,6 @@ async def list_async( await self._request_async( "get", "/v1/treasury/inbound_transfers", - api_mode="V1", base_address="api", params=params, options=options, @@ -137,7 +135,6 @@ def create( self._request( "post", "/v1/treasury/inbound_transfers", - api_mode="V1", base_address="api", params=params, options=options, @@ -157,7 +154,6 @@ async def create_async( await self._request_async( "post", "/v1/treasury/inbound_transfers", - api_mode="V1", base_address="api", params=params, options=options, @@ -180,7 +176,6 @@ def retrieve( "/v1/treasury/inbound_transfers/{id}".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -203,7 +198,6 @@ async def retrieve_async( "/v1/treasury/inbound_transfers/{id}".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -226,7 +220,6 @@ def cancel( "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( inbound_transfer=sanitize_id(inbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -249,7 +242,6 @@ async def cancel_async( "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( inbound_transfer=sanitize_id(inbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/treasury/_outbound_payment_service.py b/stripe/treasury/_outbound_payment_service.py index 2a22eb7e2..45305a619 100644 --- a/stripe/treasury/_outbound_payment_service.py +++ b/stripe/treasury/_outbound_payment_service.py @@ -265,7 +265,6 @@ def list( self._request( "get", "/v1/treasury/outbound_payments", - api_mode="V1", base_address="api", params=params, options=options, @@ -285,7 +284,6 @@ async def list_async( await self._request_async( "get", "/v1/treasury/outbound_payments", - api_mode="V1", base_address="api", params=params, options=options, @@ -305,7 +303,6 @@ def create( self._request( "post", "/v1/treasury/outbound_payments", - api_mode="V1", base_address="api", params=params, options=options, @@ -325,7 +322,6 @@ async def create_async( await self._request_async( "post", "/v1/treasury/outbound_payments", - api_mode="V1", base_address="api", params=params, options=options, @@ -348,7 +344,6 @@ def retrieve( "/v1/treasury/outbound_payments/{id}".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -371,7 +366,6 @@ async def retrieve_async( "/v1/treasury/outbound_payments/{id}".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -394,7 +388,6 @@ def cancel( "/v1/treasury/outbound_payments/{id}/cancel".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -417,7 +410,6 @@ async def cancel_async( "/v1/treasury/outbound_payments/{id}/cancel".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/treasury/_outbound_transfer_service.py b/stripe/treasury/_outbound_transfer_service.py index c87bdde15..23f5e2275 100644 --- a/stripe/treasury/_outbound_transfer_service.py +++ b/stripe/treasury/_outbound_transfer_service.py @@ -117,7 +117,6 @@ def list( self._request( "get", "/v1/treasury/outbound_transfers", - api_mode="V1", base_address="api", params=params, options=options, @@ -137,7 +136,6 @@ async def list_async( await self._request_async( "get", "/v1/treasury/outbound_transfers", - api_mode="V1", base_address="api", params=params, options=options, @@ -157,7 +155,6 @@ def create( self._request( "post", "/v1/treasury/outbound_transfers", - api_mode="V1", base_address="api", params=params, options=options, @@ -177,7 +174,6 @@ async def create_async( await self._request_async( "post", "/v1/treasury/outbound_transfers", - api_mode="V1", base_address="api", params=params, options=options, @@ -200,7 +196,6 @@ def retrieve( "/v1/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(outbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -223,7 +218,6 @@ async def retrieve_async( "/v1/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(outbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -246,7 +240,6 @@ def cancel( "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( outbound_transfer=sanitize_id(outbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -269,7 +262,6 @@ async def cancel_async( "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( outbound_transfer=sanitize_id(outbound_transfer), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/treasury/_received_credit_service.py b/stripe/treasury/_received_credit_service.py index 250b663e4..0644fde0a 100644 --- a/stripe/treasury/_received_credit_service.py +++ b/stripe/treasury/_received_credit_service.py @@ -69,7 +69,6 @@ def list( self._request( "get", "/v1/treasury/received_credits", - api_mode="V1", base_address="api", params=params, options=options, @@ -89,7 +88,6 @@ async def list_async( await self._request_async( "get", "/v1/treasury/received_credits", - api_mode="V1", base_address="api", params=params, options=options, @@ -112,7 +110,6 @@ def retrieve( "/v1/treasury/received_credits/{id}".format( id=sanitize_id(id) ), - api_mode="V1", base_address="api", params=params, options=options, @@ -135,7 +132,6 @@ async def retrieve_async( "/v1/treasury/received_credits/{id}".format( id=sanitize_id(id) ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/treasury/_received_debit_service.py b/stripe/treasury/_received_debit_service.py index e1ef7306d..dd3d55cf6 100644 --- a/stripe/treasury/_received_debit_service.py +++ b/stripe/treasury/_received_debit_service.py @@ -55,7 +55,6 @@ def list( self._request( "get", "/v1/treasury/received_debits", - api_mode="V1", base_address="api", params=params, options=options, @@ -75,7 +74,6 @@ async def list_async( await self._request_async( "get", "/v1/treasury/received_debits", - api_mode="V1", base_address="api", params=params, options=options, @@ -96,7 +94,6 @@ def retrieve( self._request( "get", "/v1/treasury/received_debits/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -117,7 +114,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/treasury/received_debits/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/treasury/_transaction_entry_service.py b/stripe/treasury/_transaction_entry_service.py index 8d720fd40..cd456871b 100644 --- a/stripe/treasury/_transaction_entry_service.py +++ b/stripe/treasury/_transaction_entry_service.py @@ -102,7 +102,6 @@ def list( self._request( "get", "/v1/treasury/transaction_entries", - api_mode="V1", base_address="api", params=params, options=options, @@ -122,7 +121,6 @@ async def list_async( await self._request_async( "get", "/v1/treasury/transaction_entries", - api_mode="V1", base_address="api", params=params, options=options, @@ -145,7 +143,6 @@ def retrieve( "/v1/treasury/transaction_entries/{id}".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, @@ -168,7 +165,6 @@ async def retrieve_async( "/v1/treasury/transaction_entries/{id}".format( id=sanitize_id(id), ), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/stripe/treasury/_transaction_service.py b/stripe/treasury/_transaction_service.py index ac91f7fd8..7012cd3d9 100644 --- a/stripe/treasury/_transaction_service.py +++ b/stripe/treasury/_transaction_service.py @@ -113,7 +113,6 @@ def list( self._request( "get", "/v1/treasury/transactions", - api_mode="V1", base_address="api", params=params, options=options, @@ -133,7 +132,6 @@ async def list_async( await self._request_async( "get", "/v1/treasury/transactions", - api_mode="V1", base_address="api", params=params, options=options, @@ -154,7 +152,6 @@ def retrieve( self._request( "get", "/v1/treasury/transactions/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, @@ -175,7 +172,6 @@ async def retrieve_async( await self._request_async( "get", "/v1/treasury/transactions/{id}".format(id=sanitize_id(id)), - api_mode="V1", base_address="api", params=params, options=options, diff --git a/tests/test_api_requestor.py b/tests/test_api_requestor.py index a2d197430..8acb0e87d 100644 --- a/tests/test_api_requestor.py +++ b/tests/test_api_requestor.py @@ -158,9 +158,7 @@ def test_param_encoding(self, requestor, http_client_mock): "get", query_string=query_string, rbody="{}", rcode=200 ) - requestor.request( - "get", "", self.ENCODE_INPUTS, base_address="api", api_mode="V1" - ) + requestor.request("get", "", self.ENCODE_INPUTS, base_address="api") http_client_mock.assert_requested("get", query_string=query_string) @@ -219,9 +217,7 @@ def test_url_construction(self, requestor, http_client_mock): rcode=200, ) - requestor.request( - "get", url, params, base_address="api", api_mode="V1" - ) + requestor.request("get", url, params, base_address="api") http_client_mock.assert_requested("get", abs_url=expected) @@ -232,7 +228,7 @@ def test_empty_methods(self, requestor, http_client_mock): ) resp = requestor.request( - meth, self.valid_path, {}, base_address="api", api_mode="V1" + meth, self.valid_path, {}, base_address="api" ) if meth == "post": @@ -256,7 +252,7 @@ async def test_empty_methods_async(self, requestor, http_client_mock): ) resp = await requestor.request_async( - meth, self.valid_path, {}, base_address="api", api_mode="V1" + meth, self.valid_path, {}, base_address="api" ) if meth == "post": @@ -291,7 +287,6 @@ async def async_iter(): self.valid_path, {}, base_address="api", - api_mode="V1", ) if meth == "post": @@ -320,7 +315,6 @@ def test_empty_methods_streaming_response( self.valid_path, {}, base_address="api", - api_mode="V1", ) if meth == "post": @@ -361,7 +355,6 @@ def test_methods_with_params_and_response( self.valid_path, params, base_address="api", - api_mode="V1", ) assert isinstance(resp, StripeObject) @@ -408,7 +401,6 @@ def test_methods_with_params_and_streaming_response( self.valid_path, params, base_address="api", - api_mode="V1", ) assert isinstance(resp, StripeStreamResponse) @@ -435,7 +427,6 @@ def test_uses_headers(self, requestor, http_client_mock): {}, options=request_options, base_address="api", - api_mode="V1", ) http_client_mock.assert_requested("get", extra_headers={"foo": "bar"}) @@ -449,7 +440,6 @@ def test_uses_api_version(self, requestor, http_client_mock): self.valid_path, options=request_options, base_address="api", - api_mode="V1", ) http_client_mock.assert_requested( "get", @@ -470,7 +460,6 @@ def test_prefers_headers_api_version(self, requestor, http_client_mock): {}, options=request_options, base_address="api", - api_mode="V1", ) http_client_mock.assert_requested( "get", @@ -485,9 +474,7 @@ def test_uses_instance_key(self, requestor, http_client_mock): "get", path=self.valid_path, rbody="{}", rcode=200 ) - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") http_client_mock.assert_requested("get", api_key=key) assert requestor.api_key == key @@ -502,9 +489,7 @@ def test_uses_instance_account(self, requestor, http_client_mock): "get", path=self.valid_path, rbody="{}", rcode=200 ) - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") http_client_mock.assert_requested( "get", @@ -545,9 +530,7 @@ def test_uses_app_info(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody="{}", rcode=200 ) - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") ua = "Stripe/v1 PythonBindings/%s" % (stripe.VERSION,) ua += " MyAwesomePlugin/1.2.34 (https://myawesomeplugin.info)" @@ -582,9 +565,7 @@ def fail(): mocker.patch("platform.platform", side_effect=fail) - requestor.request( - "get", self.valid_path, {}, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, {}, base_address="api") last_call = http_client_mock.get_last_call() last_call.assert_method("get") @@ -607,7 +588,6 @@ def test_uses_given_idempotency_key(self, requestor, http_client_mock): {}, options=request_options, base_address="api", - api_mode="V1", ) http_client_mock.assert_requested( @@ -621,9 +601,7 @@ def test_uuid4_idempotency_key_when_not_given( http_client_mock.stub_request( meth, path=self.valid_path, rbody="{}", rcode=200 ) - requestor.request( - meth, self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request(meth, self.valid_path, {}, base_address="api") http_client_mock.assert_requested( meth, idempotency_key=AnyUUID4Matcher(), post_data="" @@ -633,9 +611,7 @@ def test_fails_without_api_key(self, requestor): stripe.api_key = None with pytest.raises(stripe.error.AuthenticationError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_invalid_request_error_404(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -643,9 +619,7 @@ def test_invalid_request_error_404(self, requestor, http_client_mock): ) with pytest.raises(stripe.error.InvalidRequestError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_invalid_request_error_400(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -653,9 +627,7 @@ def test_invalid_request_error_400(self, requestor, http_client_mock): ) with pytest.raises(stripe.error.InvalidRequestError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_idempotency_error(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -666,9 +638,7 @@ def test_idempotency_error(self, requestor, http_client_mock): ) with pytest.raises(stripe.error.IdempotencyError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_authentication_error(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -676,9 +646,7 @@ def test_authentication_error(self, requestor, http_client_mock): ) with pytest.raises(stripe.error.AuthenticationError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_permissions_error(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -686,9 +654,7 @@ def test_permissions_error(self, requestor, http_client_mock): ) with pytest.raises(stripe.error.PermissionError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_card_error(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -699,9 +665,7 @@ def test_card_error(self, requestor, http_client_mock): ) with pytest.raises(stripe.error.CardError) as excinfo: - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") assert excinfo.value.code == "invalid_expiry_year" def test_rate_limit_error(self, requestor, http_client_mock): @@ -710,9 +674,7 @@ def test_rate_limit_error(self, requestor, http_client_mock): ) with pytest.raises(stripe.error.RateLimitError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_old_rate_limit_error(self, requestor, http_client_mock): """ @@ -726,9 +688,7 @@ def test_old_rate_limit_error(self, requestor, http_client_mock): ) with pytest.raises(stripe.error.RateLimitError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_server_error(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -736,9 +696,7 @@ def test_server_error(self, requestor, http_client_mock): ) with pytest.raises(stripe.error.APIError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_invalid_json(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -746,13 +704,11 @@ def test_invalid_json(self, requestor, http_client_mock): ) with pytest.raises(stripe.error.APIError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_invalid_method(self, requestor): with pytest.raises(stripe.error.APIConnectionError): - requestor.request("foo", "bar", base_address="api", api_mode="V1") + requestor.request("foo", "bar", base_address="api") def test_oauth_invalid_requestor_error(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -763,9 +719,7 @@ def test_oauth_invalid_requestor_error(self, requestor, http_client_mock): ) with pytest.raises(stripe.oauth_error.InvalidRequestError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_invalid_client_error(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -776,9 +730,7 @@ def test_invalid_client_error(self, requestor, http_client_mock): ) with pytest.raises(stripe.oauth_error.InvalidClientError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_invalid_grant_error(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -789,9 +741,7 @@ def test_invalid_grant_error(self, requestor, http_client_mock): ) with pytest.raises(stripe.oauth_error.InvalidGrantError): - requestor.request( - "get", self.valid_path, {}, base_address="api", api_mode="V1" - ) + requestor.request("get", self.valid_path, {}, base_address="api") def test_extract_error_from_stream_request_for_bytes( self, requestor, http_client_mock @@ -805,7 +755,7 @@ def test_extract_error_from_stream_request_for_bytes( with pytest.raises(stripe.oauth_error.InvalidGrantError): requestor.request_stream( - "get", self.valid_path, {}, base_address="api", api_mode="V1" + "get", self.valid_path, {}, base_address="api" ) def test_extract_error_from_stream_request_for_response( @@ -824,7 +774,7 @@ def test_extract_error_from_stream_request_for_response( with pytest.raises(stripe.oauth_error.InvalidGrantError): requestor.request_stream( - "get", self.valid_path, {}, base_address="api", api_mode="V1" + "get", self.valid_path, {}, base_address="api" ) def test_raw_request_with_file_param(self, requestor, http_client_mock): @@ -842,7 +792,6 @@ def test_raw_request_with_file_param(self, requestor, http_client_mock): params, supplied_headers, base_address="api", - api_mode="V1", ) assert supplied_headers["Content-Type"] == "multipart/form-data" diff --git a/tests/test_stripe_object.py b/tests/test_stripe_object.py index c75b06548..be893167a 100644 --- a/tests/test_stripe_object.py +++ b/tests/test_stripe_object.py @@ -405,7 +405,7 @@ def test_sends_request_with_api_key(self, http_client_mock): path="/foo", ) - obj._request("get", "/foo", base_address="api", api_mode="V1") + obj._request("get", "/foo", base_address="api") http_client_mock.assert_requested( api_key="key", @@ -416,9 +416,7 @@ def test_sends_request_with_api_key(self, http_client_mock): async def test_request_async_succeeds(self, http_client_mock): http_client_mock.stub_request("get", "/foo") obj = stripe.stripe_object.StripeObject("id", "key") - await obj._request_async( - "get", "/foo", base_address="api", api_mode="V1" - ) + await obj._request_async("get", "/foo", base_address="api") http_client_mock.assert_requested( api_key="key", stripe_account=None, @@ -448,7 +446,7 @@ def test_can_update_api_key(self, http_client_mock): ) obj.api_key = "key2" - obj._request("get", "/foo", base_address="api", api_mode="V1") + obj._request("get", "/foo", base_address="api") assert "api_key" not in obj.items() From 9c9c6df2911f94651c6467c8cbbd5dabd225cbf1 Mon Sep 17 00:00:00 2001 From: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:47:40 -0700 Subject: [PATCH 104/179] Generate SDK for OpenAPI spec version 1230 (#1385) --- OPENAPI_VERSION | 2 +- stripe/_account_link.py | 2 +- stripe/_account_link_service.py | 2 +- stripe/_charge.py | 12 +++++++++--- stripe/_charge_service.py | 8 ++++++-- stripe/_customer.py | 6 ++++-- stripe/_customer_service.py | 3 ++- stripe/_customer_session.py | 4 ++++ stripe/_customer_tax_id_service.py | 3 ++- stripe/_file.py | 5 ++++- stripe/_file_link.py | 2 +- stripe/_file_link_service.py | 2 +- stripe/_file_service.py | 4 +++- stripe/_invoice.py | 18 +++++++++++------- stripe/_invoice_line_item.py | 6 ++++++ stripe/_invoice_service.py | 10 ++++++---- stripe/_invoice_upcoming_lines_service.py | 5 +++-- stripe/_line_item.py | 2 +- stripe/_payment_intent.py | 18 +++++++++++++----- stripe/_payment_intent_service.py | 14 ++++++++++---- stripe/_payment_link.py | 12 ++++++++---- stripe/_payment_link_service.py | 12 ++++++++---- stripe/_subscription.py | 4 ++-- stripe/_subscription_schedule.py | 4 ++-- stripe/_subscription_schedule_service.py | 4 ++-- stripe/_subscription_service.py | 4 ++-- stripe/_tax_id.py | 6 ++++-- stripe/_tax_id_service.py | 3 ++- stripe/checkout/_session.py | 9 ++++++--- stripe/checkout/_session_service.py | 6 ++++-- stripe/tax/_calculation.py | 8 +++++--- stripe/tax/_calculation_service.py | 5 +++-- stripe/tax/_transaction.py | 3 ++- stripe/test_helpers/_test_clock.py | 14 ++++++++++++++ stripe/treasury/_inbound_transfer.py | 4 +++- stripe/treasury/_outbound_payment.py | 4 +++- stripe/treasury/_outbound_transfer.py | 4 +++- stripe/treasury/_received_credit.py | 4 +++- stripe/treasury/_transaction.py | 12 +++++++++--- stripe/treasury/_transaction_entry.py | 12 +++++++++--- 40 files changed, 183 insertions(+), 79 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 82e4a49f9..a02063ef6 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1201 \ No newline at end of file +v1230 diff --git a/stripe/_account_link.py b/stripe/_account_link.py index 1e2452e4d..dce24a0c6 100644 --- a/stripe/_account_link.py +++ b/stripe/_account_link.py @@ -49,7 +49,7 @@ class CreateParams(RequestOptions): """ class CreateParamsCollectionOptions(TypedDict): - fields: Literal["currently_due", "eventually_due"] + fields: NotRequired[Literal["currently_due", "eventually_due"]] """ Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify `collection_options`, the default value is `currently_due`. """ diff --git a/stripe/_account_link_service.py b/stripe/_account_link_service.py index da1cddd79..793610084 100644 --- a/stripe/_account_link_service.py +++ b/stripe/_account_link_service.py @@ -41,7 +41,7 @@ class CreateParams(TypedDict): """ class CreateParamsCollectionOptions(TypedDict): - fields: Literal["currently_due", "eventually_due"] + fields: NotRequired[Literal["currently_due", "eventually_due"]] """ Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify `collection_options`, the default value is `currently_due`. """ diff --git a/stripe/_charge.py b/stripe/_charge.py index a1dd7cf1c..2bcb9b148 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1803,7 +1803,9 @@ class CaptureParams(RequestOptions): """ statement_descriptor: NotRequired[str] """ - For a non-card charge, text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors). This value overrides the account's default statement descriptor. For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. + For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. """ statement_descriptor_suffix: NotRequired[str] """ @@ -1881,7 +1883,9 @@ class CreateParams(RequestOptions): """ statement_descriptor: NotRequired[str] """ - For a non-card charge, text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors). This value overrides the account's default statement descriptor. For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. + For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. """ statement_descriptor_suffix: NotRequired[str] """ @@ -2324,7 +2328,9 @@ class SearchParams(RequestOptions): """ statement_descriptor: Optional[str] """ - For a non-card charge, text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors). This value overrides the account's default statement descriptor. For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. + For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. """ statement_descriptor_suffix: Optional[str] """ diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index 47506a7de..28992cf71 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -34,7 +34,9 @@ class CaptureParams(TypedDict): """ statement_descriptor: NotRequired[str] """ - For a non-card charge, text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors). This value overrides the account's default statement descriptor. For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. + For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. """ statement_descriptor_suffix: NotRequired[str] """ @@ -112,7 +114,9 @@ class CreateParams(TypedDict): """ statement_descriptor: NotRequired[str] """ - For a non-card charge, text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors). This value overrides the account's default statement descriptor. For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. + For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. """ statement_descriptor_suffix: NotRequired[str] """ diff --git a/stripe/_customer.py b/stripe/_customer.py index 012fcbad8..500ba4759 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -537,6 +537,7 @@ class CreateParamsTaxIdDatum(TypedDict): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -580,7 +581,7 @@ class CreateParamsTaxIdDatum(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -640,6 +641,7 @@ class CreateTaxIdParams(RequestOptions): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -683,7 +685,7 @@ class CreateTaxIdParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 16f5f092e..3c01eb8df 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -302,6 +302,7 @@ class CreateParamsTaxIdDatum(TypedDict): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -345,7 +346,7 @@ class CreateParamsTaxIdDatum(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index 1e7791109..f1b9a9a89 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -21,6 +21,10 @@ class CustomerSession(CreateableAPIResource["CustomerSession"]): """ A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access control over a Customer. + + Related guides: [Customer Session with the Payment Element](https://stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment#save-payment-methods), + [Customer Session with the Pricing Table](https://stripe.com/payments/checkout/pricing-table#customer-session), + [Customer Session with the Buy Button](https://stripe.com/payment-links/buy-button#pass-an-existing-customer). """ OBJECT_NAME: ClassVar[Literal["customer_session"]] = "customer_session" diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index 5efa2382e..af1ce221e 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -48,6 +48,7 @@ class CreateParams(TypedDict): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -91,7 +92,7 @@ class CreateParams(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_file.py b/stripe/_file.py index 65c797a6c..7c36c1e5b 100644 --- a/stripe/_file.py +++ b/stripe/_file.py @@ -51,6 +51,7 @@ class CreateParams(RequestOptions): "customer_signature", "dispute_evidence", "identity_document", + "issuing_regulatory_reporting", "pci_document", "tax_document_user_upload", "terminal_reader_splashscreen", @@ -62,7 +63,7 @@ class CreateParams(RequestOptions): class CreateParamsFileLinkData(TypedDict): create: bool """ - Set this to `true` to create a file link for the newly created file. Creating a link is only possible when the file's `purpose` is one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `pci_document`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. + Set this to `true` to create a file link for the newly created file. Creating a link is only possible when the file's `purpose` is one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `issuing_regulatory_reporting`, `pci_document`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. """ expires_at: NotRequired[int] """ @@ -102,6 +103,7 @@ class ListParams(RequestOptions): "finance_report_run", "identity_document", "identity_document_downloadable", + "issuing_regulatory_reporting", "pci_document", "selfie", "sigma_scheduled_query", @@ -176,6 +178,7 @@ class RetrieveParams(RequestOptions): "finance_report_run", "identity_document", "identity_document_downloadable", + "issuing_regulatory_reporting", "pci_document", "selfie", "sigma_scheduled_query", diff --git a/stripe/_file_link.py b/stripe/_file_link.py index ff62720d5..02e1f2168 100644 --- a/stripe/_file_link.py +++ b/stripe/_file_link.py @@ -44,7 +44,7 @@ class CreateParams(RequestOptions): """ file: str """ - The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. + The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `issuing_regulatory_reporting`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ diff --git a/stripe/_file_link_service.py b/stripe/_file_link_service.py index 41166ff6f..73e955371 100644 --- a/stripe/_file_link_service.py +++ b/stripe/_file_link_service.py @@ -21,7 +21,7 @@ class CreateParams(TypedDict): """ file: str """ - The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. + The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `issuing_regulatory_reporting`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ diff --git a/stripe/_file_service.py b/stripe/_file_service.py index 367109272..4c29215c4 100644 --- a/stripe/_file_service.py +++ b/stripe/_file_service.py @@ -31,6 +31,7 @@ class CreateParams(TypedDict): "customer_signature", "dispute_evidence", "identity_document", + "issuing_regulatory_reporting", "pci_document", "tax_document_user_upload", "terminal_reader_splashscreen", @@ -42,7 +43,7 @@ class CreateParams(TypedDict): class CreateParamsFileLinkData(TypedDict): create: bool """ - Set this to `true` to create a file link for the newly created file. Creating a link is only possible when the file's `purpose` is one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `pci_document`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. + Set this to `true` to create a file link for the newly created file. Creating a link is only possible when the file's `purpose` is one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `issuing_regulatory_reporting`, `pci_document`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. """ expires_at: NotRequired[int] """ @@ -82,6 +83,7 @@ class ListParams(TypedDict): "finance_report_run", "identity_document", "identity_document_downloadable", + "issuing_regulatory_reporting", "pci_document", "selfie", "sigma_scheduled_query", diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 29a1a9640..d07fda707 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -240,6 +240,7 @@ class CustomerTaxId(StripeObject): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -284,7 +285,7 @@ class CustomerTaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` """ value: Optional[str] """ @@ -2063,6 +2064,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -2106,7 +2108,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -2450,7 +2452,7 @@ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData( """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ @@ -3900,6 +3902,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -3943,7 +3946,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -4287,7 +4290,7 @@ class UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemPriceData( """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ @@ -5034,6 +5037,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -5077,7 +5081,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -5411,7 +5415,7 @@ class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index cf6691f38..6d75beb36 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -25,6 +25,12 @@ class InvoiceLineItem(UpdateableAPIResource["InvoiceLineItem"]): + """ + Invoice Line Items represent the individual lines within an [invoice](https://stripe.com/docs/api/invoices) and only exist within the context of an invoice. + + Each line item is backed by either an [invoice item](https://stripe.com/docs/api/invoiceitems) or a [subscription item](https://stripe.com/docs/api/subscription_items). + """ + OBJECT_NAME: ClassVar[Literal["line_item"]] = "line_item" class DiscountAmount(StripeObject): diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 9ba1ab735..510e62407 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -1088,6 +1088,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -1131,7 +1132,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -1479,7 +1480,7 @@ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData( """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ @@ -2306,6 +2307,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -2349,7 +2351,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -2689,7 +2691,7 @@ class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index 80cb30a6a..a42d6a464 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -309,6 +309,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -352,7 +353,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -696,7 +697,7 @@ class ListParamsScheduleDetailsPhaseAddInvoiceItemPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ diff --git a/stripe/_line_item.py b/stripe/_line_item.py index 9b1de7110..19641c124 100644 --- a/stripe/_line_item.py +++ b/stripe/_line_item.py @@ -88,7 +88,7 @@ class Tax(StripeObject): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - description: str + description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 7ddf264ba..f2c006c3a 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -2081,7 +2081,9 @@ class CaptureParams(RequestOptions): """ statement_descriptor: NotRequired[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ @@ -4519,7 +4521,9 @@ class CreateParams(RequestOptions): """ statement_descriptor: NotRequired[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ @@ -6783,7 +6787,7 @@ class IncrementAuthorizationParams(RequestOptions): """ statement_descriptor: NotRequired[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card or card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). """ transfer_data: NotRequired[ "PaymentIntent.IncrementAuthorizationParamsTransferData" @@ -6932,7 +6936,9 @@ class ModifyParams(RequestOptions): """ statement_descriptor: NotRequired[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ @@ -9305,7 +9311,9 @@ class VerifyMicrodepositsParams(RequestOptions): """ statement_descriptor: Optional[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: Optional[str] """ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index b63deeff4..29e858261 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -68,7 +68,9 @@ class CaptureParams(TypedDict): """ statement_descriptor: NotRequired[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ @@ -2534,7 +2536,9 @@ class CreateParams(TypedDict): """ statement_descriptor: NotRequired[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ @@ -4822,7 +4826,7 @@ class IncrementAuthorizationParams(TypedDict): """ statement_descriptor: NotRequired[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card or card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). """ transfer_data: NotRequired[ "PaymentIntentService.IncrementAuthorizationParamsTransferData" @@ -5001,7 +5005,9 @@ class UpdateParams(TypedDict): """ statement_descriptor: NotRequired[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 5d384e435..f6bf3ba2f 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -1194,11 +1194,13 @@ class CreateParamsPaymentIntentData(TypedDict): """ statement_descriptor: NotRequired[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_group: NotRequired[str] """ @@ -1994,11 +1996,13 @@ class ModifyParamsPaymentIntentData(TypedDict): """ statement_descriptor: NotRequired["Literal['']|str"] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired["Literal['']|str"] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_group: NotRequired["Literal['']|str"] """ diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index b1dacbc1d..678cd5b7c 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -548,11 +548,13 @@ class CreateParamsPaymentIntentData(TypedDict): """ statement_descriptor: NotRequired[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_group: NotRequired[str] """ @@ -1346,11 +1348,13 @@ class UpdateParamsPaymentIntentData(TypedDict): """ statement_descriptor: NotRequired["Literal['']|str"] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired["Literal['']|str"] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_group: NotRequired["Literal['']|str"] """ diff --git a/stripe/_subscription.py b/stripe/_subscription.py index a1e841553..f35851929 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -723,7 +723,7 @@ class CreateParamsAddInvoiceItemPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ @@ -1541,7 +1541,7 @@ class ModifyParamsAddInvoiceItemPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index d688436d7..f241ad1b5 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -765,7 +765,7 @@ class CreateParamsPhaseAddInvoiceItemPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ @@ -1395,7 +1395,7 @@ class ModifyParamsPhaseAddInvoiceItemPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index 4ec8d5603..938df116d 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -349,7 +349,7 @@ class CreateParamsPhaseAddInvoiceItemPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ @@ -997,7 +997,7 @@ class UpdateParamsPhaseAddInvoiceItemPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index f183dc291..3735278e8 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -284,7 +284,7 @@ class CreateParamsAddInvoiceItemPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ @@ -1158,7 +1158,7 @@ class UpdateParamsAddInvoiceItemPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ unit_amount_decimal: NotRequired[str] """ diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index 436e6ade3..3c6ab718e 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -111,6 +111,7 @@ class CreateParams(RequestOptions): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -154,7 +155,7 @@ class CreateParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -281,6 +282,7 @@ class RetrieveParams(RequestOptions): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -325,7 +327,7 @@ class RetrieveParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` """ value: str """ diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py index c2b1546df..87e07bc5b 100644 --- a/stripe/_tax_id_service.py +++ b/stripe/_tax_id_service.py @@ -52,6 +52,7 @@ class CreateParams(TypedDict): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -95,7 +96,7 @@ class CreateParams(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 644112811..5b1c4b8f4 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -370,6 +370,7 @@ class TaxId(StripeObject): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -414,7 +415,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` """ value: Optional[str] """ @@ -2412,11 +2413,13 @@ class CreateParamsPaymentIntentData(TypedDict): """ statement_descriptor: NotRequired[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired[ "Session.CreateParamsPaymentIntentDataTransferData" diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 10c03dcb6..a484a7081 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -829,11 +829,13 @@ class CreateParamsPaymentIntentData(TypedDict): """ statement_descriptor: NotRequired[str] """ - Text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors) for a non-card charge. This value overrides the account's default statement descriptor. Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ statement_descriptor_suffix: NotRequired[str] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ transfer_data: NotRequired[ "SessionService.CreateParamsPaymentIntentDataTransferData" diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 69157e32b..07f6d8442 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -88,6 +88,7 @@ class TaxId(StripeObject): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -132,7 +133,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` """ value: str """ @@ -503,6 +504,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -546,7 +548,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -627,7 +629,7 @@ class CreateParamsShippingCost(TypedDict): """ tax_code: NotRequired[str] """ - The [tax code](https://stripe.com/docs/tax/tax-categories) used to calculate tax on shipping. If not provided, the default shipping tax code from your [Tax Settings](https://stripe.com/settings/tax) is used. + The [tax code](https://stripe.com/docs/tax/tax-categories) used to calculate tax on shipping. If not provided, the default shipping tax code from your [Tax Settings](https://dashboard.stripe.com/settings/tax) is used. """ class ListLineItemsParams(RequestOptions): diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index c1b68be72..cc367fc97 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -144,6 +144,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -187,7 +188,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -268,7 +269,7 @@ class CreateParamsShippingCost(TypedDict): """ tax_code: NotRequired[str] """ - The [tax code](https://stripe.com/docs/tax/tax-categories) used to calculate tax on shipping. If not provided, the default shipping tax code from your [Tax Settings](https://stripe.com/settings/tax) is used. + The [tax code](https://stripe.com/docs/tax/tax-categories) used to calculate tax on shipping. If not provided, the default shipping tax code from your [Tax Settings](https://dashboard.stripe.com/settings/tax) is used. """ class RetrieveParams(TypedDict): diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index 4ae3ba540..8711f8d18 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -88,6 +88,7 @@ class TaxId(StripeObject): "gb_vat", "ge_vat", "hk_br", + "hr_oib", "hu_tin", "id_npwp", "il_vat", @@ -132,7 +133,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` """ value: str """ diff --git a/stripe/test_helpers/_test_clock.py b/stripe/test_helpers/_test_clock.py index b73b93ed9..c9eaab7ae 100644 --- a/stripe/test_helpers/_test_clock.py +++ b/stripe/test_helpers/_test_clock.py @@ -5,6 +5,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, Unpack @@ -25,6 +26,16 @@ class TestClock( "test_helpers.test_clock" ) + class StatusDetails(StripeObject): + class Advancing(StripeObject): + target_frozen_time: int + """ + The `frozen_time` that the Test Clock is advancing towards. + """ + + advancing: Optional[Advancing] + _inner_class_types = {"advancing": Advancing} + class AdvanceParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -108,6 +119,7 @@ class RetrieveParams(RequestOptions): """ The status of the Test Clock. """ + status_details: Optional[StatusDetails] deleted: Optional[Literal[True]] """ Always true for a deleted object @@ -412,3 +424,5 @@ async def retrieve_async( instance = cls(id, **params) await instance.refresh_async() return instance + + _inner_class_types = {"status_details": StatusDetails} diff --git a/stripe/treasury/_inbound_transfer.py b/stripe/treasury/_inbound_transfer.py index d23b01a94..5976aa1eb 100644 --- a/stripe/treasury/_inbound_transfer.py +++ b/stripe/treasury/_inbound_transfer.py @@ -28,7 +28,9 @@ class InboundTransfer( ListableAPIResource["InboundTransfer"], ): """ - Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + + Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) """ OBJECT_NAME: ClassVar[Literal["treasury.inbound_transfer"]] = ( diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index db206c833..1104e2885 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -28,9 +28,11 @@ class OutboundPayment( ListableAPIResource["OutboundPayment"], ): """ - Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + + Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) """ OBJECT_NAME: ClassVar[Literal["treasury.outbound_payment"]] = ( diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index db574845d..1cfac43da 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -28,9 +28,11 @@ class OutboundTransfer( ListableAPIResource["OutboundTransfer"], ): """ - Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + + Related guide: [Moving money with Treasury using OutboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) """ OBJECT_NAME: ClassVar[Literal["treasury.outbound_transfer"]] = ( diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 4aad11661..2e67c2832 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -130,9 +130,11 @@ class SourceFlowDetails(StripeObject): """ outbound_payment: Optional["OutboundPayment"] """ - Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + + Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) """ payout: Optional["Payout"] """ diff --git a/stripe/treasury/_transaction.py b/stripe/treasury/_transaction.py index a8d220526..8652d29f5 100644 --- a/stripe/treasury/_transaction.py +++ b/stripe/treasury/_transaction.py @@ -59,7 +59,9 @@ class FlowDetails(StripeObject): """ inbound_transfer: Optional["InboundTransfer"] """ - Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + + Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) """ issuing_authorization: Optional["Authorization"] """ @@ -71,15 +73,19 @@ class FlowDetails(StripeObject): """ outbound_payment: Optional["OutboundPayment"] """ - Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + + Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) """ outbound_transfer: Optional["OutboundTransfer"] """ - Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + + Related guide: [Moving money with Treasury using OutboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) """ received_credit: Optional["ReceivedCredit"] """ diff --git a/stripe/treasury/_transaction_entry.py b/stripe/treasury/_transaction_entry.py index 6633d2785..7fba8ed23 100644 --- a/stripe/treasury/_transaction_entry.py +++ b/stripe/treasury/_transaction_entry.py @@ -60,7 +60,9 @@ class FlowDetails(StripeObject): """ inbound_transfer: Optional["InboundTransfer"] """ - Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + + Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) """ issuing_authorization: Optional["Authorization"] """ @@ -72,15 +74,19 @@ class FlowDetails(StripeObject): """ outbound_payment: Optional["OutboundPayment"] """ - Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + + Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) """ outbound_transfer: Optional["OutboundTransfer"] """ - Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + + Related guide: [Moving money with Treasury using OutboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) """ received_credit: Optional["ReceivedCredit"] """ From 3d0426fea243a0b0031c827b78f68db680500b6e Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 29 Aug 2024 15:01:04 -0700 Subject: [PATCH 105/179] Bump version to 10.9.0 --- CHANGELOG.md | 15 +++++++++++---- VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11ef47a0c..b4c6abdf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 10.9.0 - 2024-08-29 +* [#1385](https://github.com/stripe/stripe-python/pull/1385) Generate SDK for OpenAPI spec version 1230 + * Add support for `status_details` on resource `stripe.test_helpers.TestClock` + * Change type of `fields` on `stripe.AccountLink.CreateParamsCollectionOptions` from `Literal['currently_due', 'eventually_due']` to `NotRequired[Literal['currently_due', 'eventually_due']]` + * Add support for `hr_oib` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `issuing_regulatory_reporting` on enums `stripe.File.purpose`, `stripe.File.CreateParams.purpose`, and `stripe.File.ListParams.purpose` + ## 10.8.0 - 2024-08-15 * [#1373](https://github.com/stripe/stripe-python/pull/1373) Update generated code * Add support for `authorization_code` on resource class `stripe.Charge.PaymentMethodDetails.Card` @@ -30,10 +37,10 @@ ## 10.6.0 - 2024-08-01 * [#1369](https://github.com/stripe/stripe-python/pull/1369) Update generated code - * Add support for resource `stripe.billing.Alert` - * ⚠️ Remove support for `authorization_code` on resource class `stripe.Charge.PaymentMethodDetails.Card`. This was accidentally released last week. - * Add support for `billing.alert.triggered` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` - * Add support for `charge_exceeds_transaction_limit` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Add support for resource `stripe.billing.Alert` + * ⚠️ Remove support for `authorization_code` on resource class `stripe.Charge.PaymentMethodDetails.Card`. This was accidentally released last week. + * Add support for `billing.alert.triggered` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `charge_exceeds_transaction_limit` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` ## 10.5.0 - 2024-07-25 * [#1368](https://github.com/stripe/stripe-python/pull/1368) Update generated code diff --git a/VERSION b/VERSION index 2a3262d8a..fe6d2ac74 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.8.0 +10.9.0 diff --git a/stripe/_version.py b/stripe/_version.py index aa24b7374..164606a55 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.8.0" +VERSION = "10.9.0" From 90f59fc89808b1cbc824887deb0389d8219abd4b Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:50:42 -0700 Subject: [PATCH 106/179] Update generated code (#1376) * Update generated code for v1232 * Update generated code for v1233 * Update generated code for v1235 * Update generated code for v1238 * Update generated code for v1243 * Update generated code for v1244 * Update generated code for v1245 * Update generated code for v1246 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_invoice.py | 6 +++--- stripe/_invoice_service.py | 4 ++-- stripe/_invoice_upcoming_lines_service.py | 2 +- stripe/_payment_intent.py | 24 +++++++++++++++++++++++ stripe/_payment_intent_service.py | 6 ++++++ stripe/_transfer.py | 2 +- stripe/billing/_alert.py | 8 ++++++++ stripe/billing/_alert_service.py | 8 ++++++++ stripe/checkout/_session.py | 4 ++-- stripe/checkout/_session_service.py | 2 +- stripe/terminal/_reader.py | 2 +- stripe/terminal/_reader_service.py | 2 +- 13 files changed, 59 insertions(+), 13 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index a02063ef6..340c4578c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1230 +v1246 \ No newline at end of file diff --git a/stripe/_invoice.py b/stripe/_invoice.py index d07fda707..60d4947ea 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -1871,7 +1871,7 @@ class CreatePreviewParams(RequestOptions): List["Invoice.CreatePreviewParamsInvoiceItem"] ] """ - List of invoice items to add or update in the upcoming invoice preview. + List of invoice items to add or update in the upcoming invoice preview (up to 250). """ issuer: NotRequired["Invoice.CreatePreviewParamsIssuer"] """ @@ -3647,7 +3647,7 @@ class UpcomingLinesParams(RequestOptions): List["Invoice.UpcomingLinesParamsInvoiceItem"] ] """ - List of invoice items to add or update in the upcoming invoice preview. + List of invoice items to add or update in the upcoming invoice preview (up to 250). """ issuer: NotRequired["Invoice.UpcomingLinesParamsIssuer"] """ @@ -4794,7 +4794,7 @@ class UpcomingParams(RequestOptions): """ invoice_items: NotRequired[List["Invoice.UpcomingParamsInvoiceItem"]] """ - List of invoice items to add or update in the upcoming invoice preview. + List of invoice items to add or update in the upcoming invoice preview (up to 250). """ issuer: NotRequired["Invoice.UpcomingParamsIssuer"] """ diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 510e62407..340514e9e 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -891,7 +891,7 @@ class CreatePreviewParams(TypedDict): List["InvoiceService.CreatePreviewParamsInvoiceItem"] ] """ - List of invoice items to add or update in the upcoming invoice preview. + List of invoice items to add or update in the upcoming invoice preview (up to 250). """ issuer: NotRequired["InvoiceService.CreatePreviewParamsIssuer"] """ @@ -2060,7 +2060,7 @@ class UpcomingParams(TypedDict): List["InvoiceService.UpcomingParamsInvoiceItem"] ] """ - List of invoice items to add or update in the upcoming invoice preview. + List of invoice items to add or update in the upcoming invoice preview (up to 250). """ issuer: NotRequired["InvoiceService.UpcomingParamsIssuer"] """ diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index a42d6a464..12e58adf8 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -52,7 +52,7 @@ class ListParams(TypedDict): List["InvoiceUpcomingLinesService.ListParamsInvoiceItem"] ] """ - List of invoice items to add or update in the upcoming invoice preview. + List of invoice items to add or update in the upcoming invoice preview (up to 250). """ issuer: NotRequired["InvoiceUpcomingLinesService.ListParamsIssuer"] """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index f2c006c3a..78fdab4ed 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -9767,6 +9767,9 @@ def _cls_confirm( after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. + There is a variable upper limit on how many times a PaymentIntent can be confirmed. + After this limit is reached, any further calls to this endpoint will + transition the PaymentIntent to the canceled state. """ return cast( "PaymentIntent", @@ -9807,6 +9810,9 @@ def confirm( after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. + There is a variable upper limit on how many times a PaymentIntent can be confirmed. + After this limit is reached, any further calls to this endpoint will + transition the PaymentIntent to the canceled state. """ ... @@ -9837,6 +9843,9 @@ def confirm( after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. + There is a variable upper limit on how many times a PaymentIntent can be confirmed. + After this limit is reached, any further calls to this endpoint will + transition the PaymentIntent to the canceled state. """ ... @@ -9867,6 +9876,9 @@ def confirm( # pyright: ignore[reportGeneralTypeIssues] after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. + There is a variable upper limit on how many times a PaymentIntent can be confirmed. + After this limit is reached, any further calls to this endpoint will + transition the PaymentIntent to the canceled state. """ return cast( "PaymentIntent", @@ -9906,6 +9918,9 @@ async def _cls_confirm_async( after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. + There is a variable upper limit on how many times a PaymentIntent can be confirmed. + After this limit is reached, any further calls to this endpoint will + transition the PaymentIntent to the canceled state. """ return cast( "PaymentIntent", @@ -9946,6 +9961,9 @@ async def confirm_async( after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. + There is a variable upper limit on how many times a PaymentIntent can be confirmed. + After this limit is reached, any further calls to this endpoint will + transition the PaymentIntent to the canceled state. """ ... @@ -9976,6 +9994,9 @@ async def confirm_async( after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. + There is a variable upper limit on how many times a PaymentIntent can be confirmed. + After this limit is reached, any further calls to this endpoint will + transition the PaymentIntent to the canceled state. """ ... @@ -10006,6 +10027,9 @@ async def confirm_async( # pyright: ignore[reportGeneralTypeIssues] after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. + There is a variable upper limit on how many times a PaymentIntent can be confirmed. + After this limit is reached, any further calls to this endpoint will + transition the PaymentIntent to the canceled state. """ return cast( "PaymentIntent", diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 29e858261..9be12ae19 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -7630,6 +7630,9 @@ def confirm( after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. + There is a variable upper limit on how many times a PaymentIntent can be confirmed. + After this limit is reached, any further calls to this endpoint will + transition the PaymentIntent to the canceled state. """ return cast( PaymentIntent, @@ -7673,6 +7676,9 @@ async def confirm_async( after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. + There is a variable upper limit on how many times a PaymentIntent can be confirmed. + After this limit is reached, any further calls to this endpoint will + transition the PaymentIntent to the canceled state. """ return cast( PaymentIntent, diff --git a/stripe/_transfer.py b/stripe/_transfer.py index 75512a1c9..17e743f78 100644 --- a/stripe/_transfer.py +++ b/stripe/_transfer.py @@ -265,7 +265,7 @@ class RetrieveReversalParams(RequestOptions): """ source_transaction: Optional[ExpandableField["Charge"]] """ - ID of the charge or payment that was used to fund the transfer. If null, the transfer was funded from the available balance. + ID of the charge that was used to fund the transfer. If null, the transfer was funded from the available balance. """ source_type: Optional[str] """ diff --git a/stripe/billing/_alert.py b/stripe/billing/_alert.py index d2a2ddbac..02aecb7da 100644 --- a/stripe/billing/_alert.py +++ b/stripe/billing/_alert.py @@ -89,6 +89,14 @@ class CreateParamsFilter(TypedDict): """ Limit the scope to this alert only to this customer. """ + subscription: NotRequired[str] + """ + Limit the scope of this rated usage alert to this subscription. + """ + subscription_item: NotRequired[str] + """ + Limit the scope of this rated usage alert to this subscription item. + """ class CreateParamsUsageThresholdConfig(TypedDict): gte: int diff --git a/stripe/billing/_alert_service.py b/stripe/billing/_alert_service.py index 31bda7bdb..39649a26a 100644 --- a/stripe/billing/_alert_service.py +++ b/stripe/billing/_alert_service.py @@ -51,6 +51,14 @@ class CreateParamsFilter(TypedDict): """ Limit the scope to this alert only to this customer. """ + subscription: NotRequired[str] + """ + Limit the scope of this rated usage alert to this subscription. + """ + subscription_item: NotRequired[str] + """ + Limit the scope of this rated usage alert to this subscription item. + """ class CreateParamsUsageThresholdConfig(TypedDict): gte: int diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 5b1c4b8f4..a447c8af4 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1886,7 +1886,7 @@ class CreateParams(RequestOptions): Literal["always", "if_required", "never"] ] """ - This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. + This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. Defaults to `always`. """ return_url: NotRequired[str] """ @@ -4109,7 +4109,7 @@ class RetrieveParams(RequestOptions): """ redirect_on_completion: Optional[Literal["always", "if_required", "never"]] """ - This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. + This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. Defaults to `always`. """ return_url: Optional[str] """ diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index a484a7081..628f7f237 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -288,7 +288,7 @@ class CreateParams(TypedDict): Literal["always", "if_required", "never"] ] """ - This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. + This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. Defaults to `always`. """ return_url: NotRequired[str] """ diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index 867dd6fe4..6d7553865 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -398,7 +398,7 @@ class ProcessPaymentIntentParamsProcessConfigTipping(TypedDict): """ class ProcessSetupIntentParams(RequestOptions): - customer_consent_collected: bool + customer_consent_collected: NotRequired[bool] """ Customer Consent Collected """ diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 7b8739b94..362d89162 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -125,7 +125,7 @@ class ProcessPaymentIntentParamsProcessConfigTipping(TypedDict): """ class ProcessSetupIntentParams(TypedDict): - customer_consent_collected: bool + customer_consent_collected: NotRequired[bool] """ Customer Consent Collected """ From f9ef46feb246a6d949185544ded1862e7d2f578c Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 5 Sep 2024 13:55:35 -0700 Subject: [PATCH 107/179] Bump version to 10.10.0 --- CHANGELOG.md | 5 +++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4c6abdf5..30b85abb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 10.10.0 - 2024-09-05 +* [#1376](https://github.com/stripe/stripe-python/pull/1376) Update generated code + * Add support for `subscription` on parameter class `stripe.billing.Alert.CreateParamsFilter` + * Change type of `customer_consent_collected` on `stripe.terminal.Reader.ProcessSetupIntentParams` from `bool` to `NotRequired[bool]` + ## 10.9.0 - 2024-08-29 * [#1385](https://github.com/stripe/stripe-python/pull/1385) Generate SDK for OpenAPI spec version 1230 * Add support for `status_details` on resource `stripe.test_helpers.TestClock` diff --git a/VERSION b/VERSION index fe6d2ac74..e8a306979 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.9.0 +10.10.0 diff --git a/stripe/_version.py b/stripe/_version.py index 164606a55..2be36b44b 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.9.0" +VERSION = "10.10.0" From ecb46762b4d0afe1c8fd885259499b550bd931eb Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:53:38 -0700 Subject: [PATCH 108/179] Update generated code (#1391) * Update generated code for v1249 * Update generated code for v1250 * Update generated code for v1252 * Update generated code for v1255 * Update generated code for v1257 * Update generated code for v1259 * Update generated code for v1260 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/__init__.py | 6 + stripe/_customer.py | 12 + stripe/_customer_service.py | 8 + stripe/_invoice.py | 24 ++ stripe/_invoice_line_item.py | 4 +- stripe/_invoice_rendering_template.py | 385 ++++++++++++++++++ stripe/_invoice_rendering_template_service.py | 219 ++++++++++ stripe/_invoice_service.py | 16 + stripe/_object_classes.py | 1 + stripe/_payment_link.py | 9 + stripe/_payment_link_service.py | 8 + stripe/_quote.py | 4 +- stripe/_quote_service.py | 4 +- stripe/_stripe_client.py | 6 + stripe/_subscription.py | 6 + stripe/_subscription_service.py | 6 + stripe/api_resources/__init__.py | 3 + .../invoice_rendering_template.py | 21 + stripe/checkout/_session.py | 8 + stripe/checkout/_session_service.py | 4 + stripe/issuing/_card.py | 1 + stripe/terminal/_location.py | 2 +- stripe/terminal/_location_service.py | 2 +- stripe/test_helpers/_test_clock.py | 2 +- 25 files changed, 753 insertions(+), 10 deletions(-) create mode 100644 stripe/_invoice_rendering_template.py create mode 100644 stripe/_invoice_rendering_template_service.py create mode 100644 stripe/api_resources/invoice_rendering_template.py diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 340c4578c..ad548b855 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1246 \ No newline at end of file +v1260 \ No newline at end of file diff --git a/stripe/__init__.py b/stripe/__init__.py index e8d3e8578..9edd2b715 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -382,6 +382,12 @@ def __getattr__(name): from stripe._invoice_line_item_service import ( InvoiceLineItemService as InvoiceLineItemService, ) +from stripe._invoice_rendering_template import ( + InvoiceRenderingTemplate as InvoiceRenderingTemplate, +) +from stripe._invoice_rendering_template_service import ( + InvoiceRenderingTemplateService as InvoiceRenderingTemplateService, +) from stripe._invoice_service import InvoiceService as InvoiceService from stripe._invoice_upcoming_lines_service import ( InvoiceUpcomingLinesService as InvoiceUpcomingLinesService, diff --git a/stripe/_customer.py b/stripe/_customer.py index 500ba4759..b163859fc 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -112,6 +112,10 @@ class RenderingOptions(StripeObject): """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. """ + template: Optional[str] + """ + ID of the invoice rendering template to be used for this customer's invoices. If set, the template will be used on all invoices for this customer unless a template is set directly on the invoice. + """ custom_fields: Optional[List[CustomField]] """ @@ -452,6 +456,10 @@ class CreateParamsInvoiceSettingsRenderingOptions(TypedDict): """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ + template: NotRequired[str] + """ + ID of the invoice rendering template to use for future invoices. + """ class CreateParamsShipping(TypedDict): address: "Customer.CreateParamsShippingAddress" @@ -1112,6 +1120,10 @@ class ModifyParamsInvoiceSettingsRenderingOptions(TypedDict): """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ + template: NotRequired[str] + """ + ID of the invoice rendering template to use for future invoices. + """ class ModifyParamsShipping(TypedDict): address: "Customer.ModifyParamsShippingAddress" diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 3c01eb8df..100c7c367 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -217,6 +217,10 @@ class CreateParamsInvoiceSettingsRenderingOptions(TypedDict): """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ + template: NotRequired[str] + """ + ID of the invoice rendering template to use for future invoices. + """ class CreateParamsShipping(TypedDict): address: "CustomerService.CreateParamsShippingAddress" @@ -600,6 +604,10 @@ class UpdateParamsInvoiceSettingsRenderingOptions(TypedDict): """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ + template: NotRequired[str] + """ + ID of the invoice rendering template to use for future invoices. + """ class UpdateParamsShipping(TypedDict): address: "CustomerService.UpdateParamsShippingAddress" diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 60d4947ea..8e83f0200 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -791,6 +791,14 @@ class Pdf(StripeObject): """ Invoice pdf rendering options """ + template: Optional[str] + """ + ID of the rendering template that the invoice is formatted by. + """ + template_version: Optional[int] + """ + Version of the rendering template that the invoice is using. + """ _inner_class_types = {"pdf": Pdf} class ShippingCost(StripeObject): @@ -1656,6 +1664,14 @@ class CreateParamsRendering(TypedDict): """ Invoice pdf rendering options """ + template: NotRequired[str] + """ + ID of the invoice rendering template to use for this invoice. + """ + template_version: NotRequired["Literal['']|int"] + """ + The specific version of invoice rendering template to use for this invoice. + """ class CreateParamsRenderingPdf(TypedDict): page_size: NotRequired[Literal["a4", "auto", "letter"]] @@ -3342,6 +3358,14 @@ class ModifyParamsRendering(TypedDict): """ Invoice pdf rendering options """ + template: NotRequired[str] + """ + ID of the invoice rendering template to use for this invoice. + """ + template_version: NotRequired["Literal['']|int"] + """ + The specific version of invoice rendering template to use for this invoice. + """ class ModifyParamsRenderingPdf(TypedDict): page_size: NotRequired[Literal["a4", "auto", "letter"]] diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 6d75beb36..0985834a8 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -386,11 +386,11 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): """ The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription. """ - tax_amounts: Optional[List[TaxAmount]] + tax_amounts: List[TaxAmount] """ The amount of tax calculated per tax rate for this line item """ - tax_rates: Optional[List["TaxRate"]] + tax_rates: List["TaxRate"] """ The tax rates which apply to the line item. """ diff --git a/stripe/_invoice_rendering_template.py b/stripe/_invoice_rendering_template.py new file mode 100644 index 000000000..5a57cf743 --- /dev/null +++ b/stripe/_invoice_rendering_template.py @@ -0,0 +1,385 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, Dict, List, Optional, cast, overload +from typing_extensions import Literal, NotRequired, Unpack + + +class InvoiceRenderingTemplate( + ListableAPIResource["InvoiceRenderingTemplate"] +): + OBJECT_NAME: ClassVar[Literal["invoice_rendering_template"]] = ( + "invoice_rendering_template" + ) + + class ArchiveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ListParams(RequestOptions): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[Literal["active", "archived"]] + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + version: NotRequired[int] + + class UnarchiveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + nickname: Optional[str] + """ + A brief description of the template, hidden from customers + """ + object: Literal["invoice_rendering_template"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + status: Literal["active", "archived"] + """ + The status of the template, one of `active` or `archived`. + """ + version: int + """ + Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering + """ + + @classmethod + def _cls_archive( + cls, + template: str, + **params: Unpack["InvoiceRenderingTemplate.ArchiveParams"], + ) -> "InvoiceRenderingTemplate": + """ + Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. + """ + return cast( + "InvoiceRenderingTemplate", + cls._static_request( + "post", + "/v1/invoice_rendering_templates/{template}/archive".format( + template=sanitize_id(template) + ), + params=params, + ), + ) + + @overload + @staticmethod + def archive( + template: str, + **params: Unpack["InvoiceRenderingTemplate.ArchiveParams"], + ) -> "InvoiceRenderingTemplate": + """ + Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. + """ + ... + + @overload + def archive( + self, **params: Unpack["InvoiceRenderingTemplate.ArchiveParams"] + ) -> "InvoiceRenderingTemplate": + """ + Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. + """ + ... + + @class_method_variant("_cls_archive") + def archive( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["InvoiceRenderingTemplate.ArchiveParams"] + ) -> "InvoiceRenderingTemplate": + """ + Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. + """ + return cast( + "InvoiceRenderingTemplate", + self._request( + "post", + "/v1/invoice_rendering_templates/{template}/archive".format( + template=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_archive_async( + cls, + template: str, + **params: Unpack["InvoiceRenderingTemplate.ArchiveParams"], + ) -> "InvoiceRenderingTemplate": + """ + Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. + """ + return cast( + "InvoiceRenderingTemplate", + await cls._static_request_async( + "post", + "/v1/invoice_rendering_templates/{template}/archive".format( + template=sanitize_id(template) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def archive_async( + template: str, + **params: Unpack["InvoiceRenderingTemplate.ArchiveParams"], + ) -> "InvoiceRenderingTemplate": + """ + Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. + """ + ... + + @overload + async def archive_async( + self, **params: Unpack["InvoiceRenderingTemplate.ArchiveParams"] + ) -> "InvoiceRenderingTemplate": + """ + Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. + """ + ... + + @class_method_variant("_cls_archive_async") + async def archive_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["InvoiceRenderingTemplate.ArchiveParams"] + ) -> "InvoiceRenderingTemplate": + """ + Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. + """ + return cast( + "InvoiceRenderingTemplate", + await self._request_async( + "post", + "/v1/invoice_rendering_templates/{template}/archive".format( + template=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["InvoiceRenderingTemplate.ListParams"] + ) -> ListObject["InvoiceRenderingTemplate"]: + """ + List all templates, ordered by creation date, with the most recently created template appearing first. + """ + 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["InvoiceRenderingTemplate.ListParams"] + ) -> ListObject["InvoiceRenderingTemplate"]: + """ + List all templates, ordered by creation date, with the most recently created template appearing first. + """ + 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["InvoiceRenderingTemplate.RetrieveParams"], + ) -> "InvoiceRenderingTemplate": + """ + Retrieves an invoice rendering template with the given ID. It by default returns the latest version of the template. Optionally, specify a version to see previous versions. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, + id: str, + **params: Unpack["InvoiceRenderingTemplate.RetrieveParams"], + ) -> "InvoiceRenderingTemplate": + """ + Retrieves an invoice rendering template with the given ID. It by default returns the latest version of the template. Optionally, specify a version to see previous versions. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + @classmethod + def _cls_unarchive( + cls, + template: str, + **params: Unpack["InvoiceRenderingTemplate.UnarchiveParams"], + ) -> "InvoiceRenderingTemplate": + """ + Unarchive an invoice rendering template so it can be used on new Stripe objects again. + """ + return cast( + "InvoiceRenderingTemplate", + cls._static_request( + "post", + "/v1/invoice_rendering_templates/{template}/unarchive".format( + template=sanitize_id(template) + ), + params=params, + ), + ) + + @overload + @staticmethod + def unarchive( + template: str, + **params: Unpack["InvoiceRenderingTemplate.UnarchiveParams"], + ) -> "InvoiceRenderingTemplate": + """ + Unarchive an invoice rendering template so it can be used on new Stripe objects again. + """ + ... + + @overload + def unarchive( + self, **params: Unpack["InvoiceRenderingTemplate.UnarchiveParams"] + ) -> "InvoiceRenderingTemplate": + """ + Unarchive an invoice rendering template so it can be used on new Stripe objects again. + """ + ... + + @class_method_variant("_cls_unarchive") + def unarchive( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["InvoiceRenderingTemplate.UnarchiveParams"] + ) -> "InvoiceRenderingTemplate": + """ + Unarchive an invoice rendering template so it can be used on new Stripe objects again. + """ + return cast( + "InvoiceRenderingTemplate", + self._request( + "post", + "/v1/invoice_rendering_templates/{template}/unarchive".format( + template=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_unarchive_async( + cls, + template: str, + **params: Unpack["InvoiceRenderingTemplate.UnarchiveParams"], + ) -> "InvoiceRenderingTemplate": + """ + Unarchive an invoice rendering template so it can be used on new Stripe objects again. + """ + return cast( + "InvoiceRenderingTemplate", + await cls._static_request_async( + "post", + "/v1/invoice_rendering_templates/{template}/unarchive".format( + template=sanitize_id(template) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def unarchive_async( + template: str, + **params: Unpack["InvoiceRenderingTemplate.UnarchiveParams"], + ) -> "InvoiceRenderingTemplate": + """ + Unarchive an invoice rendering template so it can be used on new Stripe objects again. + """ + ... + + @overload + async def unarchive_async( + self, **params: Unpack["InvoiceRenderingTemplate.UnarchiveParams"] + ) -> "InvoiceRenderingTemplate": + """ + Unarchive an invoice rendering template so it can be used on new Stripe objects again. + """ + ... + + @class_method_variant("_cls_unarchive_async") + async def unarchive_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["InvoiceRenderingTemplate.UnarchiveParams"] + ) -> "InvoiceRenderingTemplate": + """ + Unarchive an invoice rendering template so it can be used on new Stripe objects again. + """ + return cast( + "InvoiceRenderingTemplate", + await self._request_async( + "post", + "/v1/invoice_rendering_templates/{template}/unarchive".format( + template=sanitize_id(self.get("id")) + ), + params=params, + ), + ) diff --git a/stripe/_invoice_rendering_template_service.py b/stripe/_invoice_rendering_template_service.py new file mode 100644 index 000000000..239ee25b8 --- /dev/null +++ b/stripe/_invoice_rendering_template_service.py @@ -0,0 +1,219 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._invoice_rendering_template import InvoiceRenderingTemplate +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class InvoiceRenderingTemplateService(StripeService): + class ArchiveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[Literal["active", "archived"]] + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + version: NotRequired[int] + + class UnarchiveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "InvoiceRenderingTemplateService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[InvoiceRenderingTemplate]: + """ + List all templates, ordered by creation date, with the most recently created template appearing first. + """ + return cast( + ListObject[InvoiceRenderingTemplate], + self._request( + "get", + "/v1/invoice_rendering_templates", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "InvoiceRenderingTemplateService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[InvoiceRenderingTemplate]: + """ + List all templates, ordered by creation date, with the most recently created template appearing first. + """ + return cast( + ListObject[InvoiceRenderingTemplate], + await self._request_async( + "get", + "/v1/invoice_rendering_templates", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + template: str, + params: "InvoiceRenderingTemplateService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> InvoiceRenderingTemplate: + """ + Retrieves an invoice rendering template with the given ID. It by default returns the latest version of the template. Optionally, specify a version to see previous versions. + """ + return cast( + InvoiceRenderingTemplate, + self._request( + "get", + "/v1/invoice_rendering_templates/{template}".format( + template=sanitize_id(template), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + template: str, + params: "InvoiceRenderingTemplateService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> InvoiceRenderingTemplate: + """ + Retrieves an invoice rendering template with the given ID. It by default returns the latest version of the template. Optionally, specify a version to see previous versions. + """ + return cast( + InvoiceRenderingTemplate, + await self._request_async( + "get", + "/v1/invoice_rendering_templates/{template}".format( + template=sanitize_id(template), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def archive( + self, + template: str, + params: "InvoiceRenderingTemplateService.ArchiveParams" = {}, + options: RequestOptions = {}, + ) -> InvoiceRenderingTemplate: + """ + Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. + """ + return cast( + InvoiceRenderingTemplate, + self._request( + "post", + "/v1/invoice_rendering_templates/{template}/archive".format( + template=sanitize_id(template), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def archive_async( + self, + template: str, + params: "InvoiceRenderingTemplateService.ArchiveParams" = {}, + options: RequestOptions = {}, + ) -> InvoiceRenderingTemplate: + """ + Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. + """ + return cast( + InvoiceRenderingTemplate, + await self._request_async( + "post", + "/v1/invoice_rendering_templates/{template}/archive".format( + template=sanitize_id(template), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def unarchive( + self, + template: str, + params: "InvoiceRenderingTemplateService.UnarchiveParams" = {}, + options: RequestOptions = {}, + ) -> InvoiceRenderingTemplate: + """ + Unarchive an invoice rendering template so it can be used on new Stripe objects again. + """ + return cast( + InvoiceRenderingTemplate, + self._request( + "post", + "/v1/invoice_rendering_templates/{template}/unarchive".format( + template=sanitize_id(template), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def unarchive_async( + self, + template: str, + params: "InvoiceRenderingTemplateService.UnarchiveParams" = {}, + options: RequestOptions = {}, + ) -> InvoiceRenderingTemplate: + """ + Unarchive an invoice rendering template so it can be used on new Stripe objects again. + """ + return cast( + InvoiceRenderingTemplate, + await self._request_async( + "post", + "/v1/invoice_rendering_templates/{template}/unarchive".format( + template=sanitize_id(template), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 340514e9e..016c3c1bb 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -674,6 +674,14 @@ class CreateParamsRendering(TypedDict): """ Invoice pdf rendering options """ + template: NotRequired[str] + """ + ID of the invoice rendering template to use for this invoice. + """ + template_version: NotRequired["Literal['']|int"] + """ + The specific version of invoice rendering template to use for this invoice. + """ class CreateParamsRenderingPdf(TypedDict): page_size: NotRequired[Literal["a4", "auto", "letter"]] @@ -3782,6 +3790,14 @@ class UpdateParamsRendering(TypedDict): """ Invoice pdf rendering options """ + template: NotRequired[str] + """ + ID of the invoice rendering template to use for this invoice. + """ + template_version: NotRequired["Literal['']|int"] + """ + The specific version of invoice rendering template to use for this invoice. + """ class UpdateParamsRenderingPdf(TypedDict): page_size: NotRequired[Literal["a4", "auto", "letter"]] diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index c1d9e20d1..083d02566 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -66,6 +66,7 @@ stripe.Invoice.OBJECT_NAME: stripe.Invoice, stripe.InvoiceItem.OBJECT_NAME: stripe.InvoiceItem, stripe.InvoiceLineItem.OBJECT_NAME: stripe.InvoiceLineItem, + stripe.InvoiceRenderingTemplate.OBJECT_NAME: stripe.InvoiceRenderingTemplate, stripe.issuing.Authorization.OBJECT_NAME: stripe.issuing.Authorization, stripe.issuing.Card.OBJECT_NAME: stripe.issuing.Card, stripe.issuing.Cardholder.OBJECT_NAME: stripe.issuing.Cardholder, diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index f6bf3ba2f..9f22c9806 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -666,6 +666,7 @@ class TaxIdCollection(StripeObject): """ Indicates whether tax ID collection is enabled for the session. """ + required: Literal["if_supported", "never"] class TransferData(StripeObject): amount: Optional[int] @@ -1543,6 +1544,10 @@ class CreateParamsTaxIdCollection(TypedDict): """ Enable tax ID collection during checkout. Defaults to `false`. """ + required: NotRequired[Literal["if_supported", "never"]] + """ + Describes whether a tax ID is required during checkout. Defaults to `never`. + """ class CreateParamsTransferData(TypedDict): amount: NotRequired[int] @@ -2325,6 +2330,10 @@ class ModifyParamsTaxIdCollection(TypedDict): """ Enable tax ID collection during checkout. Defaults to `false`. """ + required: NotRequired[Literal["if_supported", "never"]] + """ + Describes whether a tax ID is required during checkout. Defaults to `never`. + """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 678cd5b7c..3ff76553a 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -895,6 +895,10 @@ class CreateParamsTaxIdCollection(TypedDict): """ Enable tax ID collection during checkout. Defaults to `false`. """ + required: NotRequired[Literal["if_supported", "never"]] + """ + Describes whether a tax ID is required during checkout. Defaults to `never`. + """ class CreateParamsTransferData(TypedDict): amount: NotRequired[int] @@ -1675,6 +1679,10 @@ class UpdateParamsTaxIdCollection(TypedDict): """ Enable tax ID collection during checkout. Defaults to `false`. """ + required: NotRequired[Literal["if_supported", "never"]] + """ + Describes whether a tax ID is required during checkout. Defaults to `never`. + """ def list( self, diff --git a/stripe/_quote.py b/stripe/_quote.py index 89da6af2d..4a6aada48 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -466,7 +466,7 @@ class CreateParams(RequestOptions): """ discounts: NotRequired["Literal['']|List[Quote.CreateParamsDiscount]"] """ - The discounts applied to the quote. You can only set up to one discount. + The discounts applied to the quote. """ expand: NotRequired[List[str]] """ @@ -802,7 +802,7 @@ class ModifyParams(RequestOptions): """ discounts: NotRequired["Literal['']|List[Quote.ModifyParamsDiscount]"] """ - The discounts applied to the quote. You can only set up to one discount. + The discounts applied to the quote. """ expand: NotRequired[List[str]] """ diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index c5d72560f..31ea86ee9 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -70,7 +70,7 @@ class CreateParams(TypedDict): "Literal['']|List[QuoteService.CreateParamsDiscount]" ] """ - The discounts applied to the quote. You can only set up to one discount. + The discounts applied to the quote. """ expand: NotRequired[List[str]] """ @@ -392,7 +392,7 @@ class UpdateParams(TypedDict): "Literal['']|List[QuoteService.UpdateParamsDiscount]" ] """ - The discounts applied to the quote. You can only set up to one discount. + The discounts applied to the quote. """ expand: NotRequired[List[str]] """ diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index d88ea65a4..8f52c2da8 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -59,6 +59,9 @@ from stripe._forwarding_service import ForwardingService from stripe._identity_service import IdentityService from stripe._invoice_service import InvoiceService +from stripe._invoice_rendering_template_service import ( + InvoiceRenderingTemplateService, +) from stripe._invoice_item_service import InvoiceItemService from stripe._issuing_service import IssuingService from stripe._mandate_service import MandateService @@ -204,6 +207,9 @@ def __init__( self.forwarding = ForwardingService(self._requestor) self.identity = IdentityService(self._requestor) self.invoices = InvoiceService(self._requestor) + self.invoice_rendering_templates = InvoiceRenderingTemplateService( + self._requestor, + ) self.invoice_items = InvoiceItemService(self._requestor) self.issuing = IssuingService(self._requestor) self.mandates = MandateService(self._requestor) diff --git a/stripe/_subscription.py b/stripe/_subscription.py index f35851929..ad418161e 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -1202,9 +1202,15 @@ class ListParams(RequestOptions): current_period_end: NotRequired[ "Subscription.ListParamsCurrentPeriodEnd|int" ] + """ + Only return subscriptions whose current_period_end falls within the given date interval. + """ current_period_start: NotRequired[ "Subscription.ListParamsCurrentPeriodStart|int" ] + """ + Only return subscriptions whose current_period_start falls within the given date interval. + """ customer: NotRequired[str] """ The ID of the customer whose subscriptions will be retrieved. diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 3735278e8..e034f9751 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -771,9 +771,15 @@ class ListParams(TypedDict): current_period_end: NotRequired[ "SubscriptionService.ListParamsCurrentPeriodEnd|int" ] + """ + Only return subscriptions whose current_period_end falls within the given date interval. + """ current_period_start: NotRequired[ "SubscriptionService.ListParamsCurrentPeriodStart|int" ] + """ + Only return subscriptions whose current_period_start falls within the given date interval. + """ customer: NotRequired[str] """ The ID of the customer whose subscriptions will be retrieved. diff --git a/stripe/api_resources/__init__.py b/stripe/api_resources/__init__.py index 73e6b55f7..99bf65826 100644 --- a/stripe/api_resources/__init__.py +++ b/stripe/api_resources/__init__.py @@ -78,6 +78,9 @@ from stripe.api_resources.invoice import Invoice from stripe.api_resources.invoice_item import InvoiceItem from stripe.api_resources.invoice_line_item import InvoiceLineItem + from stripe.api_resources.invoice_rendering_template import ( + InvoiceRenderingTemplate, + ) from stripe.api_resources.line_item import LineItem from stripe.api_resources.list_object import ListObject from stripe.api_resources.login_link import LoginLink diff --git a/stripe/api_resources/invoice_rendering_template.py b/stripe/api_resources/invoice_rendering_template.py new file mode 100644 index 000000000..e0b96650e --- /dev/null +++ b/stripe/api_resources/invoice_rendering_template.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.invoice_rendering_template package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.invoice_rendering_template import InvoiceRenderingTemplate + To: + from stripe import InvoiceRenderingTemplate + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._invoice_rendering_template import ( # noqa + InvoiceRenderingTemplate, + ) diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index a447c8af4..e6f7ba017 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1542,6 +1542,10 @@ class TaxIdCollection(StripeObject): """ Indicates whether tax ID collection is enabled for the session """ + required: Literal["if_supported", "never"] + """ + Indicates whether a tax ID is required on the payment page + """ class TotalDetails(StripeObject): class Breakdown(StripeObject): @@ -3791,6 +3795,10 @@ class CreateParamsTaxIdCollection(TypedDict): """ Enable tax ID collection during checkout. Defaults to `false`. """ + required: NotRequired[Literal["if_supported", "never"]] + """ + Describes whether a tax ID is required during checkout. Defaults to `never`. + """ class ExpireParams(RequestOptions): expand: NotRequired[List[str]] diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 628f7f237..e1010120d 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -2237,6 +2237,10 @@ class CreateParamsTaxIdCollection(TypedDict): """ Enable tax ID collection during checkout. Defaults to `false`. """ + required: NotRequired[Literal["if_supported", "never"]] + """ + Describes whether a tax ID is required during checkout. Defaults to `never`. + """ class ExpireParams(TypedDict): expand: NotRequired[List[str]] diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index f4c190958..37dc34817 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -160,6 +160,7 @@ class Customs(StripeObject): "pending", "returned", "shipped", + "submitted", ] ] """ diff --git a/stripe/terminal/_location.py b/stripe/terminal/_location.py index 1d5990791..e0a4cb4a2 100644 --- a/stripe/terminal/_location.py +++ b/stripe/terminal/_location.py @@ -63,7 +63,7 @@ class CreateParams(RequestOptions): """ display_name: str """ - A name for the location. + A name for the location. Maximum length is 1000 characters. """ expand: NotRequired[List[str]] """ diff --git a/stripe/terminal/_location_service.py b/stripe/terminal/_location_service.py index 427c395f7..bcbfed219 100644 --- a/stripe/terminal/_location_service.py +++ b/stripe/terminal/_location_service.py @@ -21,7 +21,7 @@ class CreateParams(TypedDict): """ display_name: str """ - A name for the location. + A name for the location. Maximum length is 1000 characters. """ expand: NotRequired[List[str]] """ diff --git a/stripe/test_helpers/_test_clock.py b/stripe/test_helpers/_test_clock.py index c9eaab7ae..0bee1d8f0 100644 --- a/stripe/test_helpers/_test_clock.py +++ b/stripe/test_helpers/_test_clock.py @@ -119,7 +119,7 @@ class RetrieveParams(RequestOptions): """ The status of the Test Clock. """ - status_details: Optional[StatusDetails] + status_details: StatusDetails deleted: Optional[Literal[True]] """ Always true for a deleted object From 7b6300fde765c22abd57381de7857172fa4b1282 Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Thu, 12 Sep 2024 18:05:40 -0400 Subject: [PATCH 109/179] Bump version to 10.11.0 --- CHANGELOG.md | 10 ++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30b85abb7..9aca996fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 10.11.0 - 2024-09-12 +* [#1391](https://github.com/stripe/stripe-python/pull/1391) Update generated code + * Add support for `template` on parameter classes `stripe.Customer.CreateParamsInvoiceSettingsRenderingOptions`, `stripe.Customer.ModifyParamsInvoiceSettingsRenderingOptions`, `stripe.Invoice.CreateParamsRendering`, and `stripe.Invoice.ModifyParamsRendering` and resource classes `stripe.Customer.InvoiceSettings.RenderingOptions` and `stripe.Invoice.Rendering` + * Add support for resource `stripe.InvoiceRenderingTemplate` + * Add support for `required` on parameter classes `stripe.PaymentLink.CreateParamsTaxIdCollection`, `stripe.PaymentLink.ModifyParamsTaxIdCollection`, and `stripe.checkout.Session.CreateParamsTaxIdCollection` and resource classes `stripe.PaymentLink.TaxIdCollection` and `stripe.checkout.Session.TaxIdCollection` + * Add support for `submitted` on enum `stripe.issuing.Card.Shipping.status` + * Change type of `tax_amounts` on `stripe.InvoiceLineItem` from `Optional[List[TaxAmount]]` to `List[TaxAmount]` + * Change type of `tax_rates` on `stripe.InvoiceLineItem` from `Optional[List[TaxRate]]` to `List[TaxRate]` + * Change type of `status_details` on `stripe.test_helpers.TestClock` from `Optional[StatusDetails]` to `StatusDetails` + ## 10.10.0 - 2024-09-05 * [#1376](https://github.com/stripe/stripe-python/pull/1376) Update generated code * Add support for `subscription` on parameter class `stripe.billing.Alert.CreateParamsFilter` diff --git a/VERSION b/VERSION index e8a306979..725870228 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.10.0 +10.11.0 diff --git a/stripe/_version.py b/stripe/_version.py index 2be36b44b..d9459cc8e 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.10.0" +VERSION = "10.11.0" From f6ce6ab076607d77e28eda3970759b8714d19dad Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:10:43 -0700 Subject: [PATCH 110/179] Update generated code (#1393) * Update generated code for v1254 * Update generated code for v1261 * Update generated code for v1263 * Update generated code for v1266 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 2 ++ stripe/_bank_account.py | 2 ++ stripe/_capability.py | 2 ++ stripe/_charge.py | 18 ++++++++++ stripe/_dispute.py | 16 +++++++-- stripe/_invoice.py | 5 +++ stripe/_invoice_rendering_template.py | 5 +++ stripe/_payment_intent.py | 1 + stripe/_person.py | 2 ++ stripe/_setup_attempt.py | 1 + stripe/_setup_intent.py | 1 + stripe/tax/_registration.py | 51 +++++++++++++++++++++++++++ stripe/tax/_registration_service.py | 28 +++++++++++++++ 14 files changed, 133 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ad548b855..1f205edf7 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1260 \ No newline at end of file +v1266 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index f5246a701..db36e83a8 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -746,6 +746,7 @@ class Error(StripeObject): "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", + "verification_supportability", ] """ The code for the type of error. @@ -895,6 +896,7 @@ class Error(StripeObject): "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", + "verification_supportability", ] """ The code for the type of error. diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index 733b7ba0e..fc827b93b 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -126,6 +126,7 @@ class Error(StripeObject): "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", + "verification_supportability", ] """ The code for the type of error. @@ -249,6 +250,7 @@ class Error(StripeObject): "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", + "verification_supportability", ] """ The code for the type of error. diff --git a/stripe/_capability.py b/stripe/_capability.py index 0974b8d52..944236d60 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -120,6 +120,7 @@ class Error(StripeObject): "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", + "verification_supportability", ] """ The code for the type of error. @@ -282,6 +283,7 @@ class Error(StripeObject): "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", + "verification_supportability", ] """ The code for the type of error. diff --git a/stripe/_charge.py b/stripe/_charge.py index 2bcb9b148..9d0463bd5 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1286,6 +1286,23 @@ class Receipt(StripeObject): _inner_class_types = {"receipt": Receipt} class Klarna(StripeObject): + class PayerDetails(StripeObject): + class Address(StripeObject): + country: Optional[str] + """ + The payer address country + """ + + address: Optional[Address] + """ + The payer's address + """ + _inner_class_types = {"address": Address} + + payer_details: Optional[PayerDetails] + """ + The payer details for this transaction. + """ payment_method_category: Optional[str] """ The Klarna payment method used for this transaction. @@ -1296,6 +1313,7 @@ class Klarna(StripeObject): Preferred language of the Klarna authorization page that the customer is redirected to. Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `ro-RO`, `en-RO`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH` """ + _inner_class_types = {"payer_details": PayerDetails} class Konbini(StripeObject): class Store(StripeObject): diff --git a/stripe/_dispute.py b/stripe/_dispute.py index a7110e941..e75cf056f 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -165,6 +165,12 @@ class EvidenceDetails(StripeObject): """ class PaymentMethodDetails(StripeObject): + class AmazonPay(StripeObject): + dispute_type: Optional[Literal["chargeback", "claim"]] + """ + The AmazonPay dispute type, chargeback or claim + """ + class Card(StripeObject): brand: str """ @@ -195,14 +201,20 @@ class Paypal(StripeObject): The reason for the dispute as defined by PayPal """ + amazon_pay: Optional[AmazonPay] card: Optional[Card] klarna: Optional[Klarna] paypal: Optional[Paypal] - type: Literal["card", "klarna", "paypal"] + type: Literal["amazon_pay", "card", "klarna", "paypal"] """ Payment method type. """ - _inner_class_types = {"card": Card, "klarna": Klarna, "paypal": Paypal} + _inner_class_types = { + "amazon_pay": AmazonPay, + "card": Card, + "klarna": Klarna, + "paypal": Paypal, + } class CloseParams(RequestOptions): expand: NotRequired[List[str]] diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 8e83f0200..07f217f9e 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -479,6 +479,7 @@ class LastFinalizationError(StripeObject): "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", + "terminal_reader_invalid_location_for_activation", "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", @@ -6164,6 +6165,10 @@ class VoidInvoiceParams(RequestOptions): Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. """ automatic_tax: AutomaticTax + automatically_finalizes_at: Optional[int] + """ + The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized. + """ billing_reason: Optional[ Literal[ "automatic_pending_invoice_item_invoice", diff --git a/stripe/_invoice_rendering_template.py b/stripe/_invoice_rendering_template.py index 5a57cf743..5d7dc7e2f 100644 --- a/stripe/_invoice_rendering_template.py +++ b/stripe/_invoice_rendering_template.py @@ -11,6 +11,11 @@ class InvoiceRenderingTemplate( ListableAPIResource["InvoiceRenderingTemplate"] ): + """ + Invoice Rendering Templates are used to configure how invoices are rendered on surfaces like the PDF. Invoice Rendering Templates + can be created from within the Dashboard, and they can be used over the API when creating invoices. + """ + OBJECT_NAME: ClassVar[Literal["invoice_rendering_template"]] = ( "invoice_rendering_template" ) diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 78fdab4ed..974f9e729 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -255,6 +255,7 @@ class LastPaymentError(StripeObject): "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", + "terminal_reader_invalid_location_for_activation", "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", diff --git a/stripe/_person.py b/stripe/_person.py index 33b573801..7082f215b 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -246,6 +246,7 @@ class Error(StripeObject): "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", + "verification_supportability", ] """ The code for the type of error. @@ -443,6 +444,7 @@ class Error(StripeObject): "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", + "verification_supportability", ] """ The code for the type of error. diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 1745937ef..d9d8d570b 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -591,6 +591,7 @@ class SetupError(StripeObject): "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", + "terminal_reader_invalid_location_for_activation", "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index b19a36352..ed2da02a6 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -240,6 +240,7 @@ class LastSetupError(StripeObject): "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", + "terminal_reader_invalid_location_for_activation", "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index 807558ad0..43bcb69a7 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -582,12 +582,34 @@ class LocalLeaseTax(StripeObject): A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. """ + class StateSalesTax(StripeObject): + class Election(StripeObject): + jurisdiction: Optional[str] + """ + A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + """ + type: Literal[ + "local_use_tax", + "simplified_sellers_use_tax", + "single_local_use_tax", + ] + """ + The type of the election for the state sales tax registration. + """ + + elections: Optional[List[Election]] + """ + Elections for the state sales tax registration. + """ + _inner_class_types = {"elections": Election} + local_amusement_tax: Optional[LocalAmusementTax] local_lease_tax: Optional[LocalLeaseTax] state: str """ Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ + state_sales_tax: Optional[StateSalesTax] type: Literal[ "local_amusement_tax", "local_lease_tax", @@ -600,6 +622,7 @@ class LocalLeaseTax(StripeObject): _inner_class_types = { "local_amusement_tax": LocalAmusementTax, "local_lease_tax": LocalLeaseTax, + "state_sales_tax": StateSalesTax, } class Vn(StripeObject): @@ -1650,6 +1673,12 @@ class CreateParamsCountryOptionsUs(TypedDict): """ Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ + state_sales_tax: NotRequired[ + "Registration.CreateParamsCountryOptionsUsStateSalesTax" + ] + """ + Options for the state sales tax registration. + """ type: Literal[ "local_amusement_tax", "local_lease_tax", @@ -1672,6 +1701,28 @@ class CreateParamsCountryOptionsUsLocalLeaseTax(TypedDict): A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `14000` (Chicago). """ + class CreateParamsCountryOptionsUsStateSalesTax(TypedDict): + elections: List[ + "Registration.CreateParamsCountryOptionsUsStateSalesTaxElection" + ] + """ + Elections for the state sales tax registration. + """ + + class CreateParamsCountryOptionsUsStateSalesTaxElection(TypedDict): + jurisdiction: NotRequired[str] + """ + A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `003` (Allegheny County) and `60000` (Philadelphia City). + """ + type: Literal[ + "local_use_tax", + "simplified_sellers_use_tax", + "single_local_use_tax", + ] + """ + The type of the election for the state sales tax registration. + """ + class CreateParamsCountryOptionsVn(TypedDict): type: Literal["simplified"] """ diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index 1f9b4ba93..fd7ccda89 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -934,6 +934,12 @@ class CreateParamsCountryOptionsUs(TypedDict): """ Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ + state_sales_tax: NotRequired[ + "RegistrationService.CreateParamsCountryOptionsUsStateSalesTax" + ] + """ + Options for the state sales tax registration. + """ type: Literal[ "local_amusement_tax", "local_lease_tax", @@ -956,6 +962,28 @@ class CreateParamsCountryOptionsUsLocalLeaseTax(TypedDict): A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `14000` (Chicago). """ + class CreateParamsCountryOptionsUsStateSalesTax(TypedDict): + elections: List[ + "RegistrationService.CreateParamsCountryOptionsUsStateSalesTaxElection" + ] + """ + Elections for the state sales tax registration. + """ + + class CreateParamsCountryOptionsUsStateSalesTaxElection(TypedDict): + jurisdiction: NotRequired[str] + """ + A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `003` (Allegheny County) and `60000` (Philadelphia City). + """ + type: Literal[ + "local_use_tax", + "simplified_sellers_use_tax", + "single_local_use_tax", + ] + """ + The type of the election for the state sales tax registration. + """ + class CreateParamsCountryOptionsVn(TypedDict): type: Literal["simplified"] """ From 6288acd773e5d4fdd31c58f7728f77c3383c8128 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:29:52 -0700 Subject: [PATCH 111/179] Update generated code for v1267 (#1394) Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/treasury/_received_debit.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 1f205edf7..5f5b31119 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1266 \ No newline at end of file +v1267 \ No newline at end of file diff --git a/stripe/treasury/_received_debit.py b/stripe/treasury/_received_debit.py index fe167d746..798915fab 100644 --- a/stripe/treasury/_received_debit.py +++ b/stripe/treasury/_received_debit.py @@ -267,7 +267,11 @@ class RetrieveParams(RequestOptions): """ failure_code: Optional[ Literal[ - "account_closed", "account_frozen", "insufficient_funds", "other" + "account_closed", + "account_frozen", + "insufficient_funds", + "international_transaction", + "other", ] ] """ From 3587026b839435d072b7d220967c476d4c6b9a9b Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Wed, 18 Sep 2024 11:39:46 -0700 Subject: [PATCH 112/179] Bump version to 10.12.0 --- CHANGELOG.md | 12 ++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aca996fd..e71c80fc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 10.12.0 - 2024-09-18 +* [#1394](https://github.com/stripe/stripe-python/pull/1394) Update generated code + * Add support for `international_transaction` on enum `stripe.treasury.ReceivedDebit.failure_code` +* [#1393](https://github.com/stripe/stripe-python/pull/1393) Update generated code + * Add support for `payer_details` on resource class `stripe.Charge.PaymentMethodDetails.Klarna` + * Add support for `amazon_pay` on resource class `stripe.Dispute.PaymentMethodDetails` + * Add support for `automatically_finalizes_at` on resource `stripe.Invoice` + * Add support for `state_sales_tax` on resource class `stripe.tax.Registration.CountryOptions.Us` and parameter class `stripe.tax.Registration.CreateParamsCountryOptionsUs` + * Add support for `verification_supportability` on enums `stripe.Account.FutureRequirements.Error.code`, `stripe.Account.Requirements.Error.code`, `stripe.BankAccount.FutureRequirements.Error.code`, `stripe.BankAccount.Requirements.Error.code`, `stripe.Capability.FutureRequirements.Error.code`, `stripe.Capability.Requirements.Error.code`, `stripe.Person.FutureRequirements.Error.code`, and `stripe.Person.Requirements.Error.code` + * Add support for `amazon_pay` on enum `stripe.Dispute.PaymentMethodDetails.type` + * Add support for `terminal_reader_invalid_location_for_activation` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + ## 10.11.0 - 2024-09-12 * [#1391](https://github.com/stripe/stripe-python/pull/1391) Update generated code * Add support for `template` on parameter classes `stripe.Customer.CreateParamsInvoiceSettingsRenderingOptions`, `stripe.Customer.ModifyParamsInvoiceSettingsRenderingOptions`, `stripe.Invoice.CreateParamsRendering`, and `stripe.Invoice.ModifyParamsRendering` and resource classes `stripe.Customer.InvoiceSettings.RenderingOptions` and `stripe.Invoice.Rendering` diff --git a/VERSION b/VERSION index 725870228..c4d592e16 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.11.0 +10.12.0 diff --git a/stripe/_version.py b/stripe/_version.py index d9459cc8e..b20ec0ac7 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.11.0" +VERSION = "10.12.0" From de20eeb9f480bde3db4a1e71b592dab76733991c Mon Sep 17 00:00:00 2001 From: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> Date: Tue, 1 Oct 2024 09:36:24 -0700 Subject: [PATCH 113/179] Support for APIs in the new API version 2024-09-30.acacia (#1404) --- OPENAPI_VERSION | 2 +- examples/README.md | 11 + examples/meter_event_stream.py | 44 ++ examples/new_example.py | 8 + examples/stripe_webhook_handler.py | 40 ++ stripe/__init__.py | 55 +- stripe/_api_mode.py | 2 +- stripe/_api_requestor.py | 175 +++-- stripe/_api_resource.py | 3 +- stripe/_api_version.py | 2 +- stripe/_base_address.py | 3 +- stripe/_billing_service.py | 14 + stripe/_capability.py | 2 +- stripe/_credit_note.py | 25 + stripe/_credit_note_line_item.py | 25 + stripe/_customer.py | 5 +- stripe/_encode.py | 21 +- stripe/_error.py | 16 +- stripe/_http_client.py | 26 +- stripe/_invoice.py | 30 + stripe/_invoice_line_item.py | 30 + stripe/_margin.py | 50 ++ stripe/_multipart_data_generator.py | 2 +- stripe/_oauth.py | 2 +- stripe/_oauth_service.py | 2 +- stripe/_object_classes.py | 13 + stripe/_product.py | 26 +- stripe/_product_service.py | 26 +- stripe/_promotion_code.py | 6 +- stripe/_promotion_code_service.py | 4 +- stripe/_request_options.py | 5 + stripe/_requestor_options.py | 13 + stripe/_stripe_client.py | 98 ++- stripe/_stripe_object.py | 2 - stripe/_subscription.py | 48 +- stripe/_subscription_service.py | 12 +- stripe/_util.py | 35 +- stripe/_v2_services.py | 12 + stripe/_webhook_endpoint.py | 1 + stripe/_webhook_endpoint_service.py | 1 + stripe/api_resources/__init__.py | 1 + stripe/api_resources/billing/__init__.py | 7 + .../billing/credit_balance_summary.py | 21 + .../billing/credit_balance_transaction.py | 21 + stripe/api_resources/billing/credit_grant.py | 21 + stripe/api_resources/margin.py | 21 + stripe/billing/__init__.py | 16 + stripe/billing/_alert.py | 61 +- stripe/billing/_alert_service.py | 36 +- stripe/billing/_credit_balance_summary.py | 158 +++++ .../_credit_balance_summary_service.py | 83 +++ stripe/billing/_credit_balance_transaction.py | 242 +++++++ .../_credit_balance_transaction_service.py | 125 ++++ stripe/billing/_credit_grant.py | 599 ++++++++++++++++++ stripe/billing/_credit_grant_service.py | 381 +++++++++++ stripe/billing_portal/_configuration.py | 11 +- .../billing_portal/_configuration_service.py | 11 +- stripe/checkout/_session.py | 2 +- stripe/checkout/_session_service.py | 2 +- stripe/events/__init__.py | 8 + stripe/events/_event_classes.py | 14 + ...ling_meter_error_report_triggered_event.py | 122 ++++ .../_v1_billing_meter_no_meter_found_event.py | 88 +++ stripe/tax/_settings.py | 2 +- stripe/terminal/_reader.py | 10 +- stripe/terminal/_reader_service.py | 10 +- stripe/treasury/_received_credit.py | 7 +- stripe/v2/__init__.py | 10 + stripe/v2/_amount.py | 14 + stripe/v2/_billing_service.py | 24 + stripe/v2/_core_service.py | 10 + stripe/v2/_event.py | 124 ++++ stripe/v2/_list_object.py | 59 ++ stripe/v2/billing/__init__.py | 21 + stripe/v2/billing/_meter_event.py | 46 ++ stripe/v2/billing/_meter_event_adjustment.py | 51 ++ .../_meter_event_adjustment_service.py | 67 ++ stripe/v2/billing/_meter_event_service.py | 72 +++ stripe/v2/billing/_meter_event_session.py | 36 ++ .../billing/_meter_event_session_service.py | 50 ++ .../v2/billing/_meter_event_stream_service.py | 71 +++ stripe/v2/core/__init__.py | 3 + stripe/v2/core/_event_service.py | 102 +++ .../abstract/test_api_resource.py | 2 +- tests/api_resources/test_list_object.py | 6 +- tests/api_resources/test_list_object_v2.py | 147 +++++ .../test_search_result_object.py | 2 +- tests/fixtures/card.json | 26 - tests/http_client_mock.py | 2 + tests/test_api_requestor.py | 300 ++++++--- tests/test_generated_examples.py | 106 +--- tests/test_http_client.py | 28 +- tests/test_integration.py | 69 +- tests/test_raw_request.py | 225 +++++++ tests/test_request_options.py | 2 + tests/test_requestor_options.py | 13 + tests/test_stripe_client.py | 70 +- tests/test_util.py | 4 +- tests/test_v2_error.py | 141 +++++ tests/test_v2_event.py | 110 ++++ tests/test_webhook.py | 12 +- 101 files changed, 4575 insertions(+), 427 deletions(-) create mode 100644 examples/README.md create mode 100644 examples/meter_event_stream.py create mode 100644 examples/new_example.py create mode 100644 examples/stripe_webhook_handler.py create mode 100644 stripe/_margin.py create mode 100644 stripe/_v2_services.py create mode 100644 stripe/api_resources/billing/credit_balance_summary.py create mode 100644 stripe/api_resources/billing/credit_balance_transaction.py create mode 100644 stripe/api_resources/billing/credit_grant.py create mode 100644 stripe/api_resources/margin.py create mode 100644 stripe/billing/_credit_balance_summary.py create mode 100644 stripe/billing/_credit_balance_summary_service.py create mode 100644 stripe/billing/_credit_balance_transaction.py create mode 100644 stripe/billing/_credit_balance_transaction_service.py create mode 100644 stripe/billing/_credit_grant.py create mode 100644 stripe/billing/_credit_grant_service.py create mode 100644 stripe/events/__init__.py create mode 100644 stripe/events/_event_classes.py create mode 100644 stripe/events/_v1_billing_meter_error_report_triggered_event.py create mode 100644 stripe/events/_v1_billing_meter_no_meter_found_event.py create mode 100644 stripe/v2/__init__.py create mode 100644 stripe/v2/_amount.py create mode 100644 stripe/v2/_billing_service.py create mode 100644 stripe/v2/_core_service.py create mode 100644 stripe/v2/_event.py create mode 100644 stripe/v2/_list_object.py create mode 100644 stripe/v2/billing/__init__.py create mode 100644 stripe/v2/billing/_meter_event.py create mode 100644 stripe/v2/billing/_meter_event_adjustment.py create mode 100644 stripe/v2/billing/_meter_event_adjustment_service.py create mode 100644 stripe/v2/billing/_meter_event_service.py create mode 100644 stripe/v2/billing/_meter_event_session.py create mode 100644 stripe/v2/billing/_meter_event_session_service.py create mode 100644 stripe/v2/billing/_meter_event_stream_service.py create mode 100644 stripe/v2/core/__init__.py create mode 100644 stripe/v2/core/_event_service.py create mode 100644 tests/api_resources/test_list_object_v2.py delete mode 100644 tests/fixtures/card.json create mode 100644 tests/test_raw_request.py create mode 100644 tests/test_v2_error.py create mode 100644 tests/test_v2_event.py diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 5f5b31119..8f166ae2e 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1267 \ No newline at end of file +v1268 \ No newline at end of file diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 000000000..c73c6149f --- /dev/null +++ b/examples/README.md @@ -0,0 +1,11 @@ +## Running an example + +From the examples folder, run: +`PYTHONPATH=../ python your_example.py` + +## Adding a new example + +1. Clone new_example.py +2. Implement your example +3. Run it (as per above) +4. 👍 diff --git a/examples/meter_event_stream.py b/examples/meter_event_stream.py new file mode 100644 index 000000000..0d02bb9d8 --- /dev/null +++ b/examples/meter_event_stream.py @@ -0,0 +1,44 @@ +from datetime import datetime, timezone +import stripe + +# Global variable for the meter event session +meter_event_session = None + + +def refresh_meter_event_session(api_key): + global meter_event_session + + # Check if the session is None or expired + if meter_event_session is None or datetime.fromisoformat( + meter_event_session["expires_at"] + ) <= datetime.now(timezone.utc): + # Create a new meter event session if the existing session has expired + client = stripe.StripeClient(api_key) + meter_event_session = client.v2.billing.meter_event_session.create() + + +def send_meter_event(meter_event, api_key): + # Refresh the meter event session if necessary + refresh_meter_event_session(api_key) + if not meter_event_session: + raise RuntimeError("Unable to refresh meter event session") + + # Create a meter event with the current session's authentication token + client = stripe.StripeClient(meter_event_session["authentication_token"]) + client.v2.billing.meter_event_stream.create( + params={"events": [meter_event]} + ) + + +# Set your API key here +api_key = "{{API_KEY}}" +customer_id = "{{CUSTOMER_ID}}" + +# Send meter event +send_meter_event( + { + "event_name": "alpaca_ai_tokens", + "payload": {"stripe_customer_id": customer_id, "value": "25"}, + }, + api_key, +) diff --git a/examples/new_example.py b/examples/new_example.py new file mode 100644 index 000000000..53a93e7e6 --- /dev/null +++ b/examples/new_example.py @@ -0,0 +1,8 @@ +import stripe + +# Set your API key here +api_key = "{{API_KEY}}" + +print("Hello world") +# client = stripe.StripeClient(api_key) +# client.v2.... diff --git a/examples/stripe_webhook_handler.py b/examples/stripe_webhook_handler.py new file mode 100644 index 000000000..e4452d9c7 --- /dev/null +++ b/examples/stripe_webhook_handler.py @@ -0,0 +1,40 @@ +import os +from stripe import StripeClient +from stripe.events import V1BillingMeterErrorReportTriggeredEvent + +from flask import Flask, request, jsonify + +app = Flask(__name__) +api_key = os.environ.get("STRIPE_API_KEY") +webhook_secret = os.environ.get("WEBHOOK_SECRET") + +client = StripeClient(api_key) + + +@app.route("/webhook", methods=["POST"]) +def webhook(): + webhook_body = request.data + sig_header = request.headers.get("Stripe-Signature") + + try: + thin_event = client.parse_thin_event( + webhook_body, sig_header, webhook_secret + ) + + # Fetch the event data to understand the failure + event = client.v2.core.events.retrieve(thin_event.id) + if isinstance(event, V1BillingMeterErrorReportTriggeredEvent): + meter = event.fetch_related_object() + meter_id = meter.id + print("Success! " + str(meter_id)) + + # Record the failures and alert your team + # Add your logic here + + return jsonify(success=True), 200 + except Exception as e: + return jsonify(error=str(e)), 400 + + +if __name__ == "__main__": + app.run(port=4242) diff --git a/stripe/__init__.py b/stripe/__init__.py index 9edd2b715..0300781a1 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -2,6 +2,7 @@ from typing import Optional import sys as _sys import os +import warnings # Stripe Python bindings # API docs at http://stripe.com/docs/api @@ -25,6 +26,7 @@ DEFAULT_API_BASE: str = "https://api.stripe.com" DEFAULT_CONNECT_API_BASE: str = "https://connect.stripe.com" DEFAULT_UPLOAD_API_BASE: str = "https://files.stripe.com" +DEFAULT_METER_EVENTS_API_BASE: str = "https://meter-events.stripe.com" api_key: Optional[str] = None @@ -32,22 +34,62 @@ api_base: str = DEFAULT_API_BASE connect_api_base: str = DEFAULT_CONNECT_API_BASE upload_api_base: str = DEFAULT_UPLOAD_API_BASE +meter_events_api_base: str = DEFAULT_METER_EVENTS_API_BASE api_version: str = _ApiVersion.CURRENT verify_ssl_certs: bool = True proxy: Optional[str] = None default_http_client: Optional["HTTPClient"] = None app_info: Optional[AppInfo] = None enable_telemetry: bool = True -max_network_retries: int = 0 +max_network_retries: int = 2 ca_bundle_path: str = os.path.join( os.path.dirname(__file__), "data", "ca-certificates.crt" ) +# Lazily initialized stripe.default_http_client +default_http_client = None +_default_proxy = None + + +def ensure_default_http_client(): + if default_http_client: + _warn_if_mismatched_proxy() + return + _init_default_http_client() + + +def _init_default_http_client(): + global _default_proxy + global default_http_client + + # If the stripe.default_http_client has not been set by the user + # yet, we'll set it here. This way, we aren't creating a new + # HttpClient for every request. + default_http_client = new_default_http_client( + verify_ssl_certs=verify_ssl_certs, proxy=proxy + ) + _default_proxy = proxy + + +def _warn_if_mismatched_proxy(): + global _default_proxy + from stripe import proxy + + if proxy != _default_proxy: + warnings.warn( + "stripe.proxy was updated after sending a " + "request - this is a no-op. To use a different proxy, " + "set stripe.default_http_client to a new client " + "configured with the proxy." + ) + + # Set to either 'debug' or 'info', controls console logging log: Optional[Literal["debug", "info"]] = None # OAuth from stripe._oauth import OAuth as OAuth +from stripe._oauth_service import OAuthService as OAuthService # Webhooks from stripe._webhook import ( @@ -58,6 +100,8 @@ # StripeClient from stripe._stripe_client import StripeClient as StripeClient # noqa +from stripe.v2._event import ThinEvent as ThinEvent # noqa + # Sets some basic information about the running application that's sent along # with API requests. Useful for plugin authors to identify their plugin when @@ -180,8 +224,6 @@ def set_app_info( from stripe import _request_metrics as request_metrics from stripe._file import File as FileUpload - import warnings - # Python 3.7+ supports module level __getattr__ that allows us to lazy load deprecated modules # this matters because if we pre-load all modules from api_resources while suppressing warning # users will never see those warnings @@ -218,6 +260,7 @@ def __getattr__(name): checkout as checkout, climate as climate, entitlements as entitlements, + events as events, financial_connections as financial_connections, forwarding as forwarding, identity as identity, @@ -229,6 +272,7 @@ def __getattr__(name): terminal as terminal, test_helpers as test_helpers, treasury as treasury, + v2 as v2, ) from stripe._account import Account as Account from stripe._account_capability_service import ( @@ -355,6 +399,9 @@ def __getattr__(name): from stripe._ephemeral_key_service import ( EphemeralKeyService as EphemeralKeyService, ) +from stripe._error import ( + TemporarySessionExpiredError as TemporarySessionExpiredError, +) from stripe._event import Event as Event from stripe._event_service import EventService as EventService from stripe._exchange_rate import ExchangeRate as ExchangeRate @@ -397,6 +444,7 @@ def __getattr__(name): from stripe._login_link import LoginLink as LoginLink from stripe._mandate import Mandate as Mandate from stripe._mandate_service import MandateService as MandateService +from stripe._margin import Margin as Margin from stripe._payment_intent import PaymentIntent as PaymentIntent from stripe._payment_intent_service import ( PaymentIntentService as PaymentIntentService, @@ -529,6 +577,7 @@ def __getattr__(name): from stripe._usage_record_summary import ( UsageRecordSummary as UsageRecordSummary, ) +from stripe._v2_services import V2Services as V2Services from stripe._webhook_endpoint import WebhookEndpoint as WebhookEndpoint from stripe._webhook_endpoint_service import ( WebhookEndpointService as WebhookEndpointService, diff --git a/stripe/_api_mode.py b/stripe/_api_mode.py index 1503e56e0..7290784d3 100644 --- a/stripe/_api_mode.py +++ b/stripe/_api_mode.py @@ -1,4 +1,4 @@ from typing_extensions import Literal -ApiMode = Literal["V1"] +ApiMode = Literal["V1", "V2"] diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index 61f3085eb..65bb449fe 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -29,15 +29,14 @@ log_info, dashboard_link, _convert_to_stripe_object, + get_api_mode, ) from stripe._version import VERSION import stripe._error as error import stripe.oauth_error as oauth_error from stripe._multipart_data_generator import MultipartDataGenerator from urllib.parse import urlencode -from stripe._encode import ( - _api_encode, -) +from stripe._encode import _api_encode, _json_encode_date_callback from stripe._stripe_response import ( StripeResponse, StripeStreamResponse, @@ -183,8 +182,8 @@ def request( base_address: BaseAddress, usage: Optional[List[str]] = None, ) -> "StripeObject": + api_mode = get_api_mode(url) requestor = self._replace_options(options) - api_mode = "V1" rbody, rcode, rheaders = requestor.request_raw( method.lower(), url, @@ -195,15 +194,17 @@ def request( options=options, usage=usage, ) - resp = requestor._interpret_response(rbody, rcode, rheaders) + resp = requestor._interpret_response(rbody, rcode, rheaders, api_mode) - return _convert_to_stripe_object( + obj = _convert_to_stripe_object( resp=resp, params=params, requestor=requestor, api_mode=api_mode, ) + return obj + async def request_async( self, method: str, @@ -214,7 +215,7 @@ async def request_async( base_address: BaseAddress, usage: Optional[List[str]] = None, ) -> "StripeObject": - api_mode = "V1" + api_mode = get_api_mode(url) requestor = self._replace_options(options) rbody, rcode, rheaders = await requestor.request_raw_async( method.lower(), @@ -226,15 +227,17 @@ async def request_async( options=options, usage=usage, ) - resp = requestor._interpret_response(rbody, rcode, rheaders) + resp = requestor._interpret_response(rbody, rcode, rheaders, api_mode) - return _convert_to_stripe_object( + obj = _convert_to_stripe_object( resp=resp, params=params, requestor=requestor, api_mode=api_mode, ) + return obj + def request_stream( self, method: str, @@ -245,7 +248,7 @@ def request_stream( base_address: BaseAddress, usage: Optional[List[str]] = None, ) -> StripeStreamResponse: - api_mode = "V1" + api_mode = get_api_mode(url) stream, rcode, rheaders = self.request_raw( method.lower(), url, @@ -262,6 +265,7 @@ def request_stream( cast(IOBase, stream), rcode, rheaders, + api_mode, ) return resp @@ -275,7 +279,7 @@ async def request_stream_async( base_address: BaseAddress, usage: Optional[List[str]] = None, ) -> StripeStreamResponseAsync: - api_mode = "V1" + api_mode = get_api_mode(url) stream, rcode, rheaders = await self.request_raw_async( method.lower(), url, @@ -290,10 +294,13 @@ async def request_stream_async( stream, rcode, rheaders, + api_mode, ) return resp - def handle_error_response(self, rbody, rcode, resp, rheaders) -> NoReturn: + def handle_error_response( + self, rbody, rcode, resp, rheaders, api_mode + ) -> NoReturn: try: error_data = resp["error"] except (KeyError, TypeError): @@ -316,15 +323,60 @@ def handle_error_response(self, rbody, rcode, resp, rheaders) -> NoReturn: ) if err is None: - err = self.specific_api_error( - rbody, rcode, resp, rheaders, error_data + err = ( + self.specific_v2_api_error( + rbody, rcode, resp, rheaders, error_data + ) + if api_mode == "V2" + else self.specific_v1_api_error( + rbody, rcode, resp, rheaders, error_data + ) ) raise err - def specific_api_error(self, rbody, rcode, resp, rheaders, error_data): + def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data): + type = error_data.get("type") + code = error_data.get("code") + message = error_data.get("message") + error_args = { + "message": message, + "http_body": rbody, + "http_status": rcode, + "json_body": resp, + "headers": rheaders, + "code": code, + } + log_info( - "Stripe API error received", + "Stripe v2 API error received", + error_code=code, + error_type=error_data.get("type"), + error_message=message, + error_param=error_data.get("param"), + ) + + if type == "idempotency_error": + return error.IdempotencyError( + message, + rbody, + rcode, + resp, + rheaders, + code, + ) + # switchCases: The beginning of the section generated from our OpenAPI spec + elif type == "temporary_session_expired": + return error.TemporarySessionExpiredError(**error_args) + # switchCases: The end of the section generated from our OpenAPI spec + + return self.specific_v1_api_error( + rbody, rcode, resp, rheaders, error_data + ) + + def specific_v1_api_error(self, rbody, rcode, resp, rheaders, error_data): + log_info( + "Stripe v1 API error received", error_code=error_data.get("code"), error_type=error_data.get("type"), error_message=error_data.get("message"), @@ -402,8 +454,13 @@ def specific_oauth_error(self, rbody, rcode, resp, rheaders, error_code): return None - def request_headers(self, method, options: RequestOptions): - user_agent = "Stripe/v1 PythonBindings/%s" % (VERSION,) + def request_headers( + self, method: HttpVerb, api_mode: ApiMode, options: RequestOptions + ): + user_agent = "Stripe/%s PythonBindings/%s" % ( + api_mode.lower(), + VERSION, + ) if stripe.app_info: user_agent += " " + self._format_app_info(stripe.app_info) @@ -436,13 +493,23 @@ def request_headers(self, method, options: RequestOptions): if stripe_account: headers["Stripe-Account"] = stripe_account + stripe_context = options.get("stripe_context") + if stripe_context: + headers["Stripe-Context"] = stripe_context + idempotency_key = options.get("idempotency_key") if idempotency_key: headers["Idempotency-Key"] = idempotency_key - if method == "post": + # IKs should be set for all POST requests and v2 delete requests + if method == "post" or (api_mode == "V2" and method == "delete"): headers.setdefault("Idempotency-Key", str(uuid.uuid4())) - headers["Content-Type"] = "application/x-www-form-urlencoded" + + if method == "post": + if api_mode == "V2": + headers["Content-Type"] = "application/json" + else: + headers["Content-Type"] = "application/x-www-form-urlencoded" stripe_version = options.get("stripe_version") if stripe_version: @@ -462,10 +529,19 @@ def _args_for_request_with_retries( usage: Optional[List[str]] = None, ): """ - Mechanism for issuing an API call + Mechanism for issuing an API call. Used by request_raw and request_raw_async. """ request_options = merge_options(self._options, options) + # Special stripe_version handling for v2 requests: + if ( + options + and "stripe_version" in options + and (options["stripe_version"] is not None) + ): + # If user specified an API version, honor it + request_options["stripe_version"] = options["stripe_version"] + if request_options.get("api_key") is None: raise error.AuthenticationError( "No API key provided. (HINT: set your API key using " @@ -480,14 +556,19 @@ def _args_for_request_with_retries( url, ) - encoded_params = urlencode(list(_api_encode(params or {}))) + encoded_params = urlencode(list(_api_encode(params or {}, api_mode))) # Don't use strict form encoding by changing the square bracket control # characters back to their literals. This is fine by the server, and # makes these parameter strings easier to read. encoded_params = encoded_params.replace("%5B", "[").replace("%5D", "]") - encoded_body = encoded_params + if api_mode == "V2": + encoded_body = json.dumps( + params or {}, default=_json_encode_date_callback + ) + else: + encoded_body = encoded_params supplied_headers = None if ( @@ -496,7 +577,12 @@ def _args_for_request_with_retries( ): supplied_headers = dict(request_options["headers"]) - headers = self.request_headers(method, request_options) + headers = self.request_headers( + # this cast is safe because the blocks below validate that `method` is one of the allowed values + cast(HttpVerb, method), + api_mode, + request_options, + ) if method == "get" or method == "delete": if params: @@ -714,6 +800,7 @@ def _interpret_response( rbody: object, rcode: int, rheaders: Mapping[str, str], + api_mode: ApiMode, ) -> StripeResponse: try: if hasattr(rbody, "decode"): @@ -734,30 +821,17 @@ def _interpret_response( rheaders, ) if self._should_handle_code_as_error(rcode): - self.handle_error_response(rbody, rcode, resp.data, rheaders) - return resp - - async def _interpret_streaming_response_async( - self, - stream: AsyncIterable[bytes], - rcode: int, - rheaders: Mapping[str, str], - ) -> StripeStreamResponseAsync: - if self._should_handle_code_as_error(rcode): - json_content = b"".join([chunk async for chunk in stream]) - self._interpret_response(json_content, rcode, rheaders) - # _interpret_response is guaranteed to throw since we've checked self._should_handle_code_as_error - raise RuntimeError( - "_interpret_response should have raised an error" + self.handle_error_response( + rbody, rcode, resp.data, rheaders, api_mode ) - else: - return StripeStreamResponseAsync(stream, rcode, rheaders) + return resp def _interpret_streaming_response( self, stream: IOBase, rcode: int, rheaders: Mapping[str, str], + api_mode: ApiMode, ) -> StripeStreamResponse: # Streaming response are handled with minimal processing for the success # case (ie. we don't want to read the content). When an error is @@ -775,10 +849,27 @@ def _interpret_streaming_response( % self._get_http_client().name ) - self._interpret_response(json_content, rcode, rheaders) + self._interpret_response(json_content, rcode, rheaders, api_mode) # _interpret_response is guaranteed to throw since we've checked self._should_handle_code_as_error raise RuntimeError( "_interpret_response should have raised an error" ) else: return StripeStreamResponse(stream, rcode, rheaders) + + async def _interpret_streaming_response_async( + self, + stream: AsyncIterable[bytes], + rcode: int, + rheaders: Mapping[str, str], + api_mode: ApiMode, + ) -> StripeStreamResponseAsync: + if self._should_handle_code_as_error(rcode): + json_content = b"".join([chunk async for chunk in stream]) + self._interpret_response(json_content, rcode, rheaders, api_mode) + # _interpret_response is guaranteed to throw since we've checked self._should_handle_code_as_error + raise RuntimeError( + "_interpret_response should have raised an error" + ) + else: + return StripeStreamResponseAsync(stream, rcode, rheaders) diff --git a/stripe/_api_resource.py b/stripe/_api_resource.py index 1fb402ab8..2866b42c1 100644 --- a/stripe/_api_resource.py +++ b/stripe/_api_resource.py @@ -99,6 +99,7 @@ async def _request_async( params=None, *, base_address: BaseAddress = "api", + api_mode: ApiMode = "V1", ) -> StripeObject: obj = await StripeObject._request_async( self, @@ -109,7 +110,7 @@ async def _request_async( ) if type(self) is type(obj): - self._refresh_from(values=obj, api_mode="V1") + self._refresh_from(values=obj, api_mode=api_mode) return self else: return obj diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 3e3f977ff..e23615373 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 = "2024-06-20" + CURRENT = "2024-09-30.acacia" diff --git a/stripe/_base_address.py b/stripe/_base_address.py index aa7a133e7..b45e6eda5 100644 --- a/stripe/_base_address.py +++ b/stripe/_base_address.py @@ -2,10 +2,11 @@ from typing_extensions import NotRequired, TypedDict, Literal -BaseAddress = Literal["api", "files", "connect"] +BaseAddress = Literal["api", "files", "connect", "meter_events"] class BaseAddresses(TypedDict): api: NotRequired[Optional[str]] connect: NotRequired[Optional[str]] files: NotRequired[Optional[str]] + meter_events: NotRequired[Optional[str]] diff --git a/stripe/_billing_service.py b/stripe/_billing_service.py index e30f30081..a94b4f57c 100644 --- a/stripe/_billing_service.py +++ b/stripe/_billing_service.py @@ -2,6 +2,13 @@ # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.billing._alert_service import AlertService +from stripe.billing._credit_balance_summary_service import ( + CreditBalanceSummaryService, +) +from stripe.billing._credit_balance_transaction_service import ( + CreditBalanceTransactionService, +) +from stripe.billing._credit_grant_service import CreditGrantService from stripe.billing._meter_event_adjustment_service import ( MeterEventAdjustmentService, ) @@ -13,6 +20,13 @@ class BillingService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.alerts = AlertService(self._requestor) + self.credit_balance_summary = CreditBalanceSummaryService( + self._requestor, + ) + self.credit_balance_transactions = CreditBalanceTransactionService( + self._requestor, + ) + self.credit_grants = CreditGrantService(self._requestor) self.meters = MeterService(self._requestor) self.meter_events = MeterEventService(self._requestor) self.meter_event_adjustments = MeterEventAdjustmentService( diff --git a/stripe/_capability.py b/stripe/_capability.py index 944236d60..d83ba3b62 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -368,7 +368,7 @@ class Error(StripeObject): requirements: Optional[Requirements] status: Literal["active", "disabled", "inactive", "pending", "unrequested"] """ - The status of the capability. Can be `active`, `inactive`, `pending`, or `unrequested`. + The status of the capability. """ def instance_url(self): diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 8054b28e5..6e5ae51ff 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -27,6 +27,9 @@ from stripe._refund import Refund from stripe._shipping_rate import ShippingRate from stripe._tax_rate import TaxRate + from stripe.billing._credit_balance_transaction import ( + CreditBalanceTransaction, + ) @nested_resource_class_methods("line") @@ -53,6 +56,26 @@ class DiscountAmount(StripeObject): The discount that was applied to get this discount amount. """ + class PretaxCreditAmount(StripeObject): + amount: int + """ + The amount, in cents (or local equivalent), of the pretax credit amount. + """ + credit_balance_transaction: Optional[ + ExpandableField["CreditBalanceTransaction"] + ] + """ + The credit balance transaction that was applied to get this pretax credit amount. + """ + discount: Optional[ExpandableField["Discount"]] + """ + The discount that was applied to get this pretax credit amount. + """ + type: Literal["credit_balance_transaction", "discount"] + """ + Type of the pretax credit amount referenced. + """ + class ShippingCost(StripeObject): class Tax(StripeObject): amount: int @@ -711,6 +734,7 @@ class VoidCreditNoteParams(RequestOptions): """ The link to download the PDF of the credit note. """ + pretax_credit_amounts: Optional[List[PretaxCreditAmount]] reason: Optional[ Literal[ "duplicate", "fraudulent", "order_change", "product_unsatisfactory" @@ -1122,6 +1146,7 @@ async def list_lines_async( _inner_class_types = { "discount_amounts": DiscountAmount, + "pretax_credit_amounts": PretaxCreditAmount, "shipping_cost": ShippingCost, "tax_amounts": TaxAmount, } diff --git a/stripe/_credit_note_line_item.py b/stripe/_credit_note_line_item.py index 40ebeb2df..04505cf83 100644 --- a/stripe/_credit_note_line_item.py +++ b/stripe/_credit_note_line_item.py @@ -8,6 +8,9 @@ if TYPE_CHECKING: from stripe._discount import Discount from stripe._tax_rate import TaxRate + from stripe.billing._credit_balance_transaction import ( + CreditBalanceTransaction, + ) class CreditNoteLineItem(StripeObject): @@ -29,6 +32,26 @@ class DiscountAmount(StripeObject): The discount that was applied to get this discount amount. """ + class PretaxCreditAmount(StripeObject): + amount: int + """ + The amount, in cents (or local equivalent), of the pretax credit amount. + """ + credit_balance_transaction: Optional[ + ExpandableField["CreditBalanceTransaction"] + ] + """ + The credit balance transaction that was applied to get this pretax credit amount. + """ + discount: Optional[ExpandableField["Discount"]] + """ + The discount that was applied to get this pretax credit amount. + """ + type: Literal["credit_balance_transaction", "discount"] + """ + Type of the pretax credit amount referenced. + """ + class TaxAmount(StripeObject): amount: int """ @@ -105,6 +128,7 @@ class TaxAmount(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ + pretax_credit_amounts: Optional[List[PretaxCreditAmount]] quantity: Optional[int] """ The number of units of product being credited. @@ -135,5 +159,6 @@ class TaxAmount(StripeObject): """ _inner_class_types = { "discount_amounts": DiscountAmount, + "pretax_credit_amounts": PretaxCreditAmount, "tax_amounts": TaxAmount, } diff --git a/stripe/_customer.py b/stripe/_customer.py index b163859fc..001126339 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -63,9 +63,8 @@ class Customer( UpdateableAPIResource["Customer"], ): """ - This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer. - - Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment) + This object represents a customer of your business. Use it to [create recurring charges](https://stripe.com/docs/invoicing/customer), [save payment](https://stripe.com/docs/payments/save-during-payment) and contact information, + and track payments that belong to the same customer. """ OBJECT_NAME: ClassVar[Literal["customer"]] = "customer" diff --git a/stripe/_encode.py b/stripe/_encode.py index 9552a739e..181038ef0 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 Generator, Optional, Tuple, Any def _encode_datetime(dttime: datetime.datetime): @@ -21,7 +21,15 @@ def _encode_nested_dict(key, data, fmt="%s[%s]"): return d -def _api_encode(data) -> Generator[Tuple[str, Any], None, None]: +def _json_encode_date_callback(value): + if isinstance(value, datetime.datetime): + return _encode_datetime(value) + return value + + +def _api_encode( + data, api_mode: Optional[str] +) -> Generator[Tuple[str, Any], None, None]: for key, value in data.items(): if value is None: continue @@ -29,15 +37,16 @@ def _api_encode(data) -> Generator[Tuple[str, Any], None, None]: yield (key, value.stripe_id) elif isinstance(value, list) or isinstance(value, tuple): for i, sv in enumerate(value): + encoded_key = key if api_mode == "V2" else "%s[%d]" % (key, i) if isinstance(sv, dict): - subdict = _encode_nested_dict("%s[%d]" % (key, i), sv) - for k, v in _api_encode(subdict): + subdict = _encode_nested_dict(encoded_key, sv) + for k, v in _api_encode(subdict, api_mode): yield (k, v) else: - yield ("%s[%d]" % (key, i), sv) + yield (encoded_key, sv) elif isinstance(value, dict): subdict = _encode_nested_dict(key, value) - for subkey, subvalue in _api_encode(subdict): + for subkey, subvalue in _api_encode(subdict, api_mode): yield (subkey, subvalue) elif isinstance(value, datetime.datetime): yield (key, _encode_datetime(value)) diff --git a/stripe/_error.py b/stripe/_error.py index aba72701d..3b486ee79 100644 --- a/stripe/_error.py +++ b/stripe/_error.py @@ -1,7 +1,6 @@ from typing import Dict, Optional, Union, cast -# Used for global variable -import stripe # noqa: IMP101 +import stripe # noqa from stripe._error_object import ErrorObject @@ -13,7 +12,7 @@ class StripeError(Exception): headers: Optional[Dict[str, str]] code: Optional[str] request_id: Optional[str] - error: Optional[ErrorObject] + error: Optional["ErrorObject"] def __init__( self, @@ -76,10 +75,13 @@ def _construct_error_object(self) -> Optional[ErrorObject]: or not isinstance(self.json_body["error"], dict) ): return None + from stripe._error_object import ErrorObject return ErrorObject._construct_from( values=self.json_body["error"], requestor=stripe._APIRequestor._global_instance(), + # We pass in API mode as "V1" here because it's required, + # but ErrorObject is reused for both V1 and V2 errors. api_mode="V1", ) @@ -177,3 +179,11 @@ class SignatureVerificationError(StripeError): def __init__(self, message, sig_header, http_body=None): super(SignatureVerificationError, self).__init__(message, http_body) self.sig_header = sig_header + + +# classDefinitions: The beginning of the section generated from our OpenAPI spec +class TemporarySessionExpiredError(StripeError): + pass + + +# classDefinitions: The end of the section generated from our OpenAPI spec diff --git a/stripe/_http_client.py b/stripe/_http_client.py index 459b40ae5..0db2ef3f5 100644 --- a/stripe/_http_client.py +++ b/stripe/_http_client.py @@ -148,7 +148,7 @@ class _Proxy(TypedDict): http: Optional[str] https: Optional[str] - MAX_DELAY = 2 + MAX_DELAY = 5 INITIAL_DELAY = 0.5 MAX_RETRY_AFTER = 60 _proxy: Optional[_Proxy] @@ -242,10 +242,11 @@ def _sleep_time_seconds( self, num_retries: int, response: Optional[Tuple[Any, Any, Mapping[str, str]]] = None, - ): - # Apply exponential backoff with initial_network_retry_delay on the - # number of num_retries so far as inputs. - # Do not allow the number to exceed max_network_retry_delay. + ) -> float: + """ + Apply exponential backoff with initial_network_retry_delay on the number of num_retries so far as inputs. + Do not allow the number to exceed `max_network_retry_delay`. + """ sleep_seconds = min( HTTPClient.INITIAL_DELAY * (2 ** (num_retries - 1)), HTTPClient.MAX_DELAY, @@ -263,9 +264,11 @@ def _sleep_time_seconds( return sleep_seconds - def _add_jitter_time(self, sleep_seconds: float): - # Randomize the value in [(sleep_seconds/ 2) to (sleep_seconds)] - # Also separated method here to isolate randomness for tests + def _add_jitter_time(self, sleep_seconds: float) -> float: + """ + Randomize the value in `[(sleep_seconds/ 2) to (sleep_seconds)]`. + Also separated method here to isolate randomness for tests + """ sleep_seconds *= 0.5 * (1 + random.uniform(0, 1)) return sleep_seconds @@ -900,6 +903,11 @@ def close(self): pass +class _Proxy(TypedDict): + http: Optional[ParseResult] + https: Optional[ParseResult] + + class PycurlClient(HTTPClient): class _ParsedProxy(TypedDict, total=False): http: Optional[ParseResult] @@ -1025,7 +1033,7 @@ def _request_internal( self._curl.setopt(self.pycurl.TIMEOUT, 80) self._curl.setopt( self.pycurl.HTTPHEADER, - ["%s: %s" % (k, v) for k, v in iter(dict(headers).items())], + ["%s: %s" % (k, v) for k, v in dict(headers).items()], ) if self._verify_ssl_certs: self._curl.setopt(self.pycurl.CAINFO, stripe.ca_bundle_path) diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 07f217f9e..db9966044 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -40,6 +40,7 @@ from stripe._customer import Customer from stripe._discount import Discount from stripe._invoice_line_item import InvoiceLineItem + from stripe._margin import Margin from stripe._payment_intent import PaymentIntent from stripe._payment_method import PaymentMethod from stripe._quote import Quote @@ -49,6 +50,9 @@ from stripe._subscription import Subscription from stripe._tax_id import TaxId from stripe._tax_rate import TaxRate + from stripe.billing._credit_balance_transaction import ( + CreditBalanceTransaction, + ) from stripe.test_helpers._test_clock import TestClock @@ -965,6 +969,30 @@ class TotalDiscountAmount(StripeObject): The discount that was applied to get this discount amount. """ + class TotalPretaxCreditAmount(StripeObject): + amount: int + """ + The amount, in cents (or local equivalent), of the pretax credit amount. + """ + credit_balance_transaction: Optional[ + ExpandableField["CreditBalanceTransaction"] + ] + """ + The credit balance transaction that was applied to get this pretax credit amount. + """ + discount: Optional[ExpandableField["Discount"]] + """ + The discount that was applied to get this pretax credit amount. + """ + margin: Optional[ExpandableField["Margin"]] + """ + The margin that was applied to get this pretax credit amount. + """ + type: Literal["credit_balance_transaction", "discount"] + """ + Type of the pretax credit amount referenced. + """ + class TotalTaxAmount(StripeObject): amount: int """ @@ -6445,6 +6473,7 @@ class VoidInvoiceParams(RequestOptions): """ The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. """ + total_pretax_credit_amounts: Optional[List[TotalPretaxCreditAmount]] total_tax_amounts: List[TotalTaxAmount] """ The aggregate amounts calculated per tax rate for all line items. @@ -7811,6 +7840,7 @@ async def list_lines_async( "subscription_details": SubscriptionDetails, "threshold_reason": ThresholdReason, "total_discount_amounts": TotalDiscountAmount, + "total_pretax_credit_amounts": TotalPretaxCreditAmount, "total_tax_amounts": TotalTaxAmount, "transfer_data": TransferData, } diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 0985834a8..c81defb72 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -17,11 +17,15 @@ if TYPE_CHECKING: from stripe._discount import Discount from stripe._invoice_item import InvoiceItem + from stripe._margin import Margin from stripe._plan import Plan from stripe._price import Price from stripe._subscription import Subscription from stripe._subscription_item import SubscriptionItem from stripe._tax_rate import TaxRate + from stripe.billing._credit_balance_transaction import ( + CreditBalanceTransaction, + ) class InvoiceLineItem(UpdateableAPIResource["InvoiceLineItem"]): @@ -53,6 +57,30 @@ class Period(StripeObject): The start of the period. This value is inclusive. """ + class PretaxCreditAmount(StripeObject): + amount: int + """ + The amount, in cents (or local equivalent), of the pretax credit amount. + """ + credit_balance_transaction: Optional[ + ExpandableField["CreditBalanceTransaction"] + ] + """ + The credit balance transaction that was applied to get this pretax credit amount. + """ + discount: Optional[ExpandableField["Discount"]] + """ + The discount that was applied to get this pretax credit amount. + """ + margin: Optional[ExpandableField["Margin"]] + """ + The margin that was applied to get this pretax credit amount. + """ + type: Literal["credit_balance_transaction", "discount"] + """ + Type of the pretax credit amount referenced. + """ + class ProrationDetails(StripeObject): class CreditedItems(StripeObject): invoice: str @@ -362,6 +390,7 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): """ The plan of the subscription, if the line item is a subscription or a proration. """ + pretax_credit_amounts: Optional[List[PretaxCreditAmount]] price: Optional["Price"] """ The price of the line item. @@ -446,6 +475,7 @@ async def modify_async( _inner_class_types = { "discount_amounts": DiscountAmount, "period": Period, + "pretax_credit_amounts": PretaxCreditAmount, "proration_details": ProrationDetails, "tax_amounts": TaxAmount, } diff --git a/stripe/_margin.py b/stripe/_margin.py new file mode 100644 index 000000000..949e35f9b --- /dev/null +++ b/stripe/_margin.py @@ -0,0 +1,50 @@ +# -*- 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 Margin(StripeObject): + """ + A (partner) margin represents a specific discount distributed in partner reseller programs to business partners who + resell products and services and earn a discount (margin) for doing so. + """ + + OBJECT_NAME: ClassVar[Literal["margin"]] = "margin" + active: bool + """ + Whether the margin can be applied to invoices, invoice items, or invoice line items. Defaults to `true`. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + name: Optional[str] + """ + Name of the margin that's displayed on, for example, invoices. + """ + object: Literal["margin"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + percent_off: float + """ + Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied. + """ + updated: int + """ + Time at which the object was last updated. Measured in seconds since the Unix epoch. + """ diff --git a/stripe/_multipart_data_generator.py b/stripe/_multipart_data_generator.py index 3151df83e..1e0be2ba1 100644 --- a/stripe/_multipart_data_generator.py +++ b/stripe/_multipart_data_generator.py @@ -19,7 +19,7 @@ def __init__(self, chunk_size: int = 1028): def add_params(self, params): # Flatten parameters first - params = dict(_api_encode(params)) + params = dict(_api_encode(params, "V1")) for key, value in params.items(): if value is None: diff --git a/stripe/_oauth.py b/stripe/_oauth.py index c2bd478b0..9940bd3ed 100644 --- a/stripe/_oauth.py +++ b/stripe/_oauth.py @@ -315,7 +315,7 @@ def authorize_url( OAuth._set_client_id(params) if "response_type" not in params: params["response_type"] = "code" - query = urlencode(list(_api_encode(params))) + query = urlencode(list(_api_encode(params, "V1"))) url = connect_api_base + path + "?" + query return url diff --git a/stripe/_oauth_service.py b/stripe/_oauth_service.py index 7c24269f5..2a1edc83c 100644 --- a/stripe/_oauth_service.py +++ b/stripe/_oauth_service.py @@ -57,7 +57,7 @@ def authorize_url( self._set_client_id(params) if "response_type" not in params: params["response_type"] = "code" - query = urlencode(list(_api_encode(params))) + query = urlencode(list(_api_encode(params, "V1"))) # connect_api_base will be always set to stripe.DEFAULT_CONNECT_API_BASE # if it is not overridden on the client explicitly. diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 083d02566..fb0a0ba5b 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -22,6 +22,9 @@ stripe.billing_portal.Session.OBJECT_NAME: stripe.billing_portal.Session, stripe.billing.Alert.OBJECT_NAME: stripe.billing.Alert, stripe.billing.AlertTriggered.OBJECT_NAME: stripe.billing.AlertTriggered, + stripe.billing.CreditBalanceSummary.OBJECT_NAME: stripe.billing.CreditBalanceSummary, + stripe.billing.CreditBalanceTransaction.OBJECT_NAME: stripe.billing.CreditBalanceTransaction, + stripe.billing.CreditGrant.OBJECT_NAME: stripe.billing.CreditGrant, stripe.billing.Meter.OBJECT_NAME: stripe.billing.Meter, stripe.billing.MeterEvent.OBJECT_NAME: stripe.billing.MeterEvent, stripe.billing.MeterEventAdjustment.OBJECT_NAME: stripe.billing.MeterEventAdjustment, @@ -78,6 +81,7 @@ stripe.LineItem.OBJECT_NAME: stripe.LineItem, stripe.LoginLink.OBJECT_NAME: stripe.LoginLink, stripe.Mandate.OBJECT_NAME: stripe.Mandate, + stripe.Margin.OBJECT_NAME: stripe.Margin, stripe.PaymentIntent.OBJECT_NAME: stripe.PaymentIntent, stripe.PaymentLink.OBJECT_NAME: stripe.PaymentLink, stripe.PaymentMethod.OBJECT_NAME: stripe.PaymentMethod, @@ -144,3 +148,12 @@ stripe.WebhookEndpoint.OBJECT_NAME: stripe.WebhookEndpoint, # Object classes: The end of the section generated from our OpenAPI spec } + +V2_OBJECT_CLASSES = { + # V2 Object classes: The beginning of the section generated from our OpenAPI spec + stripe.v2.billing.MeterEvent.OBJECT_NAME: stripe.v2.billing.MeterEvent, + stripe.v2.billing.MeterEventAdjustment.OBJECT_NAME: stripe.v2.billing.MeterEventAdjustment, + stripe.v2.billing.MeterEventSession.OBJECT_NAME: stripe.v2.billing.MeterEventSession, + stripe.v2.Event.OBJECT_NAME: stripe.v2.Event, + # V2 Object classes: The end of the section generated from our OpenAPI spec +} diff --git a/stripe/_product.py b/stripe/_product.py index ea3cda794..4bda6d1ca 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -176,6 +176,12 @@ class CreateParamsDefaultPriceData(TypedDict): """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ + custom_unit_amount: NotRequired[ + "Product.CreateParamsDefaultPriceDataCustomUnitAmount" + ] + """ + When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + """ recurring: NotRequired["Product.CreateParamsDefaultPriceDataRecurring"] """ The recurring components of a price such as `interval` and `interval_count`. @@ -188,7 +194,7 @@ class CreateParamsDefaultPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required. """ unit_amount_decimal: NotRequired[str] """ @@ -265,6 +271,24 @@ class CreateParamsDefaultPriceDataCurrencyOptionsTier(TypedDict): Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ + class CreateParamsDefaultPriceDataCustomUnitAmount(TypedDict): + enabled: bool + """ + Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + """ + maximum: NotRequired[int] + """ + The maximum unit amount the customer can specify for this item. + """ + minimum: NotRequired[int] + """ + The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + """ + preset: NotRequired[int] + """ + The starting unit amount which can be updated by the customer. + """ + class CreateParamsDefaultPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ diff --git a/stripe/_product_service.py b/stripe/_product_service.py index 817c190b6..3e1b632c2 100644 --- a/stripe/_product_service.py +++ b/stripe/_product_service.py @@ -105,6 +105,12 @@ class CreateParamsDefaultPriceData(TypedDict): """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ + custom_unit_amount: NotRequired[ + "ProductService.CreateParamsDefaultPriceDataCustomUnitAmount" + ] + """ + When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + """ recurring: NotRequired[ "ProductService.CreateParamsDefaultPriceDataRecurring" ] @@ -119,7 +125,7 @@ class CreateParamsDefaultPriceData(TypedDict): """ unit_amount: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required. """ unit_amount_decimal: NotRequired[str] """ @@ -198,6 +204,24 @@ class CreateParamsDefaultPriceDataCurrencyOptionsTier(TypedDict): Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ + class CreateParamsDefaultPriceDataCustomUnitAmount(TypedDict): + enabled: bool + """ + Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + """ + maximum: NotRequired[int] + """ + The maximum unit amount the customer can specify for this item. + """ + minimum: NotRequired[int] + """ + The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + """ + preset: NotRequired[int] + """ + The starting unit amount which can be updated by the customer. + """ + class CreateParamsDefaultPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ diff --git a/stripe/_promotion_code.py b/stripe/_promotion_code.py index 13fb3c528..e11786c09 100644 --- a/stripe/_promotion_code.py +++ b/stripe/_promotion_code.py @@ -67,7 +67,9 @@ class CreateParams(RequestOptions): """ code: NotRequired[str] """ - The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically. + The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), and digits (0-9). + + If left blank, we will generate one automatically. """ coupon: str """ @@ -224,7 +226,7 @@ class RetrieveParams(RequestOptions): """ code: str """ - The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer. + The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), and digits (0-9). """ coupon: "Coupon" """ diff --git a/stripe/_promotion_code_service.py b/stripe/_promotion_code_service.py index b3eeed7b3..4da95a810 100644 --- a/stripe/_promotion_code_service.py +++ b/stripe/_promotion_code_service.py @@ -17,7 +17,9 @@ class CreateParams(TypedDict): """ code: NotRequired[str] """ - The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically. + The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), and digits (0-9). + + If left blank, we will generate one automatically. """ coupon: str """ diff --git a/stripe/_request_options.py b/stripe/_request_options.py index caa26fa50..e97cf1e1c 100644 --- a/stripe/_request_options.py +++ b/stripe/_request_options.py @@ -7,6 +7,7 @@ class RequestOptions(TypedDict): api_key: NotRequired["str|None"] stripe_version: NotRequired["str|None"] stripe_account: NotRequired["str|None"] + stripe_context: NotRequired["str|None"] max_network_retries: NotRequired["int|None"] idempotency_key: NotRequired["str|None"] content_type: NotRequired["str|None"] @@ -25,6 +26,7 @@ def merge_options( return { "api_key": requestor.api_key, "stripe_account": requestor.stripe_account, + "stripe_context": requestor.stripe_context, "stripe_version": requestor.stripe_version, "max_network_retries": requestor.max_network_retries, "idempotency_key": None, @@ -36,6 +38,8 @@ def merge_options( "api_key": request.get("api_key") or requestor.api_key, "stripe_account": request.get("stripe_account") or requestor.stripe_account, + "stripe_context": request.get("stripe_context") + or requestor.stripe_context, "stripe_version": request.get("stripe_version") or requestor.stripe_version, "max_network_retries": request.get("max_network_retries") @@ -62,6 +66,7 @@ def extract_options_from_dict( "api_key", "stripe_version", "stripe_account", + "stripe_context", "max_network_retries", "idempotency_key", "content_type", diff --git a/stripe/_requestor_options.py b/stripe/_requestor_options.py index 1314a8a71..6f8ebb328 100644 --- a/stripe/_requestor_options.py +++ b/stripe/_requestor_options.py @@ -8,6 +8,7 @@ class RequestorOptions(object): api_key: Optional[str] stripe_account: Optional[str] + stripe_context: Optional[str] stripe_version: Optional[str] base_addresses: BaseAddresses max_network_retries: Optional[int] @@ -16,12 +17,14 @@ def __init__( self, api_key: Optional[str] = None, stripe_account: Optional[str] = None, + stripe_context: Optional[str] = None, stripe_version: Optional[str] = None, base_addresses: BaseAddresses = {}, max_network_retries: Optional[int] = None, ): self.api_key = api_key self.stripe_account = stripe_account + self.stripe_context = stripe_context self.stripe_version = stripe_version self.base_addresses = {} @@ -33,6 +36,10 @@ def __init__( self.base_addresses["connect"] = base_addresses.get("connect") if base_addresses.get("files") is not None: self.base_addresses["files"] = base_addresses.get("files") + if base_addresses.get("meter_events") is not None: + self.base_addresses["meter_events"] = base_addresses.get( + "meter_events" + ) self.max_network_retries = max_network_retries @@ -43,6 +50,7 @@ def to_dict(self): return { "api_key": self.api_key, "stripe_account": self.stripe_account, + "stripe_context": self.stripe_context, "stripe_version": self.stripe_version, "base_addresses": self.base_addresses, "max_network_retries": self.max_network_retries, @@ -59,6 +67,7 @@ def base_addresses(self): "api": stripe.api_base, "connect": stripe.connect_api_base, "files": stripe.upload_api_base, + "meter_events": stripe.meter_events_api_base, } @property @@ -73,6 +82,10 @@ def stripe_version(self): def stripe_account(self): return None + @property + def stripe_context(self): + return None + @property def max_network_retries(self): return stripe.max_network_retries diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 8f52c2da8..661c018b1 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -7,10 +7,13 @@ DEFAULT_API_BASE, DEFAULT_CONNECT_API_BASE, DEFAULT_UPLOAD_API_BASE, + DEFAULT_METER_EVENTS_API_BASE, ) +from stripe._api_mode import ApiMode from stripe._error import AuthenticationError from stripe._api_requestor import _APIRequestor +from stripe._request_options import extract_options_from_dict from stripe._requestor_options import RequestorOptions, BaseAddresses from stripe._client_options import _ClientOptions from stripe._http_client import ( @@ -19,10 +22,14 @@ new_http_client_async_fallback, ) 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 from stripe._webhook import Webhook, WebhookSignature from stripe._event import Event +from stripe.v2._event import ThinEvent -from typing import Optional, Union, cast +from typing import Any, Dict, Optional, Union, cast # Non-generated services from stripe._oauth_service import OAuthService @@ -100,6 +107,7 @@ from stripe._transfer_service import TransferService from stripe._treasury_service import TreasuryService from stripe._webhook_endpoint_service import WebhookEndpointService +from stripe._v2_services import V2Services # services: The end of the section generated from our OpenAPI spec @@ -109,6 +117,7 @@ def __init__( api_key: str, *, stripe_account: Optional[str] = None, + stripe_context: Optional[str] = None, stripe_version: Optional[str] = None, base_addresses: BaseAddresses = {}, client_id: Optional[str] = None, @@ -140,12 +149,14 @@ def __init__( "api": DEFAULT_API_BASE, "connect": DEFAULT_CONNECT_API_BASE, "files": DEFAULT_UPLOAD_API_BASE, + "meter_events": DEFAULT_METER_EVENTS_API_BASE, **base_addresses, } requestor_options = RequestorOptions( api_key=api_key, stripe_account=stripe_account, + stripe_context=stripe_context, stripe_version=stripe_version or _ApiVersion.CURRENT, base_addresses=base_addresses, max_network_retries=max_network_retries, @@ -252,9 +263,27 @@ def __init__( self.transfers = TransferService(self._requestor) self.treasury = TreasuryService(self._requestor) self.webhook_endpoints = WebhookEndpointService(self._requestor) + self.v2 = V2Services(self._requestor) # top-level services: The end of the section generated from our OpenAPI spec - def construct_event( + def parse_thin_event( + self, + raw: Union[bytes, str, bytearray], + sig_header: str, + secret: str, + tolerance: int = Webhook.DEFAULT_TOLERANCE, + ) -> ThinEvent: + payload = ( + cast(Union[bytes, bytearray], raw).decode("utf-8") + if hasattr(raw, "decode") + else cast(str, raw) + ) + + WebhookSignature.verify_header(payload, sig_header, secret, tolerance) + + return ThinEvent(payload) + + def parse_snapshot_event( self, payload: Union[bytes, str], sig_header: str, @@ -274,3 +303,68 @@ def construct_event( ) return event + + def raw_request(self, method_: str, url_: str, **params): + params = params.copy() + options, params = extract_options_from_dict(params) + api_mode = get_api_mode(url_) + base_address = params.pop("base", "api") + + stripe_context = params.pop("stripe_context", None) + + # stripe-context goes *here* and not in api_requestor. Properties + # go on api_requestor when you want them to persist onto requests + # made when you call instance methods on APIResources that come from + # the first request. No need for that here, as we aren't deserializing APIResources + if stripe_context is not None: + options["headers"] = options.get("headers", {}) + assert isinstance(options["headers"], dict) + options["headers"].update({"Stripe-Context": stripe_context}) + + rbody, rcode, rheaders = self._requestor.request_raw( + method_, + url_, + params=params, + options=options, + base_address=base_address, + api_mode=api_mode, + usage=["raw_request"], + ) + + return self._requestor._interpret_response( + rbody, rcode, rheaders, api_mode + ) + + async def raw_request_async(self, method_: str, url_: str, **params): + params = params.copy() + options, params = extract_options_from_dict(params) + api_mode = get_api_mode(url_) + base_address = params.pop("base", "api") + + rbody, rcode, rheaders = await self._requestor.request_raw_async( + method_, + url_, + params=params, + options=options, + base_address=base_address, + api_mode=api_mode, + usage=["raw_request"], + ) + + return self._requestor._interpret_response( + rbody, rcode, rheaders, api_mode + ) + + def deserialize( + self, + resp: Union[StripeResponse, Dict[str, Any]], + params: Optional[Dict[str, Any]] = None, + *, + api_mode: ApiMode, + ) -> StripeObject: + return _convert_to_stripe_object( + resp=resp, + params=params, + requestor=self._requestor, + api_mode=api_mode, + ) diff --git a/stripe/_stripe_object.py b/stripe/_stripe_object.py index 2cc00104d..e8fd042e6 100644 --- a/stripe/_stripe_object.py +++ b/stripe/_stripe_object.py @@ -81,8 +81,6 @@ class StripeObject(Dict[str, Any]): class _ReprJSONEncoder(json.JSONEncoder): def default(self, o: Any) -> Any: if isinstance(o, datetime.datetime): - # pyright complains that _encode_datetime is "private", but it's - # private to outsiders, not to stripe_object return _encode_datetime(o) return super(StripeObject._ReprJSONEncoder, self).default(o) diff --git a/stripe/_subscription.py b/stripe/_subscription.py index ad418161e..93c9edeb6 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -2270,11 +2270,11 @@ def _cls_cancel( **params: Unpack["Subscription.CancelParams"], ) -> "Subscription": """ - Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + 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://stripe.com/metadata). - Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/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. - By default, upon subscription cancellation, Stripe will stop 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. + 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. """ return cast( "Subscription", @@ -2296,11 +2296,11 @@ def cancel( **params: Unpack["Subscription.CancelParams"], ) -> "Subscription": """ - Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + 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://stripe.com/metadata). - Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/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. - By default, upon subscription cancellation, Stripe will stop 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. + 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. """ ... @@ -2309,11 +2309,11 @@ def cancel( self, **params: Unpack["Subscription.CancelParams"] ) -> "Subscription": """ - Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + 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://stripe.com/metadata). - Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/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. - By default, upon subscription cancellation, Stripe will stop 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. + 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. """ ... @@ -2322,11 +2322,11 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Subscription.CancelParams"] ) -> "Subscription": """ - Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + 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://stripe.com/metadata). - Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/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. - By default, upon subscription cancellation, Stripe will stop 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. + 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. """ return cast( "Subscription", @@ -2346,11 +2346,11 @@ async def _cls_cancel_async( **params: Unpack["Subscription.CancelParams"], ) -> "Subscription": """ - Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + 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://stripe.com/metadata). - Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/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. - By default, upon subscription cancellation, Stripe will stop 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. + 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. """ return cast( "Subscription", @@ -2372,11 +2372,11 @@ async def cancel_async( **params: Unpack["Subscription.CancelParams"], ) -> "Subscription": """ - Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + 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://stripe.com/metadata). - Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/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. - By default, upon subscription cancellation, Stripe will stop 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. + 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. """ ... @@ -2385,11 +2385,11 @@ async def cancel_async( self, **params: Unpack["Subscription.CancelParams"] ) -> "Subscription": """ - Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + 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://stripe.com/metadata). - Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/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. - By default, upon subscription cancellation, Stripe will stop 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. + 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. """ ... @@ -2398,11 +2398,11 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Subscription.CancelParams"] ) -> "Subscription": """ - Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + 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://stripe.com/metadata). - Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/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. - By default, upon subscription cancellation, Stripe will stop 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. + 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. """ return cast( "Subscription", diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index e034f9751..adad3f820 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -1647,11 +1647,11 @@ def cancel( options: RequestOptions = {}, ) -> Subscription: """ - Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + 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://stripe.com/metadata). - Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/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. - By default, upon subscription cancellation, Stripe will stop 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. + 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. """ return cast( Subscription, @@ -1675,11 +1675,11 @@ async def cancel_async( options: RequestOptions = {}, ) -> Subscription: """ - Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + 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://stripe.com/metadata). - Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/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. - By default, upon subscription cancellation, Stripe will stop 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. + 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. """ return cast( Subscription, diff --git a/stripe/_util.py b/stripe/_util.py index 6458d70a7..2ef97e7c2 100644 --- a/stripe/_util.py +++ b/stripe/_util.py @@ -192,8 +192,19 @@ def secure_compare(val1, val2): return result == 0 -def get_object_classes(): +def get_thin_event_classes(): + from stripe.events._event_classes import THIN_EVENT_CLASSES + + return THIN_EVENT_CLASSES + + +def get_object_classes(api_mode): # This is here to avoid a circular dependency + if api_mode == "V2": + from stripe._object_classes import V2_OBJECT_CLASSES + + return V2_OBJECT_CLASSES + from stripe._object_classes import OBJECT_CLASSES return OBJECT_CLASSES @@ -310,7 +321,20 @@ def _convert_to_stripe_object( resp = resp.copy() klass_name = resp.get("object") if isinstance(klass_name, str): - klass = get_object_classes().get(klass_name, StripeObject) + if api_mode == "V2" and klass_name == "v2.core.event": + event_name = resp.get("type", "") + klass = get_thin_event_classes().get( + event_name, stripe.StripeObject + ) + else: + klass = get_object_classes(api_mode).get( + klass_name, stripe.StripeObject + ) + # TODO: this is a horrible hack. The API needs + # to return something for `object` here. + + elif "data" in resp and "next_page_url" in resp: + klass = stripe.v2.ListObject elif klass_ is not None: klass = klass_ else: @@ -393,6 +417,13 @@ def sanitize_id(id): return quotedId +def get_api_mode(url): + if url.startswith("/v2"): + return "V2" + else: + return "V1" + + class class_method_variant(object): def __init__(self, class_method_name): self.class_method_name = class_method_name diff --git a/stripe/_v2_services.py b/stripe/_v2_services.py new file mode 100644 index 000000000..93e3e7064 --- /dev/null +++ b/stripe/_v2_services.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe.v2._billing_service import BillingService +from stripe.v2._core_service import CoreService + + +class V2Services(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.billing = BillingService(self._requestor) + self.core = CoreService(self._requestor) diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 9fc7bcb79..bd4140848 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -134,6 +134,7 @@ class CreateParams(RequestOptions): "2023-10-16", "2024-04-10", "2024-06-20", + "2024-09-30.acacia", ] ] """ diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 2acb57b8c..c29a6db8c 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -115,6 +115,7 @@ class CreateParams(TypedDict): "2023-10-16", "2024-04-10", "2024-06-20", + "2024-09-30.acacia", ] ] """ diff --git a/stripe/api_resources/__init__.py b/stripe/api_resources/__init__.py index 99bf65826..d142b58af 100644 --- a/stripe/api_resources/__init__.py +++ b/stripe/api_resources/__init__.py @@ -85,6 +85,7 @@ from stripe.api_resources.list_object import ListObject from stripe.api_resources.login_link import LoginLink from stripe.api_resources.mandate import Mandate + from stripe.api_resources.margin import Margin from stripe.api_resources.payment_intent import PaymentIntent from stripe.api_resources.payment_link import PaymentLink from stripe.api_resources.payment_method import PaymentMethod diff --git a/stripe/api_resources/billing/__init__.py b/stripe/api_resources/billing/__init__.py index e469ff8d7..3375658a4 100644 --- a/stripe/api_resources/billing/__init__.py +++ b/stripe/api_resources/billing/__init__.py @@ -18,6 +18,13 @@ if not TYPE_CHECKING: from stripe.api_resources.billing.alert import Alert from stripe.api_resources.billing.alert_triggered import AlertTriggered + from stripe.api_resources.billing.credit_balance_summary import ( + CreditBalanceSummary, + ) + from stripe.api_resources.billing.credit_balance_transaction import ( + CreditBalanceTransaction, + ) + from stripe.api_resources.billing.credit_grant import CreditGrant from stripe.api_resources.billing.meter import Meter from stripe.api_resources.billing.meter_event import MeterEvent from stripe.api_resources.billing.meter_event_adjustment import ( diff --git a/stripe/api_resources/billing/credit_balance_summary.py b/stripe/api_resources/billing/credit_balance_summary.py new file mode 100644 index 000000000..48e8754c2 --- /dev/null +++ b/stripe/api_resources/billing/credit_balance_summary.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.billing.credit_balance_summary package is deprecated, please change your + imports to import from stripe.billing directly. + From: + from stripe.api_resources.billing.credit_balance_summary import CreditBalanceSummary + To: + from stripe.billing import CreditBalanceSummary + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.billing._credit_balance_summary import ( # noqa + CreditBalanceSummary, + ) diff --git a/stripe/api_resources/billing/credit_balance_transaction.py b/stripe/api_resources/billing/credit_balance_transaction.py new file mode 100644 index 000000000..8797820ad --- /dev/null +++ b/stripe/api_resources/billing/credit_balance_transaction.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.billing.credit_balance_transaction package is deprecated, please change your + imports to import from stripe.billing directly. + From: + from stripe.api_resources.billing.credit_balance_transaction import CreditBalanceTransaction + To: + from stripe.billing import CreditBalanceTransaction + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.billing._credit_balance_transaction import ( # noqa + CreditBalanceTransaction, + ) diff --git a/stripe/api_resources/billing/credit_grant.py b/stripe/api_resources/billing/credit_grant.py new file mode 100644 index 000000000..4d50815d7 --- /dev/null +++ b/stripe/api_resources/billing/credit_grant.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.billing.credit_grant package is deprecated, please change your + imports to import from stripe.billing directly. + From: + from stripe.api_resources.billing.credit_grant import CreditGrant + To: + from stripe.billing import CreditGrant + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.billing._credit_grant import ( # noqa + CreditGrant, + ) diff --git a/stripe/api_resources/margin.py b/stripe/api_resources/margin.py new file mode 100644 index 000000000..2a94240be --- /dev/null +++ b/stripe/api_resources/margin.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.margin package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.margin import Margin + To: + from stripe import Margin + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._margin import ( # noqa + Margin, + ) diff --git a/stripe/billing/__init__.py b/stripe/billing/__init__.py index a6aea1532..29a9770a6 100644 --- a/stripe/billing/__init__.py +++ b/stripe/billing/__init__.py @@ -3,6 +3,22 @@ from stripe.billing._alert import Alert as Alert from stripe.billing._alert_service import AlertService as AlertService from stripe.billing._alert_triggered import AlertTriggered as AlertTriggered +from stripe.billing._credit_balance_summary import ( + CreditBalanceSummary as CreditBalanceSummary, +) +from stripe.billing._credit_balance_summary_service import ( + CreditBalanceSummaryService as CreditBalanceSummaryService, +) +from stripe.billing._credit_balance_transaction import ( + CreditBalanceTransaction as CreditBalanceTransaction, +) +from stripe.billing._credit_balance_transaction_service import ( + CreditBalanceTransactionService as CreditBalanceTransactionService, +) +from stripe.billing._credit_grant import CreditGrant as CreditGrant +from stripe.billing._credit_grant_service import ( + CreditGrantService as CreditGrantService, +) from stripe.billing._meter import Meter as Meter from stripe.billing._meter_event import MeterEvent as MeterEvent from stripe.billing._meter_event_adjustment import ( diff --git a/stripe/billing/_alert.py b/stripe/billing/_alert.py index 02aecb7da..0141ba0e7 100644 --- a/stripe/billing/_alert.py +++ b/stripe/billing/_alert.py @@ -28,13 +28,18 @@ class Alert(CreateableAPIResource["Alert"], ListableAPIResource["Alert"]): OBJECT_NAME: ClassVar[Literal["billing.alert"]] = "billing.alert" - class Filter(StripeObject): - customer: Optional[ExpandableField["Customer"]] + class UsageThreshold(StripeObject): + class Filter(StripeObject): + customer: Optional[ExpandableField["Customer"]] + """ + Limit the scope of the alert to this customer ID + """ + type: Literal["customer"] + + filters: Optional[List[Filter]] """ - Limit the scope of the alert to this customer ID + The filters allow limiting the scope of this usage alert. You can only specify up to one filter at this time. """ - - class UsageThresholdConfig(StripeObject): gte: int """ The value at which this alert will trigger. @@ -47,6 +52,7 @@ class UsageThresholdConfig(StripeObject): """ Defines how the alert will behave. """ + _inner_class_types = {"filters": Filter} class ActivateParams(RequestOptions): expand: NotRequired[List[str]] @@ -69,36 +75,20 @@ class CreateParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - filter: NotRequired["Alert.CreateParamsFilter"] - """ - Filters to limit the scope of an alert. - """ title: str """ The title of the alert. """ - usage_threshold_config: NotRequired[ - "Alert.CreateParamsUsageThresholdConfig" - ] + usage_threshold: NotRequired["Alert.CreateParamsUsageThreshold"] """ The configuration of the usage threshold. """ - class CreateParamsFilter(TypedDict): - customer: NotRequired[str] - """ - Limit the scope to this alert only to this customer. - """ - subscription: NotRequired[str] - """ - Limit the scope of this rated usage alert to this subscription. - """ - subscription_item: NotRequired[str] + class CreateParamsUsageThreshold(TypedDict): + filters: NotRequired[List["Alert.CreateParamsUsageThresholdFilter"]] """ - Limit the scope of this rated usage alert to this subscription item. + The filters allows limiting the scope of this usage alert. You can only specify up to one filter at this time. """ - - class CreateParamsUsageThresholdConfig(TypedDict): gte: int """ Defines at which value the alert will fire. @@ -112,6 +102,16 @@ class CreateParamsUsageThresholdConfig(TypedDict): Whether the alert should only fire only once, or once per billing cycle. """ + class CreateParamsUsageThresholdFilter(TypedDict): + customer: NotRequired[str] + """ + Limit the scope to this usage alert only to this customer. + """ + type: Literal["customer"] + """ + What type of filter is being applied to this usage alert. + """ + class DeactivateParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -154,10 +154,6 @@ class RetrieveParams(RequestOptions): """ Defines the type of the alert. """ - filter: Optional[Filter] - """ - Limits the scope of the alert to a specific [customer](https://stripe.com/docs/api/customers). - """ id: str """ Unique identifier for the object. @@ -178,7 +174,7 @@ class RetrieveParams(RequestOptions): """ Title of the alert. """ - usage_threshold_config: Optional[UsageThresholdConfig] + usage_threshold: Optional[UsageThreshold] """ Encapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://stripe.com/docs/api/billing/meter). """ @@ -587,7 +583,4 @@ async def retrieve_async( await instance.refresh_async() return instance - _inner_class_types = { - "filter": Filter, - "usage_threshold_config": UsageThresholdConfig, - } + _inner_class_types = {"usage_threshold": UsageThreshold} diff --git a/stripe/billing/_alert_service.py b/stripe/billing/_alert_service.py index 39649a26a..457fefda8 100644 --- a/stripe/billing/_alert_service.py +++ b/stripe/billing/_alert_service.py @@ -31,36 +31,22 @@ class CreateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - filter: NotRequired["AlertService.CreateParamsFilter"] - """ - Filters to limit the scope of an alert. - """ title: str """ The title of the alert. """ - usage_threshold_config: NotRequired[ - "AlertService.CreateParamsUsageThresholdConfig" - ] + usage_threshold: NotRequired["AlertService.CreateParamsUsageThreshold"] """ The configuration of the usage threshold. """ - class CreateParamsFilter(TypedDict): - customer: NotRequired[str] - """ - Limit the scope to this alert only to this customer. - """ - subscription: NotRequired[str] - """ - Limit the scope of this rated usage alert to this subscription. - """ - subscription_item: NotRequired[str] + class CreateParamsUsageThreshold(TypedDict): + filters: NotRequired[ + List["AlertService.CreateParamsUsageThresholdFilter"] + ] """ - Limit the scope of this rated usage alert to this subscription item. + The filters allows limiting the scope of this usage alert. You can only specify up to one filter at this time. """ - - class CreateParamsUsageThresholdConfig(TypedDict): gte: int """ Defines at which value the alert will fire. @@ -74,6 +60,16 @@ class CreateParamsUsageThresholdConfig(TypedDict): Whether the alert should only fire only once, or once per billing cycle. """ + class CreateParamsUsageThresholdFilter(TypedDict): + customer: NotRequired[str] + """ + Limit the scope to this usage alert only to this customer. + """ + type: Literal["customer"] + """ + What type of filter is being applied to this usage alert. + """ + class DeactivateParams(TypedDict): expand: NotRequired[List[str]] """ diff --git a/stripe/billing/_credit_balance_summary.py b/stripe/billing/_credit_balance_summary.py new file mode 100644 index 000000000..d91252dbf --- /dev/null +++ b/stripe/billing/_credit_balance_summary.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._expandable_field import ExpandableField +from stripe._request_options import RequestOptions +from stripe._singleton_api_resource import SingletonAPIResource +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from stripe._customer import Customer + + +class CreditBalanceSummary(SingletonAPIResource["CreditBalanceSummary"]): + """ + Indicates the credit balance for credits granted to a customer. + """ + + OBJECT_NAME: ClassVar[Literal["billing.credit_balance_summary"]] = ( + "billing.credit_balance_summary" + ) + + class Balance(StripeObject): + class AvailableBalance(StripeObject): + class Monetary(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 positive integer representing the amount. + """ + + monetary: Optional[Monetary] + """ + The monetary amount. + """ + type: Literal["monetary"] + """ + The type of this amount. We currently only support `monetary` credits. + """ + _inner_class_types = {"monetary": Monetary} + + class LedgerBalance(StripeObject): + class Monetary(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 positive integer representing the amount. + """ + + monetary: Optional[Monetary] + """ + The monetary amount. + """ + type: Literal["monetary"] + """ + The type of this amount. We currently only support `monetary` credits. + """ + _inner_class_types = {"monetary": Monetary} + + available_balance: AvailableBalance + ledger_balance: LedgerBalance + _inner_class_types = { + "available_balance": AvailableBalance, + "ledger_balance": LedgerBalance, + } + + class RetrieveParams(RequestOptions): + customer: str + """ + The customer for which to fetch credit balance summary. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + filter: "CreditBalanceSummary.RetrieveParamsFilter" + """ + The filter criteria for the credit balance summary. + """ + + class RetrieveParamsFilter(TypedDict): + applicability_scope: NotRequired[ + "CreditBalanceSummary.RetrieveParamsFilterApplicabilityScope" + ] + """ + The credit applicability scope for which to fetch balance summary. + """ + credit_grant: NotRequired[str] + """ + The credit grant for which to fetch balance summary. + """ + type: Literal["applicability_scope", "credit_grant"] + """ + Specify the type of this filter. + """ + + class RetrieveParamsFilterApplicabilityScope(TypedDict): + price_type: Literal["metered"] + """ + The price type to which credit grants can apply to. We currently only support `metered` price type. + """ + + balances: List[Balance] + """ + The credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry. + """ + customer: ExpandableField["Customer"] + """ + The customer the balance is for. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["billing.credit_balance_summary"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + + @classmethod + def retrieve( + cls, **params: Unpack["CreditBalanceSummary.RetrieveParams"] + ) -> "CreditBalanceSummary": + """ + Retrieves the credit balance summary for a customer + """ + instance = cls(None, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, **params: Unpack["CreditBalanceSummary.RetrieveParams"] + ) -> "CreditBalanceSummary": + """ + Retrieves the credit balance summary for a customer + """ + instance = cls(None, **params) + await instance.refresh_async() + return instance + + @classmethod + def class_url(cls): + return "/v1/billing/credit_balance_summary" + + _inner_class_types = {"balances": Balance} diff --git a/stripe/billing/_credit_balance_summary_service.py b/stripe/billing/_credit_balance_summary_service.py new file mode 100644 index 000000000..045e093b0 --- /dev/null +++ b/stripe/billing/_credit_balance_summary_service.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe.billing._credit_balance_summary import CreditBalanceSummary +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class CreditBalanceSummaryService(StripeService): + class RetrieveParams(TypedDict): + customer: str + """ + The customer for which to fetch credit balance summary. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + filter: "CreditBalanceSummaryService.RetrieveParamsFilter" + """ + The filter criteria for the credit balance summary. + """ + + class RetrieveParamsFilter(TypedDict): + applicability_scope: NotRequired[ + "CreditBalanceSummaryService.RetrieveParamsFilterApplicabilityScope" + ] + """ + The credit applicability scope for which to fetch balance summary. + """ + credit_grant: NotRequired[str] + """ + The credit grant for which to fetch balance summary. + """ + type: Literal["applicability_scope", "credit_grant"] + """ + Specify the type of this filter. + """ + + class RetrieveParamsFilterApplicabilityScope(TypedDict): + price_type: Literal["metered"] + """ + The price type to which credit grants can apply to. We currently only support `metered` price type. + """ + + def retrieve( + self, + params: "CreditBalanceSummaryService.RetrieveParams", + options: RequestOptions = {}, + ) -> CreditBalanceSummary: + """ + Retrieves the credit balance summary for a customer + """ + return cast( + CreditBalanceSummary, + self._request( + "get", + "/v1/billing/credit_balance_summary", + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + params: "CreditBalanceSummaryService.RetrieveParams", + options: RequestOptions = {}, + ) -> CreditBalanceSummary: + """ + Retrieves the credit balance summary for a customer + """ + return cast( + CreditBalanceSummary, + await self._request_async( + "get", + "/v1/billing/credit_balance_summary", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing/_credit_balance_transaction.py b/stripe/billing/_credit_balance_transaction.py new file mode 100644 index 000000000..ff8de6bad --- /dev/null +++ b/stripe/billing/_credit_balance_transaction.py @@ -0,0 +1,242 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe.billing._credit_grant import CreditGrant + from stripe.test_helpers._test_clock import TestClock + + +class CreditBalanceTransaction( + ListableAPIResource["CreditBalanceTransaction"] +): + """ + A credit balance transaction is a resource representing a transaction (either a credit or a debit) against an existing credit grant. + """ + + OBJECT_NAME: ClassVar[Literal["billing.credit_balance_transaction"]] = ( + "billing.credit_balance_transaction" + ) + + class Credit(StripeObject): + class Amount(StripeObject): + class Monetary(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 positive integer representing the amount. + """ + + monetary: Optional[Monetary] + """ + The monetary amount. + """ + type: Literal["monetary"] + """ + The type of this amount. We currently only support `monetary` credits. + """ + _inner_class_types = {"monetary": Monetary} + + amount: Amount + type: Literal["credits_granted"] + """ + The type of credit transaction. + """ + _inner_class_types = {"amount": Amount} + + class Debit(StripeObject): + class Amount(StripeObject): + class Monetary(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 positive integer representing the amount. + """ + + monetary: Optional[Monetary] + """ + The monetary amount. + """ + type: Literal["monetary"] + """ + The type of this amount. We currently only support `monetary` credits. + """ + _inner_class_types = {"monetary": Monetary} + + class CreditsApplied(StripeObject): + invoice: ExpandableField["Invoice"] + """ + The invoice to which the credits were applied. + """ + invoice_line_item: str + """ + The invoice line item to which the credits were applied. + """ + + amount: Amount + credits_applied: Optional[CreditsApplied] + """ + Details of how the credits were applied to an invoice. Only present if `type` is `credits_applied`. + """ + type: Literal["credits_applied", "credits_expired", "credits_voided"] + """ + The type of debit transaction. + """ + _inner_class_types = { + "amount": Amount, + "credits_applied": CreditsApplied, + } + + class ListParams(RequestOptions): + credit_grant: NotRequired[str] + """ + The credit grant for which to fetch credit balance transactions. + """ + customer: str + """ + The customer for which to fetch credit balance transactions. + """ + 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. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + credit: Optional[Credit] + """ + Credit details for this balance transaction. Only present if type is `credit`. + """ + credit_grant: ExpandableField["CreditGrant"] + """ + The credit grant associated with this balance transaction. + """ + debit: Optional[Debit] + """ + Debit details for this balance transaction. Only present if type is `debit`. + """ + effective_at: int + """ + The effective time of this balance transaction. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["billing.credit_balance_transaction"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + test_clock: Optional[ExpandableField["TestClock"]] + """ + ID of the test clock this credit balance transaction belongs to. + """ + type: Optional[Literal["credit", "debit"]] + """ + The type of balance transaction (credit or debit). + """ + + @classmethod + def list( + cls, **params: Unpack["CreditBalanceTransaction.ListParams"] + ) -> ListObject["CreditBalanceTransaction"]: + """ + Retrieve a list of credit balance transactions + """ + 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["CreditBalanceTransaction.ListParams"] + ) -> ListObject["CreditBalanceTransaction"]: + """ + Retrieve a list of credit balance transactions + """ + 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["CreditBalanceTransaction.RetrieveParams"], + ) -> "CreditBalanceTransaction": + """ + Retrieves a credit balance transaction + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, + id: str, + **params: Unpack["CreditBalanceTransaction.RetrieveParams"], + ) -> "CreditBalanceTransaction": + """ + Retrieves a credit balance transaction + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = {"credit": Credit, "debit": Debit} diff --git a/stripe/billing/_credit_balance_transaction_service.py b/stripe/billing/_credit_balance_transaction_service.py new file mode 100644 index 000000000..102258473 --- /dev/null +++ b/stripe/billing/_credit_balance_transaction_service.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.billing._credit_balance_transaction import CreditBalanceTransaction +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class CreditBalanceTransactionService(StripeService): + class ListParams(TypedDict): + credit_grant: NotRequired[str] + """ + The credit grant for which to fetch credit balance transactions. + """ + customer: str + """ + The customer for which to fetch credit balance transactions. + """ + 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. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "CreditBalanceTransactionService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[CreditBalanceTransaction]: + """ + Retrieve a list of credit balance transactions + """ + return cast( + ListObject[CreditBalanceTransaction], + self._request( + "get", + "/v1/billing/credit_balance_transactions", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "CreditBalanceTransactionService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[CreditBalanceTransaction]: + """ + Retrieve a list of credit balance transactions + """ + return cast( + ListObject[CreditBalanceTransaction], + await self._request_async( + "get", + "/v1/billing/credit_balance_transactions", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "CreditBalanceTransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> CreditBalanceTransaction: + """ + Retrieves a credit balance transaction + """ + return cast( + CreditBalanceTransaction, + self._request( + "get", + "/v1/billing/credit_balance_transactions/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "CreditBalanceTransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> CreditBalanceTransaction: + """ + Retrieves a credit balance transaction + """ + return cast( + CreditBalanceTransaction, + await self._request_async( + "get", + "/v1/billing/credit_balance_transactions/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing/_credit_grant.py b/stripe/billing/_credit_grant.py new file mode 100644 index 000000000..51858796d --- /dev/null +++ b/stripe/billing/_credit_grant.py @@ -0,0 +1,599 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, Dict, List, Optional, cast, overload +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from stripe._customer import Customer + from stripe.test_helpers._test_clock import TestClock + + +class CreditGrant( + CreateableAPIResource["CreditGrant"], + ListableAPIResource["CreditGrant"], + UpdateableAPIResource["CreditGrant"], +): + """ + A credit grant is a resource that records a grant of some credit to a customer. + """ + + OBJECT_NAME: ClassVar[Literal["billing.credit_grant"]] = ( + "billing.credit_grant" + ) + + class Amount(StripeObject): + class Monetary(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 positive integer representing the amount. + """ + + monetary: Optional[Monetary] + """ + The monetary amount. + """ + type: Literal["monetary"] + """ + The type of this amount. We currently only support `monetary` credits. + """ + _inner_class_types = {"monetary": Monetary} + + class ApplicabilityConfig(StripeObject): + class Scope(StripeObject): + price_type: Literal["metered"] + """ + The price type to which credit grants can apply to. We currently only support `metered` price type. + """ + + scope: Scope + _inner_class_types = {"scope": Scope} + + class CreateParams(RequestOptions): + amount: "CreditGrant.CreateParamsAmount" + """ + Amount of this credit grant. + """ + applicability_config: "CreditGrant.CreateParamsApplicabilityConfig" + """ + Configuration specifying what this credit grant applies to. + """ + category: Literal["paid", "promotional"] + """ + The category of this credit grant. + """ + customer: str + """ + Id of the customer to whom the credit should be granted. + """ + effective_at: NotRequired[int] + """ + The time when the credit becomes effective i.e when it is eligible to be used. Defaults to the current timestamp if not specified. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + expires_at: NotRequired[int] + """ + The time when the credit will expire. If not specified, the credit will never expire. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (ex: cost basis) in a structured format. + """ + name: NotRequired[str] + """ + A descriptive name shown in dashboard and on invoices. + """ + + class CreateParamsAmount(TypedDict): + monetary: NotRequired["CreditGrant.CreateParamsAmountMonetary"] + """ + The monetary amount. + """ + type: Literal["monetary"] + """ + Specify the type of this amount. We currently only support `monetary` credits. + """ + + class CreateParamsAmountMonetary(TypedDict): + currency: str + """ + Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `value` parameter. + """ + value: int + """ + A positive integer representing the amount of the credit grant. + """ + + class CreateParamsApplicabilityConfig(TypedDict): + scope: "CreditGrant.CreateParamsApplicabilityConfigScope" + """ + Specify the scope of this applicability config. + """ + + class CreateParamsApplicabilityConfigScope(TypedDict): + price_type: Literal["metered"] + """ + The price type to which credit grants can apply to. We currently only support `metered` price type. + """ + + class ExpireParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ListParams(RequestOptions): + customer: NotRequired[str] + """ + Only return credit grants for this customer. + """ + 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. + """ + + class ModifyParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + expires_at: NotRequired["Literal['']|int"] + """ + The time when the credit created by this credit grant will expire. If set to empty, the credit will never expire. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (ex: cost basis) in a structured format. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class VoidGrantParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + amount: Amount + applicability_config: ApplicabilityConfig + category: Literal["paid", "promotional"] + """ + The category of this credit grant. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + customer: ExpandableField["Customer"] + """ + Id of the customer to whom the credit was granted. + """ + effective_at: Optional[int] + """ + The time when the credit becomes effective i.e when it is eligible to be used. + """ + expires_at: Optional[int] + """ + The time when the credit will expire. If not present, the credit will never expire. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Dict[str, str] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + name: Optional[str] + """ + A descriptive name shown in dashboard and on invoices. + """ + object: Literal["billing.credit_grant"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + test_clock: Optional[ExpandableField["TestClock"]] + """ + ID of the test clock this credit grant belongs to. + """ + updated: int + """ + Time at which the object was last updated. Measured in seconds since the Unix epoch. + """ + voided_at: Optional[int] + """ + The time when this credit grant was voided. If not present, the credit grant hasn't been voided. + """ + + @classmethod + def create( + cls, **params: Unpack["CreditGrant.CreateParams"] + ) -> "CreditGrant": + """ + Creates a credit grant + """ + return cast( + "CreditGrant", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["CreditGrant.CreateParams"] + ) -> "CreditGrant": + """ + Creates a credit grant + """ + return cast( + "CreditGrant", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def _cls_expire( + cls, id: str, **params: Unpack["CreditGrant.ExpireParams"] + ) -> "CreditGrant": + """ + Expires a credit grant + """ + return cast( + "CreditGrant", + cls._static_request( + "post", + "/v1/billing/credit_grants/{id}/expire".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def expire( + id: str, **params: Unpack["CreditGrant.ExpireParams"] + ) -> "CreditGrant": + """ + Expires a credit grant + """ + ... + + @overload + def expire( + self, **params: Unpack["CreditGrant.ExpireParams"] + ) -> "CreditGrant": + """ + Expires a credit grant + """ + ... + + @class_method_variant("_cls_expire") + def expire( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["CreditGrant.ExpireParams"] + ) -> "CreditGrant": + """ + Expires a credit grant + """ + return cast( + "CreditGrant", + self._request( + "post", + "/v1/billing/credit_grants/{id}/expire".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_expire_async( + cls, id: str, **params: Unpack["CreditGrant.ExpireParams"] + ) -> "CreditGrant": + """ + Expires a credit grant + """ + return cast( + "CreditGrant", + await cls._static_request_async( + "post", + "/v1/billing/credit_grants/{id}/expire".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def expire_async( + id: str, **params: Unpack["CreditGrant.ExpireParams"] + ) -> "CreditGrant": + """ + Expires a credit grant + """ + ... + + @overload + async def expire_async( + self, **params: Unpack["CreditGrant.ExpireParams"] + ) -> "CreditGrant": + """ + Expires a credit grant + """ + ... + + @class_method_variant("_cls_expire_async") + async def expire_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["CreditGrant.ExpireParams"] + ) -> "CreditGrant": + """ + Expires a credit grant + """ + return cast( + "CreditGrant", + await self._request_async( + "post", + "/v1/billing/credit_grants/{id}/expire".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["CreditGrant.ListParams"] + ) -> ListObject["CreditGrant"]: + """ + Retrieve a list of credit grants + """ + 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["CreditGrant.ListParams"] + ) -> ListObject["CreditGrant"]: + """ + Retrieve a list of credit grants + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + + @classmethod + def modify( + cls, id: str, **params: Unpack["CreditGrant.ModifyParams"] + ) -> "CreditGrant": + """ + Updates a credit grant + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "CreditGrant", + cls._static_request( + "post", + url, + params=params, + ), + ) + + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["CreditGrant.ModifyParams"] + ) -> "CreditGrant": + """ + Updates a credit grant + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "CreditGrant", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["CreditGrant.RetrieveParams"] + ) -> "CreditGrant": + """ + Retrieves a credit grant + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["CreditGrant.RetrieveParams"] + ) -> "CreditGrant": + """ + Retrieves a credit grant + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + @classmethod + def _cls_void_grant( + cls, id: str, **params: Unpack["CreditGrant.VoidGrantParams"] + ) -> "CreditGrant": + """ + Voids a credit grant + """ + return cast( + "CreditGrant", + cls._static_request( + "post", + "/v1/billing/credit_grants/{id}/void".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def void_grant( + id: str, **params: Unpack["CreditGrant.VoidGrantParams"] + ) -> "CreditGrant": + """ + Voids a credit grant + """ + ... + + @overload + def void_grant( + self, **params: Unpack["CreditGrant.VoidGrantParams"] + ) -> "CreditGrant": + """ + Voids a credit grant + """ + ... + + @class_method_variant("_cls_void_grant") + def void_grant( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["CreditGrant.VoidGrantParams"] + ) -> "CreditGrant": + """ + Voids a credit grant + """ + return cast( + "CreditGrant", + self._request( + "post", + "/v1/billing/credit_grants/{id}/void".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_void_grant_async( + cls, id: str, **params: Unpack["CreditGrant.VoidGrantParams"] + ) -> "CreditGrant": + """ + Voids a credit grant + """ + return cast( + "CreditGrant", + await cls._static_request_async( + "post", + "/v1/billing/credit_grants/{id}/void".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def void_grant_async( + id: str, **params: Unpack["CreditGrant.VoidGrantParams"] + ) -> "CreditGrant": + """ + Voids a credit grant + """ + ... + + @overload + async def void_grant_async( + self, **params: Unpack["CreditGrant.VoidGrantParams"] + ) -> "CreditGrant": + """ + Voids a credit grant + """ + ... + + @class_method_variant("_cls_void_grant_async") + async def void_grant_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["CreditGrant.VoidGrantParams"] + ) -> "CreditGrant": + """ + Voids a credit grant + """ + return cast( + "CreditGrant", + await self._request_async( + "post", + "/v1/billing/credit_grants/{id}/void".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + _inner_class_types = { + "amount": Amount, + "applicability_config": ApplicabilityConfig, + } diff --git a/stripe/billing/_credit_grant_service.py b/stripe/billing/_credit_grant_service.py new file mode 100644 index 000000000..011a189fb --- /dev/null +++ b/stripe/billing/_credit_grant_service.py @@ -0,0 +1,381 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.billing._credit_grant import CreditGrant +from typing import Dict, List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class CreditGrantService(StripeService): + class CreateParams(TypedDict): + amount: "CreditGrantService.CreateParamsAmount" + """ + Amount of this credit grant. + """ + applicability_config: ( + "CreditGrantService.CreateParamsApplicabilityConfig" + ) + """ + Configuration specifying what this credit grant applies to. + """ + category: Literal["paid", "promotional"] + """ + The category of this credit grant. + """ + customer: str + """ + Id of the customer to whom the credit should be granted. + """ + effective_at: NotRequired[int] + """ + The time when the credit becomes effective i.e when it is eligible to be used. Defaults to the current timestamp if not specified. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + expires_at: NotRequired[int] + """ + The time when the credit will expire. If not specified, the credit will never expire. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (ex: cost basis) in a structured format. + """ + name: NotRequired[str] + """ + A descriptive name shown in dashboard and on invoices. + """ + + class CreateParamsAmount(TypedDict): + monetary: NotRequired["CreditGrantService.CreateParamsAmountMonetary"] + """ + The monetary amount. + """ + type: Literal["monetary"] + """ + Specify the type of this amount. We currently only support `monetary` credits. + """ + + class CreateParamsAmountMonetary(TypedDict): + currency: str + """ + Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `value` parameter. + """ + value: int + """ + A positive integer representing the amount of the credit grant. + """ + + class CreateParamsApplicabilityConfig(TypedDict): + scope: "CreditGrantService.CreateParamsApplicabilityConfigScope" + """ + Specify the scope of this applicability config. + """ + + class CreateParamsApplicabilityConfigScope(TypedDict): + price_type: Literal["metered"] + """ + The price type to which credit grants can apply to. We currently only support `metered` price type. + """ + + class ExpireParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ListParams(TypedDict): + customer: NotRequired[str] + """ + Only return credit grants for this customer. + """ + 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. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class UpdateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + expires_at: NotRequired["Literal['']|int"] + """ + The time when the credit created by this credit grant will expire. If set to empty, the credit will never expire. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (ex: cost basis) in a structured format. + """ + + class VoidGrantParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "CreditGrantService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[CreditGrant]: + """ + Retrieve a list of credit grants + """ + return cast( + ListObject[CreditGrant], + self._request( + "get", + "/v1/billing/credit_grants", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "CreditGrantService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[CreditGrant]: + """ + Retrieve a list of credit grants + """ + return cast( + ListObject[CreditGrant], + await self._request_async( + "get", + "/v1/billing/credit_grants", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "CreditGrantService.CreateParams", + options: RequestOptions = {}, + ) -> CreditGrant: + """ + Creates a credit grant + """ + return cast( + CreditGrant, + self._request( + "post", + "/v1/billing/credit_grants", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "CreditGrantService.CreateParams", + options: RequestOptions = {}, + ) -> CreditGrant: + """ + Creates a credit grant + """ + return cast( + CreditGrant, + await self._request_async( + "post", + "/v1/billing/credit_grants", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "CreditGrantService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> CreditGrant: + """ + Retrieves a credit grant + """ + return cast( + CreditGrant, + self._request( + "get", + "/v1/billing/credit_grants/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "CreditGrantService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> CreditGrant: + """ + Retrieves a credit grant + """ + return cast( + CreditGrant, + await self._request_async( + "get", + "/v1/billing/credit_grants/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + params: "CreditGrantService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> CreditGrant: + """ + Updates a credit grant + """ + return cast( + CreditGrant, + self._request( + "post", + "/v1/billing/credit_grants/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: "CreditGrantService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> CreditGrant: + """ + Updates a credit grant + """ + return cast( + CreditGrant, + await self._request_async( + "post", + "/v1/billing/credit_grants/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def expire( + self, + id: str, + params: "CreditGrantService.ExpireParams" = {}, + options: RequestOptions = {}, + ) -> CreditGrant: + """ + Expires a credit grant + """ + return cast( + CreditGrant, + self._request( + "post", + "/v1/billing/credit_grants/{id}/expire".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def expire_async( + self, + id: str, + params: "CreditGrantService.ExpireParams" = {}, + options: RequestOptions = {}, + ) -> CreditGrant: + """ + Expires a credit grant + """ + return cast( + CreditGrant, + await self._request_async( + "post", + "/v1/billing/credit_grants/{id}/expire".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def void_grant( + self, + id: str, + params: "CreditGrantService.VoidGrantParams" = {}, + options: RequestOptions = {}, + ) -> CreditGrant: + """ + Voids a credit grant + """ + return cast( + CreditGrant, + self._request( + "post", + "/v1/billing/credit_grants/{id}/void".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def void_grant_async( + self, + id: str, + params: "CreditGrantService.VoidGrantParams" = {}, + options: RequestOptions = {}, + ) -> CreditGrant: + """ + Voids a credit grant + """ + return cast( + CreditGrant, + await self._request_async( + "post", + "/v1/billing/credit_grants/{id}/void".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index 90bc5fbd2..41dd41f34 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -315,8 +315,8 @@ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): """ class CreateParamsFeaturesSubscriptionUpdate(TypedDict): - default_allowed_updates: Union[ - Literal[""], List[Literal["price", "promotion_code", "quantity"]] + default_allowed_updates: NotRequired[ + "Literal['']|List[Literal['price', 'promotion_code', 'quantity']]" ] """ The types of subscription updates that are supported. When empty, subscriptions are not updateable. @@ -325,11 +325,8 @@ class CreateParamsFeaturesSubscriptionUpdate(TypedDict): """ Whether the feature is enabled. """ - products: Union[ - Literal[""], - List[ - "Configuration.CreateParamsFeaturesSubscriptionUpdateProduct" - ], + products: NotRequired[ + "Literal['']|List[Configuration.CreateParamsFeaturesSubscriptionUpdateProduct]" ] """ The list of up to 10 products that support subscription updates. diff --git a/stripe/billing_portal/_configuration_service.py b/stripe/billing_portal/_configuration_service.py index 7cbc97444..9edf1db04 100644 --- a/stripe/billing_portal/_configuration_service.py +++ b/stripe/billing_portal/_configuration_service.py @@ -153,8 +153,8 @@ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): """ class CreateParamsFeaturesSubscriptionUpdate(TypedDict): - default_allowed_updates: Union[ - Literal[""], List[Literal["price", "promotion_code", "quantity"]] + default_allowed_updates: NotRequired[ + "Literal['']|List[Literal['price', 'promotion_code', 'quantity']]" ] """ The types of subscription updates that are supported. When empty, subscriptions are not updateable. @@ -163,11 +163,8 @@ class CreateParamsFeaturesSubscriptionUpdate(TypedDict): """ Whether the feature is enabled. """ - products: Union[ - Literal[""], - List[ - "ConfigurationService.CreateParamsFeaturesSubscriptionUpdateProduct" - ], + products: NotRequired[ + "Literal['']|List[ConfigurationService.CreateParamsFeaturesSubscriptionUpdateProduct]" ] """ The list of up to 10 products that support subscription updates. diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index e6f7ba017..66bbac645 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -2280,7 +2280,7 @@ class CreateParamsLineItem(TypedDict): class CreateParamsLineItemAdjustableQuantity(TypedDict): enabled: bool """ - Set to true if the quantity can be adjusted to any non-negative integer. By default customers will be able to remove the line item by setting the quantity to 0. + Set to true if the quantity can be adjusted to any non-negative integer. """ maximum: NotRequired[int] """ diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index e1010120d..82d78f1be 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -690,7 +690,7 @@ class CreateParamsLineItem(TypedDict): class CreateParamsLineItemAdjustableQuantity(TypedDict): enabled: bool """ - Set to true if the quantity can be adjusted to any non-negative integer. By default customers will be able to remove the line item by setting the quantity to 0. + Set to true if the quantity can be adjusted to any non-negative integer. """ maximum: NotRequired[int] """ diff --git a/stripe/events/__init__.py b/stripe/events/__init__.py new file mode 100644 index 000000000..bcf79de80 --- /dev/null +++ b/stripe/events/__init__.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.events._v1_billing_meter_error_report_triggered_event import ( + V1BillingMeterErrorReportTriggeredEvent as V1BillingMeterErrorReportTriggeredEvent, +) +from stripe.events._v1_billing_meter_no_meter_found_event import ( + V1BillingMeterNoMeterFoundEvent as V1BillingMeterNoMeterFoundEvent, +) diff --git a/stripe/events/_event_classes.py b/stripe/events/_event_classes.py new file mode 100644 index 000000000..cfbfe23ba --- /dev/null +++ b/stripe/events/_event_classes.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.events._v1_billing_meter_error_report_triggered_event import ( + V1BillingMeterErrorReportTriggeredEvent, +) +from stripe.events._v1_billing_meter_no_meter_found_event import ( + V1BillingMeterNoMeterFoundEvent, +) + + +THIN_EVENT_CLASSES = { + V1BillingMeterErrorReportTriggeredEvent.LOOKUP_TYPE: V1BillingMeterErrorReportTriggeredEvent, + V1BillingMeterNoMeterFoundEvent.LOOKUP_TYPE: V1BillingMeterNoMeterFoundEvent, +} diff --git a/stripe/events/_v1_billing_meter_error_report_triggered_event.py b/stripe/events/_v1_billing_meter_error_report_triggered_event.py new file mode 100644 index 000000000..f20157177 --- /dev/null +++ b/stripe/events/_v1_billing_meter_error_report_triggered_event.py @@ -0,0 +1,122 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.billing._meter import Meter +from stripe.v2._event import Event +from typing import List, cast +from typing_extensions import Literal + + +class V1BillingMeterErrorReportTriggeredEvent(Event): + LOOKUP_TYPE = "v1.billing.meter.error_report_triggered" + type: Literal["v1.billing.meter.error_report_triggered"] + + class V1BillingMeterErrorReportTriggeredEventData(StripeObject): + class Reason(StripeObject): + class ErrorType(StripeObject): + class SampleError(StripeObject): + class Request(StripeObject): + identifier: str + """ + The request idempotency key. + """ + + error_message: str + """ + The error message. + """ + request: Request + """ + The request causes the error. + """ + _inner_class_types = {"request": Request} + + code: Literal[ + "archived_meter", + "meter_event_customer_not_found", + "meter_event_dimension_count_too_high", + "meter_event_invalid_value", + "meter_event_no_customer_defined", + "missing_dimension_payload_keys", + "no_meter", + "timestamp_in_future", + "timestamp_too_far_in_past", + ] + """ + Open Enum. + """ + error_count: int + """ + The number of errors of this type. + """ + sample_errors: List[SampleError] + """ + A list of sample errors of this type. + """ + _inner_class_types = {"sample_errors": SampleError} + + error_count: int + """ + The total error count within this window. + """ + error_types: List[ErrorType] + """ + The error details. + """ + _inner_class_types = {"error_types": ErrorType} + + developer_message_summary: str + """ + Extra field included in the event's `data` when fetched from /v2/events. + """ + reason: Reason + """ + This contains information about why meter error happens. + """ + validation_end: str + """ + The end of the window that is encapsulated by this summary. + """ + validation_start: str + """ + The start of the window that is encapsulated by this summary. + """ + _inner_class_types = {"reason": Reason} + + data: V1BillingMeterErrorReportTriggeredEventData + """ + Data for the v1.billing.meter.error_report_triggered event + """ + + 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) -> Meter: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Meter, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v1_billing_meter_no_meter_found_event.py b/stripe/events/_v1_billing_meter_no_meter_found_event.py new file mode 100644 index 000000000..680c094aa --- /dev/null +++ b/stripe/events/_v1_billing_meter_no_meter_found_event.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from typing import List +from typing_extensions import Literal + + +class V1BillingMeterNoMeterFoundEvent(Event): + LOOKUP_TYPE = "v1.billing.meter.no_meter_found" + type: Literal["v1.billing.meter.no_meter_found"] + + class V1BillingMeterNoMeterFoundEventData(StripeObject): + class Reason(StripeObject): + class ErrorType(StripeObject): + class SampleError(StripeObject): + class Request(StripeObject): + identifier: str + """ + The request idempotency key. + """ + + error_message: str + """ + The error message. + """ + request: Request + """ + The request causes the error. + """ + _inner_class_types = {"request": Request} + + code: Literal[ + "archived_meter", + "meter_event_customer_not_found", + "meter_event_dimension_count_too_high", + "meter_event_invalid_value", + "meter_event_no_customer_defined", + "missing_dimension_payload_keys", + "no_meter", + "timestamp_in_future", + "timestamp_too_far_in_past", + ] + """ + Open Enum. + """ + error_count: int + """ + The number of errors of this type. + """ + sample_errors: List[SampleError] + """ + A list of sample errors of this type. + """ + _inner_class_types = {"sample_errors": SampleError} + + error_count: int + """ + The total error count within this window. + """ + error_types: List[ErrorType] + """ + The error details. + """ + _inner_class_types = {"error_types": ErrorType} + + developer_message_summary: str + """ + Extra field included in the event's `data` when fetched from /v2/events. + """ + reason: Reason + """ + This contains information about why meter error happens. + """ + validation_end: str + """ + The end of the window that is encapsulated by this summary. + """ + validation_start: str + """ + The start of the window that is encapsulated by this summary. + """ + _inner_class_types = {"reason": Reason} + + data: V1BillingMeterNoMeterFoundEventData + """ + Data for the v1.billing.meter.no_meter_found event + """ diff --git a/stripe/tax/_settings.py b/stripe/tax/_settings.py index c8454342a..c8e64bdd4 100644 --- a/stripe/tax/_settings.py +++ b/stripe/tax/_settings.py @@ -155,7 +155,7 @@ class RetrieveParams(RequestOptions): """ status: Literal["active", "pending"] """ - The `active` status indicates you have all required settings to calculate tax. A status can transition out of `active` when new required settings are introduced. + The status of the Tax `Settings`. """ status_details: StatusDetails diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index 6d7553865..c8bcaf97a 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -376,6 +376,12 @@ class ProcessPaymentIntentParams(RequestOptions): """ class ProcessPaymentIntentParamsProcessConfig(TypedDict): + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + """ enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. @@ -398,9 +404,9 @@ class ProcessPaymentIntentParamsProcessConfigTipping(TypedDict): """ class ProcessSetupIntentParams(RequestOptions): - customer_consent_collected: NotRequired[bool] + allow_redisplay: Literal["always", "limited", "unspecified"] """ - Customer Consent Collected + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. """ expand: NotRequired[List[str]] """ diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 362d89162..271a9701f 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -103,6 +103,12 @@ class ProcessPaymentIntentParams(TypedDict): """ class ProcessPaymentIntentParamsProcessConfig(TypedDict): + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + """ enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. @@ -125,9 +131,9 @@ class ProcessPaymentIntentParamsProcessConfigTipping(TypedDict): """ class ProcessSetupIntentParams(TypedDict): - customer_consent_collected: NotRequired[bool] + allow_redisplay: Literal["always", "limited", "unspecified"] """ - Customer Consent Collected + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. """ expand: NotRequired[List[str]] """ diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 2e67c2832..702c42b91 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -317,7 +317,12 @@ class RetrieveParams(RequestOptions): An arbitrary string attached to the object. Often useful for displaying to users. """ failure_code: Optional[ - Literal["account_closed", "account_frozen", "other"] + Literal[ + "account_closed", + "account_frozen", + "international_transaction", + "other", + ] ] """ Reason for the failure. A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. diff --git a/stripe/v2/__init__.py b/stripe/v2/__init__.py new file mode 100644 index 000000000..d8a2170e1 --- /dev/null +++ b/stripe/v2/__init__.py @@ -0,0 +1,10 @@ +from stripe.v2._list_object import ListObject as ListObject +from stripe.v2._amount import Amount as Amount, AmountParam as AmountParam + + +# The beginning of the section generated from our OpenAPI spec +from stripe.v2 import billing as billing, core as core +from stripe.v2._billing_service import BillingService as BillingService +from stripe.v2._core_service import CoreService as CoreService +from stripe.v2._event import Event as Event +# The end of the section generated from our OpenAPI spec diff --git a/stripe/v2/_amount.py b/stripe/v2/_amount.py new file mode 100644 index 000000000..97a6bf63a --- /dev/null +++ b/stripe/v2/_amount.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# NOT codegenned +from typing_extensions import TypedDict +from stripe._stripe_object import StripeObject + + +class Amount(StripeObject): + value: int + currency: str + + +class AmountParam(TypedDict): + value: int + currency: str diff --git a/stripe/v2/_billing_service.py b/stripe/v2/_billing_service.py new file mode 100644 index 000000000..77d36d39a --- /dev/null +++ b/stripe/v2/_billing_service.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe.v2.billing._meter_event_adjustment_service import ( + MeterEventAdjustmentService, +) +from stripe.v2.billing._meter_event_service import MeterEventService +from stripe.v2.billing._meter_event_session_service import ( + MeterEventSessionService, +) +from stripe.v2.billing._meter_event_stream_service import ( + MeterEventStreamService, +) + + +class BillingService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.meter_event_session = MeterEventSessionService(self._requestor) + self.meter_event_adjustments = MeterEventAdjustmentService( + self._requestor, + ) + self.meter_event_stream = MeterEventStreamService(self._requestor) + self.meter_events = MeterEventService(self._requestor) diff --git a/stripe/v2/_core_service.py b/stripe/v2/_core_service.py new file mode 100644 index 000000000..96c4a6f2e --- /dev/null +++ b/stripe/v2/_core_service.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe.v2.core._event_service import EventService + + +class CoreService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.events = EventService(self._requestor) diff --git a/stripe/v2/_event.py b/stripe/v2/_event.py new file mode 100644 index 000000000..04c95ca8d --- /dev/null +++ b/stripe/v2/_event.py @@ -0,0 +1,124 @@ +# -*- coding: utf-8 -*- + +import json +from typing import ClassVar, Optional + +from typing_extensions import Literal + +from stripe._stripe_object import StripeObject + +# This describes the common format for the pull payload of a V2 ThinEvent +# more specific classes will add `data` and `fetch_related_objects()` as needed + + +# The beginning of the section generated from our OpenAPI spec +class Event(StripeObject): + OBJECT_NAME: ClassVar[Literal["v2.core.event"]] = "v2.core.event" + + class Reason(StripeObject): + class Request(StripeObject): + id: str + """ + ID of the API request that caused the event. + """ + idempotency_key: str + """ + The idempotency key transmitted during the request. + """ + + type: Literal["request"] + """ + Event reason type. + """ + request: Optional[Request] + """ + Information on the API request that instigated the event. + """ + _inner_class_types = {"request": Request} + + context: Optional[str] + """ + Authentication context needed to fetch the event or related object. + """ + created: str + """ + Time at which the object was created. + """ + id: str + """ + Unique identifier for the event. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.core.event"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + reason: Optional[Reason] + """ + Reason for the event. + """ + type: str + """ + The type of the event. + """ + _inner_class_types = {"reason": Reason} + + +# The end of the section generated from our OpenAPI spec + + +class Reason: + id: str + idempotency_key: str + + def __init__(self, d) -> None: + self.id = d["id"] + self.idempotency_key = d["idempotency_key"] + + def __repr__(self) -> str: + return f"" + + +class RelatedObject: + id: str + type: str + url: str + + def __init__(self, d) -> None: + self.id = d["id"] + self.type_ = d["type"] + self.url = d["url"] + + def __repr__(self) -> str: + return f"" + + +class ThinEvent: + """ + ThinEvent represents the json that's delivered from an Event Destination. It's a basic `dict` with no additional methods or properties. Use it to check basic information about a delivered event. If you want more details, use `stripe.v2.Event.retrieve(thin_event.id)` to fetch the full event object. + """ + + id: str + type: str + created: str + context: Optional[str] = None + related_object: Optional[RelatedObject] = None + reason: Optional[Reason] = None + + def __init__(self, payload: str) -> None: + parsed = json.loads(payload) + + self.id = parsed["id"] + self.type = parsed["type"] + self.created = parsed["created"] + self.context = parsed.get("context") + if parsed.get("related_object"): + self.related_object = RelatedObject(parsed["related_object"]) + if parsed.get("reason"): + self.reason = Reason(parsed["reason"]) + + def __repr__(self) -> str: + return f"" diff --git a/stripe/v2/_list_object.py b/stripe/v2/_list_object.py new file mode 100644 index 000000000..a9d73546c --- /dev/null +++ b/stripe/v2/_list_object.py @@ -0,0 +1,59 @@ +from stripe._stripe_object import StripeObject +from typing import List, Optional, TypeVar, Generic + + +T = TypeVar("T", bound=StripeObject) + + +class ListObject(StripeObject, Generic[T]): + """ + Represents one page of a list of V2 Stripe objects. Use `.data` to access + the objects on this page, or use + + for item in list_object.auto_paging_iter(): + # do something with item + + to iterate over this and all following pages. + """ + + OBJECT_NAME = "list" + data: List[StripeObject] + next_page_url: Optional[str] + + def __getitem__(self, k): + if isinstance(k, str): # type: ignore + return super(ListObject, self).__getitem__(k) + else: + raise KeyError( + "You tried to access the %s index, but ListObjectV2 types only " + "support string keys. (HINT: List calls return an object with " + "a 'data' (which is the data array). You likely want to call " + ".data[%s])" % (repr(k), repr(k)) + ) + + def __iter__(self): + return getattr(self, "data", []).__iter__() + + def __len__(self): + return getattr(self, "data", []).__len__() + + def __reversed__(self): + return getattr(self, "data", []).__reversed__() + + def auto_paging_iter(self): + page = self.data + next_page_url = self.next_page_url + while True: + for item in page: + yield item + if next_page_url is None: + break + + result = self._request( + "get", + next_page_url, + base_address="api", + ) + assert isinstance(result, ListObject) + page = result.data + next_page_url = result.next_page_url diff --git a/stripe/v2/billing/__init__.py b/stripe/v2/billing/__init__.py new file mode 100644 index 000000000..ff5fd91c6 --- /dev/null +++ b/stripe/v2/billing/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.billing._meter_event import MeterEvent as MeterEvent +from stripe.v2.billing._meter_event_adjustment import ( + MeterEventAdjustment as MeterEventAdjustment, +) +from stripe.v2.billing._meter_event_adjustment_service import ( + MeterEventAdjustmentService as MeterEventAdjustmentService, +) +from stripe.v2.billing._meter_event_service import ( + MeterEventService as MeterEventService, +) +from stripe.v2.billing._meter_event_session import ( + MeterEventSession as MeterEventSession, +) +from stripe.v2.billing._meter_event_session_service import ( + MeterEventSessionService as MeterEventSessionService, +) +from stripe.v2.billing._meter_event_stream_service import ( + MeterEventStreamService as MeterEventStreamService, +) diff --git a/stripe/v2/billing/_meter_event.py b/stripe/v2/billing/_meter_event.py new file mode 100644 index 000000000..ce33c36cd --- /dev/null +++ b/stripe/v2/billing/_meter_event.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict +from typing_extensions import Literal + + +class MeterEvent(StripeObject): + """ + Fix me empty_doc_string. + """ + + OBJECT_NAME: ClassVar[Literal["billing.meter_event"]] = ( + "billing.meter_event" + ) + created: str + """ + The creation time of this meter event. + """ + event_name: str + """ + The name of the meter event. Corresponds with the `event_name` field on a meter. + """ + identifier: str + """ + A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["billing.meter_event"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + payload: Dict[str, str] + """ + The payload of the event. This must contain the fields corresponding to a meter's + `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and + `value_settings.event_payload_key` (default is `value`). Read more about the payload. + """ + timestamp: str + """ + The time of the event. Must be within the past 35 calendar days or up to + 5 minutes in the future. Defaults to current timestamp if not specified. + """ diff --git a/stripe/v2/billing/_meter_event_adjustment.py b/stripe/v2/billing/_meter_event_adjustment.py new file mode 100644 index 000000000..7561e67ba --- /dev/null +++ b/stripe/v2/billing/_meter_event_adjustment.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar +from typing_extensions import Literal + + +class MeterEventAdjustment(StripeObject): + OBJECT_NAME: ClassVar[Literal["billing.meter_event_adjustment"]] = ( + "billing.meter_event_adjustment" + ) + + class Cancel(StripeObject): + identifier: str + """ + Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. + """ + + cancel: Cancel + """ + Specifies which event to cancel. + """ + created: str + """ + The time the adjustment was created. + """ + event_name: str + """ + The name of the meter event. Corresponds with the `event_name` field on a meter. + """ + id: str + """ + The unique id of this meter event adjustment. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["billing.meter_event_adjustment"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + status: Literal["complete", "pending"] + """ + Open Enum. The meter event adjustment's status. + """ + type: Literal["cancel"] + """ + Open Enum. Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. + """ + _inner_class_types = {"cancel": Cancel} diff --git a/stripe/v2/billing/_meter_event_adjustment_service.py b/stripe/v2/billing/_meter_event_adjustment_service.py new file mode 100644 index 000000000..9533243f8 --- /dev/null +++ b/stripe/v2/billing/_meter_event_adjustment_service.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe.v2.billing._meter_event_adjustment import MeterEventAdjustment +from typing import cast +from typing_extensions import Literal, TypedDict + + +class MeterEventAdjustmentService(StripeService): + class CreateParams(TypedDict): + cancel: "MeterEventAdjustmentService.CreateParamsCancel" + """ + Specifies which event to cancel. + """ + event_name: str + """ + The name of the meter event. Corresponds with the `event_name` field on a meter. + """ + type: Literal["cancel"] + """ + Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. + """ + + class CreateParamsCancel(TypedDict): + identifier: str + """ + Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. + """ + + def create( + self, + params: "MeterEventAdjustmentService.CreateParams", + options: RequestOptions = {}, + ) -> MeterEventAdjustment: + """ + Creates a meter event adjustment to cancel a previously sent meter event. + """ + return cast( + MeterEventAdjustment, + self._request( + "post", + "/v2/billing/meter_event_adjustments", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "MeterEventAdjustmentService.CreateParams", + options: RequestOptions = {}, + ) -> MeterEventAdjustment: + """ + Creates a meter event adjustment to cancel a previously sent meter event. + """ + return cast( + MeterEventAdjustment, + await self._request_async( + "post", + "/v2/billing/meter_event_adjustments", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/billing/_meter_event_service.py b/stripe/v2/billing/_meter_event_service.py new file mode 100644 index 000000000..50eb75009 --- /dev/null +++ b/stripe/v2/billing/_meter_event_service.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe.v2.billing._meter_event import MeterEvent +from typing import Dict, cast +from typing_extensions import NotRequired, TypedDict + + +class MeterEventService(StripeService): + class CreateParams(TypedDict): + event_name: str + """ + The name of the meter event. Corresponds with the `event_name` field on a meter. + """ + identifier: NotRequired[str] + """ + A unique identifier for the event. If not provided, one will be generated. + We recommend using a globally unique identifier for this. We'll enforce + uniqueness within a rolling 24 hour period. + """ + payload: Dict[str, str] + """ + The payload of the event. This must contain the fields corresponding to a meter's + `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and + `value_settings.event_payload_key` (default is `value`). Read more about + the + [payload](https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). + """ + timestamp: NotRequired[str] + """ + The time of the event. Must be within the past 35 calendar days or up to + 5 minutes in the future. Defaults to current timestamp if not specified. + """ + + def create( + self, + params: "MeterEventService.CreateParams", + options: RequestOptions = {}, + ) -> MeterEvent: + """ + Creates a meter event. Events are validated synchronously, but are processed asynchronously. Supports up to 1,000 events per second in livemode. For higher rate-limits, please use meter event streams instead. + """ + return cast( + MeterEvent, + self._request( + "post", + "/v2/billing/meter_events", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "MeterEventService.CreateParams", + options: RequestOptions = {}, + ) -> MeterEvent: + """ + Creates a meter event. Events are validated synchronously, but are processed asynchronously. Supports up to 1,000 events per second in livemode. For higher rate-limits, please use meter event streams instead. + """ + return cast( + MeterEvent, + await self._request_async( + "post", + "/v2/billing/meter_events", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/billing/_meter_event_session.py b/stripe/v2/billing/_meter_event_session.py new file mode 100644 index 000000000..f1d96650e --- /dev/null +++ b/stripe/v2/billing/_meter_event_session.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar +from typing_extensions import Literal + + +class MeterEventSession(StripeObject): + OBJECT_NAME: ClassVar[Literal["billing.meter_event_session"]] = ( + "billing.meter_event_session" + ) + authentication_token: str + """ + The authentication token for this session. Use this token when calling the + high-throughput meter event API. + """ + created: str + """ + The creation time of this session. + """ + expires_at: str + """ + The time at which this session will expire. + """ + id: str + """ + The unique id of this auth session. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["billing.meter_event_session"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ diff --git a/stripe/v2/billing/_meter_event_session_service.py b/stripe/v2/billing/_meter_event_session_service.py new file mode 100644 index 000000000..600c80362 --- /dev/null +++ b/stripe/v2/billing/_meter_event_session_service.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe.v2.billing._meter_event_session import MeterEventSession +from typing import cast +from typing_extensions import TypedDict + + +class MeterEventSessionService(StripeService): + class CreateParams(TypedDict): + pass + + def create( + self, + params: "MeterEventSessionService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> MeterEventSession: + """ + Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you will need to create a new meter event session when your token expires. + """ + return cast( + MeterEventSession, + self._request( + "post", + "/v2/billing/meter_event_session", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "MeterEventSessionService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> MeterEventSession: + """ + Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you will need to create a new meter event session when your token expires. + """ + return cast( + MeterEventSession, + await self._request_async( + "post", + "/v2/billing/meter_event_session", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/billing/_meter_event_stream_service.py b/stripe/v2/billing/_meter_event_stream_service.py new file mode 100644 index 000000000..84e6908e5 --- /dev/null +++ b/stripe/v2/billing/_meter_event_stream_service.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from typing import Dict, List +from typing_extensions import NotRequired, TypedDict + + +class MeterEventStreamService(StripeService): + class CreateParams(TypedDict): + events: List["MeterEventStreamService.CreateParamsEvent"] + """ + List of meter events to include in the request. + """ + + class CreateParamsEvent(TypedDict): + event_name: str + """ + The name of the meter event. Corresponds with the `event_name` field on a meter. + """ + identifier: NotRequired[str] + """ + A unique identifier for the event. If not provided, one will be generated. + We recommend using a globally unique identifier for this. We'll enforce + uniqueness within a rolling 24 hour period. + """ + payload: Dict[str, str] + """ + The payload of the event. This must contain the fields corresponding to a meter's + `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and + `value_settings.event_payload_key` (default is `value`). Read more about + the + [payload](https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). + """ + timestamp: NotRequired[str] + """ + The time of the event. Must be within the past 35 calendar days or up to + 5 minutes in the future. Defaults to current timestamp if not specified. + """ + + def create( + self, + params: "MeterEventStreamService.CreateParams", + options: RequestOptions = {}, + ) -> None: + """ + Creates meter events. Events are processed asynchronously, including validation. Requires a meter event session for authentication. Supports up to 10,000 requests per second in livemode. For even higher rate-limits, contact sales. + """ + self._request( + "post", + "/v2/billing/meter_event_stream", + base_address="meter_events", + params=params, + options=options, + ) + + async def create_async( + self, + params: "MeterEventStreamService.CreateParams", + options: RequestOptions = {}, + ) -> None: + """ + Creates meter events. Events are processed asynchronously, including validation. Requires a meter event session for authentication. Supports up to 10,000 requests per second in livemode. For even higher rate-limits, contact sales. + """ + await self._request_async( + "post", + "/v2/billing/meter_event_stream", + base_address="meter_events", + params=params, + options=options, + ) diff --git a/stripe/v2/core/__init__.py b/stripe/v2/core/__init__.py new file mode 100644 index 000000000..5879a6c60 --- /dev/null +++ b/stripe/v2/core/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event_service import EventService as EventService diff --git a/stripe/v2/core/_event_service.py b/stripe/v2/core/_event_service.py new file mode 100644 index 000000000..999fe8471 --- /dev/null +++ b/stripe/v2/core/_event_service.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._event import Event +from stripe.v2._list_object import ListObject +from typing import cast +from typing_extensions import NotRequired, TypedDict + + +class EventService(StripeService): + class ListParams(TypedDict): + limit: NotRequired[int] + """ + The page size. + """ + object_id: str + """ + Primary object ID used to retrieve related events. + """ + page: NotRequired[str] + """ + The requested page number. + """ + + class RetrieveParams(TypedDict): + pass + + def list( + self, params: "EventService.ListParams", options: RequestOptions = {} + ) -> ListObject[Event]: + """ + List events, going back up to 30 days. + """ + return cast( + ListObject[Event], + self._request( + "get", + "/v2/core/events", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, params: "EventService.ListParams", options: RequestOptions = {} + ) -> ListObject[Event]: + """ + List events, going back up to 30 days. + """ + return cast( + ListObject[Event], + await self._request_async( + "get", + "/v2/core/events", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "EventService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Event: + """ + Retrieves the details of an event. + """ + return cast( + Event, + self._request( + "get", + "/v2/core/events/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "EventService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Event: + """ + Retrieves the details of an event. + """ + return cast( + Event, + await self._request_async( + "get", + "/v2/core/events/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/tests/api_resources/abstract/test_api_resource.py b/tests/api_resources/abstract/test_api_resource.py index ebb533c9f..005309f20 100644 --- a/tests/api_resources/abstract/test_api_resource.py +++ b/tests/api_resources/abstract/test_api_resource.py @@ -95,7 +95,7 @@ def test_convert_to_stripe_object(self): } converted = stripe.util.convert_to_stripe_object( - sample, "akey", None, None + sample, "akey", None, None, api_mode="V1" ) # Types diff --git a/tests/api_resources/test_list_object.py b/tests/api_resources/test_list_object.py index 98a4e72ce..fe6340a14 100644 --- a/tests/api_resources/test_list_object.py +++ b/tests/api_resources/test_list_object.py @@ -95,13 +95,15 @@ def test_empty_list(self): def test_iter(self): arr = [{"id": 1}, {"id": 2}, {"id": 3}] - expected = stripe.util.convert_to_stripe_object(arr) + expected = stripe.util.convert_to_stripe_object(arr, api_mode="V1") lo = stripe.ListObject.construct_from({"data": arr}, None) assert list(lo) == expected def test_iter_reversed(self): arr = [{"id": 1}, {"id": 2}, {"id": 3}] - expected = stripe.util.convert_to_stripe_object(list(reversed(arr))) + expected = stripe.util.convert_to_stripe_object( + list(reversed(arr)), api_mode="V1" + ) lo = stripe.ListObject.construct_from({"data": arr}, None) assert list(reversed(lo)) == expected diff --git a/tests/api_resources/test_list_object_v2.py b/tests/api_resources/test_list_object_v2.py new file mode 100644 index 000000000..d86ed54c5 --- /dev/null +++ b/tests/api_resources/test_list_object_v2.py @@ -0,0 +1,147 @@ +from __future__ import absolute_import, division, print_function + +import json + +import pytest + +import stripe +from stripe.v2._list_object import ListObject +from tests.http_client_mock import HTTPClientMock + + +class TestListObjectV2(object): + @pytest.fixture + def list_object(self): + return ListObject.construct_from( + { + "data": ["a", "b", "c"], + "next_page_url": None, + "previous_page_url": None, + }, + "mykey", + ) + + def test_iter(self): + arr = ["a", "b", "c"] + expected = stripe.util.convert_to_stripe_object(arr, api_mode="V2") + lo = ListObject.construct_from({"data": arr}, None) + assert list(lo) == expected + + @staticmethod + def pageable_model_response(ids, next_page_url): + return { + "data": [{"id": id, "object": "pageablemodel"} for id in ids], + "next_page_url": next_page_url, + } + + def test_iter_one_page(self, http_client_mock): + lo = ListObject.construct_from( + self.pageable_model_response(["pm_123", "pm_124"], None), "mykey" + ) + + http_client_mock.assert_no_request() + + seen = [item["id"] for item in lo.auto_paging_iter()] + + assert seen == ["pm_123", "pm_124"] + + def test_iter_two_pages(self, http_client_mock): + method = "get" + path = "/v2/pageablemodels" + + lo = ListObject.construct_from( + self.pageable_model_response( + ["pm_123", "pm_124"], "/v2/pageablemodels?foo=bar&page=page_2" + ), + None, + ) + + http_client_mock.stub_request( + method, + path=path, + query_string="foo=bar&page=page_3", + rbody=json.dumps( + self.pageable_model_response(["pm_127", "pm_128"], None) + ), + ) + + http_client_mock.stub_request( + method, + path=path, + query_string="foo=bar&page=page_2", + rbody=json.dumps( + self.pageable_model_response( + ["pm_125", "pm_126"], + "/v2/pageablemodels?foo=bar&page=page_3", + ) + ), + ) + + seen = [item["id"] for item in lo.auto_paging_iter()] + + http_client_mock.assert_requested( + method, path=path, query_string="foo=bar&page=page_2" + ) + + http_client_mock.assert_requested( + method, path=path, query_string="foo=bar&page=page_3" + ) + + assert seen == [ + "pm_123", + "pm_124", + "pm_125", + "pm_126", + "pm_127", + "pm_128", + ] + + def test_iter_forwards_api_key(self, http_client_mock: HTTPClientMock): + client = stripe.StripeClient( + http_client=http_client_mock.get_mock_http_client(), + api_key="sk_test_xyz", + ) + + method = "get" + query_string_1 = "object_id=obj_123" + query_string_2 = "object_id=obj_123&page=page_2" + path = "/v2/core/events" + + http_client_mock.stub_request( + method, + path=path, + query_string=query_string_1, + rbody='{"data": [{"id": "x"}], "next_page_url": "/v2/core/events?object_id=obj_123&page=page_2"}', + rcode=200, + rheaders={}, + ) + + http_client_mock.stub_request( + method, + path=path, + query_string=query_string_2, + rbody='{"data": [{"id": "y"}, {"id": "z"}], "next_page_url": null}', + rcode=200, + rheaders={}, + ) + + lo = client.v2.core.events.list( + params={"object_id": "obj_123"}, + options={"api_key": "sk_test_iter_forwards_options"}, + ) + + seen = [item["id"] for item in lo.auto_paging_iter()] + + assert seen == ["x", "y", "z"] + http_client_mock.assert_requested( + method, + path=path, + query_string=query_string_1, + api_key="sk_test_iter_forwards_options", + ) + http_client_mock.assert_requested( + method, + path=path, + query_string=query_string_2, + api_key="sk_test_iter_forwards_options", + ) diff --git a/tests/api_resources/test_search_result_object.py b/tests/api_resources/test_search_result_object.py index 6e4d3f535..83266f0b9 100644 --- a/tests/api_resources/test_search_result_object.py +++ b/tests/api_resources/test_search_result_object.py @@ -82,7 +82,7 @@ def test_empty_search_result(self): def test_iter(self): arr = [{"id": 1}, {"id": 2}, {"id": 3}] - expected = stripe.util.convert_to_stripe_object(arr) + expected = stripe.util.convert_to_stripe_object(arr, api_mode="V1") sro = stripe.SearchResultObject.construct_from({"data": arr}, None) assert list(sro) == expected diff --git a/tests/fixtures/card.json b/tests/fixtures/card.json deleted file mode 100644 index 97a40a318..000000000 --- a/tests/fixtures/card.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "id": "card_123", - "object": "payment_methods.card", - "address_city": null, - "address_country": null, - "address_line1": null, - "address_line1_check": null, - "address_line2": null, - "address_state": null, - "address_zip": null, - "address_zip_check": null, - "brand": "Visa", - "country": "US", - "customer": "cus_123", - "cvc_check": null, - "dynamic_last4": null, - "exp_month": 8, - "exp_year": 2019, - "fingerprint": "Xt5EWLLDS7FJjR1c", - "funding": "credit", - "last4": "4242", - "metadata": { - }, - "name": null, - "tokenization_method": null -} diff --git a/tests/http_client_mock.py b/tests/http_client_mock.py index 0e2ea588a..db13f432c 100644 --- a/tests/http_client_mock.py +++ b/tests/http_client_mock.py @@ -336,6 +336,7 @@ def assert_requested( api_key=None, stripe_version=None, stripe_account=None, + stripe_context=None, content_type=None, idempotency_key=None, user_agent=None, @@ -366,6 +367,7 @@ def assert_requested( api_key=api_key, stripe_version=stripe_version, stripe_account=stripe_account, + stripe_context=stripe_context, content_type=content_type, idempotency_key=idempotency_key, user_agent=user_agent, diff --git a/tests/test_api_requestor.py b/tests/test_api_requestor.py index 8acb0e87d..82f10e5a3 100644 --- a/tests/test_api_requestor.py +++ b/tests/test_api_requestor.py @@ -3,25 +3,25 @@ import tempfile import uuid from collections import OrderedDict +from urllib.parse import urlencode, urlsplit import pytest +import urllib3 import stripe from stripe import util +from stripe._api_requestor import _api_encode, _APIRequestor +from stripe._request_options import RequestOptions +from stripe._requestor_options import ( + RequestorOptions, + _GlobalRequestorOptions, +) +from stripe._stripe_object import StripeObject from stripe._stripe_response import ( StripeStreamResponse, StripeStreamResponseAsync, ) -from stripe._api_requestor import _APIRequestor, _api_encode -from stripe._stripe_object import StripeObject -from stripe._requestor_options import ( - _GlobalRequestorOptions, -) -from stripe._request_options import RequestOptions - -from urllib.parse import urlencode, urlsplit - -import urllib3 +from tests.http_client_mock import HTTPClientMock VALID_API_METHODS = ("get", "post", "delete") @@ -49,6 +49,19 @@ def __repr__(self): return "AnyUUID4Matcher()" +class IsNoneMatcher: + """ + Matcher to make assertions against None because `assert_requested` doesn't + run checks if you pass `None` as the expected value. + """ + + def __eq__(self, other): + return other is None + + def __repr__(self): + return "None (from IsNoneMatcher())" + + class TestAPIRequestor(object): ENCODE_INPUTS = { "dict": { @@ -113,8 +126,12 @@ def requestor(self, http_client_mock): return requestor @property - def valid_path(self): - return "/foo" + def v1_path(self): + return "/v1/foo" + + @property + def v2_path(self): + return "/v2/foo" def encoder_check(self, key): stk_key = "my%s" % (key,) @@ -162,9 +179,46 @@ def test_param_encoding(self, requestor, http_client_mock): http_client_mock.assert_requested("get", query_string=query_string) + def test_param_api_mode_preview(self, requestor, http_client_mock): + http_client_mock.stub_request( + "post", path=self.v2_path, rbody="{}", rcode=200 + ) + + requestor.request( + "post", self.v2_path, self.ENCODE_INPUTS, base_address="api" + ) + + expectation = '{"dict": {"astring": "bar", "anint": 5, "anull": null, "adatetime": 1356994800, "atuple": [1, 2], "adict": {"foo": "bar", "boz": 5}, "alist": ["foo", "bar"]}, "list": [1, "foo", "baz"], "string": "boo", "unicode": "\\u1234", "datetime": 1356994801, "none": null}' + + http_client_mock.assert_requested( + "post", + content_type="application/json", + post_data=expectation, + is_json=True, + ) + + def test_encodes_null_values_preview(self, requestor, http_client_mock): + http_client_mock.stub_request( + "post", path=self.v2_path, rbody="{}", rcode=200 + ) + + requestor.request( + "post", + self.v2_path, + {"foo": None}, + base_address="api", + ) + + http_client_mock.assert_requested( + "post", + content_type="application/json", + post_data='{"foo": null}', + is_json=True, + ) + def test_dictionary_list_encoding(self): params = {"foo": {"0": {"bar": "bat"}}} - encoded = list(_api_encode(params)) + encoded = list(_api_encode(params, "V1")) key, value = encoded[0] assert key == "foo[0][bar]" @@ -181,7 +235,7 @@ def test_ordereddict_encoding(self): ] ) } - encoded = list(_api_encode(params)) + encoded = list(_api_encode(params, "V1")) assert encoded[0][0] == "ordered[one]" assert encoded[1][0] == "ordered[two]" @@ -224,11 +278,11 @@ def test_url_construction(self, requestor, http_client_mock): def test_empty_methods(self, requestor, http_client_mock): for meth in VALID_API_METHODS: http_client_mock.stub_request( - meth, path=self.valid_path, rbody="{}", rcode=200 + meth, path=self.v1_path, rbody="{}", rcode=200 ) resp = requestor.request( - meth, self.valid_path, {}, base_address="api" + meth, self.v1_path, {}, base_address="api" ) if meth == "post": @@ -246,13 +300,13 @@ async def test_empty_methods_async(self, requestor, http_client_mock): for meth in VALID_API_METHODS: http_client_mock.stub_request( meth, - path=self.valid_path, + path=self.v1_path, rbody="{}", rcode=200, ) resp = await requestor.request_async( - meth, self.valid_path, {}, base_address="api" + meth, self.v1_path, {}, base_address="api" ) if meth == "post": @@ -277,14 +331,14 @@ async def async_iter(): for meth in VALID_API_METHODS: http_client_mock.stub_request( meth, - path=self.valid_path, + path=self.v1_path, rbody=async_iter(), rcode=200, ) resp = await requestor.request_stream_async( meth, - self.valid_path, + self.v1_path, {}, base_address="api", ) @@ -305,14 +359,14 @@ def test_empty_methods_streaming_response( for meth in VALID_API_METHODS: http_client_mock.stub_request( meth, - path=self.valid_path, + path=self.v1_path, rbody=util.io.BytesIO(b"thisisdata"), rcode=200, ) resp = requestor.request_stream( meth, - self.valid_path, + self.v1_path, {}, base_address="api", ) @@ -338,7 +392,7 @@ def test_methods_with_params_and_response( http_client_mock.stub_request( method, - path=self.valid_path, + path=self.v1_path, query_string=encoded if method != "post" else "", rbody='{"foo": "bar", "baz": 6}', rcode=200, @@ -352,7 +406,7 @@ def test_methods_with_params_and_response( resp = requestor.request( method, - self.valid_path, + self.v1_path, params, base_address="api", ) @@ -368,7 +422,7 @@ def test_methods_with_params_and_response( else: abs_url = "%s%s?%s" % ( stripe.api_base, - self.valid_path, + self.v1_path, encoded, ) http_client_mock.assert_requested(method, abs_url=abs_url) @@ -384,7 +438,7 @@ def test_methods_with_params_and_streaming_response( http_client_mock.stub_request( method, - path=self.valid_path, + path=self.v1_path, query_string=encoded if method != "post" else "", rbody=util.io.BytesIO(b'{"foo": "bar", "baz": 6}'), rcode=200, @@ -398,7 +452,7 @@ def test_methods_with_params_and_streaming_response( resp = requestor.request_stream( method, - self.valid_path, + self.v1_path, params, base_address="api", ) @@ -411,19 +465,19 @@ def test_methods_with_params_and_streaming_response( else: abs_url = "%s%s?%s" % ( stripe.api_base, - self.valid_path, + self.v1_path, encoded, ) http_client_mock.assert_requested(method, abs_url=abs_url) def test_uses_headers(self, requestor, http_client_mock): http_client_mock.stub_request( - "get", path=self.valid_path, rbody="{}", rcode=200 + "get", path=self.v1_path, rbody="{}", rcode=200 ) request_options: RequestOptions = {"headers": {"foo": "bar"}} requestor.request( "get", - self.valid_path, + self.v1_path, {}, options=request_options, base_address="api", @@ -432,12 +486,12 @@ def test_uses_headers(self, requestor, http_client_mock): def test_uses_api_version(self, requestor, http_client_mock): http_client_mock.stub_request( - "get", path=self.valid_path, rbody="{}", rcode=200 + "get", path=self.v1_path, rbody="{}", rcode=200 ) request_options: RequestOptions = {"stripe_version": "fooversion"} requestor.request( "get", - self.valid_path, + self.v1_path, options=request_options, base_address="api", ) @@ -448,7 +502,7 @@ def test_uses_api_version(self, requestor, http_client_mock): def test_prefers_headers_api_version(self, requestor, http_client_mock): http_client_mock.stub_request( - "get", path=self.valid_path, rbody="{}", rcode=200 + "get", path=self.v1_path, rbody="{}", rcode=200 ) request_options: RequestOptions = { "stripe_version": "fooversion", @@ -456,7 +510,7 @@ def test_prefers_headers_api_version(self, requestor, http_client_mock): } requestor.request( "get", - self.valid_path, + self.v1_path, {}, options=request_options, base_address="api", @@ -471,10 +525,10 @@ def test_uses_instance_key(self, requestor, http_client_mock): requestor = requestor._replace_options(RequestOptions(api_key=key)) http_client_mock.stub_request( - "get", path=self.valid_path, rbody="{}", rcode=200 + "get", path=self.v1_path, rbody="{}", rcode=200 ) - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") http_client_mock.assert_requested("get", api_key=key) assert requestor.api_key == key @@ -486,16 +540,66 @@ def test_uses_instance_account(self, requestor, http_client_mock): ) http_client_mock.stub_request( - "get", path=self.valid_path, rbody="{}", rcode=200 + "get", path=self.v1_path, rbody="{}", rcode=200 ) - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") http_client_mock.assert_requested( "get", stripe_account=account, ) + def test_removes_None_account( + self, requestor, http_client_mock: HTTPClientMock + ): + """ + important test! + + If there's no context on a retrieved event, it's important that passing `stripe-account: None` + in the generated fetch_related_object doesn't actually send the null header + """ + account = None + requestor = requestor._replace_options( + RequestOptions(stripe_account=account) + ) + + http_client_mock.stub_request( + "get", path=self.v1_path, rbody="{}", rcode=200 + ) + + requestor.request("get", self.v1_path, {}, base_address="api") + + assert len(http_client_mock.get_all_calls()) == 1 + call = http_client_mock.get_last_call() + assert call.headers is not None + + assert "Stripe-Account" not in call.headers + + def test_uses_instance_context(self, http_client_mock): + context = "acct_bar" + + requestor = _APIRequestor( + options=RequestorOptions( + **{ + **_GlobalRequestorOptions().to_dict(), + "stripe_context": context, + } + ), + client=http_client_mock.get_mock_http_client(), + ) + + http_client_mock.stub_request( + "get", path=self.v1_path, rbody="{}", rcode=200 + ) + + requestor.request("get", self.v1_path, {}, base_address="api") + + http_client_mock.assert_requested( + "get", + stripe_context=context, + ) + def test_sets_default_http_client(self, mocker): assert not stripe.default_http_client @@ -528,9 +632,9 @@ def test_uses_app_info(self, requestor, http_client_mock): ) http_client_mock.stub_request( - "get", path=self.valid_path, rbody="{}", rcode=200 + "get", path=self.v1_path, rbody="{}", rcode=200 ) - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") ua = "Stripe/v1 PythonBindings/%s" % (stripe.VERSION,) ua += " MyAwesomePlugin/1.2.34 (https://myawesomeplugin.info)" @@ -557,7 +661,7 @@ def test_handles_failed_platform_call( self, requestor, mocker, http_client_mock ): http_client_mock.stub_request( - "get", path=self.valid_path, rbody="{}", rcode=200 + "get", path=self.v1_path, rbody="{}", rcode=200 ) def fail(): @@ -565,7 +669,7 @@ def fail(): mocker.patch("platform.platform", side_effect=fail) - requestor.request("get", self.valid_path, {}, {}, base_address="api") + requestor.request("get", self.v1_path, {}, {}, base_address="api") last_call = http_client_mock.get_last_call() last_call.assert_method("get") @@ -577,104 +681,130 @@ def fail(): ) def test_uses_given_idempotency_key(self, requestor, http_client_mock): - meth = "post" + method = "post" http_client_mock.stub_request( - meth, path=self.valid_path, rbody="{}", rcode=200 + method, path=self.v1_path, rbody="{}", rcode=200 ) request_options: RequestOptions = {"idempotency_key": "123abc"} requestor.request( - meth, - self.valid_path, + method, + self.v1_path, {}, options=request_options, base_address="api", ) http_client_mock.assert_requested( - meth, idempotency_key="123abc", post_data="" + method, idempotency_key="123abc", post_data="" ) def test_uuid4_idempotency_key_when_not_given( self, requestor, http_client_mock ): - meth = "post" + method = "post" + http_client_mock.stub_request( + method, path=self.v1_path, rbody="{}", rcode=200 + ) + requestor.request(method, self.v1_path, {}, base_address="api") + + http_client_mock.assert_requested( + method, idempotency_key=AnyUUID4Matcher(), post_data="" + ) + + def test_generates_default_idempotency_key_for_v2_delete( + self, requestor, http_client_mock + ): + method = "delete" + http_client_mock.stub_request( + method, path=self.v2_path, rbody="{}", rcode=200 + ) + requestor.request(method, self.v2_path, {}, base_address="api") + + http_client_mock.assert_requested( + method, idempotency_key=AnyUUID4Matcher() + ) + + def test_skips_generates_default_idempotency_key_for_v1_delete( + self, requestor, http_client_mock + ): + method = "delete" http_client_mock.stub_request( - meth, path=self.valid_path, rbody="{}", rcode=200 + method, path=self.v1_path, rbody="{}", rcode=200 ) - requestor.request(meth, self.valid_path, {}, base_address="api") + requestor.request(method, self.v1_path, {}, base_address="api") http_client_mock.assert_requested( - meth, idempotency_key=AnyUUID4Matcher(), post_data="" + method, idempotency_key=IsNoneMatcher() ) def test_fails_without_api_key(self, requestor): stripe.api_key = None with pytest.raises(stripe.error.AuthenticationError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_invalid_request_error_404(self, requestor, http_client_mock): http_client_mock.stub_request( - "get", path=self.valid_path, rbody='{"error": {}}', rcode=404 + "get", path=self.v1_path, rbody='{"error": {}}', rcode=404 ) with pytest.raises(stripe.error.InvalidRequestError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_invalid_request_error_400(self, requestor, http_client_mock): http_client_mock.stub_request( - "get", path=self.valid_path, rbody='{"error": {}}', rcode=400 + "get", path=self.v1_path, rbody='{"error": {}}', rcode=400 ) with pytest.raises(stripe.error.InvalidRequestError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_idempotency_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", - path=self.valid_path, + path=self.v1_path, rbody='{"error": {"type": "idempotency_error"}}', rcode=400, ) with pytest.raises(stripe.error.IdempotencyError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_authentication_error(self, requestor, http_client_mock): http_client_mock.stub_request( - "get", path=self.valid_path, rbody='{"error": {}}', rcode=401 + "get", path=self.v1_path, rbody='{"error": {}}', rcode=401 ) with pytest.raises(stripe.error.AuthenticationError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_permissions_error(self, requestor, http_client_mock): http_client_mock.stub_request( - "get", path=self.valid_path, rbody='{"error": {}}', rcode=403 + "get", path=self.v1_path, rbody='{"error": {}}', rcode=403 ) with pytest.raises(stripe.error.PermissionError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_card_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", - path=self.valid_path, + path=self.v1_path, rbody='{"error": {"code": "invalid_expiry_year"}}', rcode=402, ) with pytest.raises(stripe.error.CardError) as excinfo: - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") assert excinfo.value.code == "invalid_expiry_year" def test_rate_limit_error(self, requestor, http_client_mock): http_client_mock.stub_request( - "get", path=self.valid_path, rbody='{"error": {}}', rcode=429 + "get", path=self.v1_path, rbody='{"error": {}}', rcode=429 ) with pytest.raises(stripe.error.RateLimitError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_old_rate_limit_error(self, requestor, http_client_mock): """ @@ -682,29 +812,29 @@ def test_old_rate_limit_error(self, requestor, http_client_mock): """ http_client_mock.stub_request( "get", - path=self.valid_path, + path=self.v1_path, rbody='{"error": {"code":"rate_limit"}}', rcode=400, ) with pytest.raises(stripe.error.RateLimitError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_server_error(self, requestor, http_client_mock): http_client_mock.stub_request( - "get", path=self.valid_path, rbody='{"error": {}}', rcode=500 + "get", path=self.v1_path, rbody='{"error": {}}', rcode=500 ) with pytest.raises(stripe.error.APIError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_invalid_json(self, requestor, http_client_mock): http_client_mock.stub_request( - "get", path=self.valid_path, rbody="{", rcode=200 + "get", path=self.v1_path, rbody="{", rcode=200 ) with pytest.raises(stripe.error.APIError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_invalid_method(self, requestor): with pytest.raises(stripe.error.APIConnectionError): @@ -713,49 +843,49 @@ def test_invalid_method(self, requestor): def test_oauth_invalid_requestor_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", - path=self.valid_path, + path=self.v1_path, rbody='{"error": "invalid_request"}', rcode=400, ) with pytest.raises(stripe.oauth_error.InvalidRequestError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_invalid_client_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", - path=self.valid_path, + path=self.v1_path, rbody='{"error": "invalid_client"}', rcode=401, ) with pytest.raises(stripe.oauth_error.InvalidClientError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_invalid_grant_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", - path=self.valid_path, + path=self.v1_path, rbody='{"error": "invalid_grant"}', rcode=400, ) with pytest.raises(stripe.oauth_error.InvalidGrantError): - requestor.request("get", self.valid_path, {}, base_address="api") + requestor.request("get", self.v1_path, {}, base_address="api") def test_extract_error_from_stream_request_for_bytes( self, requestor, http_client_mock ): http_client_mock.stub_request( "get", - path=self.valid_path, + path=self.v1_path, rbody=util.io.BytesIO(b'{"error": "invalid_grant"}'), rcode=400, ) with pytest.raises(stripe.oauth_error.InvalidGrantError): requestor.request_stream( - "get", self.valid_path, {}, base_address="api" + "get", self.v1_path, {}, base_address="api" ) def test_extract_error_from_stream_request_for_response( @@ -764,7 +894,7 @@ def test_extract_error_from_stream_request_for_response( # Responses don't have getvalue, they only have a read method. http_client_mock.stub_request( "get", - path=self.valid_path, + path=self.v1_path, rbody=urllib3.response.HTTPResponse( body=util.io.BytesIO(b'{"error": "invalid_grant"}'), preload_content=False, @@ -774,20 +904,20 @@ def test_extract_error_from_stream_request_for_response( with pytest.raises(stripe.oauth_error.InvalidGrantError): requestor.request_stream( - "get", self.valid_path, {}, base_address="api" + "get", self.v1_path, {}, base_address="api" ) def test_raw_request_with_file_param(self, requestor, http_client_mock): test_file = tempfile.NamedTemporaryFile() test_file.write("\u263a".encode("utf-16")) test_file.seek(0) - meth = "post" + method = "post" path = "/v1/files" params = {"file": test_file, "purpose": "dispute_evidence"} supplied_headers = {"Content-Type": "multipart/form-data"} - http_client_mock.stub_request(meth, path=path, rbody="{}", rcode=200) + http_client_mock.stub_request(method, path=path, rbody="{}", rcode=200) requestor.request( - meth, + method, path, params, supplied_headers, diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 64b304971..3676af8ab 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -4460,6 +4460,26 @@ async def test_checkout_sessions_post_2_service_async( post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", ) + def test_core_events_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/events/ll_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.events.retrieve("ll_123") + http_client_mock.assert_requested( + "get", + path="/v2/core/events/ll_123", + query_string="", + api_base="https://api.stripe.com", + ) + def test_country_specs_get(self, http_client_mock: HTTPClientMock) -> None: stripe.CountrySpec.list(limit=3) http_client_mock.assert_requested( @@ -25845,92 +25865,6 @@ async def test_terminal_readers_process_payment_intent_post_service_async( post_data="payment_intent=pi_xxxxxxxxxxxxx", ) - def test_terminal_readers_process_setup_intent_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.terminal.Reader.process_setup_intent( - "tmr_xxxxxxxxxxxxx", - setup_intent="seti_xxxxxxxxxxxxx", - customer_consent_collected=True, - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", - query_string="", - post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", - ) - - def test_terminal_readers_process_setup_intent_post_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "post", - "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.terminal.readers.process_setup_intent( - "tmr_xxxxxxxxxxxxx", - { - "setup_intent": "seti_xxxxxxxxxxxxx", - "customer_consent_collected": True, - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", - query_string="", - api_base="https://api.stripe.com", - post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", - ) - - @pytest.mark.anyio - async def test_terminal_readers_process_setup_intent_post_async( - self, http_client_mock: HTTPClientMock - ) -> None: - await stripe.terminal.Reader.process_setup_intent_async( - "tmr_xxxxxxxxxxxxx", - setup_intent="seti_xxxxxxxxxxxxx", - customer_consent_collected=True, - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", - query_string="", - post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", - ) - - @pytest.mark.anyio - async def test_terminal_readers_process_setup_intent_post_service_async( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "post", - "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - await client.terminal.readers.process_setup_intent_async( - "tmr_xxxxxxxxxxxxx", - { - "setup_intent": "seti_xxxxxxxxxxxxx", - "customer_consent_collected": True, - }, - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", - query_string="", - api_base="https://api.stripe.com", - post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", - ) - def test_test_helpers_customers_fund_cash_balance_post( self, http_client_mock: HTTPClientMock ) -> None: diff --git a/tests/test_http_client.py b/tests/test_http_client.py index d6cbbbdf5..b671b1e7a 100644 --- a/tests/test_http_client.py +++ b/tests/test_http_client.py @@ -1,4 +1,4 @@ -from typing import Any +from typing import Any, List from typing_extensions import Type from unittest.mock import call import pytest @@ -96,11 +96,13 @@ def test_new_http_client_async_fallback_no_import_found( class TestRetrySleepTimeDefaultHttpClient(StripeClientTestCase): from contextlib import contextmanager - def assert_sleep_times(self, client, expected): - until = len(expected) - actual = list( - map(lambda i: client._sleep_time_seconds(i + 1), range(until)) - ) + def assert_sleep_times( + self, client: _http_client.HTTPClient, expected: List[float] + ): + # the sleep duration for a request after N retries + actual = [ + client._sleep_time_seconds(i + 1) for i in range(len(expected)) + ] assert expected == actual @contextmanager @@ -128,7 +130,7 @@ def test_maximum_delay(self): client = _http_client.new_default_http_client() client._add_jitter_time = lambda sleep_seconds: sleep_seconds max_delay = _http_client.HTTPClient.MAX_DELAY - expected = [0.5, 1.0, max_delay, max_delay, max_delay] + expected = [0.5, 1.0, 2.0, 4.0, max_delay, max_delay, max_delay] self.assert_sleep_times(client, expected) def test_retry_after_header(self): @@ -1090,7 +1092,7 @@ class TestAPIEncode(StripeClientTestCase): def test_encode_dict(self): body = {"foo": {"dob": {"month": 1}, "name": "bat"}} - values = [t for t in _api_encode(body)] + values = [t for t in _api_encode(body, "V1")] assert ("foo[dob][month]", 1) in values assert ("foo[name]", "bat") in values @@ -1098,11 +1100,19 @@ def test_encode_dict(self): def test_encode_array(self): body = {"foo": [{"dob": {"month": 1}, "name": "bat"}]} - values = [t for t in _api_encode(body)] + values = [t for t in _api_encode(body, "V1")] assert ("foo[0][dob][month]", 1) in values assert ("foo[0][name]", "bat") in values + def test_encode_v2_array(self): + body = {"foo": [{"dob": {"month": 1}, "name": "bat"}]} + + values = [t for t in _api_encode(body, "V2")] + + assert ("foo[dob][month]", 1) in values + assert ("foo[name]", "bat") in values + class TestHTTPXClient(StripeClientTestCase, ClientTestBase): REQUEST_CLIENT: Type[_http_client.HTTPXClient] = _http_client.HTTPXClient diff --git a/tests/test_integration.py b/tests/test_integration.py index a96f9b533..843937541 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -13,6 +13,8 @@ from collections import defaultdict from typing import List, Dict, Tuple, Optional +from stripe._stripe_client import StripeClient + if platform.python_implementation() == "PyPy": pytest.skip("skip integration tests with PyPy", allow_module_level=True) @@ -101,7 +103,6 @@ def setup_stripe(self): stripe._default_proxy = None stripe.enable_telemetry = False stripe.max_network_retries = 3 - stripe.proxy = None yield stripe.api_base = orig_attrs["api_base"] stripe.upload_api_base = orig_attrs["api_base"] @@ -348,7 +349,9 @@ async def async_http_client(self, request, anyio_backend): async def set_global_async_http_client(self, async_http_client): stripe.default_http_client = async_http_client - async def test_async_success(self, set_global_async_http_client): + async def test_async_raw_request_success( + self, set_global_async_http_client + ): class MockServerRequestHandler(MyTestHandler): default_body = '{"id": "cus_123", "object": "customer"}'.encode( "utf-8" @@ -357,11 +360,16 @@ class MockServerRequestHandler(MyTestHandler): self.setup_mock_server(MockServerRequestHandler) - stripe.api_base = "http://localhost:%s" % self.mock_server_port - - cus = await stripe.Customer.create_async( - description="My test customer" + client = StripeClient( + "sk_test_123", + base_addresses={ + "api": "http://localhost:%s" % self.mock_server_port + }, + ) + resp = await client.raw_request_async( + "post", "/v1/customers", description="My test customer" ) + cus = client.deserialize(resp.data, api_mode="V1") reqs = MockServerRequestHandler.get_requests(1) req = reqs[0] @@ -370,14 +378,15 @@ class MockServerRequestHandler(MyTestHandler): assert req.command == "POST" assert isinstance(cus, stripe.Customer) - async def test_async_timeout(self, set_global_async_http_client): + async def test_async_raw_request_timeout( + self, set_global_async_http_client + ): class MockServerRequestHandler(MyTestHandler): def do_request(self, n): time.sleep(0.02) return super().do_request(n) self.setup_mock_server(MockServerRequestHandler) - stripe.api_base = "http://localhost:%s" % self.mock_server_port # If we set HTTPX's generic timeout the test is flaky (sometimes it's a ReadTimeout, sometimes its a ConnectTimeout) # so we set only the read timeout specifically. hc = stripe.default_http_client @@ -391,11 +400,20 @@ def do_request(self, n): expected_message = "A ServerTimeoutError was raised" else: raise ValueError(f"Unknown http client: {hc.name}") - stripe.max_network_retries = 0 exception = None try: - await stripe.Customer.create_async(description="My test customer") + client = StripeClient( + "sk_test_123", + http_client=hc, + base_addresses={ + "api": "http://localhost:%s" % self.mock_server_port + }, + max_network_retries=0, + ) + await client.raw_request_async( + "post", "/v1/customers", description="My test customer" + ) except stripe.APIConnectionError as e: exception = e @@ -403,7 +421,9 @@ def do_request(self, n): assert expected_message in str(exception.user_message) - async def test_async_retries(self, set_global_async_http_client): + async def test_async_raw_request_retries( + self, set_global_async_http_client + ): class MockServerRequestHandler(MyTestHandler): def do_request(self, n): if n == 0: @@ -417,16 +437,26 @@ def do_request(self, n): pass self.setup_mock_server(MockServerRequestHandler) - stripe.api_base = "http://localhost:%s" % self.mock_server_port - await stripe.Customer.create_async(description="My test customer") + client = StripeClient( + "sk_test_123", + base_addresses={ + "api": "http://localhost:%s" % self.mock_server_port + }, + max_network_retries=stripe.max_network_retries, + ) + await client.raw_request_async( + "post", "/v1/customers", description="My test customer" + ) reqs = MockServerRequestHandler.get_requests(2) req = reqs[0] assert req.path == "/v1/customers" - async def test_async_unretryable(self, set_global_async_http_client): + async def test_async_raw_request_unretryable( + self, set_global_async_http_client + ): class MockServerRequestHandler(MyTestHandler): def do_request(self, n): return ( @@ -438,11 +468,18 @@ def do_request(self, n): pass self.setup_mock_server(MockServerRequestHandler) - stripe.api_base = "http://localhost:%s" % self.mock_server_port exception = None try: - await stripe.Customer.create_async(description="My test customer") + client = StripeClient( + "sk_test_123", + base_addresses={ + "api": "http://localhost:%s" % self.mock_server_port + }, + ) + await client.raw_request_async( + "post", "/v1/customers", description="My test customer" + ) except stripe.AuthenticationError as e: exception = e diff --git a/tests/test_raw_request.py b/tests/test_raw_request.py new file mode 100644 index 000000000..459b0d98b --- /dev/null +++ b/tests/test_raw_request.py @@ -0,0 +1,225 @@ +from __future__ import absolute_import, division, print_function + +import datetime + +import stripe + +from tests.test_api_requestor import GMT1 + + +class TestRawRequest(object): + ENCODE_INPUTS = { + "type": "standard", + "int": 123, + "datetime": datetime.datetime(2013, 1, 1, second=1, tzinfo=GMT1()), + } + POST_REL_URL = "/v1/accounts" + GET_REL_URL = "/v1/accounts/acct_123" + POST_REL_URL_V2 = "/v2/billing/meter_event_session" + GET_REL_URL_V2 = "/v2/accounts/acct_123" + + def test_form_request_get( + self, http_client_mock, stripe_mock_stripe_client + ): + http_client_mock.stub_request( + "get", + path=self.GET_REL_URL, + rbody='{"id": "acct_123", "object": "account"}', + rcode=200, + rheaders={}, + ) + + resp = stripe_mock_stripe_client.raw_request("get", self.GET_REL_URL) + http_client_mock.assert_requested("get", path=self.GET_REL_URL) + + deserialized = stripe_mock_stripe_client.deserialize( + resp, api_mode="V1" + ) + assert isinstance(deserialized, stripe.Account) + + def test_form_request_post( + self, http_client_mock, stripe_mock_stripe_client + ): + http_client_mock.stub_request( + "post", + path=self.POST_REL_URL, + rbody='{"id": "acct_123", "object": "account"}', + rcode=200, + rheaders={}, + ) + + expectation = "type=standard&int=123&datetime=1356994801" + + resp = stripe_mock_stripe_client.raw_request( + "post", self.POST_REL_URL, **self.ENCODE_INPUTS + ) + + http_client_mock.assert_requested( + "post", + path=self.POST_REL_URL, + content_type="application/x-www-form-urlencoded", + post_data=expectation, + ) + + deserialized = stripe_mock_stripe_client.deserialize( + resp, api_mode="V1" + ) + assert isinstance(deserialized, stripe.Account) + + def test_preview_request_post( + self, http_client_mock, stripe_mock_stripe_client + ): + http_client_mock.stub_request( + "post", + path=self.POST_REL_URL_V2, + rbody='{"id": "bmes_123", "object": "billing.meter_event_session"}', + rcode=200, + rheaders={}, + ) + + params = dict({}, **self.ENCODE_INPUTS) + expectation = ( + '{"type": "standard", "int": 123, "datetime": 1356994801}' + ) + + resp = stripe_mock_stripe_client.raw_request( + "post", self.POST_REL_URL_V2, **params + ) + + http_client_mock.assert_requested( + "post", + path=self.POST_REL_URL_V2, + content_type="application/json", + post_data=expectation, + is_json=True, + ) + + deserialized = stripe_mock_stripe_client.deserialize( + resp, api_mode="V2" + ) + assert isinstance(deserialized, stripe.v2.billing.MeterEventSession) + + def test_form_request_with_extra_headers( + self, http_client_mock, stripe_mock_stripe_client + ): + http_client_mock.stub_request( + "get", + path=self.GET_REL_URL, + rbody='{"id": "acct_123", "object": "account"}', + rcode=200, + rheaders={}, + ) + + extra_headers = {"foo": "bar", "Stripe-Account": "acct_123"} + params = {"headers": extra_headers} + + stripe_mock_stripe_client.raw_request( + "get", self.GET_REL_URL, **params + ) + + http_client_mock.assert_requested( + "get", + path=self.GET_REL_URL, + extra_headers=extra_headers, + ) + + def test_preview_request_default_api_version( + self, http_client_mock, stripe_mock_stripe_client + ): + http_client_mock.stub_request( + "get", + path=self.GET_REL_URL_V2, + rbody='{"id": "acct_123", "object": "account"}', + rcode=200, + rheaders={}, + ) + params = {} + + stripe_mock_stripe_client.raw_request( + "get", self.GET_REL_URL_V2, **params + ) + + http_client_mock.assert_requested( + "get", + path=self.GET_REL_URL_V2, + ) + + def test_preview_request_overridden_api_version( + self, http_client_mock, stripe_mock_stripe_client + ): + http_client_mock.stub_request( + "post", + path=self.POST_REL_URL_V2, + rbody='{"id": "acct_123", "object": "account"}', + rcode=200, + rheaders={}, + ) + stripe_version_override = "2023-05-15.preview" + params = { + "stripe_version": stripe_version_override, + } + + stripe_mock_stripe_client.raw_request( + "post", self.POST_REL_URL_V2, **params + ) + + http_client_mock.assert_requested( + "post", + path=self.POST_REL_URL_V2, + content_type="application/json", + stripe_version=stripe_version_override, + post_data="{}", + is_json=True, + ) + + # TODO(jar) this test is not applicable yet, but may be some day + # @pytest.mark.anyio + # async def test_form_request_get_async( + # self, http_client_mock, stripe_mock_stripe_client + # ): + # http_client_mock.stub_request( + # "get", + # path=self.GET_REL_URL, + # rbody='{"id": "acct_123", "object": "account"}', + # rcode=200, + # rheaders={}, + # ) + # + # resp = await stripe_mock_stripe_client.raw_request_async( + # "get", self.GET_REL_URL + # ) + # + # http_client_mock.assert_requested("get", path=self.GET_REL_URL) + # + # deserialized = stripe_mock_stripe_client.deserialize(resp) + # assert isinstance(deserialized, stripe.Account) + # + def test_raw_request_usage_reported( + self, http_client_mock, stripe_mock_stripe_client + ): + http_client_mock.stub_request( + "post", + path=self.POST_REL_URL, + rbody='{"id": "acct_123", "object": "account"}', + rcode=200, + rheaders={}, + ) + + expectation = "type=standard&int=123&datetime=1356994801" + + resp = stripe_mock_stripe_client.raw_request( + "post", self.POST_REL_URL, **self.ENCODE_INPUTS + ) + + http_client_mock.assert_requested( + "post", + path=self.POST_REL_URL, + content_type="application/x-www-form-urlencoded", + post_data=expectation, + usage=["raw_request"], + ) + + deserialized = stripe_mock_stripe_client.deserialize( + resp, api_mode="V1" + ) + assert isinstance(deserialized, stripe.Account) diff --git a/tests/test_request_options.py b/tests/test_request_options.py index b57995ba1..27d1fe026 100644 --- a/tests/test_request_options.py +++ b/tests/test_request_options.py @@ -42,6 +42,7 @@ def test_extract_from_dict(self): "api_key": "sk_test_123", "stripe_version": "2020-01-01", "stripe_account": "acct_123", + "stripe_context": "wksp_123", "idempotency_key": "idemp_123", "headers": { "X-Stripe-Header": "Some-Value", @@ -52,6 +53,7 @@ def test_extract_from_dict(self): assert options.get("api_key") == "sk_test_123" assert options.get("stripe_version") == "2020-01-01" assert options.get("stripe_account") == "acct_123" + assert options.get("stripe_context") == "wksp_123" assert options.get("idempotency_key") == "idemp_123" assert options.get("headers") == {"X-Stripe-Header": "Some-Value"} assert remaining == {"foo": "bar"} diff --git a/tests/test_requestor_options.py b/tests/test_requestor_options.py index 2ed3731ad..b818d39a8 100644 --- a/tests/test_requestor_options.py +++ b/tests/test_requestor_options.py @@ -10,6 +10,7 @@ def test_to_dict(self): requestor = RequestorOptions( api_key="sk_test_123", stripe_account="acct_123", + stripe_context="wksp_123", stripe_version="2019-12-03", base_addresses={ "api": "https://api.example.com", @@ -21,6 +22,7 @@ def test_to_dict(self): assert requestor.to_dict() == { "api_key": "sk_test_123", "stripe_account": "acct_123", + "stripe_context": "wksp_123", "stripe_version": "2019-12-03", "base_addresses": { "api": "https://api.example.com", @@ -38,16 +40,22 @@ def test_global_options_get_updated( orig_api_base = stripe.api_base orig_connect_base = stripe.connect_api_base orig_upload_base = stripe.upload_api_base + orig_meter_events_base = stripe.meter_events_api_base orig_max_network_retries = stripe.max_network_retries assert global_options.api_key == orig_api_key assert global_options.base_addresses["api"] == orig_api_base assert global_options.base_addresses["connect"] == orig_connect_base assert global_options.base_addresses["files"] == orig_upload_base + assert ( + global_options.base_addresses["meter_events"] + == orig_meter_events_base + ) assert global_options.stripe_account is None stripe.api_key = "sk_test_555555555" stripe.api_base = "https://api.example.com" stripe.connect_api_base = "https://connect.example.com" stripe.upload_api_base = "https://upload.example.com" + stripe.meter_events_api_base = "https://meter-events.example.com" stripe.max_network_retries = 3 assert global_options.api_key == "sk_test_555555555" assert ( @@ -61,10 +69,15 @@ def test_global_options_get_updated( global_options.base_addresses["files"] == "https://upload.example.com" ) + assert ( + global_options.base_addresses["meter_events"] + == "https://meter-events.example.com" + ) assert global_options.stripe_account is None assert global_options.max_network_retries == 3 stripe.api_key = orig_api_key stripe.api_base = orig_api_base stripe.connect_api_base = orig_connect_base stripe.upload_api_base = orig_upload_base + stripe.meter_events_api_base = orig_meter_events_base stripe.max_network_retries = orig_max_network_retries diff --git a/tests/test_stripe_client.py b/tests/test_stripe_client.py index 6abfe396b..16a5d53bc 100644 --- a/tests/test_stripe_client.py +++ b/tests/test_stripe_client.py @@ -2,7 +2,11 @@ import stripe import pytest +from stripe.v2._event import Event from stripe._http_client import new_default_http_client +from stripe.events._v1_billing_meter_error_report_triggered_event import ( + V1BillingMeterErrorReportTriggeredEvent, +) class TestStripeClient(object): @@ -28,6 +32,32 @@ def test_v1_customers_retrieve( http_client_mock.assert_requested(method, path=path) assert customer.id is not None + def test_v2_events_retrieve(self, http_client_mock): + method = "get" + path = "/v2/core/events/evt_123" + http_client_mock.stub_request( + method, + path=path, + rbody='{"id": "evt_123","object": "v2.core.event", "type": "v1.billing.meter.error_report_triggered"}', + rcode=200, + rheaders={}, + ) + client = stripe.StripeClient( + api_key="keyinfo_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + event = client.v2.core.events.retrieve("evt_123") + + http_client_mock.assert_requested( + method, + api_base=stripe.DEFAULT_API_BASE, + path=path, + api_key="keyinfo_test_123", + ) + assert event.id is not None + assert isinstance(event, Event) + assert isinstance(event, V1BillingMeterErrorReportTriggeredEvent) + def test_no_api_key(self): with pytest.raises(stripe.error.AuthenticationError): stripe.StripeClient(None) # type: ignore @@ -61,12 +91,14 @@ def test_client_level_options(self, http_client_mock): api_base = "https://example.com" api_key = "sk_test_456" stripe_account = "acct_123" + stripe_context = "wksp_123" stripe_client = stripe.StripeClient( api_key=api_key, http_client=http_client_mock.get_mock_http_client(), base_addresses={"api": api_base}, stripe_account=stripe_account, + stripe_context=stripe_context, ) stripe_client.customers.retrieve("cus_xxxxxxxxxxxxx") @@ -77,6 +109,7 @@ def test_client_level_options(self, http_client_mock): path=path, api_key=api_key, stripe_account=stripe_account, + stripe_context=stripe_context, stripe_version=stripe.api_version, ) @@ -111,15 +144,18 @@ def test_request_level_options(self, http_client_mock): client_api_base = "https://example.com" client_api_key = "sk_test_456" client_stripe_account = "acct_123" + client_stripe_context = "wksp_123" request_api_key = "sk_test_789" request_stripe_account = "acct_456" + request_stripe_context = "wksp_456" stripe_client = stripe.StripeClient( api_key=client_api_key, http_client=http_client_mock.get_mock_http_client(), base_addresses={"api": client_api_base}, stripe_account=client_stripe_account, + stripe_context=client_stripe_context, ) stripe_client.customers.retrieve( @@ -127,6 +163,7 @@ def test_request_level_options(self, http_client_mock): options={ "api_key": request_api_key, "stripe_account": request_stripe_account, + "stripe_context": request_stripe_context, }, ) @@ -136,6 +173,7 @@ def test_request_level_options(self, http_client_mock): path=path, api_key=request_api_key, stripe_account=request_stripe_account, + stripe_context=request_stripe_context, stripe_version=stripe.api_version, ) @@ -179,6 +217,31 @@ def test_separate_clients_have_separate_options(self, http_client_mock): stripe_version=stripe.api_version, ) + def test_v2_encodes_none_as_null(self, http_client_mock): + http_client_mock.stub_request( + "post", + path="/v2/billing/meter_events", + rbody='{"event_name": "cool", "payload": {}, "identifier": null}', + rcode=200, + rheaders={}, + ) + + client = stripe.StripeClient( + api_key="sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.meter_events.create( + {"event_name": "cool", "payload": {}, "identifier": None} # type: ignore - None is not valid for `identifier` + ) + + http_client_mock.assert_requested( + "post", + content_type="application/json", + post_data='{"event_name": "cool", "payload": {}, "identifier": null}', + is_json=True, + ) + def test_carries_over_requestor_options_to_resource( self, http_client_mock ): @@ -230,7 +293,8 @@ def test_user_options_are_not_mutated(self, http_client_mock): http_client_mock.stub_request( "get", - path="/v1/accounts", + path="/v2/core/events", + query_string="object_id=obj_123", rbody='{"data": [{"id": "x"}], "next_page": "page_2"}', rcode=200, rheaders={}, @@ -238,7 +302,9 @@ def test_user_options_are_not_mutated(self, http_client_mock): my_options: stripe.RequestOptions = {"api_key": "sk_test_xyz"} - client.accounts.list(options=my_options) + client.v2.core.events.list( + {"object_id": "obj_123"}, options=my_options + ) assert my_options == {"api_key": "sk_test_xyz"} diff --git a/tests/test_util.py b/tests/test_util.py index df045a749..93b75c84f 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -135,7 +135,7 @@ def test_convert_to_stripe_object_and_back(self): "livemode": False, } - obj = util.convert_to_stripe_object(resp) + obj = util.convert_to_stripe_object(resp, api_mode="V1") assert isinstance(obj, stripe.Balance) assert isinstance(obj.available, list) assert isinstance(obj.available[0], stripe.stripe_object.StripeObject) @@ -149,4 +149,6 @@ def test_convert_to_stripe_object_and_back(self): def test_sanitize_id(self): sanitized_id = util.sanitize_id("cu %x 123") + if isinstance(sanitized_id, bytes): + sanitized_id = sanitized_id.decode("utf-8", "strict") assert sanitized_id == "cu++%25x+123" diff --git a/tests/test_v2_error.py b/tests/test_v2_error.py new file mode 100644 index 000000000..f2828c377 --- /dev/null +++ b/tests/test_v2_error.py @@ -0,0 +1,141 @@ +from __future__ import absolute_import, division, print_function + +import json + +import pytest + +import stripe +from stripe import error +from tests.http_client_mock import HTTPClientMock + + +class TestV2Error(object): + @pytest.fixture(scope="function") + def stripe_client(self, http_client_mock): + return stripe.StripeClient( + api_key="keyinfo_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + def test_raises_v2_error( + self, + stripe_client: stripe.StripeClient, + http_client_mock: HTTPClientMock, + ): + method = "get" + path = "/v2/core/events/evt_123" + + error_response = { + "error": { + "type": "temporary_session_expired", + "code": "session_bad", + "message": "you messed up", + } + } + http_client_mock.stub_request( + method, + path=path, + rbody=json.dumps(error_response), + rcode=400, + rheaders={}, + ) + + try: + stripe_client.v2.core.events.retrieve("evt_123") + except error.TemporarySessionExpiredError as e: + assert e.code == "session_bad" + assert e.error.code == "session_bad" + assert e.error.message == "you messed up" + else: + assert False, "Should have raised a TemporarySessionExpiredError" + + http_client_mock.assert_requested( + method, + path=path, + api_key="keyinfo_test_123", + ) + + @pytest.mark.skip("python doesn't have any errors with invalid params yet") + def test_raises_v2_error_with_field( + self, + stripe_client: stripe.StripeClient, + http_client_mock: HTTPClientMock, + ): + method = "post" + path = "/v2/payment_methods/us_bank_accounts" + + error_response = { + "error": { + "type": "invalid_payment_method", + "code": "invalid_us_bank_account", + "message": "bank account is invalid", + "invalid_param": "routing_number", + } + } + http_client_mock.stub_request( + method, + path=path, + rbody=json.dumps(error_response), + rcode=400, + rheaders={}, + ) + + try: + stripe_client.v2.payment_methods.us_bank_accounts.create( + params={"account_number": "123", "routing_number": "456"} + ) + except error.InvalidPaymentMethodError as e: + assert e.invalid_param == "routing_number" + assert e.error.code == "invalid_us_bank_account" + assert e.error.message == "bank account is invalid" + else: + assert False, "Should have raised a InvalidUsBankAccountError" + + http_client_mock.assert_requested( + method, + path=path, + api_key="keyinfo_test_123", + ) + + def test_falls_back_to_v1_error( + self, + stripe_client: stripe.StripeClient, + http_client_mock: HTTPClientMock, + ): + method = "post" + path = "/v2/billing/meter_events" + + error_response = { + "error": { + "code": "invalid_request", + "message": "your request is invalid", + "param": "invalid_param", + } + } + http_client_mock.stub_request( + method, + path=path, + rbody=json.dumps(error_response), + rcode=400, + rheaders={"request-id": "123"}, + ) + + try: + stripe_client.v2.billing.meter_events.create( + {"event_name": "asdf", "payload": {}} + ) + except error.InvalidRequestError as e: + assert e.param == "invalid_param" + assert repr(e) == ( + "InvalidRequestError(message='your request is invalid', " + "param='invalid_param', code='invalid_request', " + "http_status=400, request_id='123')" + ) + else: + assert False, "Should have raised a InvalidRequestError" + + http_client_mock.assert_requested( + method, + path=path, + api_key="keyinfo_test_123", + ) diff --git a/tests/test_v2_event.py b/tests/test_v2_event.py new file mode 100644 index 000000000..4fbbc7af7 --- /dev/null +++ b/tests/test_v2_event.py @@ -0,0 +1,110 @@ +import json +from typing import Callable + +import pytest + +import stripe +from stripe import ThinEvent +from tests.test_webhook import DUMMY_WEBHOOK_SECRET, generate_header + +EventParser = Callable[[str], ThinEvent] + + +class TestV2Event(object): + @pytest.fixture(scope="function") + def v2_payload_no_data(self): + return json.dumps( + { + "id": "evt_234", + "object": "v2.core.event", + "type": "financial_account.balance.opened", + "created": "2022-02-15T00:27:45.330Z", + "related_object": { + "id": "fa_123", + "type": "financial_account", + "url": "/v2/financial_accounts/fa_123", + "stripe_context": "acct_123", + }, + "reason": { + "id": "foo", + "idempotency_key": "bar", + }, + } + ) + + @pytest.fixture(scope="function") + def v2_payload_with_data(self): + return json.dumps( + { + "id": "evt_234", + "object": "v2.core.event", + "type": "financial_account.balance.opened", + "created": "2022-02-15T00:27:45.330Z", + "related_object": { + "id": "fa_123", + "type": "financial_account", + "url": "/v2/financial_accounts/fa_123", + "stripe_context": "acct_123", + }, + "data": { + "containing_compartment_id": "compid", + "id": "foo", + "type": "bufo", + }, + } + ) + + @pytest.fixture(scope="function") + def stripe_client(self, http_client_mock): + return stripe.StripeClient( + api_key="keyinfo_test_123", + stripe_context="wksp_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + @pytest.fixture(scope="function") + def parse_thin_event( + self, stripe_client: stripe.StripeClient + ) -> EventParser: + """ + helper to simplify parsing and validating events given a payload + returns a function that has the client pre-bound + """ + + def _parse_thin_event(payload: str): + return stripe_client.parse_thin_event( + payload, generate_header(payload=payload), DUMMY_WEBHOOK_SECRET + ) + + return _parse_thin_event + + def test_parses_thin_event( + self, parse_thin_event: EventParser, v2_payload_no_data: str + ): + event = parse_thin_event(v2_payload_no_data) + + assert isinstance(event, ThinEvent) + assert event.id == "evt_234" + + assert event.related_object + assert event.related_object.id == "fa_123" + + assert event.reason + assert event.reason.id == "foo" + + def test_parses_thin_event_with_data( + self, parse_thin_event: EventParser, v2_payload_with_data: str + ): + event = parse_thin_event(v2_payload_with_data) + + assert isinstance(event, ThinEvent) + assert not hasattr(event, "data") + assert event.reason is None + + def test_validates_signature( + self, stripe_client: stripe.StripeClient, v2_payload_no_data + ): + with pytest.raises(stripe.error.SignatureVerificationError): + stripe_client.parse_thin_event( + v2_payload_no_data, "bad header", DUMMY_WEBHOOK_SECRET + ) diff --git a/tests/test_webhook.py b/tests/test_webhook.py index 53389f725..8c190acb7 100644 --- a/tests/test_webhook.py +++ b/tests/test_webhook.py @@ -135,7 +135,7 @@ def test_timestamp_off_but_no_tolerance(self): class TestStripeClientConstructEvent(object): def test_construct_event(self, stripe_mock_stripe_client): header = generate_header() - event = stripe_mock_stripe_client.construct_event( + event = stripe_mock_stripe_client.parse_snapshot_event( DUMMY_WEBHOOK_PAYLOAD, header, DUMMY_WEBHOOK_SECRET ) assert isinstance(event, stripe.Event) @@ -144,21 +144,21 @@ def test_raise_on_json_error(self, stripe_mock_stripe_client): payload = "this is not valid JSON" header = generate_header(payload=payload) with pytest.raises(ValueError): - stripe_mock_stripe_client.construct_event( + stripe_mock_stripe_client.parse_snapshot_event( payload, header, DUMMY_WEBHOOK_SECRET ) def test_raise_on_invalid_header(self, stripe_mock_stripe_client): header = "bad_header" with pytest.raises(stripe.error.SignatureVerificationError): - stripe_mock_stripe_client.construct_event( + stripe_mock_stripe_client.parse_snapshot_event( DUMMY_WEBHOOK_PAYLOAD, header, DUMMY_WEBHOOK_SECRET ) def test_construct_event_from_bytearray(self, stripe_mock_stripe_client): header = generate_header() payload = bytearray(DUMMY_WEBHOOK_PAYLOAD, "utf-8") - event = stripe_mock_stripe_client.construct_event( + event = stripe_mock_stripe_client.parse_snapshot_event( payload, header, DUMMY_WEBHOOK_SECRET ) assert isinstance(event, stripe.Event) @@ -166,7 +166,7 @@ def test_construct_event_from_bytearray(self, stripe_mock_stripe_client): def test_construct_event_from_bytes(self, stripe_mock_stripe_client): header = generate_header() payload = bytes(DUMMY_WEBHOOK_PAYLOAD, "utf-8") - event = stripe_mock_stripe_client.construct_event( + event = stripe_mock_stripe_client.parse_snapshot_event( payload, header, DUMMY_WEBHOOK_SECRET ) assert isinstance(event, stripe.Event) @@ -181,7 +181,7 @@ def test_construct_event_inherits_requestor(self, http_client_mock): http_client=http_client_mock.get_mock_http_client(), ) header = generate_header() - event = client.construct_event( + event = client.parse_snapshot_event( DUMMY_WEBHOOK_PAYLOAD, header, DUMMY_WEBHOOK_SECRET ) assert event._requestor == client._requestor From 206b394bac3b52566d9e793a29621d9b1d1d524a Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Tue, 1 Oct 2024 10:01:08 -0700 Subject: [PATCH 114/179] Add Custom requests section to README (#1405) --- README.md | 14 ++++++++++++++ examples/raw_request.py | 15 +++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 examples/raw_request.py diff --git a/README.md b/README.md index 1723b0e2e..62f399fd0 100644 --- a/README.md +++ b/README.md @@ -264,6 +264,20 @@ If your beta feature requires a `Stripe-Version` header to be sent, set the `str stripe.add_beta_version("feature_beta", "v3") ``` +### Custom requests + +If you would like to send a request to an undocumented API (for example you are in a private beta), or if you prefer to bypass the method definitions in the library and specify your request details directly, you can use the `raw_request` method on `StripeClient`. + +```python +client = StripeClient("sk_test_...") +response = client.raw_request( + "post", "/v1/beta_endpoint", param=123, stripe_version="2022-11-15; feature_beta=v3" +) + +# (Optional) response is a StripeResponse. You can use `client.deserialize` to get a StripeObject. +deserialized_resp = client.deserialize(response, api_mode='V1') +``` + ### Async Asynchronous versions of request-making methods are available by suffixing the method name diff --git a/examples/raw_request.py b/examples/raw_request.py new file mode 100644 index 000000000..5d142f909 --- /dev/null +++ b/examples/raw_request.py @@ -0,0 +1,15 @@ +from stripe import StripeClient + +# Set your API key here +api_key = "{{API_KEY}}" + +client = StripeClient(api_key) +response = client.raw_request( + "post", + "/v1/beta_endpoint", + param=123, + stripe_version="2022-11-15; feature_beta=v3", +) + +# (Optional) response is a StripeResponse. You can use `client.deserialize` to get a StripeObject. +deserialized_resp = client.deserialize(response, api_mode="V1") From ae9cfd183377401f2e1658bcf48c8549301441cd Mon Sep 17 00:00:00 2001 From: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:21:18 -0400 Subject: [PATCH 115/179] Removed parseSnapshotEvent (#1406) --- stripe/_stripe_client.py | 2 +- stripe/v2/_event.py | 18 ++++++++++++++++++ tests/test_webhook.py | 12 ++++++------ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 661c018b1..5ef477d9d 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -283,7 +283,7 @@ def parse_thin_event( return ThinEvent(payload) - def parse_snapshot_event( + def construct_event( self, payload: Union[bytes, str], sig_header: str, diff --git a/stripe/v2/_event.py b/stripe/v2/_event.py index 04c95ca8d..56f160dc0 100644 --- a/stripe/v2/_event.py +++ b/stripe/v2/_event.py @@ -102,11 +102,29 @@ class ThinEvent: """ id: str + """ + Unique identifier for the event. + """ type: str + """ + The type of the event. + """ created: str + """ + Time at which the object was created. + """ context: Optional[str] = None + """ + [Optional] Authentication context needed to fetch the event or related object. + """ related_object: Optional[RelatedObject] = None + """ + [Optional] Object containing the reference to API resource relevant to the event. + """ reason: Optional[Reason] = None + """ + [Optional] Reason for the event. + """ def __init__(self, payload: str) -> None: parsed = json.loads(payload) diff --git a/tests/test_webhook.py b/tests/test_webhook.py index 8c190acb7..53389f725 100644 --- a/tests/test_webhook.py +++ b/tests/test_webhook.py @@ -135,7 +135,7 @@ def test_timestamp_off_but_no_tolerance(self): class TestStripeClientConstructEvent(object): def test_construct_event(self, stripe_mock_stripe_client): header = generate_header() - event = stripe_mock_stripe_client.parse_snapshot_event( + event = stripe_mock_stripe_client.construct_event( DUMMY_WEBHOOK_PAYLOAD, header, DUMMY_WEBHOOK_SECRET ) assert isinstance(event, stripe.Event) @@ -144,21 +144,21 @@ def test_raise_on_json_error(self, stripe_mock_stripe_client): payload = "this is not valid JSON" header = generate_header(payload=payload) with pytest.raises(ValueError): - stripe_mock_stripe_client.parse_snapshot_event( + stripe_mock_stripe_client.construct_event( payload, header, DUMMY_WEBHOOK_SECRET ) def test_raise_on_invalid_header(self, stripe_mock_stripe_client): header = "bad_header" with pytest.raises(stripe.error.SignatureVerificationError): - stripe_mock_stripe_client.parse_snapshot_event( + stripe_mock_stripe_client.construct_event( DUMMY_WEBHOOK_PAYLOAD, header, DUMMY_WEBHOOK_SECRET ) def test_construct_event_from_bytearray(self, stripe_mock_stripe_client): header = generate_header() payload = bytearray(DUMMY_WEBHOOK_PAYLOAD, "utf-8") - event = stripe_mock_stripe_client.parse_snapshot_event( + event = stripe_mock_stripe_client.construct_event( payload, header, DUMMY_WEBHOOK_SECRET ) assert isinstance(event, stripe.Event) @@ -166,7 +166,7 @@ def test_construct_event_from_bytearray(self, stripe_mock_stripe_client): def test_construct_event_from_bytes(self, stripe_mock_stripe_client): header = generate_header() payload = bytes(DUMMY_WEBHOOK_PAYLOAD, "utf-8") - event = stripe_mock_stripe_client.parse_snapshot_event( + event = stripe_mock_stripe_client.construct_event( payload, header, DUMMY_WEBHOOK_SECRET ) assert isinstance(event, stripe.Event) @@ -181,7 +181,7 @@ def test_construct_event_inherits_requestor(self, http_client_mock): http_client=http_client_mock.get_mock_http_client(), ) header = generate_header() - event = client.parse_snapshot_event( + event = client.construct_event( DUMMY_WEBHOOK_PAYLOAD, header, DUMMY_WEBHOOK_SECRET ) assert event._requestor == client._requestor From 9bc3689f3736eab961aa937ff9ddee9105b375e9 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Tue, 1 Oct 2024 11:35:45 -0700 Subject: [PATCH 116/179] Bump version to 11.0.0 --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e71c80fc2..0fc81f549 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,36 @@ +## 11.0.0 - 2024-10-01 +* [#1404](https://github.com/stripe/stripe-python/pull/1404) Support for APIs in the new API version 2024-09-30.acacia + + This release changes the pinned API version to `2024-09-30.acacia`. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-09-30.acacia) and carefully review the API changes before upgrading. + + ### ⚠️ Breaking changes due to changes in the API + + + * Rename for `usage_threshold_config` to `usage_threshold` on parameter class `stripe.billing.Alert.CreateParams` and resource `stripe.billing.Alert` + * Remove support for `filter` on parameter class `stripe.billing.Alert.CreateParams` and resource `stripe.billing.Alert`. Use the filters on the `usage_threshold` instead + * * Remove support for `customer_consent_collected` on parameter class `stripe.terminal.Reader.ProcessSetupIntentParams` + + ### ⚠️ Other Breaking changes in the SDK + * Adjusted default values for HTTP requests. You can use the old defaults by setting them explicitly. New values are: + - max retries: `0` -> `2` + - max timeout (seconds): `2` -> `5` + * Add method `parse_thin_event()` on the `StripeClient` class to parse [thin events](https://docs.corp.stripe.com/event-destinations#events-overview). Rename `construct_event()` method on the same class to `parse_snapshot_event()` to clearly distinguish between the two kinds of events. + + ### Additions + + * Add support for `custom_unit_amount` on parameter class `stripe.Product.CreateParamsDefaultPriceData` + * Add support for `usage_threshold` on parameter class `stripe.billing.Alert.CreateParams` and resource `stripe.billing.Alert` + * Add support for `allow_redisplay` on parameter classes `stripe.terminal.Reader.ProcessPaymentIntentParamsProcessConfig` and `stripe.terminal.Reader.ProcessSetupIntentParams` + * Add support for `international_transaction` on enum `stripe.treasury.ReceivedCredit.failure_code` + * Add support for `2024-09-30.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` + * Add support for new Usage Billing APIs `stripe.v2.billing.MeterEvent`, `stripe.v2.billing.MeterEventAdjustments`, `stripe.v2.billing.MeterEventSession`, `stripe.v2.billing.MeterEventStream` and the new Events API `stripe.v2.core.Events` under the [v2 namespace ](https://docs.corp.stripe.com/api-v2-overview) + * Add method [rawRequest()](https://github.com/stripe/stripe-python/tree/master?tab=readme-ov-file#custom-requests) on the `StripeClient` class that takes a HTTP method type, url and relevant parameters to make requests to the Stripe API that are not yet supported in the SDK. + + ### Other changes + * Change type of `default_allowed_updates` on `stripe.billing_portal.Configuration.CreateParamsFeaturesSubscriptionUpdate` from `Union[Literal[''], List[Literal['price', 'promotion_code', 'quantity']]]` to `NotRequired[Literal['']|List[Literal['price', 'promotion_code', 'quantity']]]` + * Change type of `products` on `stripe.billing_portal.Configuration.CreateParamsFeaturesSubscriptionUpdate` from `Union[Literal[''], List[Configuration.CreateParamsFeaturesSubscriptionUpdateProduct]]` to `NotRequired[Literal['']|List[Configuration.CreateParamsFeaturesSubscriptionUpdateProduct]]` + + ## 10.12.0 - 2024-09-18 * [#1394](https://github.com/stripe/stripe-python/pull/1394) Update generated code * Add support for `international_transaction` on enum `stripe.treasury.ReceivedDebit.failure_code` diff --git a/VERSION b/VERSION index c4d592e16..275283a18 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.12.0 +11.0.0 diff --git a/stripe/_version.py b/stripe/_version.py index b20ec0ac7..cbbc18cb3 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "10.12.0" +VERSION = "11.0.0" From 668f1d46c6cd1c7849f1a47097f0668a4cd40455 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 10:03:17 -0700 Subject: [PATCH 117/179] Update generated code for v1268 (#1408) Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- stripe/__init__.py | 1 - stripe/_invoice.py | 5 ---- stripe/_invoice_line_item.py | 5 ---- stripe/_margin.py | 50 -------------------------------- stripe/_object_classes.py | 1 - stripe/api_resources/__init__.py | 1 - stripe/api_resources/margin.py | 21 -------------- 7 files changed, 84 deletions(-) delete mode 100644 stripe/_margin.py delete mode 100644 stripe/api_resources/margin.py diff --git a/stripe/__init__.py b/stripe/__init__.py index 0300781a1..3f28c4ecd 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -444,7 +444,6 @@ def __getattr__(name): from stripe._login_link import LoginLink as LoginLink from stripe._mandate import Mandate as Mandate from stripe._mandate_service import MandateService as MandateService -from stripe._margin import Margin as Margin from stripe._payment_intent import PaymentIntent as PaymentIntent from stripe._payment_intent_service import ( PaymentIntentService as PaymentIntentService, diff --git a/stripe/_invoice.py b/stripe/_invoice.py index db9966044..3c2bd5886 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -40,7 +40,6 @@ from stripe._customer import Customer from stripe._discount import Discount from stripe._invoice_line_item import InvoiceLineItem - from stripe._margin import Margin from stripe._payment_intent import PaymentIntent from stripe._payment_method import PaymentMethod from stripe._quote import Quote @@ -984,10 +983,6 @@ class TotalPretaxCreditAmount(StripeObject): """ The discount that was applied to get this pretax credit amount. """ - margin: Optional[ExpandableField["Margin"]] - """ - The margin that was applied to get this pretax credit amount. - """ type: Literal["credit_balance_transaction", "discount"] """ Type of the pretax credit amount referenced. diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index c81defb72..827490207 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -17,7 +17,6 @@ if TYPE_CHECKING: from stripe._discount import Discount from stripe._invoice_item import InvoiceItem - from stripe._margin import Margin from stripe._plan import Plan from stripe._price import Price from stripe._subscription import Subscription @@ -72,10 +71,6 @@ class PretaxCreditAmount(StripeObject): """ The discount that was applied to get this pretax credit amount. """ - margin: Optional[ExpandableField["Margin"]] - """ - The margin that was applied to get this pretax credit amount. - """ type: Literal["credit_balance_transaction", "discount"] """ Type of the pretax credit amount referenced. diff --git a/stripe/_margin.py b/stripe/_margin.py deleted file mode 100644 index 949e35f9b..000000000 --- a/stripe/_margin.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- 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 Margin(StripeObject): - """ - A (partner) margin represents a specific discount distributed in partner reseller programs to business partners who - resell products and services and earn a discount (margin) for doing so. - """ - - OBJECT_NAME: ClassVar[Literal["margin"]] = "margin" - active: bool - """ - Whether the margin can be applied to invoices, invoice items, or invoice line items. Defaults to `true`. - """ - created: int - """ - Time at which the object was created. Measured in seconds since the Unix epoch. - """ - id: str - """ - Unique identifier for the object. - """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ - metadata: Optional[Dict[str, str]] - """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - """ - name: Optional[str] - """ - Name of the margin that's displayed on, for example, invoices. - """ - object: Literal["margin"] - """ - String representing the object's type. Objects of the same type share the same value. - """ - percent_off: float - """ - Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied. - """ - updated: int - """ - Time at which the object was last updated. Measured in seconds since the Unix epoch. - """ diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index fb0a0ba5b..cbb749a12 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -81,7 +81,6 @@ stripe.LineItem.OBJECT_NAME: stripe.LineItem, stripe.LoginLink.OBJECT_NAME: stripe.LoginLink, stripe.Mandate.OBJECT_NAME: stripe.Mandate, - stripe.Margin.OBJECT_NAME: stripe.Margin, stripe.PaymentIntent.OBJECT_NAME: stripe.PaymentIntent, stripe.PaymentLink.OBJECT_NAME: stripe.PaymentLink, stripe.PaymentMethod.OBJECT_NAME: stripe.PaymentMethod, diff --git a/stripe/api_resources/__init__.py b/stripe/api_resources/__init__.py index d142b58af..99bf65826 100644 --- a/stripe/api_resources/__init__.py +++ b/stripe/api_resources/__init__.py @@ -85,7 +85,6 @@ from stripe.api_resources.list_object import ListObject from stripe.api_resources.login_link import LoginLink from stripe.api_resources.mandate import Mandate - from stripe.api_resources.margin import Margin from stripe.api_resources.payment_intent import PaymentIntent from stripe.api_resources.payment_link import PaymentLink from stripe.api_resources.payment_method import PaymentMethod diff --git a/stripe/api_resources/margin.py b/stripe/api_resources/margin.py deleted file mode 100644 index 2a94240be..000000000 --- a/stripe/api_resources/margin.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from typing_extensions import TYPE_CHECKING -from warnings import warn - -warn( - """ - The stripe.api_resources.margin package is deprecated, please change your - imports to import from stripe directly. - From: - from stripe.api_resources.margin import Margin - To: - from stripe import Margin - """, - DeprecationWarning, - stacklevel=2, -) -if not TYPE_CHECKING: - from stripe._margin import ( # noqa - Margin, - ) From e65fcaa92f9a4ca093cf289ea7e119f313c15361 Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:22:45 -0700 Subject: [PATCH 118/179] Add livemode to ThinEvent (#1409) --- stripe/v2/_event.py | 5 +++++ tests/test_v2_event.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/stripe/v2/_event.py b/stripe/v2/_event.py index 56f160dc0..693644b4f 100644 --- a/stripe/v2/_event.py +++ b/stripe/v2/_event.py @@ -111,6 +111,10 @@ class ThinEvent: """ created: str """ + Livemode indicates if the event is from a production(true) or test(false) account. + """ + livemode: bool + """ Time at which the object was created. """ context: Optional[str] = None @@ -132,6 +136,7 @@ def __init__(self, payload: str) -> None: self.id = parsed["id"] self.type = parsed["type"] self.created = parsed["created"] + self.livemode = parsed.get("livemode") self.context = parsed.get("context") if parsed.get("related_object"): self.related_object = RelatedObject(parsed["related_object"]) diff --git a/tests/test_v2_event.py b/tests/test_v2_event.py index 4fbbc7af7..9ffc910d9 100644 --- a/tests/test_v2_event.py +++ b/tests/test_v2_event.py @@ -18,6 +18,7 @@ def v2_payload_no_data(self): "id": "evt_234", "object": "v2.core.event", "type": "financial_account.balance.opened", + "livemode": True, "created": "2022-02-15T00:27:45.330Z", "related_object": { "id": "fa_123", @@ -39,6 +40,7 @@ def v2_payload_with_data(self): "id": "evt_234", "object": "v2.core.event", "type": "financial_account.balance.opened", + "livemode": False, "created": "2022-02-15T00:27:45.330Z", "related_object": { "id": "fa_123", From 9ad9bfaee1814036da35a7fa0a44088d7548c268 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 3 Oct 2024 15:50:10 -0700 Subject: [PATCH 119/179] Bump version to 11.1.0 --- CHANGELOG.md | 5 +++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fc81f549..bcc240bd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 11.1.0 - 2024-10-03 +* [#1409](https://github.com/stripe/stripe-python/pull/1409) Update the class for `ThinEvent` to include `livemode` +* [#1408](https://github.com/stripe/stripe-python/pull/1408) Update generated code + * Remove the support for resource `Margin` that was accidentally made public in the last release + ## 11.0.0 - 2024-10-01 * [#1404](https://github.com/stripe/stripe-python/pull/1404) Support for APIs in the new API version 2024-09-30.acacia diff --git a/VERSION b/VERSION index 275283a18..68d8f15e2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.0.0 +11.1.0 diff --git a/stripe/_version.py b/stripe/_version.py index cbbc18cb3..e67067092 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "11.0.0" +VERSION = "11.1.0" From 1e8ee4713feb03880aca8ed3ea677319139400be Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Wed, 9 Oct 2024 16:42:54 -0700 Subject: [PATCH 120/179] Clean up examples (#1412) --- examples/README.md | 11 +++++++--- examples/example_template.py | 22 +++++++++++++++++++ examples/meter_event_stream.py | 12 ++++++++++ examples/new_example.py | 8 ------- ...andler.py => thinevent_webhook_handler.py} | 13 +++++++++++ 5 files changed, 55 insertions(+), 11 deletions(-) create mode 100644 examples/example_template.py delete mode 100644 examples/new_example.py rename examples/{stripe_webhook_handler.py => thinevent_webhook_handler.py} (68%) diff --git a/examples/README.md b/examples/README.md index c73c6149f..d70b4a6ba 100644 --- a/examples/README.md +++ b/examples/README.md @@ -3,9 +3,14 @@ From the examples folder, run: `PYTHONPATH=../ python your_example.py` +e.g. + +`PYTHONPATH=../ python thinevent_webhook_handler.py` + ## Adding a new example -1. Clone new_example.py +1. Clone example_template.py 2. Implement your example -3. Run it (as per above) -4. 👍 +3. Fill out the file comment. Include a description and key steps that are being demonstrated. +4. Run it (as per above) +5. 👍 diff --git a/examples/example_template.py b/examples/example_template.py new file mode 100644 index 000000000..8edbed126 --- /dev/null +++ b/examples/example_template.py @@ -0,0 +1,22 @@ +""" +example_template.py - This is a template for defining new examples. It is not intended to be used directly. + + + +In this example, we: + - + - +""" + +import stripe + +# Set your API key here +api_key = "{{API_KEY}}" + +print("Hello world") +# client = stripe.StripeClient(api_key) +# client.v2.... diff --git a/examples/meter_event_stream.py b/examples/meter_event_stream.py index 0d02bb9d8..852decf0e 100644 --- a/examples/meter_event_stream.py +++ b/examples/meter_event_stream.py @@ -1,3 +1,15 @@ +""" +meter_event_stream.py - use the high-throughput meter event stream to report create billing meter events. + +In this example, we: + - create a meter event session and store the session's authentication token + - define an event with a payload + - use the meter_event_stream service accessor in StripeClient to create an event stream that reports this event + +This example expects a billing meter with an event_name of 'alpaca_ai_tokens'. If you have +a different meter event name, you can change it before running this example. +""" + from datetime import datetime, timezone import stripe diff --git a/examples/new_example.py b/examples/new_example.py deleted file mode 100644 index 53a93e7e6..000000000 --- a/examples/new_example.py +++ /dev/null @@ -1,8 +0,0 @@ -import stripe - -# Set your API key here -api_key = "{{API_KEY}}" - -print("Hello world") -# client = stripe.StripeClient(api_key) -# client.v2.... diff --git a/examples/stripe_webhook_handler.py b/examples/thinevent_webhook_handler.py similarity index 68% rename from examples/stripe_webhook_handler.py rename to examples/thinevent_webhook_handler.py index e4452d9c7..f93e0a560 100644 --- a/examples/stripe_webhook_handler.py +++ b/examples/thinevent_webhook_handler.py @@ -1,3 +1,16 @@ +""" +thinevent_webhook_handler.py - receive and process thin events like the +v1.billing.meter.error_report_triggered event. + +In this example, we: + - create a StripeClient called client + - use client.parse_thin_event to parse the received thin event webhook body + - call client.v2.core.events.retrieve to retrieve the full event object + - if it is a V1BillingMeterErrorReportTriggeredEvent event type, call + event.fetchRelatedObject to retrieve the Billing Meter object associated + with the event. +""" + import os from stripe import StripeClient from stripe.events import V1BillingMeterErrorReportTriggeredEvent From 62e89af8abe9f80abba1d8991f1a54abd1d9e881 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:17:04 -0700 Subject: [PATCH 121/179] update object tags for meter-related classes (#1415) * update object tags * fix tests --- stripe/v2/billing/_meter_event.py | 6 +++--- stripe/v2/billing/_meter_event_adjustment.py | 6 +++--- stripe/v2/billing/_meter_event_session.py | 6 +++--- tests/test_raw_request.py | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/stripe/v2/billing/_meter_event.py b/stripe/v2/billing/_meter_event.py index ce33c36cd..9d5a304dd 100644 --- a/stripe/v2/billing/_meter_event.py +++ b/stripe/v2/billing/_meter_event.py @@ -10,8 +10,8 @@ class MeterEvent(StripeObject): Fix me empty_doc_string. """ - OBJECT_NAME: ClassVar[Literal["billing.meter_event"]] = ( - "billing.meter_event" + OBJECT_NAME: ClassVar[Literal["v2.billing.meter_event"]] = ( + "v2.billing.meter_event" ) created: str """ @@ -29,7 +29,7 @@ class MeterEvent(StripeObject): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ - object: Literal["billing.meter_event"] + object: Literal["v2.billing.meter_event"] """ String representing the object's type. Objects of the same type share the same value of the object field. """ diff --git a/stripe/v2/billing/_meter_event_adjustment.py b/stripe/v2/billing/_meter_event_adjustment.py index 7561e67ba..662e8b9bc 100644 --- a/stripe/v2/billing/_meter_event_adjustment.py +++ b/stripe/v2/billing/_meter_event_adjustment.py @@ -6,8 +6,8 @@ class MeterEventAdjustment(StripeObject): - OBJECT_NAME: ClassVar[Literal["billing.meter_event_adjustment"]] = ( - "billing.meter_event_adjustment" + OBJECT_NAME: ClassVar[Literal["v2.billing.meter_event_adjustment"]] = ( + "v2.billing.meter_event_adjustment" ) class Cancel(StripeObject): @@ -36,7 +36,7 @@ class Cancel(StripeObject): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ - object: Literal["billing.meter_event_adjustment"] + object: Literal["v2.billing.meter_event_adjustment"] """ String representing the object's type. Objects of the same type share the same value of the object field. """ diff --git a/stripe/v2/billing/_meter_event_session.py b/stripe/v2/billing/_meter_event_session.py index f1d96650e..8a6d47538 100644 --- a/stripe/v2/billing/_meter_event_session.py +++ b/stripe/v2/billing/_meter_event_session.py @@ -6,8 +6,8 @@ class MeterEventSession(StripeObject): - OBJECT_NAME: ClassVar[Literal["billing.meter_event_session"]] = ( - "billing.meter_event_session" + OBJECT_NAME: ClassVar[Literal["v2.billing.meter_event_session"]] = ( + "v2.billing.meter_event_session" ) authentication_token: str """ @@ -30,7 +30,7 @@ class MeterEventSession(StripeObject): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ - object: Literal["billing.meter_event_session"] + object: Literal["v2.billing.meter_event_session"] """ String representing the object's type. Objects of the same type share the same value of the object field. """ diff --git a/tests/test_raw_request.py b/tests/test_raw_request.py index 459b0d98b..94d493f8b 100644 --- a/tests/test_raw_request.py +++ b/tests/test_raw_request.py @@ -72,7 +72,7 @@ def test_preview_request_post( http_client_mock.stub_request( "post", path=self.POST_REL_URL_V2, - rbody='{"id": "bmes_123", "object": "billing.meter_event_session"}', + rbody='{"id": "bmes_123", "object": "v2.billing.meter_event_session"}', rcode=200, rheaders={}, ) From acd1bccfdfae25259404801aeff107d24726fe0f Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:38:28 -0700 Subject: [PATCH 122/179] Deserialize into correct v2 EventData types (#1414) * Add event data deserialization * Fix python attribute checking * fix pr feedback --- ...ling_meter_error_report_triggered_event.py | 29 ++++++++- .../_v1_billing_meter_no_meter_found_event.py | 29 ++++++++- tests/test_v2_event.py | 60 +++++++++++++++---- 3 files changed, 103 insertions(+), 15 deletions(-) diff --git a/stripe/events/_v1_billing_meter_error_report_triggered_event.py b/stripe/events/_v1_billing_meter_error_report_triggered_event.py index f20157177..a3af378fb 100644 --- a/stripe/events/_v1_billing_meter_error_report_triggered_event.py +++ b/stripe/events/_v1_billing_meter_error_report_triggered_event.py @@ -1,9 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse from stripe.billing._meter import Meter from stripe.v2._event import Event -from typing import List, cast +from typing import Any, Dict, List, Optional, cast from typing_extensions import Literal @@ -88,6 +91,30 @@ class Request(StripeObject): Data for the v1.billing.meter.error_report_triggered event """ + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V1BillingMeterErrorReportTriggeredEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V1BillingMeterErrorReportTriggeredEvent.V1BillingMeterErrorReportTriggeredEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + class RelatedObject(StripeObject): id: str """ diff --git a/stripe/events/_v1_billing_meter_no_meter_found_event.py b/stripe/events/_v1_billing_meter_no_meter_found_event.py index 680c094aa..5f8d64479 100644 --- a/stripe/events/_v1_billing_meter_no_meter_found_event.py +++ b/stripe/events/_v1_billing_meter_no_meter_found_event.py @@ -1,8 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse from stripe.v2._event import Event -from typing import List +from typing import Any, Dict, List, Optional from typing_extensions import Literal @@ -86,3 +89,27 @@ class Request(StripeObject): """ Data for the v1.billing.meter.no_meter_found event """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V1BillingMeterNoMeterFoundEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V1BillingMeterNoMeterFoundEvent.V1BillingMeterNoMeterFoundEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt diff --git a/tests/test_v2_event.py b/tests/test_v2_event.py index 9ffc910d9..32bd3fabb 100644 --- a/tests/test_v2_event.py +++ b/tests/test_v2_event.py @@ -5,6 +5,9 @@ import stripe from stripe import ThinEvent +from stripe.events._v1_billing_meter_error_report_triggered_event import ( + V1BillingMeterErrorReportTriggeredEvent, +) from tests.test_webhook import DUMMY_WEBHOOK_SECRET, generate_header EventParser = Callable[[str], ThinEvent] @@ -17,13 +20,13 @@ def v2_payload_no_data(self): { "id": "evt_234", "object": "v2.core.event", - "type": "financial_account.balance.opened", + "type": "v1.billing.meter.error_report_triggered", "livemode": True, "created": "2022-02-15T00:27:45.330Z", "related_object": { - "id": "fa_123", - "type": "financial_account", - "url": "/v2/financial_accounts/fa_123", + "id": "mtr_123", + "type": "billing.meter", + "url": "/v1/billing/meters/mtr_123", "stripe_context": "acct_123", }, "reason": { @@ -39,19 +42,19 @@ def v2_payload_with_data(self): { "id": "evt_234", "object": "v2.core.event", - "type": "financial_account.balance.opened", + "type": "v1.billing.meter.error_report_triggered", "livemode": False, "created": "2022-02-15T00:27:45.330Z", + "context": "acct_123", "related_object": { - "id": "fa_123", - "type": "financial_account", - "url": "/v2/financial_accounts/fa_123", - "stripe_context": "acct_123", + "id": "mtr_123", + "type": "billing.meter", + "url": "/v1/billing/meters/mtr_123", }, "data": { - "containing_compartment_id": "compid", - "id": "foo", - "type": "bufo", + "reason": { + "error_count": 1, + } }, } ) @@ -89,7 +92,7 @@ def test_parses_thin_event( assert event.id == "evt_234" assert event.related_object - assert event.related_object.id == "fa_123" + assert event.related_object.id == "mtr_123" assert event.reason assert event.reason.id == "foo" @@ -110,3 +113,34 @@ def test_validates_signature( stripe_client.parse_thin_event( v2_payload_no_data, "bad header", DUMMY_WEBHOOK_SECRET ) + + def test_v2_events_data_type(self, http_client_mock, v2_payload_with_data): + method = "get" + path = "/v2/core/events/evt_123" + http_client_mock.stub_request( + method, + path=path, + rbody=v2_payload_with_data, + rcode=200, + rheaders={}, + ) + client = stripe.StripeClient( + api_key="keyinfo_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + event = client.v2.core.events.retrieve("evt_123") + + http_client_mock.assert_requested( + method, + api_base=stripe.DEFAULT_API_BASE, + path=path, + api_key="keyinfo_test_123", + ) + assert event.id is not None + assert isinstance(event, V1BillingMeterErrorReportTriggeredEvent) + assert event.data is not None + assert isinstance( + event.data, + V1BillingMeterErrorReportTriggeredEvent.V1BillingMeterErrorReportTriggeredEventData, + ) + assert event.data.reason.error_count == 1 From d53a190ef5bf8a1ebbc683af2af3b601770589da Mon Sep 17 00:00:00 2001 From: David Brownman Date: Fri, 18 Oct 2024 11:42:23 -0700 Subject: [PATCH 123/179] Bump version to 11.1.1 --- CHANGELOG.md | 8 ++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcc240bd7..e89347ffc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 11.1.1 - 2024-10-18 +* [#1414](https://github.com/stripe/stripe-python/pull/1414) Deserialize into correct v2 EventData types + * Fixes a bug where v2 EventData was not being deserialized into the appropriate type for `V1BillingMeterErrorReportTriggeredEvent` and `V1BillingMeterNoMeterFoundEvent` +* [#1415](https://github.com/stripe/stripe-python/pull/1415) update object tags for meter-related classes + + - fixes a bug where the `object` property of the `MeterEvent`, `MeterEventAdjustment`, and `MeterEventSession` didn't match the server. +* [#1412](https://github.com/stripe/stripe-python/pull/1412) Clean up examples + ## 11.1.0 - 2024-10-03 * [#1409](https://github.com/stripe/stripe-python/pull/1409) Update the class for `ThinEvent` to include `livemode` * [#1408](https://github.com/stripe/stripe-python/pull/1408) Update generated code diff --git a/VERSION b/VERSION index 68d8f15e2..668182d21 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.1.0 +11.1.1 diff --git a/stripe/_version.py b/stripe/_version.py index e67067092..043e1f3c1 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "11.1.0" +VERSION = "11.1.1" From f71b687b9ab5f722c58c56659d6d078775de50c0 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:14:41 -0700 Subject: [PATCH 124/179] Update generated code (#1411) * Update generated code for v1268 * Update generated code for v1314 * Update generated code for v1315 * Update generated code for v1317 * Update generated code for v1318 * Update generated code for v1318 * Update generated code for v1319 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 129 +++- stripe/_account_login_link_service.py | 4 +- stripe/_account_service.py | 168 ++++- stripe/_account_session.py | 62 +- stripe/_account_session_service.py | 30 +- stripe/_api_version.py | 2 +- stripe/_charge.py | 78 +++ stripe/_confirmation_token.py | 136 +++- stripe/_credit_note.py | 9 +- stripe/_credit_note_line_item.py | 3 + stripe/_credit_note_preview_lines_service.py | 2 +- stripe/_credit_note_service.py | 4 +- stripe/_customer.py | 34 +- stripe/_customer_payment_method_service.py | 6 + stripe/_customer_service.py | 20 +- stripe/_customer_tax_id_service.py | 8 +- stripe/_dispute.py | 344 ++++++++++ stripe/_dispute_service.py | 166 +++++ stripe/_event.py | 2 + stripe/_invoice.py | 60 +- stripe/_invoice_line_item.py | 4 + stripe/_invoice_line_item_service.py | 1 + stripe/_invoice_service.py | 34 +- stripe/_invoice_upcoming_lines_service.py | 10 +- stripe/_mandate.py | 10 + stripe/_object_classes.py | 1 + stripe/_payment_intent.py | 617 +++++++++++++++++- stripe/_payment_intent_service.py | 561 +++++++++++++++- stripe/_payment_link.py | 4 +- stripe/_payment_link_service.py | 3 +- stripe/_payment_method.py | 140 +++- stripe/_payment_method_configuration.py | 64 +- .../_payment_method_configuration_service.py | 40 +- stripe/_payment_method_domain.py | 22 + stripe/_payment_method_service.py | 69 +- stripe/_person.py | 2 +- stripe/_refund.py | 8 +- stripe/_setup_attempt.py | 10 + stripe/_setup_intent.py | 179 ++++- stripe/_setup_intent_service.py | 195 +++++- stripe/_subscription.py | 13 +- stripe/_subscription_service.py | 8 +- stripe/_tax_id.py | 16 +- stripe/_tax_id_service.py | 8 +- stripe/_tax_rate.py | 24 + stripe/_tax_rate_service.py | 2 + stripe/_token.py | 6 +- stripe/_token_service.py | 6 +- stripe/_usage_record_summary.py | 4 + stripe/_webhook_endpoint.py | 5 + stripe/_webhook_endpoint_service.py | 5 + stripe/billing/_credit_balance_summary.py | 12 +- .../_credit_balance_summary_service.py | 4 +- stripe/billing/_credit_balance_transaction.py | 20 +- stripe/billing/_credit_grant.py | 31 +- stripe/billing/_credit_grant_service.py | 12 +- stripe/billing/_meter.py | 2 + stripe/billing_portal/_configuration.py | 71 +- .../billing_portal/_configuration_service.py | 50 +- stripe/checkout/_session.py | 142 +++- stripe/checkout/_session_service.py | 78 +++ stripe/forwarding/_request.py | 10 +- stripe/forwarding/_request_service.py | 6 +- stripe/issuing/_card.py | 118 +++- stripe/issuing/_card_service.py | 2 +- stripe/tax/_calculation.py | 37 +- stripe/tax/_calculation_line_item.py | 1 + stripe/tax/_calculation_service.py | 8 +- stripe/tax/_registration.py | 164 +++++ stripe/tax/_registration_service.py | 91 +++ stripe/tax/_transaction.py | 9 +- stripe/terminal/_configuration.py | 52 ++ stripe/terminal/_configuration_service.py | 36 + .../_confirmation_token_service.py | 65 +- stripe/test_helpers/issuing/_card_service.py | 50 ++ stripe/treasury/_financial_account.py | 2 +- stripe/v2/__init__.py | 1 + stripe/v2/_core_service.py | 2 + stripe/v2/_event_destination.py | 124 ++++ stripe/v2/core/__init__.py | 3 + stripe/v2/core/_event_destination_service.py | 478 ++++++++++++++ stripe/v2/core/_event_service.py | 2 +- 83 files changed, 4856 insertions(+), 167 deletions(-) create mode 100644 stripe/v2/_event_destination.py create mode 100644 stripe/v2/core/_event_destination_service.py diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 8f166ae2e..c626f7dd8 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1268 \ No newline at end of file +v1319 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index db36e83a8..b13e39411 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -170,6 +170,10 @@ class Capabilities(StripeObject): """ The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges. """ + alma_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the Alma capability of the account, or whether the account can directly process Alma payments. + """ amazon_pay_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the AmazonPay capability of the account, or whether the account can directly process AmazonPay payments. @@ -262,6 +266,10 @@ class Capabilities(StripeObject): """ The status of the Japanese customer_balance payments (JPY currency) capability of the account, or whether the account can directly process Japanese customer_balance charges. """ + kakao_pay_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the KakaoPay capability of the account, or whether the account can directly process KakaoPay payments. + """ klarna_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Klarna payments capability of the account, or whether the account can directly process Klarna charges. @@ -270,6 +278,10 @@ class Capabilities(StripeObject): """ The status of the konbini payments capability of the account, or whether the account can directly process konbini charges. """ + kr_card_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the KrCard capability of the account, or whether the account can directly process KrCard payments. + """ legacy_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the legacy payments capability of the account. @@ -292,6 +304,10 @@ class Capabilities(StripeObject): """ The status of the Mexican customer_balance payments (MXN currency) capability of the account, or whether the account can directly process Mexican customer_balance charges. """ + naver_pay_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the NaverPay capability of the account, or whether the account can directly process NaverPay payments. + """ oxxo_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. @@ -300,6 +316,10 @@ class Capabilities(StripeObject): """ The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. """ + payco_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the Payco capability of the account, or whether the account can directly process Payco payments. + """ paynow_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. @@ -314,6 +334,12 @@ class Capabilities(StripeObject): """ The status of the RevolutPay capability of the account, or whether the account can directly process RevolutPay payments. """ + samsung_pay_payments: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the SamsungPay capability of the account, or whether the account can directly process SamsungPay payments. + """ sepa_bank_transfer_payments: Optional[ Literal["active", "inactive", "pending"] ] @@ -794,6 +820,12 @@ class Error(StripeObject): """ _inner_class_types = {"alternatives": Alternative, "errors": Error} + class Groups(StripeObject): + payments_pricing: Optional[str] + """ + The group the account is in to determine their payments pricing, and null if the account is on customized pricing. [See the Platform pricing tool documentation](https://stripe.com/docs/connect/platform-pricing-tools) for details. + """ + class Requirements(StripeObject): class Alternative(StripeObject): alternative_fields_due: List[str] @@ -1292,6 +1324,10 @@ class CreateParams(RequestOptions): By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/api#account_create_bank_account) or [card creation](https://stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ + groups: NotRequired["Account.CreateParamsGroups"] + """ + A hash of account group type to tokens. These are account groups this account should be added to + """ individual: NotRequired["Account.CreateParamsIndividual"] """ Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. @@ -1461,6 +1497,12 @@ class CreateParamsCapabilities(TypedDict): """ The afterpay_clearpay_payments capability. """ + alma_payments: NotRequired[ + "Account.CreateParamsCapabilitiesAlmaPayments" + ] + """ + The alma_payments capability. + """ amazon_pay_payments: NotRequired[ "Account.CreateParamsCapabilitiesAmazonPayPayments" ] @@ -1581,6 +1623,12 @@ class CreateParamsCapabilities(TypedDict): """ The jp_bank_transfer_payments capability. """ + kakao_pay_payments: NotRequired[ + "Account.CreateParamsCapabilitiesKakaoPayPayments" + ] + """ + The kakao_pay_payments capability. + """ klarna_payments: NotRequired[ "Account.CreateParamsCapabilitiesKlarnaPayments" ] @@ -1593,6 +1641,12 @@ class CreateParamsCapabilities(TypedDict): """ The konbini_payments capability. """ + kr_card_payments: NotRequired[ + "Account.CreateParamsCapabilitiesKrCardPayments" + ] + """ + The kr_card_payments capability. + """ legacy_payments: NotRequired[ "Account.CreateParamsCapabilitiesLegacyPayments" ] @@ -1623,6 +1677,12 @@ class CreateParamsCapabilities(TypedDict): """ The mx_bank_transfer_payments capability. """ + naver_pay_payments: NotRequired[ + "Account.CreateParamsCapabilitiesNaverPayPayments" + ] + """ + The naver_pay_payments capability. + """ oxxo_payments: NotRequired[ "Account.CreateParamsCapabilitiesOxxoPayments" ] @@ -1635,6 +1695,12 @@ class CreateParamsCapabilities(TypedDict): """ The p24_payments capability. """ + payco_payments: NotRequired[ + "Account.CreateParamsCapabilitiesPaycoPayments" + ] + """ + The payco_payments capability. + """ paynow_payments: NotRequired[ "Account.CreateParamsCapabilitiesPaynowPayments" ] @@ -1653,6 +1719,12 @@ class CreateParamsCapabilities(TypedDict): """ The revolut_pay_payments capability. """ + samsung_pay_payments: NotRequired[ + "Account.CreateParamsCapabilitiesSamsungPayPayments" + ] + """ + The samsung_pay_payments capability. + """ sepa_bank_transfer_payments: NotRequired[ "Account.CreateParamsCapabilitiesSepaBankTransferPayments" ] @@ -1740,6 +1812,12 @@ class CreateParamsCapabilitiesAfterpayClearpayPayments(TypedDict): 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 CreateParamsCapabilitiesAlmaPayments(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 CreateParamsCapabilitiesAmazonPayPayments(TypedDict): requested: NotRequired[bool] """ @@ -1860,6 +1938,12 @@ class CreateParamsCapabilitiesJpBankTransferPayments(TypedDict): 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 CreateParamsCapabilitiesKakaoPayPayments(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 CreateParamsCapabilitiesKlarnaPayments(TypedDict): requested: NotRequired[bool] """ @@ -1872,6 +1956,12 @@ class CreateParamsCapabilitiesKonbiniPayments(TypedDict): 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 CreateParamsCapabilitiesKrCardPayments(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 CreateParamsCapabilitiesLegacyPayments(TypedDict): requested: NotRequired[bool] """ @@ -1902,6 +1992,12 @@ class CreateParamsCapabilitiesMxBankTransferPayments(TypedDict): 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 CreateParamsCapabilitiesNaverPayPayments(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 CreateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired[bool] """ @@ -1914,6 +2010,12 @@ class CreateParamsCapabilitiesP24Payments(TypedDict): 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 CreateParamsCapabilitiesPaycoPayments(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 CreateParamsCapabilitiesPaynowPayments(TypedDict): requested: NotRequired[bool] """ @@ -1932,6 +2034,12 @@ class CreateParamsCapabilitiesRevolutPayPayments(TypedDict): 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 CreateParamsCapabilitiesSamsungPayPayments(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 CreateParamsCapabilitiesSepaBankTransferPayments(TypedDict): requested: NotRequired[bool] """ @@ -2353,6 +2461,12 @@ class CreateParamsDocumentsProofOfRegistration(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class CreateParamsGroups(TypedDict): + payments_pricing: NotRequired["Literal['']|str"] + """ + The group the account is in to determine their payments pricing, and null if the account is on customized pricing. [See the Platform pricing tool documentation](https://stripe.com/docs/connect/platform-pricing-tools) for details. + """ + class CreateParamsIndividual(TypedDict): address: NotRequired["Account.CreateParamsIndividualAddress"] """ @@ -2394,7 +2508,7 @@ class CreateParamsIndividual(TypedDict): """ gender: NotRequired[str] """ - The individual's gender (International regulations require either "male" or "female"). + The individual's gender """ id_number: NotRequired[str] """ @@ -3865,7 +3979,7 @@ class RetrievePersonParams(RequestOptions): capabilities: Optional[Capabilities] charges_enabled: Optional[bool] """ - Whether the account can create live charges. + Whether the account can process charges. """ company: Optional[Company] controller: Optional[Controller] @@ -3894,6 +4008,10 @@ class RetrievePersonParams(RequestOptions): External accounts (bank accounts and debit cards) currently attached to this account. External accounts are only returned for requests where `controller[is_controller]` is true. """ future_requirements: Optional[FutureRequirements] + groups: Optional[Groups] + """ + The groups associated with the account. + """ id: str """ Unique identifier for the object. @@ -3916,7 +4034,7 @@ class RetrievePersonParams(RequestOptions): """ payouts_enabled: Optional[bool] """ - Whether Stripe can send payouts to this account. + Whether the funds in this account can be paid out. """ requirements: Optional[Requirements] settings: Optional[Settings] @@ -4790,7 +4908,7 @@ def create_login_link( cls, account: str, **params: Unpack["Account.CreateLoginLinkParams"] ) -> "LoginLink": """ - Creates a single-use login link for a connected account to access the Express Dashboard. + Creates a login link for a connected account to access the Express Dashboard. You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ @@ -4810,7 +4928,7 @@ async def create_login_link_async( cls, account: str, **params: Unpack["Account.CreateLoginLinkParams"] ) -> "LoginLink": """ - Creates a single-use login link for a connected account to access the Express Dashboard. + Creates a login link for a connected account to access the Express Dashboard. You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ @@ -5029,6 +5147,7 @@ async def list_persons_async( "company": Company, "controller": Controller, "future_requirements": FutureRequirements, + "groups": Groups, "requirements": Requirements, "settings": Settings, "tos_acceptance": TosAcceptance, diff --git a/stripe/_account_login_link_service.py b/stripe/_account_login_link_service.py index aa3d3dc7d..0d1d0a30c 100644 --- a/stripe/_account_login_link_service.py +++ b/stripe/_account_login_link_service.py @@ -22,7 +22,7 @@ def create( options: RequestOptions = {}, ) -> LoginLink: """ - Creates a single-use login link for a connected account to access the Express Dashboard. + Creates a login link for a connected account to access the Express Dashboard. You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ @@ -46,7 +46,7 @@ async def create_async( options: RequestOptions = {}, ) -> LoginLink: """ - Creates a single-use login link for a connected account to access the Express Dashboard. + Creates a login link for a connected account to access the Express Dashboard. You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index bf8142bc8..9d973845c 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -87,6 +87,10 @@ class CreateParams(TypedDict): By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/api#account_create_bank_account) or [card creation](https://stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ + groups: NotRequired["AccountService.CreateParamsGroups"] + """ + A hash of account group type to tokens. These are account groups this account should be added to + """ individual: NotRequired["AccountService.CreateParamsIndividual"] """ Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. @@ -256,6 +260,12 @@ class CreateParamsCapabilities(TypedDict): """ The afterpay_clearpay_payments capability. """ + alma_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesAlmaPayments" + ] + """ + The alma_payments capability. + """ amazon_pay_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesAmazonPayPayments" ] @@ -376,6 +386,12 @@ class CreateParamsCapabilities(TypedDict): """ The jp_bank_transfer_payments capability. """ + kakao_pay_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesKakaoPayPayments" + ] + """ + The kakao_pay_payments capability. + """ klarna_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesKlarnaPayments" ] @@ -388,6 +404,12 @@ class CreateParamsCapabilities(TypedDict): """ The konbini_payments capability. """ + kr_card_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesKrCardPayments" + ] + """ + The kr_card_payments capability. + """ legacy_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesLegacyPayments" ] @@ -418,6 +440,12 @@ class CreateParamsCapabilities(TypedDict): """ The mx_bank_transfer_payments capability. """ + naver_pay_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesNaverPayPayments" + ] + """ + The naver_pay_payments capability. + """ oxxo_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesOxxoPayments" ] @@ -430,6 +458,12 @@ class CreateParamsCapabilities(TypedDict): """ The p24_payments capability. """ + payco_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesPaycoPayments" + ] + """ + The payco_payments capability. + """ paynow_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesPaynowPayments" ] @@ -448,6 +482,12 @@ class CreateParamsCapabilities(TypedDict): """ The revolut_pay_payments capability. """ + samsung_pay_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesSamsungPayPayments" + ] + """ + The samsung_pay_payments capability. + """ sepa_bank_transfer_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesSepaBankTransferPayments" ] @@ -539,6 +579,12 @@ class CreateParamsCapabilitiesAfterpayClearpayPayments(TypedDict): 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 CreateParamsCapabilitiesAlmaPayments(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 CreateParamsCapabilitiesAmazonPayPayments(TypedDict): requested: NotRequired[bool] """ @@ -659,6 +705,12 @@ class CreateParamsCapabilitiesJpBankTransferPayments(TypedDict): 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 CreateParamsCapabilitiesKakaoPayPayments(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 CreateParamsCapabilitiesKlarnaPayments(TypedDict): requested: NotRequired[bool] """ @@ -671,6 +723,12 @@ class CreateParamsCapabilitiesKonbiniPayments(TypedDict): 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 CreateParamsCapabilitiesKrCardPayments(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 CreateParamsCapabilitiesLegacyPayments(TypedDict): requested: NotRequired[bool] """ @@ -701,6 +759,12 @@ class CreateParamsCapabilitiesMxBankTransferPayments(TypedDict): 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 CreateParamsCapabilitiesNaverPayPayments(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 CreateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired[bool] """ @@ -713,6 +777,12 @@ class CreateParamsCapabilitiesP24Payments(TypedDict): 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 CreateParamsCapabilitiesPaycoPayments(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 CreateParamsCapabilitiesPaynowPayments(TypedDict): requested: NotRequired[bool] """ @@ -731,6 +801,12 @@ class CreateParamsCapabilitiesRevolutPayPayments(TypedDict): 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 CreateParamsCapabilitiesSamsungPayPayments(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 CreateParamsCapabilitiesSepaBankTransferPayments(TypedDict): requested: NotRequired[bool] """ @@ -1158,6 +1234,12 @@ class CreateParamsDocumentsProofOfRegistration(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class CreateParamsGroups(TypedDict): + payments_pricing: NotRequired["Literal['']|str"] + """ + The group the account is in to determine their payments pricing, and null if the account is on customized pricing. [See the Platform pricing tool documentation](https://stripe.com/docs/connect/platform-pricing-tools) for details. + """ + class CreateParamsIndividual(TypedDict): address: NotRequired["AccountService.CreateParamsIndividualAddress"] """ @@ -1203,7 +1285,7 @@ class CreateParamsIndividual(TypedDict): """ gender: NotRequired[str] """ - The individual's gender (International regulations require either "male" or "female"). + The individual's gender """ id_number: NotRequired[str] """ @@ -1777,6 +1859,10 @@ class UpdateParams(TypedDict): By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/api#account_create_bank_account) or [card creation](https://stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ + groups: NotRequired["AccountService.UpdateParamsGroups"] + """ + A hash of account group type to tokens. These are account groups this account should be added to + """ individual: NotRequired["AccountService.UpdateParamsIndividual"] """ Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. @@ -1942,6 +2028,12 @@ class UpdateParamsCapabilities(TypedDict): """ The afterpay_clearpay_payments capability. """ + alma_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesAlmaPayments" + ] + """ + The alma_payments capability. + """ amazon_pay_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesAmazonPayPayments" ] @@ -2062,6 +2154,12 @@ class UpdateParamsCapabilities(TypedDict): """ The jp_bank_transfer_payments capability. """ + kakao_pay_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesKakaoPayPayments" + ] + """ + The kakao_pay_payments capability. + """ klarna_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesKlarnaPayments" ] @@ -2074,6 +2172,12 @@ class UpdateParamsCapabilities(TypedDict): """ The konbini_payments capability. """ + kr_card_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesKrCardPayments" + ] + """ + The kr_card_payments capability. + """ legacy_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesLegacyPayments" ] @@ -2104,6 +2208,12 @@ class UpdateParamsCapabilities(TypedDict): """ The mx_bank_transfer_payments capability. """ + naver_pay_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesNaverPayPayments" + ] + """ + The naver_pay_payments capability. + """ oxxo_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesOxxoPayments" ] @@ -2116,6 +2226,12 @@ class UpdateParamsCapabilities(TypedDict): """ The p24_payments capability. """ + payco_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesPaycoPayments" + ] + """ + The payco_payments capability. + """ paynow_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesPaynowPayments" ] @@ -2134,6 +2250,12 @@ class UpdateParamsCapabilities(TypedDict): """ The revolut_pay_payments capability. """ + samsung_pay_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesSamsungPayPayments" + ] + """ + The samsung_pay_payments capability. + """ sepa_bank_transfer_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesSepaBankTransferPayments" ] @@ -2225,6 +2347,12 @@ class UpdateParamsCapabilitiesAfterpayClearpayPayments(TypedDict): 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 UpdateParamsCapabilitiesAlmaPayments(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 UpdateParamsCapabilitiesAmazonPayPayments(TypedDict): requested: NotRequired[bool] """ @@ -2345,6 +2473,12 @@ class UpdateParamsCapabilitiesJpBankTransferPayments(TypedDict): 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 UpdateParamsCapabilitiesKakaoPayPayments(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 UpdateParamsCapabilitiesKlarnaPayments(TypedDict): requested: NotRequired[bool] """ @@ -2357,6 +2491,12 @@ class UpdateParamsCapabilitiesKonbiniPayments(TypedDict): 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 UpdateParamsCapabilitiesKrCardPayments(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 UpdateParamsCapabilitiesLegacyPayments(TypedDict): requested: NotRequired[bool] """ @@ -2387,6 +2527,12 @@ class UpdateParamsCapabilitiesMxBankTransferPayments(TypedDict): 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 UpdateParamsCapabilitiesNaverPayPayments(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 UpdateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired[bool] """ @@ -2399,6 +2545,12 @@ class UpdateParamsCapabilitiesP24Payments(TypedDict): 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 UpdateParamsCapabilitiesPaycoPayments(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 UpdateParamsCapabilitiesPaynowPayments(TypedDict): requested: NotRequired[bool] """ @@ -2417,6 +2569,12 @@ class UpdateParamsCapabilitiesRevolutPayPayments(TypedDict): 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 UpdateParamsCapabilitiesSamsungPayPayments(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 UpdateParamsCapabilitiesSepaBankTransferPayments(TypedDict): requested: NotRequired[bool] """ @@ -2806,6 +2964,12 @@ class UpdateParamsDocumentsProofOfRegistration(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class UpdateParamsGroups(TypedDict): + payments_pricing: NotRequired["Literal['']|str"] + """ + The group the account is in to determine their payments pricing, and null if the account is on customized pricing. [See the Platform pricing tool documentation](https://stripe.com/docs/connect/platform-pricing-tools) for details. + """ + class UpdateParamsIndividual(TypedDict): address: NotRequired["AccountService.UpdateParamsIndividualAddress"] """ @@ -2851,7 +3015,7 @@ class UpdateParamsIndividual(TypedDict): """ gender: NotRequired[str] """ - The individual's gender (International regulations require either "male" or "female"). + The individual's gender """ id_number: NotRequired[str] """ diff --git a/stripe/_account_session.py b/stripe/_account_session.py index 4b844424d..eee61b8fb 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -3,7 +3,7 @@ from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from typing import ClassVar, List, cast +from typing import ClassVar, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack @@ -23,9 +23,13 @@ class AccountSession(CreateableAPIResource["AccountSession"]): class Components(StripeObject): class AccountManagement(StripeObject): class Features(StripeObject): + disable_stripe_user_authentication: Optional[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ enabled: bool @@ -37,9 +41,13 @@ class Features(StripeObject): class AccountOnboarding(StripeObject): class Features(StripeObject): + disable_stripe_user_authentication: Optional[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ enabled: bool @@ -51,13 +59,17 @@ class Features(StripeObject): class Balances(StripeObject): class Features(StripeObject): + disable_stripe_user_authentication: Optional[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ edit_payout_schedule: bool """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ instant_payouts: bool """ @@ -88,9 +100,13 @@ class Features(StripeObject): class NotificationBanner(StripeObject): class Features(StripeObject): + disable_stripe_user_authentication: Optional[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ enabled: bool @@ -154,13 +170,17 @@ class Features(StripeObject): class Payouts(StripeObject): class Features(StripeObject): + disable_stripe_user_authentication: Optional[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ edit_payout_schedule: bool """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ instant_payouts: bool """ @@ -325,9 +345,13 @@ class CreateParamsComponentsAccountManagement(TypedDict): """ class CreateParamsComponentsAccountManagementFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ class CreateParamsComponentsAccountOnboarding(TypedDict): @@ -343,9 +367,13 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): """ class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ class CreateParamsComponentsBalances(TypedDict): @@ -361,13 +389,17 @@ class CreateParamsComponentsBalances(TypedDict): """ class CreateParamsComponentsBalancesFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ edit_payout_schedule: NotRequired[bool] """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ instant_payouts: NotRequired[bool] """ @@ -406,9 +438,13 @@ class CreateParamsComponentsNotificationBanner(TypedDict): """ class CreateParamsComponentsNotificationBannerFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ class CreateParamsComponentsPaymentDetails(TypedDict): @@ -484,13 +520,17 @@ class CreateParamsComponentsPayouts(TypedDict): """ class CreateParamsComponentsPayoutsFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ edit_payout_schedule: NotRequired[bool] """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ instant_payouts: NotRequired[bool] """ diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 52ea8afa3..fbdf22315 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -103,9 +103,13 @@ class CreateParamsComponentsAccountManagement(TypedDict): """ class CreateParamsComponentsAccountManagementFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ class CreateParamsComponentsAccountOnboarding(TypedDict): @@ -121,9 +125,13 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): """ class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ class CreateParamsComponentsBalances(TypedDict): @@ -139,13 +147,17 @@ class CreateParamsComponentsBalances(TypedDict): """ class CreateParamsComponentsBalancesFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ edit_payout_schedule: NotRequired[bool] """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ instant_payouts: NotRequired[bool] """ @@ -184,9 +196,13 @@ class CreateParamsComponentsNotificationBanner(TypedDict): """ class CreateParamsComponentsNotificationBannerFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ class CreateParamsComponentsPaymentDetails(TypedDict): @@ -262,13 +278,17 @@ class CreateParamsComponentsPayouts(TypedDict): """ class CreateParamsComponentsPayoutsFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + """ edit_payout_schedule: NotRequired[bool] """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. + Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ instant_payouts: NotRequired[bool] """ diff --git a/stripe/_api_version.py b/stripe/_api_version.py index e23615373..16c42a5c5 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 = "2024-09-30.acacia" + CURRENT = "2024-10-28.acacia" diff --git a/stripe/_charge.py b/stripe/_charge.py index 9d0463bd5..3a08da9f8 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -282,6 +282,9 @@ class Alipay(StripeObject): Transaction ID of this particular Alipay transaction. """ + class Alma(StripeObject): + pass + class AmazonPay(StripeObject): pass @@ -1285,6 +1288,12 @@ class Receipt(StripeObject): """ _inner_class_types = {"receipt": Receipt} + class KakaoPay(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + class Klarna(StripeObject): class PayerDetails(StripeObject): class Address(StripeObject): @@ -1330,6 +1339,45 @@ class Store(StripeObject): """ _inner_class_types = {"store": Store} + class KrCard(StripeObject): + brand: Optional[ + Literal[ + "bc", + "citi", + "hana", + "hyundai", + "jeju", + "jeonbuk", + "kakaobank", + "kbank", + "kdbbank", + "kookmin", + "kwangju", + "lotte", + "mg", + "nh", + "post", + "samsung", + "savingsbank", + "shinhan", + "shinhyup", + "suhyup", + "tossbank", + "woori", + ] + ] + """ + The local credit or debit card brand. + """ + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + last4: Optional[str] + """ + The last four digits of the card. This may not be present for American Express cards. + """ + class Link(StripeObject): country: Optional[str] """ @@ -1376,6 +1424,12 @@ class Multibanco(StripeObject): Reference number associated with this Multibanco payment. """ + class NaverPay(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + class Oxxo(StripeObject): number: Optional[str] """ @@ -1427,6 +1481,12 @@ class P24(StripeObject): Przelewy24 rarely provides this information so the attribute is usually empty. """ + class Payco(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + class Paynow(StripeObject): reference: Optional[str] """ @@ -1487,6 +1547,12 @@ class Promptpay(StripeObject): class RevolutPay(StripeObject): pass + class SamsungPay(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + class SepaCreditTransfer(StripeObject): bank_name: Optional[str] """ @@ -1645,6 +1711,7 @@ class Zip(StripeObject): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + alma: Optional[Alma] amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] @@ -1661,18 +1728,23 @@ class Zip(StripeObject): grabpay: Optional[Grabpay] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] + kakao_pay: Optional[KakaoPay] klarna: Optional[Klarna] konbini: Optional[Konbini] + kr_card: Optional[KrCard] link: Optional[Link] mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] + naver_pay: Optional[NaverPay] oxxo: Optional[Oxxo] p24: Optional[P24] + payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] pix: Optional[Pix] promptpay: Optional[Promptpay] revolut_pay: Optional[RevolutPay] + samsung_pay: Optional[SamsungPay] sepa_credit_transfer: Optional[SepaCreditTransfer] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] @@ -1696,6 +1768,7 @@ class Zip(StripeObject): "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "alma": Alma, "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, @@ -1712,18 +1785,23 @@ class Zip(StripeObject): "grabpay": Grabpay, "ideal": Ideal, "interac_present": InteracPresent, + "kakao_pay": KakaoPay, "klarna": Klarna, "konbini": Konbini, + "kr_card": KrCard, "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, + "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "payco": Payco, "paynow": Paynow, "paypal": Paypal, "pix": Pix, "promptpay": Promptpay, "revolut_pay": RevolutPay, + "samsung_pay": SamsungPay, "sepa_credit_transfer": SepaCreditTransfer, "sepa_debit": SepaDebit, "sofort": Sofort, diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 239f20322..4afa0d288 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -107,6 +107,9 @@ class AfterpayClearpay(StripeObject): class Alipay(StripeObject): pass + class Alma(StripeObject): + pass + class AmazonPay(StripeObject): pass @@ -1026,6 +1029,9 @@ class Networks(StripeObject): """ _inner_class_types = {"networks": Networks} + class KakaoPay(StripeObject): + pass + class Klarna(StripeObject): class Dob(StripeObject): day: Optional[int] @@ -1050,6 +1056,41 @@ class Dob(StripeObject): class Konbini(StripeObject): pass + class KrCard(StripeObject): + brand: Optional[ + Literal[ + "bc", + "citi", + "hana", + "hyundai", + "jeju", + "jeonbuk", + "kakaobank", + "kbank", + "kdbbank", + "kookmin", + "kwangju", + "lotte", + "mg", + "nh", + "post", + "samsung", + "savingsbank", + "shinhan", + "shinhyup", + "suhyup", + "tossbank", + "woori", + ] + ] + """ + The local credit or debit card brand. + """ + last4: Optional[str] + """ + The last four digits of the card. This may not be present for American Express cards. + """ + class Link(StripeObject): email: Optional[str] """ @@ -1066,6 +1107,12 @@ class Mobilepay(StripeObject): class Multibanco(StripeObject): pass + class NaverPay(StripeObject): + funding: Literal["card", "points"] + """ + Whether to fund this transaction with Naver Pay points or a card. + """ + class Oxxo(StripeObject): pass @@ -1104,6 +1151,9 @@ class P24(StripeObject): The customer's bank, if provided. """ + class Payco(StripeObject): + pass + class Paynow(StripeObject): pass @@ -1127,6 +1177,9 @@ class Promptpay(StripeObject): class RevolutPay(StripeObject): pass + class SamsungPay(StripeObject): + pass + class SepaDebit(StripeObject): class GeneratedFrom(StripeObject): charge: Optional[ExpandableField["Charge"]] @@ -1280,6 +1333,7 @@ class Zip(StripeObject): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. """ + alma: Optional[Alma] amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] @@ -1301,18 +1355,23 @@ class Zip(StripeObject): grabpay: Optional[Grabpay] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] + kakao_pay: Optional[KakaoPay] klarna: Optional[Klarna] konbini: Optional[Konbini] + kr_card: Optional[KrCard] link: Optional[Link] mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] + naver_pay: Optional[NaverPay] oxxo: Optional[Oxxo] p24: Optional[P24] + payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] pix: Optional[Pix] promptpay: Optional[Promptpay] revolut_pay: Optional[RevolutPay] + samsung_pay: Optional[SamsungPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] @@ -1322,6 +1381,7 @@ class Zip(StripeObject): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -1338,18 +1398,23 @@ class Zip(StripeObject): "grabpay", "ideal", "interac_present", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -1369,6 +1434,7 @@ class Zip(StripeObject): "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "alma": Alma, "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, @@ -1386,18 +1452,23 @@ class Zip(StripeObject): "grabpay": Grabpay, "ideal": Ideal, "interac_present": InteracPresent, + "kakao_pay": KakaoPay, "klarna": Klarna, "konbini": Konbini, + "kr_card": KrCard, "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, + "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "payco": Payco, "paynow": Paynow, "paypal": Paypal, "pix": Pix, "promptpay": Promptpay, "revolut_pay": RevolutPay, + "samsung_pay": SamsungPay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, @@ -1506,6 +1577,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataAlma" + ] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataAmazonPay" ] @@ -1592,6 +1669,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataKlarna" ] @@ -1604,6 +1687,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataLink" ] @@ -1626,6 +1715,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataOxxo" ] @@ -1636,6 +1731,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataPayco" + ] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataPaynow" ] @@ -1670,6 +1771,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataSepaDebit" ] @@ -1699,6 +1806,7 @@ class CreateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -1712,18 +1820,23 @@ class CreateParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -1775,6 +1888,9 @@ class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class CreateParamsPaymentMethodDataAlipay(TypedDict): pass + class CreateParamsPaymentMethodDataAlma(TypedDict): + pass + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -1960,12 +2076,15 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class CreateParamsPaymentMethodDataInteracPresent(TypedDict): pass + class CreateParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class CreateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataKlarnaDob" @@ -1991,6 +2110,9 @@ class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): class CreateParamsPaymentMethodDataKonbini(TypedDict): pass + class CreateParamsPaymentMethodDataKrCard(TypedDict): + pass + class CreateParamsPaymentMethodDataLink(TypedDict): pass @@ -2000,6 +2122,12 @@ class CreateParamsPaymentMethodDataMobilepay(TypedDict): class CreateParamsPaymentMethodDataMultibanco(TypedDict): pass + class CreateParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2038,6 +2166,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayco(TypedDict): + pass + class CreateParamsPaymentMethodDataPaynow(TypedDict): pass @@ -2059,6 +2190,9 @@ class CreateParamsPaymentMethodDataRadarOptions(TypedDict): class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass + class CreateParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 6e5ae51ff..0d298d755 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -245,7 +245,7 @@ class CreateParams(RequestOptions): class CreateParamsLine(TypedDict): amount: NotRequired[int] """ - The line item amount to credit. Only valid when `type` is `invoice_line_item`. + The line item amount to credit. Only valid when `type` is `invoice_line_item`. If invoice is set up with `automatic_tax[enabled]=true`, this amount is tax exclusive """ description: NotRequired[str] """ @@ -462,7 +462,7 @@ class PreviewLinesParams(RequestOptions): class PreviewLinesParamsLine(TypedDict): amount: NotRequired[int] """ - The line item amount to credit. Only valid when `type` is `invoice_line_item`. + The line item amount to credit. Only valid when `type` is `invoice_line_item`. If invoice is set up with `automatic_tax[enabled]=true`, this amount is tax exclusive """ description: NotRequired[str] """ @@ -587,7 +587,7 @@ class PreviewParams(RequestOptions): class PreviewParamsLine(TypedDict): amount: NotRequired[int] """ - The line item amount to credit. Only valid when `type` is `invoice_line_item`. + The line item amount to credit. Only valid when `type` is `invoice_line_item`. If invoice is set up with `automatic_tax[enabled]=true`, this amount is tax exclusive """ description: NotRequired[str] """ @@ -735,6 +735,9 @@ class VoidCreditNoteParams(RequestOptions): The link to download the PDF of the credit note. """ pretax_credit_amounts: Optional[List[PretaxCreditAmount]] + """ + The pretax credit amounts (ex: discount, credit grants, etc) for all line items. + """ reason: Optional[ Literal[ "duplicate", "fraudulent", "order_change", "product_unsatisfactory" diff --git a/stripe/_credit_note_line_item.py b/stripe/_credit_note_line_item.py index 04505cf83..9b22896f8 100644 --- a/stripe/_credit_note_line_item.py +++ b/stripe/_credit_note_line_item.py @@ -129,6 +129,9 @@ class TaxAmount(StripeObject): String representing the object's type. Objects of the same type share the same value. """ pretax_credit_amounts: Optional[List[PretaxCreditAmount]] + """ + The pretax credit amounts (ex: discount, credit grants, etc) for this line item. + """ quantity: Optional[int] """ The number of units of product being credited. diff --git a/stripe/_credit_note_preview_lines_service.py b/stripe/_credit_note_preview_lines_service.py index 10cc91426..bce76c93a 100644 --- a/stripe/_credit_note_preview_lines_service.py +++ b/stripe/_credit_note_preview_lines_service.py @@ -93,7 +93,7 @@ class ListParams(TypedDict): class ListParamsLine(TypedDict): amount: NotRequired[int] """ - The line item amount to credit. Only valid when `type` is `invoice_line_item`. + The line item amount to credit. Only valid when `type` is `invoice_line_item`. If invoice is set up with `automatic_tax[enabled]=true`, this amount is tax exclusive """ description: NotRequired[str] """ diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index 774b1a8c8..f68cf465d 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -89,7 +89,7 @@ class CreateParams(TypedDict): class CreateParamsLine(TypedDict): amount: NotRequired[int] """ - The line item amount to credit. Only valid when `type` is `invoice_line_item`. + The line item amount to credit. Only valid when `type` is `invoice_line_item`. If invoice is set up with `automatic_tax[enabled]=true`, this amount is tax exclusive """ description: NotRequired[str] """ @@ -264,7 +264,7 @@ class PreviewParams(TypedDict): class PreviewParamsLine(TypedDict): amount: NotRequired[int] """ - The line item amount to credit. Only valid when `type` is `invoice_line_item`. + The line item amount to credit. Only valid when `type` is `invoice_line_item`. If invoice is set up with `automatic_tax[enabled]=true`, this amount is tax exclusive """ description: NotRequired[str] """ diff --git a/stripe/_customer.py b/stripe/_customer.py index 001126339..a4a2b108d 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -382,7 +382,7 @@ class CreateParamsAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -481,7 +481,7 @@ class CreateParamsShippingAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -522,6 +522,7 @@ class CreateParamsTaxIdDatum(TypedDict): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -557,6 +558,8 @@ class CreateParamsTaxIdDatum(TypedDict): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -580,15 +583,18 @@ class CreateParamsTaxIdDatum(TypedDict): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -626,6 +632,7 @@ class CreateTaxIdParams(RequestOptions): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -661,6 +668,8 @@ class CreateTaxIdParams(RequestOptions): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -684,15 +693,18 @@ class CreateTaxIdParams(RequestOptions): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -845,6 +857,7 @@ class ListPaymentMethodsParams(RequestOptions): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -859,18 +872,23 @@ class ListPaymentMethodsParams(RequestOptions): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -1046,7 +1064,7 @@ class ModifyParamsAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -1145,7 +1163,7 @@ class ModifyParamsShippingAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -1169,7 +1187,9 @@ class ModifyParamsTax(TypedDict): """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ - validate_location: NotRequired[Literal["deferred", "immediately"]] + validate_location: NotRequired[ + Literal["auto", "deferred", "immediately"] + ] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. """ diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index e1749bf91..6bc307d5b 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -39,6 +39,7 @@ class ListParams(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -53,18 +54,23 @@ class ListParams(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 100c7c367..9caaa851d 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -142,7 +142,7 @@ class CreateParamsAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -243,7 +243,7 @@ class CreateParamsShippingAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -284,6 +284,7 @@ class CreateParamsTaxIdDatum(TypedDict): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -319,6 +320,8 @@ class CreateParamsTaxIdDatum(TypedDict): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -342,15 +345,18 @@ class CreateParamsTaxIdDatum(TypedDict): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -529,7 +535,7 @@ class UpdateParamsAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -630,7 +636,7 @@ class UpdateParamsShippingAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -654,7 +660,9 @@ class UpdateParamsTax(TypedDict): """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ - validate_location: NotRequired[Literal["deferred", "immediately"]] + validate_location: NotRequired[ + Literal["auto", "deferred", "immediately"] + ] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. """ diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index af1ce221e..6ba3e2efd 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -26,6 +26,7 @@ class CreateParams(TypedDict): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -61,6 +62,8 @@ class CreateParams(TypedDict): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -84,15 +87,18 @@ class CreateParams(TypedDict): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_dispute.py b/stripe/_dispute.py index e75cf056f..22f5c33e1 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -37,6 +37,150 @@ class Dispute( OBJECT_NAME: ClassVar[Literal["dispute"]] = "dispute" class Evidence(StripeObject): + class EnhancedEvidence(StripeObject): + class VisaCompellingEvidence3(StripeObject): + class DisputedTransaction(StripeObject): + class ShippingAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + customer_account_id: Optional[str] + """ + User Account ID used to log into business platform. Must be recognizable by the user. + """ + customer_device_fingerprint: Optional[str] + """ + Unique identifier of the cardholder's device derived from a combination of at least two hardware and software attributes. Must be at least 20 characters. + """ + customer_device_id: Optional[str] + """ + Unique identifier of the cardholder's device such as a device serial number (e.g., International Mobile Equipment Identity [IMEI]). Must be at least 15 characters. + """ + customer_email_address: Optional[str] + """ + The email address of the customer. + """ + customer_purchase_ip: Optional[str] + """ + The IP address that the customer used when making the purchase. + """ + merchandise_or_services: Optional[ + Literal["merchandise", "services"] + ] + """ + Categorization of disputed payment. + """ + product_description: Optional[str] + """ + A description of the product or service that was sold. + """ + shipping_address: Optional[ShippingAddress] + """ + The address to which a physical product was shipped. All fields are required for Visa Compelling Evidence 3.0 evidence submission. + """ + _inner_class_types = {"shipping_address": ShippingAddress} + + class PriorUndisputedTransaction(StripeObject): + class ShippingAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + charge: str + """ + Stripe charge ID for the Visa Compelling Evidence 3.0 eligible prior charge. + """ + customer_account_id: Optional[str] + """ + User Account ID used to log into business platform. Must be recognizable by the user. + """ + customer_device_fingerprint: Optional[str] + """ + Unique identifier of the cardholder's device derived from a combination of at least two hardware and software attributes. Must be at least 20 characters. + """ + customer_device_id: Optional[str] + """ + Unique identifier of the cardholder's device such as a device serial number (e.g., International Mobile Equipment Identity [IMEI]). Must be at least 15 characters. + """ + customer_email_address: Optional[str] + """ + The email address of the customer. + """ + customer_purchase_ip: Optional[str] + """ + The IP address that the customer used when making the purchase. + """ + product_description: Optional[str] + """ + A description of the product or service that was sold. + """ + shipping_address: Optional[ShippingAddress] + """ + The address to which a physical product was shipped. All fields are required for Visa Compelling Evidence 3.0 evidence submission. + """ + _inner_class_types = {"shipping_address": ShippingAddress} + + disputed_transaction: Optional[DisputedTransaction] + """ + Disputed transaction details for Visa Compelling Evidence 3.0 evidence submission. + """ + prior_undisputed_transactions: List[PriorUndisputedTransaction] + """ + List of exactly two prior undisputed transaction objects for Visa Compelling Evidence 3.0 evidence submission. + """ + _inner_class_types = { + "disputed_transaction": DisputedTransaction, + "prior_undisputed_transactions": PriorUndisputedTransaction, + } + + visa_compelling_evidence_3: Optional[VisaCompellingEvidence3] + _inner_class_types = { + "visa_compelling_evidence_3": VisaCompellingEvidence3, + } + access_activity_log: Optional[str] """ Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. @@ -89,6 +233,7 @@ class Evidence(StripeObject): """ The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. """ + enhanced_evidence: EnhancedEvidence product_description: Optional[str] """ A description of the product or service that was sold. @@ -145,12 +290,40 @@ class Evidence(StripeObject): """ Any additional evidence or statements. """ + _inner_class_types = {"enhanced_evidence": EnhancedEvidence} class EvidenceDetails(StripeObject): + class EnhancedEligibility(StripeObject): + class VisaCompellingEvidence3(StripeObject): + required_actions: List[ + Literal[ + "missing_customer_identifiers", + "missing_disputed_transaction_description", + "missing_merchandise_or_services", + "missing_prior_undisputed_transaction_description", + "missing_prior_undisputed_transactions", + ] + ] + """ + List of actions required to qualify dispute for Visa Compelling Evidence 3.0 evidence submission. + """ + status: Literal[ + "not_qualified", "qualified", "requires_action" + ] + """ + Visa Compelling Evidence 3.0 eligibility status. + """ + + visa_compelling_evidence_3: Optional[VisaCompellingEvidence3] + _inner_class_types = { + "visa_compelling_evidence_3": VisaCompellingEvidence3, + } + due_by: Optional[int] """ Date by which evidence must be submitted in order to successfully challenge dispute. Will be 0 if the customer's bank or credit card company doesn't allow a response for this particular dispute. """ + enhanced_eligibility: EnhancedEligibility has_evidence: bool """ Whether evidence has been staged for this dispute. @@ -163,6 +336,7 @@ class EvidenceDetails(StripeObject): """ The number of times evidence has been submitted. Typically, you may only submit evidence once. """ + _inner_class_types = {"enhanced_eligibility": EnhancedEligibility} class PaymentMethodDetails(StripeObject): class AmazonPay(StripeObject): @@ -341,6 +515,12 @@ class ModifyParamsEvidence(TypedDict): """ The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. """ + enhanced_evidence: NotRequired[ + "Literal['']|Dispute.ModifyParamsEvidenceEnhancedEvidence" + ] + """ + Additional evidence for qualifying evidence programs. + """ product_description: NotRequired[str] """ A description of the product or service that was sold. Has a maximum character count of 20,000. @@ -398,6 +578,166 @@ class ModifyParamsEvidence(TypedDict): Any additional evidence or statements. Has a maximum character count of 20,000. """ + class ModifyParamsEvidenceEnhancedEvidence(TypedDict): + visa_compelling_evidence_3: NotRequired[ + "Dispute.ModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3" + ] + """ + Evidence provided for Visa Compelling Evidence 3.0 evidence submission. + """ + + class ModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3( + TypedDict, + ): + disputed_transaction: NotRequired[ + "Dispute.ModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransaction" + ] + """ + Disputed transaction details for Visa Compelling Evidence 3.0 evidence submission. + """ + prior_undisputed_transactions: NotRequired[ + List[ + "Dispute.ModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransaction" + ] + ] + """ + List of exactly two prior undisputed transaction objects for Visa Compelling Evidence 3.0 evidence submission. + """ + + class ModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransaction( + TypedDict, + ): + customer_account_id: NotRequired["Literal['']|str"] + """ + User Account ID used to log into business platform. Must be recognizable by the user. + """ + customer_device_fingerprint: NotRequired["Literal['']|str"] + """ + Unique identifier of the cardholder's device derived from a combination of at least two hardware and software attributes. Must be at least 20 characters. + """ + customer_device_id: NotRequired["Literal['']|str"] + """ + Unique identifier of the cardholder's device such as a device serial number (e.g., International Mobile Equipment Identity [IMEI]). Must be at least 15 characters. + """ + customer_email_address: NotRequired["Literal['']|str"] + """ + The email address of the customer. + """ + customer_purchase_ip: NotRequired["Literal['']|str"] + """ + The IP address that the customer used when making the purchase. + """ + merchandise_or_services: NotRequired[ + Literal["merchandise", "services"] + ] + """ + Categorization of disputed payment. + """ + product_description: NotRequired["Literal['']|str"] + """ + A description of the product or service that was sold. + """ + shipping_address: NotRequired[ + "Dispute.ModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionShippingAddress" + ] + """ + The address to which a physical product was shipped. All fields are required for Visa Compelling Evidence 3.0 evidence submission. + """ + + class ModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionShippingAddress( + TypedDict, + ): + city: NotRequired["Literal['']|str"] + """ + City, district, suburb, town, or village. + """ + country: NotRequired["Literal['']|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 (e.g., street, PO Box, or company name). + """ + line2: NotRequired["Literal['']|str"] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired["Literal['']|str"] + """ + ZIP or postal code. + """ + state: NotRequired["Literal['']|str"] + """ + State, county, province, or region. + """ + + class ModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransaction( + TypedDict, + ): + charge: str + """ + Stripe charge ID for the Visa Compelling Evidence 3.0 eligible prior charge. + """ + customer_account_id: NotRequired["Literal['']|str"] + """ + User Account ID used to log into business platform. Must be recognizable by the user. + """ + customer_device_fingerprint: NotRequired["Literal['']|str"] + """ + Unique identifier of the cardholder's device derived from a combination of at least two hardware and software attributes. Must be at least 20 characters. + """ + customer_device_id: NotRequired["Literal['']|str"] + """ + Unique identifier of the cardholder's device such as a device serial number (e.g., International Mobile Equipment Identity [IMEI]). Must be at least 15 characters. + """ + customer_email_address: NotRequired["Literal['']|str"] + """ + The email address of the customer. + """ + customer_purchase_ip: NotRequired["Literal['']|str"] + """ + The IP address that the customer used when making the purchase. + """ + product_description: NotRequired["Literal['']|str"] + """ + A description of the product or service that was sold. + """ + shipping_address: NotRequired[ + "Dispute.ModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransactionShippingAddress" + ] + """ + The address to which a physical product was shipped. All fields are required for Visa Compelling Evidence 3.0 evidence submission. + """ + + class ModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransactionShippingAddress( + TypedDict, + ): + city: NotRequired["Literal['']|str"] + """ + City, district, suburb, town, or village. + """ + country: NotRequired["Literal['']|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 (e.g., street, PO Box, or company name). + """ + line2: NotRequired["Literal['']|str"] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired["Literal['']|str"] + """ + ZIP or postal code. + """ + state: NotRequired["Literal['']|str"] + """ + State, county, province, or region. + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -424,6 +764,10 @@ class RetrieveParams(RequestOptions): """ 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). """ + enhanced_eligibility_types: List[Literal["visa_compelling_evidence_3"]] + """ + List of eligibility types that are included in `enhanced_evidence`. + """ evidence: Evidence evidence_details: EvidenceDetails id: str diff --git a/stripe/_dispute_service.py b/stripe/_dispute_service.py index e55049146..97c4f7897 100644 --- a/stripe/_dispute_service.py +++ b/stripe/_dispute_service.py @@ -141,6 +141,12 @@ class UpdateParamsEvidence(TypedDict): """ The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. """ + enhanced_evidence: NotRequired[ + "Literal['']|DisputeService.UpdateParamsEvidenceEnhancedEvidence" + ] + """ + Additional evidence for qualifying evidence programs. + """ product_description: NotRequired[str] """ A description of the product or service that was sold. Has a maximum character count of 20,000. @@ -198,6 +204,166 @@ class UpdateParamsEvidence(TypedDict): Any additional evidence or statements. Has a maximum character count of 20,000. """ + class UpdateParamsEvidenceEnhancedEvidence(TypedDict): + visa_compelling_evidence_3: NotRequired[ + "DisputeService.UpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3" + ] + """ + Evidence provided for Visa Compelling Evidence 3.0 evidence submission. + """ + + class UpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3( + TypedDict, + ): + disputed_transaction: NotRequired[ + "DisputeService.UpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransaction" + ] + """ + Disputed transaction details for Visa Compelling Evidence 3.0 evidence submission. + """ + prior_undisputed_transactions: NotRequired[ + List[ + "DisputeService.UpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransaction" + ] + ] + """ + List of exactly two prior undisputed transaction objects for Visa Compelling Evidence 3.0 evidence submission. + """ + + class UpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransaction( + TypedDict, + ): + customer_account_id: NotRequired["Literal['']|str"] + """ + User Account ID used to log into business platform. Must be recognizable by the user. + """ + customer_device_fingerprint: NotRequired["Literal['']|str"] + """ + Unique identifier of the cardholder's device derived from a combination of at least two hardware and software attributes. Must be at least 20 characters. + """ + customer_device_id: NotRequired["Literal['']|str"] + """ + Unique identifier of the cardholder's device such as a device serial number (e.g., International Mobile Equipment Identity [IMEI]). Must be at least 15 characters. + """ + customer_email_address: NotRequired["Literal['']|str"] + """ + The email address of the customer. + """ + customer_purchase_ip: NotRequired["Literal['']|str"] + """ + The IP address that the customer used when making the purchase. + """ + merchandise_or_services: NotRequired[ + Literal["merchandise", "services"] + ] + """ + Categorization of disputed payment. + """ + product_description: NotRequired["Literal['']|str"] + """ + A description of the product or service that was sold. + """ + shipping_address: NotRequired[ + "DisputeService.UpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionShippingAddress" + ] + """ + The address to which a physical product was shipped. All fields are required for Visa Compelling Evidence 3.0 evidence submission. + """ + + class UpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionShippingAddress( + TypedDict, + ): + city: NotRequired["Literal['']|str"] + """ + City, district, suburb, town, or village. + """ + country: NotRequired["Literal['']|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 (e.g., street, PO Box, or company name). + """ + line2: NotRequired["Literal['']|str"] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired["Literal['']|str"] + """ + ZIP or postal code. + """ + state: NotRequired["Literal['']|str"] + """ + State, county, province, or region. + """ + + class UpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransaction( + TypedDict, + ): + charge: str + """ + Stripe charge ID for the Visa Compelling Evidence 3.0 eligible prior charge. + """ + customer_account_id: NotRequired["Literal['']|str"] + """ + User Account ID used to log into business platform. Must be recognizable by the user. + """ + customer_device_fingerprint: NotRequired["Literal['']|str"] + """ + Unique identifier of the cardholder's device derived from a combination of at least two hardware and software attributes. Must be at least 20 characters. + """ + customer_device_id: NotRequired["Literal['']|str"] + """ + Unique identifier of the cardholder's device such as a device serial number (e.g., International Mobile Equipment Identity [IMEI]). Must be at least 15 characters. + """ + customer_email_address: NotRequired["Literal['']|str"] + """ + The email address of the customer. + """ + customer_purchase_ip: NotRequired["Literal['']|str"] + """ + The IP address that the customer used when making the purchase. + """ + product_description: NotRequired["Literal['']|str"] + """ + A description of the product or service that was sold. + """ + shipping_address: NotRequired[ + "DisputeService.UpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransactionShippingAddress" + ] + """ + The address to which a physical product was shipped. All fields are required for Visa Compelling Evidence 3.0 evidence submission. + """ + + class UpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransactionShippingAddress( + TypedDict, + ): + city: NotRequired["Literal['']|str"] + """ + City, district, suburb, town, or village. + """ + country: NotRequired["Literal['']|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 (e.g., street, PO Box, or company name). + """ + line2: NotRequired["Literal['']|str"] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired["Literal['']|str"] + """ + ZIP or postal code. + """ + state: NotRequired["Literal['']|str"] + """ + State, county, province, or region. + """ + def list( self, params: "DisputeService.ListParams" = {}, diff --git a/stripe/_event.py b/stripe/_event.py index a54c62909..1b9ed4c48 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -276,6 +276,7 @@ class RetrieveParams(RequestOptions): "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", @@ -319,6 +320,7 @@ class RetrieveParams(RequestOptions): "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", + "refund.failed", "refund.updated", "reporting.report_run.failed", "reporting.report_run.succeeded", diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 3c2bd5886..8d7d66e0a 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -221,6 +221,7 @@ class CustomerTaxId(StripeObject): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -256,6 +257,8 @@ class CustomerTaxId(StripeObject): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -279,16 +282,19 @@ class CustomerTaxId(StripeObject): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "unknown", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` """ value: Optional[str] """ @@ -758,10 +764,15 @@ class Filters(StripeObject): "giropay", "grabpay", "ideal", + "jp_credit_transfer", + "kakao_pay", "konbini", + "kr_card", "link", "multibanco", + "naver_pay", "p24", + "payco", "paynow", "paypal", "promptpay", @@ -1238,6 +1249,7 @@ class AddLinesParamsLineTaxAmountTaxRateData(TypedDict): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", @@ -1264,6 +1276,10 @@ class CreateParams(RequestOptions): """ Settings for automatic tax lookup for this invoice. """ + automatically_finalizes_at: NotRequired[int] + """ + The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state. + """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] @@ -1457,7 +1473,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -2045,7 +2061,7 @@ class CreatePreviewParamsCustomerDetailsShippingAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -2082,6 +2098,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -2117,6 +2134,8 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -2140,15 +2159,18 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -2984,6 +3006,10 @@ class ModifyParams(RequestOptions): """ Settings for automatic tax lookup for this invoice. """ + automatically_finalizes_at: NotRequired[int] + """ + The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state. To turn off automatic finalization, set `auto_advance` to false. + """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] @@ -3151,7 +3177,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -3891,7 +3917,7 @@ class UpcomingLinesParamsCustomerDetailsShippingAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -3928,6 +3954,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -3963,6 +3990,8 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -3986,15 +4015,18 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -5026,7 +5058,7 @@ class UpcomingParamsCustomerDetailsShippingAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -5063,6 +5095,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -5098,6 +5131,8 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -5121,15 +5156,18 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -6124,6 +6162,7 @@ class UpdateLinesParamsLineTaxAmountTaxRateData(TypedDict): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", @@ -6469,6 +6508,9 @@ class VoidInvoiceParams(RequestOptions): The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. """ total_pretax_credit_amounts: Optional[List[TotalPretaxCreditAmount]] + """ + Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items. + """ total_tax_amounts: List[TotalTaxAmount] """ The aggregate amounts calculated per tax rate for all line items. diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 827490207..f7a943ad8 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -319,6 +319,7 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", @@ -386,6 +387,9 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): The plan of the subscription, if the line item is a subscription or a proration. """ pretax_credit_amounts: Optional[List[PretaxCreditAmount]] + """ + Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item. + """ price: Optional["Price"] """ The price of the line item. diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index 3130ebda8..62dade07b 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -216,6 +216,7 @@ class UpdateParamsTaxAmountTaxRateData(TypedDict): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 016c3c1bb..0e17cf433 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -218,6 +218,7 @@ class AddLinesParamsLineTaxAmountTaxRateData(TypedDict): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", @@ -244,6 +245,10 @@ class CreateParams(TypedDict): """ Settings for automatic tax lookup for this invoice. """ + automatically_finalizes_at: NotRequired[int] + """ + The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state. + """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] @@ -443,7 +448,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -1037,7 +1042,7 @@ class CreatePreviewParamsCustomerDetailsShippingAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -1074,6 +1079,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -1109,6 +1115,8 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -1132,15 +1140,18 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -2256,7 +2267,7 @@ class UpcomingParamsCustomerDetailsShippingAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -2293,6 +2304,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -2328,6 +2340,8 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -2351,15 +2365,18 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -3362,6 +3379,7 @@ class UpdateLinesParamsLineTaxAmountTaxRateData(TypedDict): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", @@ -3388,6 +3406,10 @@ class UpdateParams(TypedDict): """ Settings for automatic tax lookup for this invoice. """ + automatically_finalizes_at: NotRequired[int] + """ + The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state. To turn off automatic finalization, set `auto_advance` to false. + """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] @@ -3559,7 +3581,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index 12e58adf8..745aa73b2 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -250,7 +250,7 @@ class ListParamsCustomerDetailsShippingAddress(TypedDict): """ country: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ @@ -287,6 +287,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -322,6 +323,8 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -345,15 +348,18 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_mandate.py b/stripe/_mandate.py index e93bf7b68..a4bebee61 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -109,6 +109,12 @@ class Card(StripeObject): class Cashapp(StripeObject): pass + class KakaoPay(StripeObject): + pass + + class KrCard(StripeObject): + pass + class Link(StripeObject): pass @@ -147,6 +153,8 @@ class UsBankAccount(StripeObject): bacs_debit: Optional[BacsDebit] card: Optional[Card] cashapp: Optional[Cashapp] + kakao_pay: Optional[KakaoPay] + kr_card: Optional[KrCard] link: Optional[Link] paypal: Optional[Paypal] revolut_pay: Optional[RevolutPay] @@ -163,6 +171,8 @@ class UsBankAccount(StripeObject): "bacs_debit": BacsDebit, "card": Card, "cashapp": Cashapp, + "kakao_pay": KakaoPay, + "kr_card": KrCard, "link": Link, "paypal": Paypal, "revolut_pay": RevolutPay, diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index cbb749a12..fe1b3d96f 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -154,5 +154,6 @@ stripe.v2.billing.MeterEventAdjustment.OBJECT_NAME: stripe.v2.billing.MeterEventAdjustment, stripe.v2.billing.MeterEventSession.OBJECT_NAME: stripe.v2.billing.MeterEventSession, stripe.v2.Event.OBJECT_NAME: stripe.v2.Event, + stripe.v2.EventDestination.OBJECT_NAME: stripe.v2.EventDestination, # V2 Object classes: The end of the section generated from our OpenAPI spec } diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 974f9e729..482373185 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1055,6 +1055,12 @@ class Alipay(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class Alma(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class AmazonPay(StripeObject): capture_method: Optional[Literal["manual"]] """ @@ -1484,6 +1490,22 @@ class Ideal(StripeObject): class InteracPresent(StripeObject): pass + class KakaoPay(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: Optional[Literal["none", "off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class Klarna(StripeObject): capture_method: Optional[Literal["manual"]] """ @@ -1532,6 +1554,22 @@ class Konbini(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class KrCard(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: Optional[Literal["none", "off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class Link(StripeObject): capture_method: Optional[Literal["manual"]] """ @@ -1580,6 +1618,12 @@ class Multibanco(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class NaverPay(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class Oxxo(StripeObject): expires_after_days: int """ @@ -1608,6 +1652,12 @@ class P24(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class Payco(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class Paynow(StripeObject): setup_future_usage: Optional[Literal["none"]] """ @@ -1692,6 +1742,12 @@ class RevolutPay(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class SamsungPay(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class SepaDebit(StripeObject): class MandateOptions(StripeObject): pass @@ -1866,6 +1922,7 @@ class Zip(StripeObject): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + alma: Optional[Alma] amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] @@ -1882,18 +1939,23 @@ class Zip(StripeObject): grabpay: Optional[Grabpay] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] + kakao_pay: Optional[KakaoPay] klarna: Optional[Klarna] konbini: Optional[Konbini] + kr_card: Optional[KrCard] link: Optional[Link] mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] + naver_pay: Optional[NaverPay] oxxo: Optional[Oxxo] p24: Optional[P24] + payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] pix: Optional[Pix] promptpay: Optional[Promptpay] revolut_pay: Optional[RevolutPay] + samsung_pay: Optional[SamsungPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] @@ -1906,6 +1968,7 @@ class Zip(StripeObject): "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "alma": Alma, "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, @@ -1922,18 +1985,23 @@ class Zip(StripeObject): "grabpay": Grabpay, "ideal": Ideal, "interac_present": InteracPresent, + "kakao_pay": KakaoPay, "klarna": Klarna, "konbini": Konbini, + "kr_card": KrCard, "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, + "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "payco": Payco, "paynow": Paynow, "paypal": Paypal, "pix": Pix, "promptpay": Promptpay, "revolut_pay": RevolutPay, + "samsung_pay": SamsungPay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, @@ -2028,11 +2096,9 @@ class TransferData(StripeObject): class ApplyCustomerBalanceParams(RequestOptions): amount: NotRequired[int] """ - Amount that you intend to apply to this PaymentIntent from the customer's cash balance. - - A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (for example, 100 cents to charge 1 USD or 100 to charge 100 JPY, a zero-decimal currency). + Amount that you intend to apply to this PaymentIntent from the customer's cash balance. If the PaymentIntent was created by an Invoice, the full amount of the PaymentIntent is applied regardless of this parameter. - The maximum amount is the amount of the PaymentIntent. + A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (for example, 100 cents to charge 1 USD or 100 to charge 100 JPY, a zero-decimal currency). The maximum amount is the amount of the PaymentIntent. When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent. """ @@ -2269,6 +2335,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataAlma"] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataAmazonPay" ] @@ -2351,6 +2421,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataKlarna" ] @@ -2363,6 +2439,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. @@ -2383,6 +2465,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -2391,6 +2479,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataPayco"] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataPaynow" ] @@ -2425,6 +2517,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataSepaDebit" ] @@ -2450,6 +2548,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -2463,18 +2562,23 @@ class ConfirmParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -2526,6 +2630,9 @@ class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): class ConfirmParamsPaymentMethodDataAlipay(TypedDict): pass + class ConfirmParamsPaymentMethodDataAlma(TypedDict): + pass + class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -2711,12 +2818,15 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class ConfirmParamsPaymentMethodDataInteracPresent(TypedDict): pass + class ConfirmParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataKlarnaDob" @@ -2742,6 +2852,9 @@ class ConfirmParamsPaymentMethodDataKlarnaDob(TypedDict): class ConfirmParamsPaymentMethodDataKonbini(TypedDict): pass + class ConfirmParamsPaymentMethodDataKrCard(TypedDict): + pass + class ConfirmParamsPaymentMethodDataLink(TypedDict): pass @@ -2751,6 +2864,12 @@ class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): pass + class ConfirmParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2789,6 +2908,9 @@ class ConfirmParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ConfirmParamsPaymentMethodDataPayco(TypedDict): + pass + class ConfirmParamsPaymentMethodDataPaynow(TypedDict): pass @@ -2810,6 +2932,9 @@ class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): pass + class ConfirmParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -2881,6 +3006,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ + alma: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAlma" + ] + """ + If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. + """ amazon_pay: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAmazonPay" ] @@ -2977,6 +3108,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ + kakao_pay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. + """ klarna: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarna" ] @@ -2989,6 +3126,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ + kr_card: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. + """ link: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsLink" ] @@ -3007,6 +3150,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ + naver_pay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsOxxo" ] @@ -3019,6 +3168,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + payco: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPayco" + ] + """ + If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. + """ paynow: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPaynow" ] @@ -3049,6 +3204,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ + samsung_pay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. + """ sepa_debit: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebit" ] @@ -3211,6 +3372,16 @@ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsAlma(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -3783,6 +3954,28 @@ class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): pass + class ConfirmParamsPaymentMethodOptionsKakaoPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -3888,6 +4081,28 @@ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsKrCard(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class ConfirmParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -3952,6 +4167,16 @@ class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsNaverPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -3988,6 +4213,16 @@ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class ConfirmParamsPaymentMethodOptionsPayco(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -4116,6 +4351,16 @@ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class ConfirmParamsPaymentMethodOptionsSamsungPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions" @@ -4630,6 +4875,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataAlma"] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataAmazonPay" ] @@ -4712,6 +4961,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataKlarna" ] @@ -4724,6 +4979,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. @@ -4744,6 +5005,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -4752,6 +5019,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataPayco"] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataPaynow" ] @@ -4786,6 +5057,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataSepaDebit" ] @@ -4811,6 +5088,7 @@ class CreateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -4824,18 +5102,23 @@ class CreateParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -4887,6 +5170,9 @@ class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class CreateParamsPaymentMethodDataAlipay(TypedDict): pass + class CreateParamsPaymentMethodDataAlma(TypedDict): + pass + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -5072,12 +5358,15 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class CreateParamsPaymentMethodDataInteracPresent(TypedDict): pass + class CreateParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class CreateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataKlarnaDob" @@ -5103,6 +5392,9 @@ class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): class CreateParamsPaymentMethodDataKonbini(TypedDict): pass + class CreateParamsPaymentMethodDataKrCard(TypedDict): + pass + class CreateParamsPaymentMethodDataLink(TypedDict): pass @@ -5112,6 +5404,12 @@ class CreateParamsPaymentMethodDataMobilepay(TypedDict): class CreateParamsPaymentMethodDataMultibanco(TypedDict): pass + class CreateParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -5150,6 +5448,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayco(TypedDict): + pass + class CreateParamsPaymentMethodDataPaynow(TypedDict): pass @@ -5171,6 +5472,9 @@ class CreateParamsPaymentMethodDataRadarOptions(TypedDict): class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass + class CreateParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -5242,6 +5546,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ + alma: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAlma" + ] + """ + If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. + """ amazon_pay: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAmazonPay" ] @@ -5338,6 +5648,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ + kakao_pay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. + """ klarna: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKlarna" ] @@ -5350,6 +5666,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ + kr_card: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. + """ link: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsLink" ] @@ -5368,6 +5690,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ + naver_pay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsOxxo" ] @@ -5380,6 +5708,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + payco: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPayco" + ] + """ + If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. + """ paynow: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPaynow" ] @@ -5410,6 +5744,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ + samsung_pay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. + """ sepa_debit: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebit" ] @@ -5572,6 +5912,16 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsAlma(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -6144,6 +6494,28 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): pass + class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -6249,6 +6621,28 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsKrCard(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -6313,6 +6707,16 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -6349,6 +6753,16 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayco(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class CreateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -6477,6 +6891,16 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsSamsungPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions" @@ -6985,6 +7409,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataAlma"] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataAmazonPay" ] @@ -7067,6 +7495,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataKlarna" ] @@ -7079,6 +7513,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. @@ -7099,6 +7539,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -7107,6 +7553,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataPayco"] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataPaynow" ] @@ -7141,6 +7591,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataSepaDebit" ] @@ -7166,6 +7622,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -7179,18 +7636,23 @@ class ModifyParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -7242,6 +7704,9 @@ class ModifyParamsPaymentMethodDataAfterpayClearpay(TypedDict): class ModifyParamsPaymentMethodDataAlipay(TypedDict): pass + class ModifyParamsPaymentMethodDataAlma(TypedDict): + pass + class ModifyParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -7427,12 +7892,15 @@ class ModifyParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class ModifyParamsPaymentMethodDataInteracPresent(TypedDict): pass + class ModifyParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class ModifyParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataKlarnaDob" @@ -7458,6 +7926,9 @@ class ModifyParamsPaymentMethodDataKlarnaDob(TypedDict): class ModifyParamsPaymentMethodDataKonbini(TypedDict): pass + class ModifyParamsPaymentMethodDataKrCard(TypedDict): + pass + class ModifyParamsPaymentMethodDataLink(TypedDict): pass @@ -7467,6 +7938,12 @@ class ModifyParamsPaymentMethodDataMobilepay(TypedDict): class ModifyParamsPaymentMethodDataMultibanco(TypedDict): pass + class ModifyParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class ModifyParamsPaymentMethodDataOxxo(TypedDict): pass @@ -7505,6 +7982,9 @@ class ModifyParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ModifyParamsPaymentMethodDataPayco(TypedDict): + pass + class ModifyParamsPaymentMethodDataPaynow(TypedDict): pass @@ -7526,6 +8006,9 @@ class ModifyParamsPaymentMethodDataRadarOptions(TypedDict): class ModifyParamsPaymentMethodDataRevolutPay(TypedDict): pass + class ModifyParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class ModifyParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -7597,6 +8080,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ + alma: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsAlma" + ] + """ + If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. + """ amazon_pay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsAmazonPay" ] @@ -7693,6 +8182,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ + kakao_pay: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. + """ klarna: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsKlarna" ] @@ -7705,6 +8200,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ + kr_card: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. + """ link: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsLink" ] @@ -7723,6 +8224,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ + naver_pay: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsOxxo" ] @@ -7735,6 +8242,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + payco: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsPayco" + ] + """ + If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. + """ paynow: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsPaynow" ] @@ -7765,6 +8278,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ + samsung_pay: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. + """ sepa_debit: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsSepaDebit" ] @@ -7927,6 +8446,16 @@ class ModifyParamsPaymentMethodOptionsAlipay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsAlma(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -8499,6 +9028,28 @@ class ModifyParamsPaymentMethodOptionsIdeal(TypedDict): class ModifyParamsPaymentMethodOptionsInteracPresent(TypedDict): pass + class ModifyParamsPaymentMethodOptionsKakaoPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -8604,6 +9155,28 @@ class ModifyParamsPaymentMethodOptionsKonbini(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsKrCard(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class ModifyParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -8668,6 +9241,16 @@ class ModifyParamsPaymentMethodOptionsMultibanco(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsNaverPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ModifyParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -8704,6 +9287,16 @@ class ModifyParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class ModifyParamsPaymentMethodOptionsPayco(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ModifyParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -8832,6 +9425,16 @@ class ModifyParamsPaymentMethodOptionsRevolutPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class ModifyParamsPaymentMethodOptionsSamsungPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ModifyParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions" diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 9be12ae19..8fa22ca1b 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -14,11 +14,9 @@ class PaymentIntentService(StripeService): class ApplyCustomerBalanceParams(TypedDict): amount: NotRequired[int] """ - Amount that you intend to apply to this PaymentIntent from the customer's cash balance. + Amount that you intend to apply to this PaymentIntent from the customer's cash balance. If the PaymentIntent was created by an Invoice, the full amount of the PaymentIntent is applied regardless of this parameter. - A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (for example, 100 cents to charge 1 USD or 100 to charge 100 JPY, a zero-decimal currency). - - The maximum amount is the amount of the PaymentIntent. + A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (for example, 100 cents to charge 1 USD or 100 to charge 100 JPY, a zero-decimal currency). The maximum amount is the amount of the PaymentIntent. When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent. """ @@ -259,6 +257,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataAlma" + ] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataAmazonPay" ] @@ -349,6 +353,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataKlarna" ] @@ -361,6 +371,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataLink" ] @@ -383,6 +399,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataOxxo" ] @@ -395,6 +417,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataPayco" + ] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataPaynow" ] @@ -431,6 +459,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataSepaDebit" ] @@ -460,6 +494,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -473,18 +508,23 @@ class ConfirmParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -538,6 +578,9 @@ class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): class ConfirmParamsPaymentMethodDataAlipay(TypedDict): pass + class ConfirmParamsPaymentMethodDataAlma(TypedDict): + pass + class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -723,12 +766,15 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class ConfirmParamsPaymentMethodDataInteracPresent(TypedDict): pass + class ConfirmParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataKlarnaDob" @@ -754,6 +800,9 @@ class ConfirmParamsPaymentMethodDataKlarnaDob(TypedDict): class ConfirmParamsPaymentMethodDataKonbini(TypedDict): pass + class ConfirmParamsPaymentMethodDataKrCard(TypedDict): + pass + class ConfirmParamsPaymentMethodDataLink(TypedDict): pass @@ -763,6 +812,12 @@ class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): pass + class ConfirmParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -801,6 +856,9 @@ class ConfirmParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ConfirmParamsPaymentMethodDataPayco(TypedDict): + pass + class ConfirmParamsPaymentMethodDataPaynow(TypedDict): pass @@ -822,6 +880,9 @@ class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): pass + class ConfirmParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -893,6 +954,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ + alma: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAlma" + ] + """ + If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. + """ amazon_pay: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAmazonPay" ] @@ -989,6 +1056,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ + kakao_pay: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. + """ klarna: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKlarna" ] @@ -1001,6 +1074,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ + kr_card: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. + """ link: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsLink" ] @@ -1019,6 +1098,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ + naver_pay: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsOxxo" ] @@ -1031,6 +1116,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + payco: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPayco" + ] + """ + If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. + """ paynow: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPaynow" ] @@ -1061,6 +1152,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ + samsung_pay: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. + """ sepa_debit: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSepaDebit" ] @@ -1223,6 +1320,16 @@ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsAlma(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -1795,6 +1902,28 @@ class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): pass + class ConfirmParamsPaymentMethodOptionsKakaoPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -1900,6 +2029,28 @@ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsKrCard(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class ConfirmParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -1964,6 +2115,16 @@ class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsNaverPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -2000,6 +2161,16 @@ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class ConfirmParamsPaymentMethodOptionsPayco(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -2128,6 +2299,16 @@ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class ConfirmParamsPaymentMethodOptionsSamsungPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions" @@ -2646,6 +2827,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataAlma" + ] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataAmazonPay" ] @@ -2736,6 +2923,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataKlarna" ] @@ -2748,6 +2941,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataLink" ] @@ -2770,6 +2969,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataOxxo" ] @@ -2782,6 +2987,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataPayco" + ] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataPaynow" ] @@ -2818,6 +3029,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataSepaDebit" ] @@ -2847,6 +3064,7 @@ class CreateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -2860,18 +3078,23 @@ class CreateParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -2925,6 +3148,9 @@ class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class CreateParamsPaymentMethodDataAlipay(TypedDict): pass + class CreateParamsPaymentMethodDataAlma(TypedDict): + pass + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -3110,12 +3336,15 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class CreateParamsPaymentMethodDataInteracPresent(TypedDict): pass + class CreateParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class CreateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataKlarnaDob" @@ -3141,6 +3370,9 @@ class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): class CreateParamsPaymentMethodDataKonbini(TypedDict): pass + class CreateParamsPaymentMethodDataKrCard(TypedDict): + pass + class CreateParamsPaymentMethodDataLink(TypedDict): pass @@ -3150,6 +3382,12 @@ class CreateParamsPaymentMethodDataMobilepay(TypedDict): class CreateParamsPaymentMethodDataMultibanco(TypedDict): pass + class CreateParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -3188,6 +3426,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayco(TypedDict): + pass + class CreateParamsPaymentMethodDataPaynow(TypedDict): pass @@ -3209,6 +3450,9 @@ class CreateParamsPaymentMethodDataRadarOptions(TypedDict): class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass + class CreateParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -3280,6 +3524,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ + alma: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAlma" + ] + """ + If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. + """ amazon_pay: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAmazonPay" ] @@ -3376,6 +3626,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ + kakao_pay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. + """ klarna: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKlarna" ] @@ -3388,6 +3644,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ + kr_card: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. + """ link: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsLink" ] @@ -3406,6 +3668,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ + naver_pay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsOxxo" ] @@ -3418,6 +3686,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + payco: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPayco" + ] + """ + If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. + """ paynow: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPaynow" ] @@ -3448,6 +3722,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ + samsung_pay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. + """ sepa_debit: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSepaDebit" ] @@ -3610,6 +3890,16 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsAlma(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -4182,6 +4472,28 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): pass + class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -4287,6 +4599,28 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsKrCard(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -4351,6 +4685,16 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -4387,6 +4731,16 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayco(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class CreateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -4515,6 +4869,16 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsSamsungPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions" @@ -5055,6 +5419,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataAlma" + ] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataAmazonPay" ] @@ -5145,6 +5515,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataKlarna" ] @@ -5157,6 +5533,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataLink" ] @@ -5179,6 +5561,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataOxxo" ] @@ -5191,6 +5579,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataPayco" + ] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataPaynow" ] @@ -5227,6 +5621,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataSepaDebit" ] @@ -5256,6 +5656,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -5269,18 +5670,23 @@ class UpdateParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -5334,6 +5740,9 @@ class UpdateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class UpdateParamsPaymentMethodDataAlipay(TypedDict): pass + class UpdateParamsPaymentMethodDataAlma(TypedDict): + pass + class UpdateParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -5519,12 +5928,15 @@ class UpdateParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class UpdateParamsPaymentMethodDataInteracPresent(TypedDict): pass + class UpdateParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class UpdateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataKlarnaDob" @@ -5550,6 +5962,9 @@ class UpdateParamsPaymentMethodDataKlarnaDob(TypedDict): class UpdateParamsPaymentMethodDataKonbini(TypedDict): pass + class UpdateParamsPaymentMethodDataKrCard(TypedDict): + pass + class UpdateParamsPaymentMethodDataLink(TypedDict): pass @@ -5559,6 +5974,12 @@ class UpdateParamsPaymentMethodDataMobilepay(TypedDict): class UpdateParamsPaymentMethodDataMultibanco(TypedDict): pass + class UpdateParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class UpdateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -5597,6 +6018,9 @@ class UpdateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class UpdateParamsPaymentMethodDataPayco(TypedDict): + pass + class UpdateParamsPaymentMethodDataPaynow(TypedDict): pass @@ -5618,6 +6042,9 @@ class UpdateParamsPaymentMethodDataRadarOptions(TypedDict): class UpdateParamsPaymentMethodDataRevolutPay(TypedDict): pass + class UpdateParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class UpdateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -5689,6 +6116,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ + alma: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsAlma" + ] + """ + If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. + """ amazon_pay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsAmazonPay" ] @@ -5785,6 +6218,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ + kakao_pay: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. + """ klarna: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsKlarna" ] @@ -5797,6 +6236,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ + kr_card: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. + """ link: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsLink" ] @@ -5815,6 +6260,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ + naver_pay: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsOxxo" ] @@ -5827,6 +6278,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + payco: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsPayco" + ] + """ + If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. + """ paynow: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsPaynow" ] @@ -5857,6 +6314,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ + samsung_pay: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. + """ sepa_debit: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsSepaDebit" ] @@ -6019,6 +6482,16 @@ class UpdateParamsPaymentMethodOptionsAlipay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsAlma(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class UpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -6591,6 +7064,28 @@ class UpdateParamsPaymentMethodOptionsIdeal(TypedDict): class UpdateParamsPaymentMethodOptionsInteracPresent(TypedDict): pass + class UpdateParamsPaymentMethodOptionsKakaoPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -6696,6 +7191,28 @@ class UpdateParamsPaymentMethodOptionsKonbini(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsKrCard(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class UpdateParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -6760,6 +7277,16 @@ class UpdateParamsPaymentMethodOptionsMultibanco(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsNaverPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class UpdateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -6796,6 +7323,16 @@ class UpdateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class UpdateParamsPaymentMethodOptionsPayco(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class UpdateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -6924,6 +7461,16 @@ class UpdateParamsPaymentMethodOptionsRevolutPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class UpdateParamsPaymentMethodOptionsSamsungPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class UpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsSepaDebitMandateOptions" diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 9f22c9806..200e09f7e 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -775,6 +775,7 @@ class CreateParams(RequestOptions): "affirm", "afterpay_clearpay", "alipay", + "alma", "au_becs_debit", "bacs_debit", "bancontact", @@ -1678,7 +1679,7 @@ class ModifyParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', '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). @@ -2430,6 +2431,7 @@ class RetrieveParams(RequestOptions): "affirm", "afterpay_clearpay", "alipay", + "alma", "au_becs_debit", "bacs_debit", "bancontact", diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 3ff76553a..0121889d8 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -116,6 +116,7 @@ class CreateParams(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "au_becs_debit", "bacs_debit", "bancontact", @@ -1021,7 +1022,7 @@ class UpdateParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', '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/_payment_method.py b/stripe/_payment_method.py index 992ccf063..bcbc2a95c 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -69,6 +69,9 @@ class AfterpayClearpay(StripeObject): class Alipay(StripeObject): pass + class Alma(StripeObject): + pass + class AmazonPay(StripeObject): pass @@ -981,6 +984,9 @@ class Networks(StripeObject): """ _inner_class_types = {"networks": Networks} + class KakaoPay(StripeObject): + pass + class Klarna(StripeObject): class Dob(StripeObject): day: Optional[int] @@ -1005,6 +1011,41 @@ class Dob(StripeObject): class Konbini(StripeObject): pass + class KrCard(StripeObject): + brand: Optional[ + Literal[ + "bc", + "citi", + "hana", + "hyundai", + "jeju", + "jeonbuk", + "kakaobank", + "kbank", + "kdbbank", + "kookmin", + "kwangju", + "lotte", + "mg", + "nh", + "post", + "samsung", + "savingsbank", + "shinhan", + "shinhyup", + "suhyup", + "tossbank", + "woori", + ] + ] + """ + The local credit or debit card brand. + """ + last4: Optional[str] + """ + The last four digits of the card. This may not be present for American Express cards. + """ + class Link(StripeObject): email: Optional[str] """ @@ -1021,6 +1062,12 @@ class Mobilepay(StripeObject): class Multibanco(StripeObject): pass + class NaverPay(StripeObject): + funding: Literal["card", "points"] + """ + Whether to fund this transaction with Naver Pay points or a card. + """ + class Oxxo(StripeObject): pass @@ -1059,6 +1106,9 @@ class P24(StripeObject): The customer's bank, if provided. """ + class Payco(StripeObject): + pass + class Paynow(StripeObject): pass @@ -1088,6 +1138,9 @@ class RadarOptions(StripeObject): class RevolutPay(StripeObject): pass + class SamsungPay(StripeObject): + pass + class SepaDebit(StripeObject): class GeneratedFrom(StripeObject): charge: Optional[ExpandableField["Charge"]] @@ -1268,6 +1321,10 @@ class CreateParams(RequestOptions): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired["PaymentMethod.CreateParamsAlma"] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired["PaymentMethod.CreateParamsAmazonPay"] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. @@ -1346,6 +1403,10 @@ class CreateParams(RequestOptions): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired["PaymentMethod.CreateParamsKakaoPay"] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired["PaymentMethod.CreateParamsKlarna"] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. @@ -1354,6 +1415,10 @@ class CreateParams(RequestOptions): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired["PaymentMethod.CreateParamsKrCard"] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired["PaymentMethod.CreateParamsLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. @@ -1370,6 +1435,10 @@ class CreateParams(RequestOptions): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired["PaymentMethod.CreateParamsNaverPay"] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired["PaymentMethod.CreateParamsOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -1378,6 +1447,10 @@ class CreateParams(RequestOptions): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired["PaymentMethod.CreateParamsPayco"] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ payment_method: NotRequired[str] """ The PaymentMethod to share. @@ -1406,6 +1479,10 @@ class CreateParams(RequestOptions): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired["PaymentMethod.CreateParamsSamsungPay"] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired["PaymentMethod.CreateParamsSepaDebit"] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. @@ -1428,6 +1505,7 @@ class CreateParams(RequestOptions): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -1442,18 +1520,23 @@ class CreateParams(RequestOptions): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -1502,6 +1585,9 @@ class CreateParamsAfterpayClearpay(TypedDict): class CreateParamsAlipay(TypedDict): pass + class CreateParamsAlma(TypedDict): + pass + class CreateParamsAmazonPay(TypedDict): pass @@ -1721,12 +1807,15 @@ class CreateParamsIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class CreateParamsInteracPresent(TypedDict): pass + class CreateParamsKakaoPay(TypedDict): + pass + class CreateParamsKlarna(TypedDict): dob: NotRequired["PaymentMethod.CreateParamsKlarnaDob"] """ @@ -1750,6 +1839,9 @@ class CreateParamsKlarnaDob(TypedDict): class CreateParamsKonbini(TypedDict): pass + class CreateParamsKrCard(TypedDict): + pass + class CreateParamsLink(TypedDict): pass @@ -1759,6 +1851,12 @@ class CreateParamsMobilepay(TypedDict): class CreateParamsMultibanco(TypedDict): pass + class CreateParamsNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class CreateParamsOxxo(TypedDict): pass @@ -1797,6 +1895,9 @@ class CreateParamsP24(TypedDict): The customer's bank. """ + class CreateParamsPayco(TypedDict): + pass + class CreateParamsPaynow(TypedDict): pass @@ -1818,6 +1919,9 @@ class CreateParamsRadarOptions(TypedDict): class CreateParamsRevolutPay(TypedDict): pass + class CreateParamsSamsungPay(TypedDict): + pass + class CreateParamsSepaDebit(TypedDict): iban: str """ @@ -1897,6 +2001,7 @@ class ListParams(RequestOptions): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -1911,18 +2016,23 @@ class ListParams(RequestOptions): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -1965,6 +2075,10 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + naver_pay: NotRequired["PaymentMethod.ModifyParamsNaverPay"] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ us_bank_account: NotRequired["PaymentMethod.ModifyParamsUsBankAccount"] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. @@ -2041,6 +2155,12 @@ class ModifyParamsCardNetworks(TypedDict): class ModifyParamsLink(TypedDict): pass + class ModifyParamsNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class ModifyParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -2065,6 +2185,7 @@ class RetrieveParams(RequestOptions): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. """ + alma: Optional[Alma] amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] @@ -2094,8 +2215,10 @@ class RetrieveParams(RequestOptions): """ ideal: Optional[Ideal] interac_present: Optional[InteracPresent] + kakao_pay: Optional[KakaoPay] klarna: Optional[Klarna] konbini: Optional[Konbini] + kr_card: Optional[KrCard] link: Optional[Link] livemode: bool """ @@ -2107,12 +2230,14 @@ class RetrieveParams(RequestOptions): """ mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] + naver_pay: Optional[NaverPay] object: Literal["payment_method"] """ String representing the object's type. Objects of the same type share the same value. """ oxxo: Optional[Oxxo] p24: Optional[P24] + payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] pix: Optional[Pix] @@ -2122,6 +2247,7 @@ class RetrieveParams(RequestOptions): Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: Optional[RevolutPay] + samsung_pay: Optional[SamsungPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] @@ -2131,6 +2257,7 @@ class RetrieveParams(RequestOptions): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -2147,18 +2274,23 @@ class RetrieveParams(RequestOptions): "grabpay", "ideal", "interac_present", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -2635,6 +2767,7 @@ async def retrieve_async( "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "alma": Alma, "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, @@ -2652,19 +2785,24 @@ async def retrieve_async( "grabpay": Grabpay, "ideal": Ideal, "interac_present": InteracPresent, + "kakao_pay": KakaoPay, "klarna": Klarna, "konbini": Konbini, + "kr_card": KrCard, "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, + "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "payco": Payco, "paynow": Paynow, "paypal": Paypal, "pix": Pix, "promptpay": Promptpay, "radar_options": RadarOptions, "revolut_pay": RevolutPay, + "samsung_pay": SamsungPay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 033ac855a..4630c094e 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -125,6 +125,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Alma(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 AmazonPay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -938,6 +960,10 @@ class CreateParams(RequestOptions): """ Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. Check this [page](https://stripe.com/docs/payments/alipay) for more details. """ + alma: NotRequired["PaymentMethodConfiguration.CreateParamsAlma"] + """ + Alma is a Buy Now, Pay Later payment method that offers customers the ability to pay in 2, 3, or 4 installments. + """ amazon_pay: NotRequired[ "PaymentMethodConfiguration.CreateParamsAmazonPay" ] @@ -1118,7 +1144,7 @@ class CreateParams(RequestOptions): "PaymentMethodConfiguration.CreateParamsUsBankAccount" ] """ - Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. + Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check this [page](https://stripe.com/docs/payments/ach-direct-debit) for more details. """ wechat_pay: NotRequired[ "PaymentMethodConfiguration.CreateParamsWechatPay" @@ -1187,6 +1213,20 @@ class CreateParamsAlipayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsAlma(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsAlmaDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsAlmaDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsAmazonPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsAmazonPayDisplayPreference" @@ -1752,6 +1792,10 @@ class ModifyParams(RequestOptions): """ Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. Check this [page](https://stripe.com/docs/payments/alipay) for more details. """ + alma: NotRequired["PaymentMethodConfiguration.ModifyParamsAlma"] + """ + Alma is a Buy Now, Pay Later payment method that offers customers the ability to pay in 2, 3, or 4 installments. + """ amazon_pay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsAmazonPay" ] @@ -1928,7 +1972,7 @@ class ModifyParams(RequestOptions): "PaymentMethodConfiguration.ModifyParamsUsBankAccount" ] """ - Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. + Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check this [page](https://stripe.com/docs/payments/ach-direct-debit) for more details. """ wechat_pay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsWechatPay" @@ -1997,6 +2041,20 @@ class ModifyParamsAlipayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsAlma(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsAlmaDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsAlmaDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsAmazonPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsAmazonPayDisplayPreference" @@ -2529,6 +2587,7 @@ class RetrieveParams(RequestOptions): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + alma: Optional[Alma] amazon_pay: Optional[AmazonPay] apple_pay: Optional[ApplePay] application: Optional[str] @@ -2735,6 +2794,7 @@ async def retrieve_async( "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "alma": Alma, "amazon_pay": AmazonPay, "apple_pay": ApplePay, "au_becs_debit": AuBecsDebit, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index d43649ab1..e0138a5ef 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -35,6 +35,10 @@ class CreateParams(TypedDict): """ Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. Check this [page](https://stripe.com/docs/payments/alipay) for more details. """ + alma: NotRequired["PaymentMethodConfigurationService.CreateParamsAlma"] + """ + Alma is a Buy Now, Pay Later payment method that offers customers the ability to pay in 2, 3, or 4 installments. + """ amazon_pay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAmazonPay" ] @@ -239,7 +243,7 @@ class CreateParams(TypedDict): "PaymentMethodConfigurationService.CreateParamsUsBankAccount" ] """ - Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. + Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check this [page](https://stripe.com/docs/payments/ach-direct-debit) for more details. """ wechat_pay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsWechatPay" @@ -308,6 +312,20 @@ class CreateParamsAlipayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsAlma(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsAlmaDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsAlmaDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsAmazonPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAmazonPayDisplayPreference" @@ -883,6 +901,10 @@ class UpdateParams(TypedDict): """ Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. Check this [page](https://stripe.com/docs/payments/alipay) for more details. """ + alma: NotRequired["PaymentMethodConfigurationService.UpdateParamsAlma"] + """ + Alma is a Buy Now, Pay Later payment method that offers customers the ability to pay in 2, 3, or 4 installments. + """ amazon_pay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAmazonPay" ] @@ -1083,7 +1105,7 @@ class UpdateParams(TypedDict): "PaymentMethodConfigurationService.UpdateParamsUsBankAccount" ] """ - Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. + Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check this [page](https://stripe.com/docs/payments/ach-direct-debit) for more details. """ wechat_pay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsWechatPay" @@ -1152,6 +1174,20 @@ class UpdateParamsAlipayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsAlma(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsAlmaDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsAlmaDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsAmazonPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAmazonPayDisplayPreference" diff --git a/stripe/_payment_method_domain.py b/stripe/_payment_method_domain.py index 533bdf5ba..3fb016792 100644 --- a/stripe/_payment_method_domain.py +++ b/stripe/_payment_method_domain.py @@ -27,6 +27,23 @@ class PaymentMethodDomain( "payment_method_domain" ) + class AmazonPay(StripeObject): + class StatusDetails(StripeObject): + error_message: str + """ + The error message associated with the status of the payment method on the domain. + """ + + status: Literal["active", "inactive"] + """ + The status of the payment method on the domain. + """ + status_details: Optional[StatusDetails] + """ + Contains additional details about the status of a payment method for a specific payment method domain. + """ + _inner_class_types = {"status_details": StatusDetails} + class ApplePay(StripeObject): class StatusDetails(StripeObject): error_message: str @@ -157,6 +174,10 @@ class ValidateParams(RequestOptions): Specifies which fields in the response should be expanded. """ + amazon_pay: AmazonPay + """ + Indicates the status of a specific payment method on a payment method domain. + """ apple_pay: ApplePay """ Indicates the status of a specific payment method on a payment method domain. @@ -483,6 +504,7 @@ async def validate_async( # pyright: ignore[reportGeneralTypeIssues] ) _inner_class_types = { + "amazon_pay": AmazonPay, "apple_pay": ApplePay, "google_pay": GooglePay, "link": Link, diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 45c33c23e..741d1437b 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -45,6 +45,10 @@ class CreateParams(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired["PaymentMethodService.CreateParamsAlma"] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired["PaymentMethodService.CreateParamsAmazonPay"] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. @@ -125,6 +129,10 @@ class CreateParams(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired["PaymentMethodService.CreateParamsKakaoPay"] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired["PaymentMethodService.CreateParamsKlarna"] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. @@ -133,6 +141,10 @@ class CreateParams(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired["PaymentMethodService.CreateParamsKrCard"] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired["PaymentMethodService.CreateParamsLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. @@ -149,6 +161,10 @@ class CreateParams(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired["PaymentMethodService.CreateParamsNaverPay"] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired["PaymentMethodService.CreateParamsOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -157,6 +173,10 @@ class CreateParams(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired["PaymentMethodService.CreateParamsPayco"] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ payment_method: NotRequired[str] """ The PaymentMethod to share. @@ -187,6 +207,10 @@ class CreateParams(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired["PaymentMethodService.CreateParamsSamsungPay"] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired["PaymentMethodService.CreateParamsSepaDebit"] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. @@ -209,6 +233,7 @@ class CreateParams(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -223,18 +248,23 @@ class CreateParams(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -285,6 +315,9 @@ class CreateParamsAfterpayClearpay(TypedDict): class CreateParamsAlipay(TypedDict): pass + class CreateParamsAlma(TypedDict): + pass + class CreateParamsAmazonPay(TypedDict): pass @@ -504,12 +537,15 @@ class CreateParamsIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class CreateParamsInteracPresent(TypedDict): pass + class CreateParamsKakaoPay(TypedDict): + pass + class CreateParamsKlarna(TypedDict): dob: NotRequired["PaymentMethodService.CreateParamsKlarnaDob"] """ @@ -533,6 +569,9 @@ class CreateParamsKlarnaDob(TypedDict): class CreateParamsKonbini(TypedDict): pass + class CreateParamsKrCard(TypedDict): + pass + class CreateParamsLink(TypedDict): pass @@ -542,6 +581,12 @@ class CreateParamsMobilepay(TypedDict): class CreateParamsMultibanco(TypedDict): pass + class CreateParamsNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class CreateParamsOxxo(TypedDict): pass @@ -580,6 +625,9 @@ class CreateParamsP24(TypedDict): The customer's bank. """ + class CreateParamsPayco(TypedDict): + pass + class CreateParamsPaynow(TypedDict): pass @@ -601,6 +649,9 @@ class CreateParamsRadarOptions(TypedDict): class CreateParamsRevolutPay(TypedDict): pass + class CreateParamsSamsungPay(TypedDict): + pass + class CreateParamsSepaDebit(TypedDict): iban: str """ @@ -680,6 +731,7 @@ class ListParams(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -694,18 +746,23 @@ class ListParams(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -754,6 +811,10 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + naver_pay: NotRequired["PaymentMethodService.UpdateParamsNaverPay"] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ us_bank_account: NotRequired[ "PaymentMethodService.UpdateParamsUsBankAccount" ] @@ -832,6 +893,12 @@ class UpdateParamsCardNetworks(TypedDict): class UpdateParamsLink(TypedDict): pass + class UpdateParamsNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class UpdateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ diff --git a/stripe/_person.py b/stripe/_person.py index 7082f215b..315874c14 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -588,7 +588,7 @@ class Document(StripeObject): """ gender: Optional[str] """ - The person's gender (International regulations require either "male" or "female"). + The person's gender. """ id: str """ diff --git a/stripe/_refund.py b/stripe/_refund.py index 6dae4382a..7a79cbe89 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -51,6 +51,9 @@ class AfterpayClearpay(StripeObject): class Alipay(StripeObject): pass + class Alma(StripeObject): + pass + class AmazonPay(StripeObject): pass @@ -227,6 +230,7 @@ class Zip(StripeObject): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] + alma: Optional[Alma] amazon_pay: Optional[AmazonPay] au_bank_transfer: Optional[AuBankTransfer] blik: Optional[Blik] @@ -262,6 +266,7 @@ class Zip(StripeObject): "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, + "alma": Alma, "amazon_pay": AmazonPay, "au_bank_transfer": AuBankTransfer, "blik": Blik, @@ -311,9 +316,6 @@ class EmailSent(StripeObject): _inner_class_types = {"email_sent": EmailSent} display_details: Optional[DisplayDetails] - """ - Contains the refund details. - """ type: str """ Type of the next action to perform. diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index d9d8d570b..f5c5943e9 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -329,9 +329,15 @@ class Ideal(StripeObject): (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ + class KakaoPay(StripeObject): + pass + class Klarna(StripeObject): pass + class KrCard(StripeObject): + pass + class Link(StripeObject): pass @@ -393,7 +399,9 @@ class UsBankAccount(StripeObject): card_present: Optional[CardPresent] cashapp: Optional[Cashapp] ideal: Optional[Ideal] + kakao_pay: Optional[KakaoPay] klarna: Optional[Klarna] + kr_card: Optional[KrCard] link: Optional[Link] paypal: Optional[Paypal] revolut_pay: Optional[RevolutPay] @@ -415,7 +423,9 @@ class UsBankAccount(StripeObject): "card_present": CardPresent, "cashapp": Cashapp, "ideal": Ideal, + "kakao_pay": KakaoPay, "klarna": Klarna, + "kr_card": KrCard, "link": Link, "paypal": Paypal, "revolut_pay": RevolutPay, diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index ed2da02a6..e55a0d367 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -765,6 +765,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataAlma"] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataAmazonPay" ] @@ -845,6 +849,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataKlarna"] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. @@ -855,6 +865,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. @@ -875,6 +891,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -883,6 +905,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataPayco"] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataPaynow"] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. @@ -913,6 +939,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataSepaDebit" ] @@ -936,6 +968,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -949,18 +982,23 @@ class ConfirmParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -1012,6 +1050,9 @@ class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): class ConfirmParamsPaymentMethodDataAlipay(TypedDict): pass + class ConfirmParamsPaymentMethodDataAlma(TypedDict): + pass + class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -1197,12 +1238,15 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class ConfirmParamsPaymentMethodDataInteracPresent(TypedDict): pass + class ConfirmParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataKlarnaDob"] """ @@ -1226,6 +1270,9 @@ class ConfirmParamsPaymentMethodDataKlarnaDob(TypedDict): class ConfirmParamsPaymentMethodDataKonbini(TypedDict): pass + class ConfirmParamsPaymentMethodDataKrCard(TypedDict): + pass + class ConfirmParamsPaymentMethodDataLink(TypedDict): pass @@ -1235,6 +1282,12 @@ class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): pass + class ConfirmParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -1273,6 +1326,9 @@ class ConfirmParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ConfirmParamsPaymentMethodDataPayco(TypedDict): + pass + class ConfirmParamsPaymentMethodDataPaynow(TypedDict): pass @@ -1294,6 +1350,9 @@ class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): pass + class ConfirmParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -1901,6 +1960,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired["SetupIntent.CreateParamsPaymentMethodDataAlma"] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataAmazonPay" ] @@ -1981,6 +2044,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired["SetupIntent.CreateParamsPaymentMethodDataKlarna"] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. @@ -1991,6 +2060,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired["SetupIntent.CreateParamsPaymentMethodDataKrCard"] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired["SetupIntent.CreateParamsPaymentMethodDataLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. @@ -2011,6 +2084,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired["SetupIntent.CreateParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -2019,6 +2098,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired["SetupIntent.CreateParamsPaymentMethodDataPayco"] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired["SetupIntent.CreateParamsPaymentMethodDataPaynow"] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. @@ -2049,6 +2132,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataSepaDebit" ] @@ -2072,6 +2161,7 @@ class CreateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -2085,18 +2175,23 @@ class CreateParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -2148,6 +2243,9 @@ class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class CreateParamsPaymentMethodDataAlipay(TypedDict): pass + class CreateParamsPaymentMethodDataAlma(TypedDict): + pass + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -2333,12 +2431,15 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class CreateParamsPaymentMethodDataInteracPresent(TypedDict): pass + class CreateParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class CreateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired["SetupIntent.CreateParamsPaymentMethodDataKlarnaDob"] """ @@ -2362,6 +2463,9 @@ class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): class CreateParamsPaymentMethodDataKonbini(TypedDict): pass + class CreateParamsPaymentMethodDataKrCard(TypedDict): + pass + class CreateParamsPaymentMethodDataLink(TypedDict): pass @@ -2371,6 +2475,12 @@ class CreateParamsPaymentMethodDataMobilepay(TypedDict): class CreateParamsPaymentMethodDataMultibanco(TypedDict): pass + class CreateParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2409,6 +2519,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayco(TypedDict): + pass + class CreateParamsPaymentMethodDataPaynow(TypedDict): pass @@ -2430,6 +2543,9 @@ class CreateParamsPaymentMethodDataRadarOptions(TypedDict): class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass + class CreateParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -3004,6 +3120,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataAlma"] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataAmazonPay" ] @@ -3084,6 +3204,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataKlarna"] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. @@ -3094,6 +3220,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataKrCard"] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. @@ -3114,6 +3244,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -3122,6 +3258,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataPayco"] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataPaynow"] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. @@ -3152,6 +3292,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataSepaDebit" ] @@ -3175,6 +3321,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -3188,18 +3335,23 @@ class ModifyParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -3251,6 +3403,9 @@ class ModifyParamsPaymentMethodDataAfterpayClearpay(TypedDict): class ModifyParamsPaymentMethodDataAlipay(TypedDict): pass + class ModifyParamsPaymentMethodDataAlma(TypedDict): + pass + class ModifyParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -3436,12 +3591,15 @@ class ModifyParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class ModifyParamsPaymentMethodDataInteracPresent(TypedDict): pass + class ModifyParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class ModifyParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataKlarnaDob"] """ @@ -3465,6 +3623,9 @@ class ModifyParamsPaymentMethodDataKlarnaDob(TypedDict): class ModifyParamsPaymentMethodDataKonbini(TypedDict): pass + class ModifyParamsPaymentMethodDataKrCard(TypedDict): + pass + class ModifyParamsPaymentMethodDataLink(TypedDict): pass @@ -3474,6 +3635,12 @@ class ModifyParamsPaymentMethodDataMobilepay(TypedDict): class ModifyParamsPaymentMethodDataMultibanco(TypedDict): pass + class ModifyParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class ModifyParamsPaymentMethodDataOxxo(TypedDict): pass @@ -3512,6 +3679,9 @@ class ModifyParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ModifyParamsPaymentMethodDataPayco(TypedDict): + pass + class ModifyParamsPaymentMethodDataPaynow(TypedDict): pass @@ -3533,6 +3703,9 @@ class ModifyParamsPaymentMethodDataRadarOptions(TypedDict): class ModifyParamsPaymentMethodDataRevolutPay(TypedDict): pass + class ModifyParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class ModifyParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index d65aaa4b6..73cfb2e9e 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -138,6 +138,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataAlma" + ] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataAmazonPay" ] @@ -228,6 +234,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataKlarna" ] @@ -240,6 +252,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataLink" ] @@ -262,6 +280,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataOxxo" ] @@ -274,6 +298,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataPayco" + ] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataPaynow" ] @@ -310,6 +340,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataSepaDebit" ] @@ -339,6 +375,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -352,18 +389,23 @@ class ConfirmParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -417,6 +459,9 @@ class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): class ConfirmParamsPaymentMethodDataAlipay(TypedDict): pass + class ConfirmParamsPaymentMethodDataAlma(TypedDict): + pass + class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -602,12 +647,15 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class ConfirmParamsPaymentMethodDataInteracPresent(TypedDict): pass + class ConfirmParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataKlarnaDob" @@ -633,6 +681,9 @@ class ConfirmParamsPaymentMethodDataKlarnaDob(TypedDict): class ConfirmParamsPaymentMethodDataKonbini(TypedDict): pass + class ConfirmParamsPaymentMethodDataKrCard(TypedDict): + pass + class ConfirmParamsPaymentMethodDataLink(TypedDict): pass @@ -642,6 +693,12 @@ class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): pass + class ConfirmParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -680,6 +737,9 @@ class ConfirmParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ConfirmParamsPaymentMethodDataPayco(TypedDict): + pass + class ConfirmParamsPaymentMethodDataPaynow(TypedDict): pass @@ -701,6 +761,9 @@ class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): pass + class ConfirmParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -1316,6 +1379,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataAlma" + ] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataAmazonPay" ] @@ -1402,6 +1471,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataKlarna" ] @@ -1414,6 +1489,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataLink" ] @@ -1436,6 +1517,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataOxxo" ] @@ -1446,6 +1533,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataPayco" + ] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataPaynow" ] @@ -1480,6 +1573,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataSepaDebit" ] @@ -1509,6 +1608,7 @@ class CreateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -1522,18 +1622,23 @@ class CreateParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -1585,6 +1690,9 @@ class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class CreateParamsPaymentMethodDataAlipay(TypedDict): pass + class CreateParamsPaymentMethodDataAlma(TypedDict): + pass + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -1770,12 +1878,15 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class CreateParamsPaymentMethodDataInteracPresent(TypedDict): pass + class CreateParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class CreateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataKlarnaDob" @@ -1801,6 +1912,9 @@ class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): class CreateParamsPaymentMethodDataKonbini(TypedDict): pass + class CreateParamsPaymentMethodDataKrCard(TypedDict): + pass + class CreateParamsPaymentMethodDataLink(TypedDict): pass @@ -1810,6 +1924,12 @@ class CreateParamsPaymentMethodDataMobilepay(TypedDict): class CreateParamsPaymentMethodDataMultibanco(TypedDict): pass + class CreateParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -1848,6 +1968,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayco(TypedDict): + pass + class CreateParamsPaymentMethodDataPaynow(TypedDict): pass @@ -1869,6 +1992,9 @@ class CreateParamsPaymentMethodDataRadarOptions(TypedDict): class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass + class CreateParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -2461,6 +2587,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataAlma" + ] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataAmazonPay" ] @@ -2547,6 +2679,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataKlarna" ] @@ -2559,6 +2697,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataLink" ] @@ -2581,6 +2725,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataOxxo" ] @@ -2591,6 +2741,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataPayco" + ] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataPaynow" ] @@ -2625,6 +2781,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataSepaDebit" ] @@ -2654,6 +2816,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -2667,18 +2830,23 @@ class UpdateParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -2730,6 +2898,9 @@ class UpdateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class UpdateParamsPaymentMethodDataAlipay(TypedDict): pass + class UpdateParamsPaymentMethodDataAlma(TypedDict): + pass + class UpdateParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -2915,12 +3086,15 @@ class UpdateParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class UpdateParamsPaymentMethodDataInteracPresent(TypedDict): pass + class UpdateParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class UpdateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataKlarnaDob" @@ -2946,6 +3120,9 @@ class UpdateParamsPaymentMethodDataKlarnaDob(TypedDict): class UpdateParamsPaymentMethodDataKonbini(TypedDict): pass + class UpdateParamsPaymentMethodDataKrCard(TypedDict): + pass + class UpdateParamsPaymentMethodDataLink(TypedDict): pass @@ -2955,6 +3132,12 @@ class UpdateParamsPaymentMethodDataMobilepay(TypedDict): class UpdateParamsPaymentMethodDataMultibanco(TypedDict): pass + class UpdateParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class UpdateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2993,6 +3176,9 @@ class UpdateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class UpdateParamsPaymentMethodDataPayco(TypedDict): + pass + class UpdateParamsPaymentMethodDataPaynow(TypedDict): pass @@ -3014,6 +3200,9 @@ class UpdateParamsPaymentMethodDataRadarOptions(TypedDict): class UpdateParamsPaymentMethodDataRevolutPay(TypedDict): pass + class UpdateParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class UpdateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 93c9edeb6..681c609b3 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -372,10 +372,15 @@ class Filters(StripeObject): "giropay", "grabpay", "ideal", + "jp_credit_transfer", + "kakao_pay", "konbini", + "kr_card", "link", "multibanco", + "naver_pay", "p24", + "payco", "paynow", "paypal", "promptpay", @@ -470,7 +475,7 @@ class CancelParams(RequestOptions): """ invoice_now: NotRequired[bool] """ - Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`. + Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. Defaults to `false`. """ prorate: NotRequired[bool] """ @@ -922,7 +927,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -1758,7 +1763,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -2020,7 +2025,7 @@ class ModifyParamsTrialSettingsEndBehavior(TypedDict): class ResumeParams(RequestOptions): billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ - Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). Setting the value to `unchanged` advances the subscription's billing cycle anchor to the period that surrounds the current time. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + The billing cycle anchor that applies when the subscription is resumed. Either `now` or `unchanged`. The default is `now`. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ expand: NotRequired[List[str]] """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index adad3f820..b3160ca51 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -25,7 +25,7 @@ class CancelParams(TypedDict): """ invoice_now: NotRequired[bool] """ - Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`. + Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. Defaults to `false`. """ prorate: NotRequired[bool] """ @@ -487,7 +487,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -893,7 +893,7 @@ class ListParamsCurrentPeriodStart(TypedDict): class ResumeParams(TypedDict): billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ - Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). Setting the value to `unchanged` advances the subscription's billing cycle anchor to the period that surrounds the current time. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + The billing cycle anchor that applies when the subscription is resumed. Either `now` or `unchanged`. The default is `now`. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ expand: NotRequired[List[str]] """ @@ -1379,7 +1379,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'multibanco', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index 3c6ab718e..3cf29c0b2 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -89,6 +89,7 @@ class CreateParams(RequestOptions): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -124,6 +125,8 @@ class CreateParams(RequestOptions): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -147,15 +150,18 @@ class CreateParams(RequestOptions): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -260,6 +266,7 @@ class RetrieveParams(RequestOptions): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -295,6 +302,8 @@ class RetrieveParams(RequestOptions): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -318,16 +327,19 @@ class RetrieveParams(RequestOptions): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "unknown", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` """ value: str """ diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py index 87e07bc5b..1f6cf5c58 100644 --- a/stripe/_tax_id_service.py +++ b/stripe/_tax_id_service.py @@ -30,6 +30,7 @@ class CreateParams(TypedDict): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -65,6 +66,8 @@ class CreateParams(TypedDict): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -88,15 +91,18 @@ class CreateParams(TypedDict): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index 8a19bb5d5..fa5efcfe8 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -4,6 +4,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast @@ -23,6 +24,16 @@ class TaxRate( OBJECT_NAME: ClassVar[Literal["tax_rate"]] = "tax_rate" + class FlatAmount(StripeObject): + amount: int + """ + Amount of the tax when the `rate_type` is `flat_amount`. This positive integer represents how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + """ + currency: str + """ + Three-letter ISO currency code, in lowercase. + """ + class CreateParams(RequestOptions): active: NotRequired[bool] """ @@ -75,6 +86,7 @@ class CreateParams(RequestOptions): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", @@ -176,6 +188,7 @@ class ModifyParams(RequestOptions): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", @@ -217,6 +230,10 @@ class RetrieveParams(RequestOptions): this percentage reflects the rate actually used to calculate tax based on the product's taxability and whether the user is registered to collect taxes in the corresponding jurisdiction. """ + flat_amount: Optional[FlatAmount] + """ + The amount of the tax rate when the `rate_type` is `flat_amount`. Tax rates with `rate_type` `percentage` can vary based on the transaction, resulting in this field being `null`. This field exposes the amount and currency of the flat tax rate. + """ id: str """ Unique identifier for the object. @@ -251,6 +268,10 @@ class RetrieveParams(RequestOptions): """ Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. """ + rate_type: Optional[Literal["flat_amount", "percentage"]] + """ + Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. + """ state: Optional[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. @@ -266,6 +287,7 @@ class RetrieveParams(RequestOptions): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", @@ -400,3 +422,5 @@ async def retrieve_async( instance = cls(id, **params) await instance.refresh_async() return instance + + _inner_class_types = {"flat_amount": FlatAmount} diff --git a/stripe/_tax_rate_service.py b/stripe/_tax_rate_service.py index 61399dec6..b8de81f3b 100644 --- a/stripe/_tax_rate_service.py +++ b/stripe/_tax_rate_service.py @@ -62,6 +62,7 @@ class CreateParams(TypedDict): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", @@ -169,6 +170,7 @@ class UpdateParams(TypedDict): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", diff --git a/stripe/_token.py b/stripe/_token.py index 11558266a..03ef8faa1 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -349,7 +349,7 @@ class CreateParamsAccountIndividual(TypedDict): """ gender: NotRequired[str] """ - The individual's gender (International regulations require either "male" or "female"). + The individual's gender """ id_number: NotRequired[str] """ @@ -1115,7 +1115,7 @@ class RetrieveParams(RequestOptions): def create(cls, **params: Unpack["Token.CreateParams"]) -> "Token": """ Creates a single-use token that represents a bank account's details. - You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. + You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. """ return cast( "Token", @@ -1132,7 +1132,7 @@ async def create_async( ) -> "Token": """ Creates a single-use token that represents a bank account's details. - You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. + You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. """ return cast( "Token", diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 9fe918393..30be56d21 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -320,7 +320,7 @@ class CreateParamsAccountIndividual(TypedDict): """ gender: NotRequired[str] """ - The individual's gender (International regulations require either "male" or "female"). + The individual's gender """ id_number: NotRequired[str] """ @@ -1092,7 +1092,7 @@ def create( ) -> Token: """ Creates a single-use token that represents a bank account's details. - You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. + You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. """ return cast( Token, @@ -1112,7 +1112,7 @@ async def create_async( ) -> Token: """ Creates a single-use token that represents a bank account's details. - You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. + You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. """ return cast( Token, diff --git a/stripe/_usage_record_summary.py b/stripe/_usage_record_summary.py index fa46e82e3..2276bf95e 100644 --- a/stripe/_usage_record_summary.py +++ b/stripe/_usage_record_summary.py @@ -6,6 +6,10 @@ class UsageRecordSummary(StripeObject): + """ + A usage record summary represents an aggregated view of how much usage was accrued for a subscription item within a subscription billing period. + """ + OBJECT_NAME: ClassVar[Literal["usage_record_summary"]] = ( "usage_record_summary" ) diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index bd4140848..d6200f448 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -135,6 +135,7 @@ class CreateParams(RequestOptions): "2024-04-10", "2024-06-20", "2024-09-30.acacia", + "2024-10-28.acacia", ] ] """ @@ -271,6 +272,7 @@ class CreateParams(RequestOptions): "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", @@ -314,6 +316,7 @@ class CreateParams(RequestOptions): "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", + "refund.failed", "refund.updated", "reporting.report_run.failed", "reporting.report_run.succeeded", @@ -560,6 +563,7 @@ class ModifyParams(RequestOptions): "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", @@ -603,6 +607,7 @@ class ModifyParams(RequestOptions): "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", + "refund.failed", "refund.updated", "reporting.report_run.failed", "reporting.report_run.succeeded", diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index c29a6db8c..30bd28342 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -116,6 +116,7 @@ class CreateParams(TypedDict): "2024-04-10", "2024-06-20", "2024-09-30.acacia", + "2024-10-28.acacia", ] ] """ @@ -252,6 +253,7 @@ class CreateParams(TypedDict): "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", @@ -295,6 +297,7 @@ class CreateParams(TypedDict): "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", + "refund.failed", "refund.updated", "reporting.report_run.failed", "reporting.report_run.succeeded", @@ -547,6 +550,7 @@ class UpdateParams(TypedDict): "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", @@ -590,6 +594,7 @@ class UpdateParams(TypedDict): "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", + "refund.failed", "refund.updated", "reporting.report_run.failed", "reporting.report_run.succeeded", diff --git a/stripe/billing/_credit_balance_summary.py b/stripe/billing/_credit_balance_summary.py index d91252dbf..03e1a5de3 100644 --- a/stripe/billing/_credit_balance_summary.py +++ b/stripe/billing/_credit_balance_summary.py @@ -19,7 +19,7 @@ class CreditBalanceSummary(SingletonAPIResource["CreditBalanceSummary"]): """ - Indicates the credit balance for credits granted to a customer. + Indicates the billing credit balance for billing credits granted to a customer. """ OBJECT_NAME: ClassVar[Literal["billing.credit_balance_summary"]] = ( @@ -44,7 +44,7 @@ class Monetary(StripeObject): """ type: Literal["monetary"] """ - The type of this amount. We currently only support `monetary` credits. + The type of this amount. We currently only support `monetary` billing credits. """ _inner_class_types = {"monetary": Monetary} @@ -65,7 +65,7 @@ class Monetary(StripeObject): """ type: Literal["monetary"] """ - The type of this amount. We currently only support `monetary` credits. + The type of this amount. We currently only support `monetary` billing credits. """ _inner_class_types = {"monetary": Monetary} @@ -95,11 +95,11 @@ class RetrieveParamsFilter(TypedDict): "CreditBalanceSummary.RetrieveParamsFilterApplicabilityScope" ] """ - The credit applicability scope for which to fetch balance summary. + The billing credit applicability scope for which to fetch credit balance summary. """ credit_grant: NotRequired[str] """ - The credit grant for which to fetch balance summary. + The credit grant for which to fetch credit balance summary. """ type: Literal["applicability_scope", "credit_grant"] """ @@ -114,7 +114,7 @@ class RetrieveParamsFilterApplicabilityScope(TypedDict): balances: List[Balance] """ - The credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry. + The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry. """ customer: ExpandableField["Customer"] """ diff --git a/stripe/billing/_credit_balance_summary_service.py b/stripe/billing/_credit_balance_summary_service.py index 045e093b0..096de2915 100644 --- a/stripe/billing/_credit_balance_summary_service.py +++ b/stripe/billing/_credit_balance_summary_service.py @@ -27,11 +27,11 @@ class RetrieveParamsFilter(TypedDict): "CreditBalanceSummaryService.RetrieveParamsFilterApplicabilityScope" ] """ - The credit applicability scope for which to fetch balance summary. + The billing credit applicability scope for which to fetch credit balance summary. """ credit_grant: NotRequired[str] """ - The credit grant for which to fetch balance summary. + The credit grant for which to fetch credit balance summary. """ type: Literal["applicability_scope", "credit_grant"] """ diff --git a/stripe/billing/_credit_balance_transaction.py b/stripe/billing/_credit_balance_transaction.py index ff8de6bad..712bd7f14 100644 --- a/stripe/billing/_credit_balance_transaction.py +++ b/stripe/billing/_credit_balance_transaction.py @@ -43,7 +43,7 @@ class Monetary(StripeObject): """ type: Literal["monetary"] """ - The type of this amount. We currently only support `monetary` credits. + The type of this amount. We currently only support `monetary` billing credits. """ _inner_class_types = {"monetary": Monetary} @@ -72,24 +72,24 @@ class Monetary(StripeObject): """ type: Literal["monetary"] """ - The type of this amount. We currently only support `monetary` credits. + The type of this amount. We currently only support `monetary` billing credits. """ _inner_class_types = {"monetary": Monetary} class CreditsApplied(StripeObject): invoice: ExpandableField["Invoice"] """ - The invoice to which the credits were applied. + The invoice to which the billing credits were applied. """ invoice_line_item: str """ - The invoice line item to which the credits were applied. + The invoice line item to which the billing credits were applied. """ amount: Amount credits_applied: Optional[CreditsApplied] """ - Details of how the credits were applied to an invoice. Only present if `type` is `credits_applied`. + Details of how the billing credits were applied to an invoice. Only present if `type` is `credits_applied`. """ type: Literal["credits_applied", "credits_expired", "credits_voided"] """ @@ -138,19 +138,19 @@ class RetrieveParams(RequestOptions): """ credit: Optional[Credit] """ - Credit details for this balance transaction. Only present if type is `credit`. + Credit details for this credit balance transaction. Only present if type is `credit`. """ credit_grant: ExpandableField["CreditGrant"] """ - The credit grant associated with this balance transaction. + The credit grant associated with this credit balance transaction. """ debit: Optional[Debit] """ - Debit details for this balance transaction. Only present if type is `debit`. + Debit details for this credit balance transaction. Only present if type is `debit`. """ effective_at: int """ - The effective time of this balance transaction. + The effective time of this credit balance transaction. """ id: str """ @@ -170,7 +170,7 @@ class RetrieveParams(RequestOptions): """ type: Optional[Literal["credit", "debit"]] """ - The type of balance transaction (credit or debit). + The type of credit balance transaction (credit or debit). """ @classmethod diff --git a/stripe/billing/_credit_grant.py b/stripe/billing/_credit_grant.py index 51858796d..29a9b52e7 100644 --- a/stripe/billing/_credit_grant.py +++ b/stripe/billing/_credit_grant.py @@ -28,7 +28,10 @@ class CreditGrant( UpdateableAPIResource["CreditGrant"], ): """ - A credit grant is a resource that records a grant of some credit to a customer. + A credit grant is an API resource that documents the allocation of some billing credits to a customer. + + Related guide: [Billing credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits) + end """ OBJECT_NAME: ClassVar[Literal["billing.credit_grant"]] = ( @@ -52,7 +55,7 @@ class Monetary(StripeObject): """ type: Literal["monetary"] """ - The type of this amount. We currently only support `monetary` credits. + The type of this amount. We currently only support `monetary` billing credits. """ _inner_class_types = {"monetary": Monetary} @@ -60,7 +63,7 @@ class ApplicabilityConfig(StripeObject): class Scope(StripeObject): price_type: Literal["metered"] """ - The price type to which credit grants can apply to. We currently only support `metered` price type. + The price type to which credit grants can apply to. We currently only support `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. """ scope: Scope @@ -81,11 +84,11 @@ class CreateParams(RequestOptions): """ customer: str """ - Id of the customer to whom the credit should be granted. + ID of the customer to whom the billing credits should be granted. """ effective_at: NotRequired[int] """ - The time when the credit becomes effective i.e when it is eligible to be used. Defaults to the current timestamp if not specified. + The time when the billing credits become effective i.e when they are eligible to be used. Defaults to the current timestamp if not specified. """ expand: NotRequired[List[str]] """ @@ -93,7 +96,7 @@ class CreateParams(RequestOptions): """ expires_at: NotRequired[int] """ - The time when the credit will expire. If not specified, the credit will never expire. + The time when the billing credits will expire. If not specified, the billing credits will never expire. """ metadata: NotRequired[Dict[str, str]] """ @@ -101,7 +104,7 @@ class CreateParams(RequestOptions): """ name: NotRequired[str] """ - A descriptive name shown in dashboard and on invoices. + A descriptive name shown in dashboard. """ class CreateParamsAmount(TypedDict): @@ -111,7 +114,7 @@ class CreateParamsAmount(TypedDict): """ type: Literal["monetary"] """ - Specify the type of this amount. We currently only support `monetary` credits. + Specify the type of this amount. We currently only support `monetary` billing credits. """ class CreateParamsAmountMonetary(TypedDict): @@ -171,7 +174,7 @@ class ModifyParams(RequestOptions): """ expires_at: NotRequired["Literal['']|int"] """ - The time when the credit created by this credit grant will expire. If set to empty, the credit will never expire. + The time when the billing credits created by this credit grant will expire. If set to empty, the billing credits will never expire. """ metadata: NotRequired[Dict[str, str]] """ @@ -194,7 +197,7 @@ class VoidGrantParams(RequestOptions): applicability_config: ApplicabilityConfig category: Literal["paid", "promotional"] """ - The category of this credit grant. + The category of this credit grant. This is for tracking purposes and will not be displayed to the customer. """ created: int """ @@ -202,15 +205,15 @@ class VoidGrantParams(RequestOptions): """ customer: ExpandableField["Customer"] """ - Id of the customer to whom the credit was granted. + ID of the customer to whom the billing credits are granted. """ effective_at: Optional[int] """ - The time when the credit becomes effective i.e when it is eligible to be used. + The time when the billing credits become effective i.e when they are eligible to be used. """ expires_at: Optional[int] """ - The time when the credit will expire. If not present, the credit will never expire. + The time when the billing credits will expire. If not present, the billing credits will never expire. """ id: str """ @@ -226,7 +229,7 @@ class VoidGrantParams(RequestOptions): """ name: Optional[str] """ - A descriptive name shown in dashboard and on invoices. + A descriptive name shown in dashboard. """ object: Literal["billing.credit_grant"] """ diff --git a/stripe/billing/_credit_grant_service.py b/stripe/billing/_credit_grant_service.py index 011a189fb..904df9c2b 100644 --- a/stripe/billing/_credit_grant_service.py +++ b/stripe/billing/_credit_grant_service.py @@ -27,11 +27,11 @@ class CreateParams(TypedDict): """ customer: str """ - Id of the customer to whom the credit should be granted. + ID of the customer to whom the billing credits should be granted. """ effective_at: NotRequired[int] """ - The time when the credit becomes effective i.e when it is eligible to be used. Defaults to the current timestamp if not specified. + The time when the billing credits become effective i.e when they are eligible to be used. Defaults to the current timestamp if not specified. """ expand: NotRequired[List[str]] """ @@ -39,7 +39,7 @@ class CreateParams(TypedDict): """ expires_at: NotRequired[int] """ - The time when the credit will expire. If not specified, the credit will never expire. + The time when the billing credits will expire. If not specified, the billing credits will never expire. """ metadata: NotRequired[Dict[str, str]] """ @@ -47,7 +47,7 @@ class CreateParams(TypedDict): """ name: NotRequired[str] """ - A descriptive name shown in dashboard and on invoices. + A descriptive name shown in dashboard. """ class CreateParamsAmount(TypedDict): @@ -57,7 +57,7 @@ class CreateParamsAmount(TypedDict): """ type: Literal["monetary"] """ - Specify the type of this amount. We currently only support `monetary` credits. + Specify the type of this amount. We currently only support `monetary` billing credits. """ class CreateParamsAmountMonetary(TypedDict): @@ -123,7 +123,7 @@ class UpdateParams(TypedDict): """ expires_at: NotRequired["Literal['']|int"] """ - The time when the credit created by this credit grant will expire. If set to empty, the credit will never expire. + The time when the billing credits created by this credit grant will expire. If set to empty, the billing credits will never expire. """ metadata: NotRequired[Dict[str, str]] """ diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index e857a9950..bf7e3ec16 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -29,6 +29,8 @@ class Meter( ): """ A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then attach the billing meter to a price and attach the price to a subscription to charge the user for the number of API calls they make. + + Related guide: [Usage based billing](https://docs.stripe.com/billing/subscriptions/usage-based) """ OBJECT_NAME: ClassVar[Literal["billing.meter"]] = "billing.meter" diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index 41dd41f34..f42349e68 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -125,6 +125,21 @@ class Product(StripeObject): The product ID. """ + class ScheduleAtPeriodEnd(StripeObject): + class Condition(StripeObject): + type: Literal[ + "decreasing_item_amount", "shortening_interval" + ] + """ + The type of condition. + """ + + conditions: List[Condition] + """ + List of conditions. When any condition is true, an update will be scheduled at the end of the current period. + """ + _inner_class_types = {"conditions": Condition} + default_allowed_updates: List[ Literal["price", "promotion_code", "quantity"] ] @@ -145,7 +160,11 @@ class Product(StripeObject): """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. Defaults to a value of `none` if you don't set it during creation. """ - _inner_class_types = {"products": Product} + schedule_at_period_end: Optional[ScheduleAtPeriodEnd] + _inner_class_types = { + "products": Product, + "schedule_at_period_end": ScheduleAtPeriodEnd, + } customer_update: CustomerUpdate invoice_history: InvoiceHistory @@ -173,7 +192,9 @@ class LoginPage(StripeObject): """ class CreateParams(RequestOptions): - business_profile: "Configuration.CreateParamsBusinessProfile" + business_profile: NotRequired[ + "Configuration.CreateParamsBusinessProfile" + ] """ The business information shown to customers in the portal. """ @@ -337,6 +358,12 @@ class CreateParamsFeaturesSubscriptionUpdate(TypedDict): """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. """ + schedule_at_period_end: NotRequired[ + "Configuration.CreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd" + ] + """ + Setting to control when an update should be scheduled at the end of the period instead of applying immediately. + """ class CreateParamsFeaturesSubscriptionUpdateProduct(TypedDict): prices: List[str] @@ -348,6 +375,24 @@ class CreateParamsFeaturesSubscriptionUpdateProduct(TypedDict): The product id. """ + class CreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd(TypedDict): + conditions: NotRequired[ + List[ + "Configuration.CreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition" + ] + ] + """ + List of conditions. When any condition is true, the update will be scheduled at the end of the current period. + """ + + class CreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition( + TypedDict, + ): + type: Literal["decreasing_item_amount", "shortening_interval"] + """ + The type of condition. + """ + class CreateParamsLoginPage(TypedDict): enabled: bool """ @@ -539,6 +584,12 @@ class ModifyParamsFeaturesSubscriptionUpdate(TypedDict): """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. """ + schedule_at_period_end: NotRequired[ + "Configuration.ModifyParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd" + ] + """ + Setting to control when an update should be scheduled at the end of the period instead of applying immediately. + """ class ModifyParamsFeaturesSubscriptionUpdateProduct(TypedDict): prices: List[str] @@ -550,6 +601,22 @@ class ModifyParamsFeaturesSubscriptionUpdateProduct(TypedDict): The product id. """ + class ModifyParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd(TypedDict): + conditions: NotRequired[ + "Literal['']|List[Configuration.ModifyParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition]" + ] + """ + List of conditions. When any condition is true, the update will be scheduled at the end of the current period. + """ + + class ModifyParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition( + TypedDict, + ): + type: Literal["decreasing_item_amount", "shortening_interval"] + """ + The type of condition. + """ + class ModifyParamsLoginPage(TypedDict): enabled: bool """ diff --git a/stripe/billing_portal/_configuration_service.py b/stripe/billing_portal/_configuration_service.py index 9edf1db04..ae3a1e47c 100644 --- a/stripe/billing_portal/_configuration_service.py +++ b/stripe/billing_portal/_configuration_service.py @@ -11,7 +11,9 @@ class ConfigurationService(StripeService): class CreateParams(TypedDict): - business_profile: "ConfigurationService.CreateParamsBusinessProfile" + business_profile: NotRequired[ + "ConfigurationService.CreateParamsBusinessProfile" + ] """ The business information shown to customers in the portal. """ @@ -175,6 +177,12 @@ class CreateParamsFeaturesSubscriptionUpdate(TypedDict): """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. """ + schedule_at_period_end: NotRequired[ + "ConfigurationService.CreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd" + ] + """ + Setting to control when an update should be scheduled at the end of the period instead of applying immediately. + """ class CreateParamsFeaturesSubscriptionUpdateProduct(TypedDict): prices: List[str] @@ -186,6 +194,24 @@ class CreateParamsFeaturesSubscriptionUpdateProduct(TypedDict): The product id. """ + class CreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd(TypedDict): + conditions: NotRequired[ + List[ + "ConfigurationService.CreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition" + ] + ] + """ + List of conditions. When any condition is true, the update will be scheduled at the end of the current period. + """ + + class CreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition( + TypedDict, + ): + type: Literal["decreasing_item_amount", "shortening_interval"] + """ + The type of condition. + """ + class CreateParamsLoginPage(TypedDict): enabled: bool """ @@ -383,6 +409,12 @@ class UpdateParamsFeaturesSubscriptionUpdate(TypedDict): """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. """ + schedule_at_period_end: NotRequired[ + "ConfigurationService.UpdateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd" + ] + """ + Setting to control when an update should be scheduled at the end of the period instead of applying immediately. + """ class UpdateParamsFeaturesSubscriptionUpdateProduct(TypedDict): prices: List[str] @@ -394,6 +426,22 @@ class UpdateParamsFeaturesSubscriptionUpdateProduct(TypedDict): The product id. """ + class UpdateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd(TypedDict): + conditions: NotRequired[ + "Literal['']|List[ConfigurationService.UpdateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition]" + ] + """ + List of conditions. When any condition is true, the update will be scheduled at the end of the current period. + """ + + class UpdateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition( + TypedDict, + ): + type: Literal["decreasing_item_amount", "shortening_interval"] + """ + The type of condition. + """ + class UpdateParamsLoginPage(TypedDict): enabled: bool """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 66bbac645..d4fe136d1 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -348,6 +348,7 @@ class TaxId(StripeObject): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -383,6 +384,8 @@ class TaxId(StripeObject): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -406,16 +409,19 @@ class TaxId(StripeObject): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "unknown", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` """ value: Optional[str] """ @@ -847,6 +853,22 @@ class Ideal(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class KakaoPay(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: Optional[Literal["none", "off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class Klarna(StripeObject): setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] @@ -877,6 +899,22 @@ class Konbini(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class KrCard(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: Optional[Literal["none", "off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class Link(StripeObject): setup_future_usage: Optional[Literal["none", "off_session"]] """ @@ -913,6 +951,12 @@ class Multibanco(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class NaverPay(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class Oxxo(StripeObject): expires_after_days: int """ @@ -941,6 +985,12 @@ class P24(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class Payco(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class Paynow(StripeObject): setup_future_usage: Optional[Literal["none"]] """ @@ -995,6 +1045,12 @@ class RevolutPay(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class SamsungPay(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class SepaDebit(StripeObject): setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] @@ -1101,17 +1157,22 @@ class Filters(StripeObject): giropay: Optional[Giropay] grabpay: Optional[Grabpay] ideal: Optional[Ideal] + kakao_pay: Optional[KakaoPay] klarna: Optional[Klarna] konbini: Optional[Konbini] + kr_card: Optional[KrCard] link: Optional[Link] mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] + naver_pay: Optional[NaverPay] oxxo: Optional[Oxxo] p24: Optional[P24] + payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] pix: Optional[Pix] revolut_pay: Optional[RevolutPay] + samsung_pay: Optional[SamsungPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] @@ -1134,17 +1195,22 @@ class Filters(StripeObject): "giropay": Giropay, "grabpay": Grabpay, "ideal": Ideal, + "kakao_pay": KakaoPay, "klarna": Klarna, "konbini": Konbini, + "kr_card": KrCard, "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, + "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "payco": Payco, "paynow": Paynow, "paypal": Paypal, "pix": Pix, "revolut_pay": RevolutPay, + "samsung_pay": SamsungPay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, @@ -1828,6 +1894,7 @@ class CreateParams(RequestOptions): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -1842,18 +1909,23 @@ class CreateParams(RequestOptions): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -2589,6 +2661,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Ideal payment method options. """ + kakao_pay: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsKakaoPay" + ] + """ + contains details about the Kakao Pay payment method options. + """ klarna: NotRequired["Session.CreateParamsPaymentMethodOptionsKlarna"] """ contains details about the Klarna payment method options. @@ -2597,6 +2675,10 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Konbini payment method options. """ + kr_card: NotRequired["Session.CreateParamsPaymentMethodOptionsKrCard"] + """ + contains details about the Korean card payment method options. + """ link: NotRequired["Session.CreateParamsPaymentMethodOptionsLink"] """ contains details about the Link payment method options. @@ -2613,6 +2695,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Multibanco payment method options. """ + naver_pay: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsNaverPay" + ] + """ + contains details about the Kakao Pay payment method options. + """ oxxo: NotRequired["Session.CreateParamsPaymentMethodOptionsOxxo"] """ contains details about the OXXO payment method options. @@ -2621,6 +2709,10 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the P24 payment method options. """ + payco: NotRequired["Session.CreateParamsPaymentMethodOptionsPayco"] + """ + contains details about the PAYCO payment method options. + """ paynow: NotRequired["Session.CreateParamsPaymentMethodOptionsPaynow"] """ contains details about the PayNow payment method options. @@ -2639,6 +2731,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the RevolutPay payment method options. """ + samsung_pay: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsSamsungPay" + ] + """ + contains details about the Samsung Pay payment method options. + """ sepa_debit: NotRequired[ "Session.CreateParamsPaymentMethodOptionsSepaDebit" ] @@ -3007,6 +3105,18 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsKlarna(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -3035,6 +3145,18 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsKrCard(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsLink(TypedDict): setup_future_usage: NotRequired[Literal["none", "off_session"]] """ @@ -3071,6 +3193,18 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -3103,6 +3237,9 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayco(TypedDict): + pass + class CreateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -3189,6 +3326,9 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsSamsungPay(TypedDict): + pass + class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 82d78f1be..c83951d3f 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -226,6 +226,7 @@ class CreateParams(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -240,18 +241,23 @@ class CreateParams(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -1017,6 +1023,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Ideal payment method options. """ + kakao_pay: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsKakaoPay" + ] + """ + contains details about the Kakao Pay payment method options. + """ klarna: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsKlarna" ] @@ -1029,6 +1041,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Konbini payment method options. """ + kr_card: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsKrCard" + ] + """ + contains details about the Korean card payment method options. + """ link: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsLink" ] @@ -1047,6 +1065,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Multibanco payment method options. """ + naver_pay: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsNaverPay" + ] + """ + contains details about the Kakao Pay payment method options. + """ oxxo: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsOxxo" ] @@ -1057,6 +1081,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the P24 payment method options. """ + payco: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsPayco" + ] + """ + contains details about the PAYCO payment method options. + """ paynow: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsPaynow" ] @@ -1079,6 +1109,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the RevolutPay payment method options. """ + samsung_pay: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsSamsungPay" + ] + """ + contains details about the Samsung Pay payment method options. + """ sepa_debit: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsSepaDebit" ] @@ -1451,6 +1487,18 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsKlarna(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -1479,6 +1527,18 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsKrCard(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsLink(TypedDict): setup_future_usage: NotRequired[Literal["none", "off_session"]] """ @@ -1515,6 +1575,18 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -1547,6 +1619,9 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayco(TypedDict): + pass + class CreateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -1633,6 +1708,9 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsSamsungPay(TypedDict): + pass + class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] diff --git a/stripe/forwarding/_request.py b/stripe/forwarding/_request.py index f371f380c..4fa54e14f 100644 --- a/stripe/forwarding/_request.py +++ b/stripe/forwarding/_request.py @@ -5,7 +5,7 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack @@ -98,6 +98,10 @@ class CreateParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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_method: str """ The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. @@ -197,6 +201,10 @@ class RetrieveParams(RequestOptions): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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["forwarding.request"] """ String representing the object's type. Objects of the same type share the same value. diff --git a/stripe/forwarding/_request_service.py b/stripe/forwarding/_request_service.py index b9049a234..7b95f680d 100644 --- a/stripe/forwarding/_request_service.py +++ b/stripe/forwarding/_request_service.py @@ -5,7 +5,7 @@ from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.forwarding._request import Request -from typing import List, cast +from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -15,6 +15,10 @@ class CreateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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_method: str """ The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index 37dc34817..f87a51c09 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -1211,7 +1211,7 @@ class CreateParams(RequestOptions): """ second_line: NotRequired["Literal['']|str"] """ - The second line to print on the card. + The second line to print on the card. Max length: 24 characters. """ shipping: NotRequired["Card.CreateParamsShipping"] """ @@ -3410,6 +3410,12 @@ class ShipCardParams(RequestOptions): Specifies which fields in the response should be expanded. """ + class SubmitCardParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + brand: str """ The brand of the card. @@ -4069,6 +4075,116 @@ async def ship_card_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def _cls_submit_card( + cls, card: str, **params: Unpack["Card.SubmitCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. + """ + return cast( + "Card", + cls._static_request( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/submit".format( + card=sanitize_id(card) + ), + params=params, + ), + ) + + @overload + @staticmethod + def submit_card( + card: str, **params: Unpack["Card.SubmitCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. + """ + ... + + @overload + def submit_card( + self, **params: Unpack["Card.SubmitCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. + """ + ... + + @class_method_variant("_cls_submit_card") + def submit_card( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Card.SubmitCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. + """ + return cast( + "Card", + self.resource._request( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/submit".format( + card=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_submit_card_async( + cls, card: str, **params: Unpack["Card.SubmitCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. + """ + return cast( + "Card", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/submit".format( + card=sanitize_id(card) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def submit_card_async( + card: str, **params: Unpack["Card.SubmitCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. + """ + ... + + @overload + async def submit_card_async( + self, **params: Unpack["Card.SubmitCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. + """ + ... + + @class_method_variant("_cls_submit_card_async") + async def submit_card_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Card.SubmitCardParams"] + ) -> "Card": + """ + Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. + """ + return cast( + "Card", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/submit".format( + card=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @property def test_helpers(self): return self.TestHelpers(self) diff --git a/stripe/issuing/_card_service.py b/stripe/issuing/_card_service.py index 3a0dcb9ff..06c07db93 100644 --- a/stripe/issuing/_card_service.py +++ b/stripe/issuing/_card_service.py @@ -48,7 +48,7 @@ class CreateParams(TypedDict): """ second_line: NotRequired["Literal['']|str"] """ - The second line to print on the card. + The second line to print on the card. Max length: 24 characters. """ shipping: NotRequired["CardService.CreateParamsShipping"] """ diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 07f6d8442..1e5f051eb 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -66,6 +66,7 @@ class TaxId(StripeObject): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -101,6 +102,8 @@ class TaxId(StripeObject): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -124,16 +127,19 @@ class TaxId(StripeObject): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "unknown", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` """ value: str """ @@ -235,6 +241,7 @@ class TaxRateDetails(StripeObject): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", @@ -313,14 +320,32 @@ class TaxRateDetails(StripeObject): class TaxBreakdown(StripeObject): class TaxRateDetails(StripeObject): + class FlatAmount(StripeObject): + amount: int + """ + Amount of the tax when the `rate_type` is `flat_amount`. This positive integer represents how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + """ + currency: str + """ + Three-letter ISO currency code, in lowercase. + """ + country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ + flat_amount: Optional[FlatAmount] + """ + The amount of the tax rate when the `rate_type` is `flat_amount`. Tax rates with `rate_type` `percentage` can vary based on the transaction, resulting in this field being `null`. This field exposes the amount and currency of the flat tax rate. + """ percentage_decimal: str """ The tax rate percentage as a string. For example, 8.5% is represented as `"8.5"`. """ + rate_type: Optional[Literal["flat_amount", "percentage"]] + """ + Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. + """ state: Optional[str] """ State, county, province, or region. @@ -336,6 +361,7 @@ class TaxRateDetails(StripeObject): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", @@ -344,6 +370,7 @@ class TaxRateDetails(StripeObject): """ The tax type, such as `vat` or `sales_tax`. """ + _inner_class_types = {"flat_amount": FlatAmount} amount: int """ @@ -482,6 +509,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -517,6 +545,8 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -540,15 +570,18 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/tax/_calculation_line_item.py b/stripe/tax/_calculation_line_item.py index 376dd7a36..17f903b36 100644 --- a/stripe/tax/_calculation_line_item.py +++ b/stripe/tax/_calculation_line_item.py @@ -48,6 +48,7 @@ class TaxRateDetails(StripeObject): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index cc367fc97..fbe7ec2ab 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -122,6 +122,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -157,6 +158,8 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -180,15 +183,18 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index 43bcb69a7..f779ceb69 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -87,6 +87,12 @@ class Bh(StripeObject): Type of registration in `country`. """ + class By(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Ca(StripeObject): class ProvinceStandard(StripeObject): province: str @@ -119,6 +125,12 @@ class Co(StripeObject): Type of registration in `country`. """ + class Cr(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Cy(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -175,6 +187,12 @@ class Standard(StripeObject): """ _inner_class_types = {"standard": Standard} + class Ec(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Ee(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -397,6 +415,18 @@ class Standard(StripeObject): """ _inner_class_types = {"standard": Standard} + class Ma(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + + class Md(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Mt(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -503,6 +533,18 @@ class Standard(StripeObject): """ _inner_class_types = {"standard": Standard} + class Rs(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + + class Ru(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Sa(StripeObject): type: Literal["simplified"] """ @@ -569,6 +611,12 @@ class Tr(StripeObject): Type of registration in `country`. """ + class Tz(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Us(StripeObject): class LocalAmusementTax(StripeObject): jurisdiction: str @@ -614,6 +662,7 @@ class Election(StripeObject): "local_amusement_tax", "local_lease_tax", "state_communications_tax", + "state_retail_delivery_fee", "state_sales_tax", ] """ @@ -625,6 +674,12 @@ class Election(StripeObject): "state_sales_tax": StateSalesTax, } + class Uz(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Vn(StripeObject): type: Literal["simplified"] """ @@ -643,14 +698,17 @@ class Za(StripeObject): be: Optional[Be] bg: Optional[Bg] bh: Optional[Bh] + by: Optional[By] ca: Optional[Ca] ch: Optional[Ch] cl: Optional[Cl] co: Optional[Co] + cr: Optional[Cr] cy: Optional[Cy] cz: Optional[Cz] de: Optional[De] dk: Optional[Dk] + ec: Optional[Ec] ee: Optional[Ee] eg: Optional[Eg] es: Optional[Es] @@ -672,6 +730,8 @@ class Za(StripeObject): lt: Optional[Lt] lu: Optional[Lu] lv: Optional[Lv] + ma: Optional[Ma] + md: Optional[Md] mt: Optional[Mt] mx: Optional[Mx] my: Optional[My] @@ -683,6 +743,8 @@ class Za(StripeObject): pl: Optional[Pl] pt: Optional[Pt] ro: Optional[Ro] + rs: Optional[Rs] + ru: Optional[Ru] sa: Optional[Sa] se: Optional[Se] sg: Optional[Sg] @@ -690,7 +752,9 @@ class Za(StripeObject): sk: Optional[Sk] th: Optional[Th] tr: Optional[Tr] + tz: Optional[Tz] us: Optional[Us] + uz: Optional[Uz] vn: Optional[Vn] za: Optional[Za] _inner_class_types = { @@ -700,14 +764,17 @@ class Za(StripeObject): "be": Be, "bg": Bg, "bh": Bh, + "by": By, "ca": Ca, "ch": Ch, "cl": Cl, "co": Co, + "cr": Cr, "cy": Cy, "cz": Cz, "de": De, "dk": Dk, + "ec": Ec, "ee": Ee, "eg": Eg, "es": Es, @@ -729,6 +796,8 @@ class Za(StripeObject): "lt": Lt, "lu": Lu, "lv": Lv, + "ma": Ma, + "md": Md, "mt": Mt, "mx": Mx, "my": My, @@ -740,6 +809,8 @@ class Za(StripeObject): "pl": Pl, "pt": Pt, "ro": Ro, + "rs": Rs, + "ru": Ru, "sa": Sa, "se": Se, "sg": Sg, @@ -747,7 +818,9 @@ class Za(StripeObject): "sk": Sk, "th": Th, "tr": Tr, + "tz": Tz, "us": Us, + "uz": Uz, "vn": Vn, "za": Za, } @@ -805,6 +878,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in BH. """ + by: NotRequired["Registration.CreateParamsCountryOptionsBy"] + """ + Options for the registration in BY. + """ ca: NotRequired["Registration.CreateParamsCountryOptionsCa"] """ Options for the registration in CA. @@ -821,6 +898,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in CO. """ + cr: NotRequired["Registration.CreateParamsCountryOptionsCr"] + """ + Options for the registration in CR. + """ cy: NotRequired["Registration.CreateParamsCountryOptionsCy"] """ Options for the registration in CY. @@ -837,6 +918,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in DK. """ + ec: NotRequired["Registration.CreateParamsCountryOptionsEc"] + """ + Options for the registration in EC. + """ ee: NotRequired["Registration.CreateParamsCountryOptionsEe"] """ Options for the registration in EE. @@ -917,6 +1002,14 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in LV. """ + ma: NotRequired["Registration.CreateParamsCountryOptionsMa"] + """ + Options for the registration in MA. + """ + md: NotRequired["Registration.CreateParamsCountryOptionsMd"] + """ + Options for the registration in MD. + """ mt: NotRequired["Registration.CreateParamsCountryOptionsMt"] """ Options for the registration in MT. @@ -961,6 +1054,14 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in RO. """ + rs: NotRequired["Registration.CreateParamsCountryOptionsRs"] + """ + Options for the registration in RS. + """ + ru: NotRequired["Registration.CreateParamsCountryOptionsRu"] + """ + Options for the registration in RU. + """ sa: NotRequired["Registration.CreateParamsCountryOptionsSa"] """ Options for the registration in SA. @@ -989,10 +1090,18 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in TR. """ + tz: NotRequired["Registration.CreateParamsCountryOptionsTz"] + """ + Options for the registration in TZ. + """ us: NotRequired["Registration.CreateParamsCountryOptionsUs"] """ Options for the registration in US. """ + uz: NotRequired["Registration.CreateParamsCountryOptionsUz"] + """ + Options for the registration in UZ. + """ vn: NotRequired["Registration.CreateParamsCountryOptionsVn"] """ Options for the registration in VN. @@ -1074,6 +1183,12 @@ class CreateParamsCountryOptionsBh(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsBy(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsCa(TypedDict): province_standard: NotRequired[ "Registration.CreateParamsCountryOptionsCaProvinceStandard" @@ -1110,6 +1225,12 @@ class CreateParamsCountryOptionsCo(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsCr(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsCy(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsCyStandard" @@ -1182,6 +1303,12 @@ class CreateParamsCountryOptionsDkStandard(TypedDict): Place of supply scheme used in an EU standard registration. """ + class CreateParamsCountryOptionsEc(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsEe(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsEeStandard" @@ -1452,6 +1579,18 @@ class CreateParamsCountryOptionsLvStandard(TypedDict): Place of supply scheme used in an EU standard registration. """ + class CreateParamsCountryOptionsMa(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsMd(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsMt(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsMtStandard" @@ -1578,6 +1717,18 @@ class CreateParamsCountryOptionsRoStandard(TypedDict): Place of supply scheme used in an EU standard registration. """ + class CreateParamsCountryOptionsRs(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsRu(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsSa(TypedDict): type: Literal["simplified"] """ @@ -1656,6 +1807,12 @@ class CreateParamsCountryOptionsTr(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsTz(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsUs(TypedDict): local_amusement_tax: NotRequired[ "Registration.CreateParamsCountryOptionsUsLocalAmusementTax" @@ -1683,6 +1840,7 @@ class CreateParamsCountryOptionsUs(TypedDict): "local_amusement_tax", "local_lease_tax", "state_communications_tax", + "state_retail_delivery_fee", "state_sales_tax", ] """ @@ -1723,6 +1881,12 @@ class CreateParamsCountryOptionsUsStateSalesTaxElection(TypedDict): The type of the election for the state sales tax registration. """ + class CreateParamsCountryOptionsUz(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsVn(TypedDict): type: Literal["simplified"] """ diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index fd7ccda89..86c979db5 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -66,6 +66,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in BH. """ + by: NotRequired["RegistrationService.CreateParamsCountryOptionsBy"] + """ + Options for the registration in BY. + """ ca: NotRequired["RegistrationService.CreateParamsCountryOptionsCa"] """ Options for the registration in CA. @@ -82,6 +86,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in CO. """ + cr: NotRequired["RegistrationService.CreateParamsCountryOptionsCr"] + """ + Options for the registration in CR. + """ cy: NotRequired["RegistrationService.CreateParamsCountryOptionsCy"] """ Options for the registration in CY. @@ -98,6 +106,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in DK. """ + ec: NotRequired["RegistrationService.CreateParamsCountryOptionsEc"] + """ + Options for the registration in EC. + """ ee: NotRequired["RegistrationService.CreateParamsCountryOptionsEe"] """ Options for the registration in EE. @@ -178,6 +190,14 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in LV. """ + ma: NotRequired["RegistrationService.CreateParamsCountryOptionsMa"] + """ + Options for the registration in MA. + """ + md: NotRequired["RegistrationService.CreateParamsCountryOptionsMd"] + """ + Options for the registration in MD. + """ mt: NotRequired["RegistrationService.CreateParamsCountryOptionsMt"] """ Options for the registration in MT. @@ -222,6 +242,14 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in RO. """ + rs: NotRequired["RegistrationService.CreateParamsCountryOptionsRs"] + """ + Options for the registration in RS. + """ + ru: NotRequired["RegistrationService.CreateParamsCountryOptionsRu"] + """ + Options for the registration in RU. + """ sa: NotRequired["RegistrationService.CreateParamsCountryOptionsSa"] """ Options for the registration in SA. @@ -250,10 +278,18 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in TR. """ + tz: NotRequired["RegistrationService.CreateParamsCountryOptionsTz"] + """ + Options for the registration in TZ. + """ us: NotRequired["RegistrationService.CreateParamsCountryOptionsUs"] """ Options for the registration in US. """ + uz: NotRequired["RegistrationService.CreateParamsCountryOptionsUz"] + """ + Options for the registration in UZ. + """ vn: NotRequired["RegistrationService.CreateParamsCountryOptionsVn"] """ Options for the registration in VN. @@ -335,6 +371,12 @@ class CreateParamsCountryOptionsBh(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsBy(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsCa(TypedDict): province_standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsCaProvinceStandard" @@ -371,6 +413,12 @@ class CreateParamsCountryOptionsCo(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsCr(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsCy(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsCyStandard" @@ -443,6 +491,12 @@ class CreateParamsCountryOptionsDkStandard(TypedDict): Place of supply scheme used in an EU standard registration. """ + class CreateParamsCountryOptionsEc(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsEe(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsEeStandard" @@ -713,6 +767,18 @@ class CreateParamsCountryOptionsLvStandard(TypedDict): Place of supply scheme used in an EU standard registration. """ + class CreateParamsCountryOptionsMa(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsMd(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsMt(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsMtStandard" @@ -839,6 +905,18 @@ class CreateParamsCountryOptionsRoStandard(TypedDict): Place of supply scheme used in an EU standard registration. """ + class CreateParamsCountryOptionsRs(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsRu(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsSa(TypedDict): type: Literal["simplified"] """ @@ -917,6 +995,12 @@ class CreateParamsCountryOptionsTr(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsTz(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsUs(TypedDict): local_amusement_tax: NotRequired[ "RegistrationService.CreateParamsCountryOptionsUsLocalAmusementTax" @@ -944,6 +1028,7 @@ class CreateParamsCountryOptionsUs(TypedDict): "local_amusement_tax", "local_lease_tax", "state_communications_tax", + "state_retail_delivery_fee", "state_sales_tax", ] """ @@ -984,6 +1069,12 @@ class CreateParamsCountryOptionsUsStateSalesTaxElection(TypedDict): The type of the election for the state sales tax registration. """ + class CreateParamsCountryOptionsUz(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsVn(TypedDict): type: Literal["simplified"] """ diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index 8711f8d18..3b4a299ba 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -66,6 +66,7 @@ class TaxId(StripeObject): "bo_tin", "br_cnpj", "br_cpf", + "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", @@ -101,6 +102,8 @@ class TaxId(StripeObject): "kr_brn", "kz_bin", "li_uid", + "ma_vat", + "md_vat", "mx_rfc", "my_frp", "my_itn", @@ -124,16 +127,19 @@ class TaxId(StripeObject): "th_vat", "tr_tin", "tw_vat", + "tz_vat", "ua_vat", "unknown", "us_ein", "uy_ruc", + "uz_tin", + "uz_vat", "ve_rif", "vn_tin", "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` """ value: str """ @@ -241,6 +247,7 @@ class TaxRateDetails(StripeObject): "lease_tax", "pst", "qst", + "retail_delivery_fee", "rst", "sales_tax", "vat", diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index 84a7dda32..9982e73d4 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -219,6 +219,20 @@ class Nzd(StripeObject): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class Pln(StripeObject): + fixed_amounts: Optional[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: Optional[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: Optional[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class Sek(StripeObject): fixed_amounts: Optional[List[int]] """ @@ -272,6 +286,7 @@ class Usd(StripeObject): myr: Optional[Myr] nok: Optional[Nok] nzd: Optional[Nzd] + pln: Optional[Pln] sek: Optional[Sek] sgd: Optional[Sgd] usd: Optional[Usd] @@ -287,6 +302,7 @@ class Usd(StripeObject): "myr": Myr, "nok": Nok, "nzd": Nzd, + "pln": Pln, "sek": Sek, "sgd": Sgd, "usd": Usd, @@ -405,6 +421,10 @@ class CreateParamsTipping(TypedDict): """ Tipping configuration for NZD """ + pln: NotRequired["Configuration.CreateParamsTippingPln"] + """ + Tipping configuration for PLN + """ sek: NotRequired["Configuration.CreateParamsTippingSek"] """ Tipping configuration for SEK @@ -572,6 +592,20 @@ class CreateParamsTippingNzd(TypedDict): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class CreateParamsTippingPln(TypedDict): + fixed_amounts: NotRequired[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: NotRequired[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: NotRequired[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class CreateParamsTippingSek(TypedDict): fixed_amounts: NotRequired[List[int]] """ @@ -760,6 +794,10 @@ class ModifyParamsTipping(TypedDict): """ Tipping configuration for NZD """ + pln: NotRequired["Configuration.ModifyParamsTippingPln"] + """ + Tipping configuration for PLN + """ sek: NotRequired["Configuration.ModifyParamsTippingSek"] """ Tipping configuration for SEK @@ -927,6 +965,20 @@ class ModifyParamsTippingNzd(TypedDict): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class ModifyParamsTippingPln(TypedDict): + fixed_amounts: NotRequired[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: NotRequired[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: NotRequired[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class ModifyParamsTippingSek(TypedDict): fixed_amounts: NotRequired[List[int]] """ diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index a47d12507..ab58a57db 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -127,6 +127,10 @@ class CreateParamsTipping(TypedDict): """ Tipping configuration for NZD """ + pln: NotRequired["ConfigurationService.CreateParamsTippingPln"] + """ + Tipping configuration for PLN + """ sek: NotRequired["ConfigurationService.CreateParamsTippingSek"] """ Tipping configuration for SEK @@ -294,6 +298,20 @@ class CreateParamsTippingNzd(TypedDict): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class CreateParamsTippingPln(TypedDict): + fixed_amounts: NotRequired[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: NotRequired[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: NotRequired[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class CreateParamsTippingSek(TypedDict): fixed_amounts: NotRequired[List[int]] """ @@ -492,6 +510,10 @@ class UpdateParamsTipping(TypedDict): """ Tipping configuration for NZD """ + pln: NotRequired["ConfigurationService.UpdateParamsTippingPln"] + """ + Tipping configuration for PLN + """ sek: NotRequired["ConfigurationService.UpdateParamsTippingSek"] """ Tipping configuration for SEK @@ -659,6 +681,20 @@ class UpdateParamsTippingNzd(TypedDict): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class UpdateParamsTippingPln(TypedDict): + fixed_amounts: NotRequired[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: NotRequired[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: NotRequired[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class UpdateParamsTippingSek(TypedDict): fixed_amounts: NotRequired[List[int]] """ diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index c52789f0a..d9eceea8e 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -69,6 +69,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ + alma: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataAlma" + ] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ amazon_pay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataAmazonPay" ] @@ -159,6 +165,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ + kakao_pay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ klarna: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataKlarna" ] @@ -171,6 +183,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ + kr_card: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ link: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataLink" ] @@ -193,6 +211,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ + naver_pay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ oxxo: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataOxxo" ] @@ -205,6 +229,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + payco: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataPayco" + ] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ paynow: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataPaynow" ] @@ -241,6 +271,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ + samsung_pay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ sepa_debit: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataSepaDebit" ] @@ -270,6 +306,7 @@ class CreateParamsPaymentMethodData(TypedDict): "affirm", "afterpay_clearpay", "alipay", + "alma", "amazon_pay", "au_becs_debit", "bacs_debit", @@ -283,18 +320,23 @@ class CreateParamsPaymentMethodData(TypedDict): "giropay", "grabpay", "ideal", + "kakao_pay", "klarna", "konbini", + "kr_card", "link", "mobilepay", "multibanco", + "naver_pay", "oxxo", "p24", + "payco", "paynow", "paypal", "pix", "promptpay", "revolut_pay", + "samsung_pay", "sepa_debit", "sofort", "swish", @@ -348,6 +390,9 @@ class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): class CreateParamsPaymentMethodDataAlipay(TypedDict): pass + class CreateParamsPaymentMethodDataAlma(TypedDict): + pass + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): pass @@ -533,12 +578,15 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): ] ] """ - The customer's bank. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ class CreateParamsPaymentMethodDataInteracPresent(TypedDict): pass + class CreateParamsPaymentMethodDataKakaoPay(TypedDict): + pass + class CreateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataKlarnaDob" @@ -564,6 +612,9 @@ class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): class CreateParamsPaymentMethodDataKonbini(TypedDict): pass + class CreateParamsPaymentMethodDataKrCard(TypedDict): + pass + class CreateParamsPaymentMethodDataLink(TypedDict): pass @@ -573,6 +624,12 @@ class CreateParamsPaymentMethodDataMobilepay(TypedDict): class CreateParamsPaymentMethodDataMultibanco(TypedDict): pass + class CreateParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -611,6 +668,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayco(TypedDict): + pass + class CreateParamsPaymentMethodDataPaynow(TypedDict): pass @@ -632,6 +692,9 @@ class CreateParamsPaymentMethodDataRadarOptions(TypedDict): class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass + class CreateParamsPaymentMethodDataSamsungPay(TypedDict): + pass + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ diff --git a/stripe/test_helpers/issuing/_card_service.py b/stripe/test_helpers/issuing/_card_service.py index 5add490c4..ede80012f 100644 --- a/stripe/test_helpers/issuing/_card_service.py +++ b/stripe/test_helpers/issuing/_card_service.py @@ -33,6 +33,12 @@ class ShipCardParams(TypedDict): Specifies which fields in the response should be expanded. """ + class SubmitCardParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + def deliver_card( self, card: str, @@ -208,3 +214,47 @@ async def ship_card_async( options=options, ), ) + + def submit_card( + self, + card: str, + params: "CardService.SubmitCardParams" = {}, + options: RequestOptions = {}, + ) -> Card: + """ + Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. + """ + return cast( + Card, + self._request( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/submit".format( + card=sanitize_id(card), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def submit_card_async( + self, + card: str, + params: "CardService.SubmitCardParams" = {}, + options: RequestOptions = {}, + ) -> Card: + """ + Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. + """ + return cast( + Card, + await self._request_async( + "post", + "/v1/test_helpers/issuing/cards/{card}/shipping/submit".format( + card=sanitize_id(card), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index 3afd750e4..f4ba9cc49 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -761,7 +761,7 @@ class UpdateFeaturesParamsOutboundTransfersUsDomesticWire(TypedDict): """ status: Literal["closed", "open"] """ - The enum specifying what state the account is in. + Status of this FinancialAccount. """ status_details: StatusDetails supported_currencies: List[str] diff --git a/stripe/v2/__init__.py b/stripe/v2/__init__.py index d8a2170e1..73418d2cf 100644 --- a/stripe/v2/__init__.py +++ b/stripe/v2/__init__.py @@ -7,4 +7,5 @@ from stripe.v2._billing_service import BillingService as BillingService from stripe.v2._core_service import CoreService as CoreService from stripe.v2._event import Event as Event +from stripe.v2._event_destination import EventDestination as EventDestination # The end of the section generated from our OpenAPI spec diff --git a/stripe/v2/_core_service.py b/stripe/v2/_core_service.py index 96c4a6f2e..f8e6b1dad 100644 --- a/stripe/v2/_core_service.py +++ b/stripe/v2/_core_service.py @@ -1,10 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService +from stripe.v2.core._event_destination_service import EventDestinationService from stripe.v2.core._event_service import EventService class CoreService(StripeService): def __init__(self, requestor): super().__init__(requestor) + self.event_destinations = EventDestinationService(self._requestor) self.events = EventService(self._requestor) diff --git a/stripe/v2/_event_destination.py b/stripe/v2/_event_destination.py new file mode 100644 index 000000000..1490f0c71 --- /dev/null +++ b/stripe/v2/_event_destination.py @@ -0,0 +1,124 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict, List, Optional +from typing_extensions import Literal + + +class EventDestination(StripeObject): + OBJECT_NAME: ClassVar[Literal["v2.core.event_destination"]] = ( + "v2.core.event_destination" + ) + + class StatusDetails(StripeObject): + class Disabled(StripeObject): + reason: Literal["no_aws_event_source_exists", "user"] + """ + Reason event destination has been disabled. + """ + + disabled: Optional[Disabled] + """ + Details about why the event destination has been disabled. + """ + _inner_class_types = {"disabled": Disabled} + + class AmazonEventbridge(StripeObject): + aws_account_id: str + """ + The AWS account ID. + """ + aws_event_source_arn: str + """ + The ARN of the AWS event source. + """ + aws_event_source_status: Literal[ + "active", "deleted", "pending", "unknown" + ] + """ + The state of the AWS event source. + """ + + class WebhookEndpoint(StripeObject): + signing_secret: Optional[str] + """ + The signing secret of the webhook endpoint, only includable on creation. + """ + url: Optional[str] + """ + The URL of the webhook endpoint, includable. + """ + + created: str + """ + Time at which the object was created. + """ + description: str + """ + An optional description of what the event destination is used for. + """ + enabled_events: List[str] + """ + The list of events to enable for this endpoint. + """ + event_payload: Literal["snapshot", "thin"] + """ + Payload type of events being subscribed to. + """ + events_from: Optional[List[Literal["other_accounts", "self"]]] + """ + Where events should be routed from. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Optional[Dict[str, str]] + """ + Metadata. + """ + name: str + """ + Event destination name. + """ + object: Literal["v2.core.event_destination"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + snapshot_api_version: Optional[str] + """ + If using the snapshot event payload, the API version events are rendered as. + """ + status: Literal["disabled", "enabled"] + """ + Status. It can be set to either enabled or disabled. + """ + status_details: Optional[StatusDetails] + """ + Additional information about event destination status. + """ + type: Literal["amazon_eventbridge", "webhook_endpoint"] + """ + Event destination type. + """ + updated: str + """ + Time at which the object was last updated. + """ + amazon_eventbridge: Optional[AmazonEventbridge] + """ + Amazon EventBridge configuration. + """ + webhook_endpoint: Optional[WebhookEndpoint] + """ + Webhook endpoint configuration. + """ + _inner_class_types = { + "status_details": StatusDetails, + "amazon_eventbridge": AmazonEventbridge, + "webhook_endpoint": WebhookEndpoint, + } diff --git a/stripe/v2/core/__init__.py b/stripe/v2/core/__init__.py index 5879a6c60..14173e719 100644 --- a/stripe/v2/core/__init__.py +++ b/stripe/v2/core/__init__.py @@ -1,3 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.v2.core._event_destination_service import ( + EventDestinationService as EventDestinationService, +) from stripe.v2.core._event_service import EventService as EventService diff --git a/stripe/v2/core/_event_destination_service.py b/stripe/v2/core/_event_destination_service.py new file mode 100644 index 000000000..bb888184e --- /dev/null +++ b/stripe/v2/core/_event_destination_service.py @@ -0,0 +1,478 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._event import Event +from stripe.v2._event_destination import EventDestination +from stripe.v2._list_object import ListObject +from typing import Dict, List, Optional, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class EventDestinationService(StripeService): + class CreateParams(TypedDict): + description: NotRequired[str] + """ + An optional description of what the event destination is used for. + """ + enabled_events: List[str] + """ + The list of events to enable for this endpoint. + """ + event_payload: Literal["snapshot", "thin"] + """ + Payload type of events being subscribed to. + """ + events_from: NotRequired[List[Literal["other_accounts", "self"]]] + """ + Where events should be routed from. + """ + include: NotRequired[ + List[ + Literal[ + "webhook_endpoint.signing_secret", "webhook_endpoint.url" + ] + ] + ] + """ + Additional fields to include in the response. + """ + metadata: NotRequired[Dict[str, str]] + """ + Metadata. + """ + name: str + """ + Event destination name. + """ + snapshot_api_version: NotRequired[str] + """ + If using the snapshot event payload, the API version events are rendered as. + """ + type: Literal["amazon_eventbridge", "webhook_endpoint"] + """ + Event destination type. + """ + amazon_eventbridge: NotRequired[ + "EventDestinationService.CreateParamsAmazonEventbridge" + ] + """ + Amazon EventBridge configuration. + """ + webhook_endpoint: NotRequired[ + "EventDestinationService.CreateParamsWebhookEndpoint" + ] + """ + Webhook endpoint configuration. + """ + + class CreateParamsAmazonEventbridge(TypedDict): + aws_account_id: str + """ + The AWS account ID. + """ + aws_region: str + """ + The region of the AWS event source. + """ + + class CreateParamsWebhookEndpoint(TypedDict): + url: str + """ + The URL of the webhook endpoint. + """ + + class DeleteParams(TypedDict): + pass + + class DisableParams(TypedDict): + pass + + class EnableParams(TypedDict): + pass + + class ListParams(TypedDict): + include: NotRequired[List[Literal["webhook_endpoint.url"]]] + """ + Additional fields to include in the response. Currently supports `webhook_endpoint.url`. + """ + limit: NotRequired[int] + """ + The page size. + """ + page: NotRequired[str] + """ + The requested page. + """ + + class PingParams(TypedDict): + pass + + class RetrieveParams(TypedDict): + include: NotRequired[List[Literal["webhook_endpoint.url"]]] + """ + Additional fields to include in the response. + """ + + class UpdateParams(TypedDict): + description: NotRequired[str] + """ + An optional description of what the event destination is used for. + """ + enabled_events: NotRequired[List[str]] + """ + The list of events to enable for this endpoint. + """ + include: NotRequired[List[Literal["webhook_endpoint.url"]]] + """ + Additional fields to include in the response. Currently supports `webhook_endpoint.url`. + """ + metadata: NotRequired[Dict[str, Optional[str]]] + """ + Metadata. + """ + name: NotRequired[str] + """ + Event destination name. + """ + webhook_endpoint: NotRequired[ + "EventDestinationService.UpdateParamsWebhookEndpoint" + ] + """ + Webhook endpoint configuration. + """ + + class UpdateParamsWebhookEndpoint(TypedDict): + url: str + """ + The URL of the webhook endpoint. + """ + + def create( + self, + params: "EventDestinationService.CreateParams", + options: RequestOptions = {}, + ) -> EventDestination: + """ + Create a new event destination. + """ + return cast( + EventDestination, + self._request( + "post", + "/v2/core/event_destinations", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "EventDestinationService.CreateParams", + options: RequestOptions = {}, + ) -> EventDestination: + """ + Create a new event destination. + """ + return cast( + EventDestination, + await self._request_async( + "post", + "/v2/core/event_destinations", + base_address="api", + params=params, + options=options, + ), + ) + + def delete( + self, + id: str, + params: "EventDestinationService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Delete an event destination. + """ + return cast( + EventDestination, + self._request( + "delete", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def delete_async( + self, + id: str, + params: "EventDestinationService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Delete an event destination. + """ + return cast( + EventDestination, + await self._request_async( + "delete", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def disable( + self, + id: str, + params: "EventDestinationService.DisableParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Disable an event destination. + """ + return cast( + EventDestination, + self._request( + "post", + "/v2/core/event_destinations/{id}/disable".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def disable_async( + self, + id: str, + params: "EventDestinationService.DisableParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Disable an event destination. + """ + return cast( + EventDestination, + await self._request_async( + "post", + "/v2/core/event_destinations/{id}/disable".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def enable( + self, + id: str, + params: "EventDestinationService.EnableParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Enable an event destination. + """ + return cast( + EventDestination, + self._request( + "post", + "/v2/core/event_destinations/{id}/enable".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def enable_async( + self, + id: str, + params: "EventDestinationService.EnableParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Enable an event destination. + """ + return cast( + EventDestination, + await self._request_async( + "post", + "/v2/core/event_destinations/{id}/enable".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + params: "EventDestinationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[EventDestination]: + """ + Lists all event destinations. + """ + return cast( + ListObject[EventDestination], + self._request( + "get", + "/v2/core/event_destinations", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "EventDestinationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[EventDestination]: + """ + Lists all event destinations. + """ + return cast( + ListObject[EventDestination], + await self._request_async( + "get", + "/v2/core/event_destinations", + base_address="api", + params=params, + options=options, + ), + ) + + def ping( + self, + id: str, + params: "EventDestinationService.PingParams" = {}, + options: RequestOptions = {}, + ) -> Event: + """ + Send a `ping` event to an event destination. + """ + return cast( + Event, + self._request( + "post", + "/v2/core/event_destinations/{id}/ping".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def ping_async( + self, + id: str, + params: "EventDestinationService.PingParams" = {}, + options: RequestOptions = {}, + ) -> Event: + """ + Send a `ping` event to an event destination. + """ + return cast( + Event, + await self._request_async( + "post", + "/v2/core/event_destinations/{id}/ping".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "EventDestinationService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Retrieves the details of an event destination. + """ + return cast( + EventDestination, + self._request( + "get", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "EventDestinationService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Retrieves the details of an event destination. + """ + return cast( + EventDestination, + await self._request_async( + "get", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + params: "EventDestinationService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Update the details of an event destination. + """ + return cast( + EventDestination, + self._request( + "post", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: "EventDestinationService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Update the details of an event destination. + """ + return cast( + EventDestination, + await self._request_async( + "post", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/core/_event_service.py b/stripe/v2/core/_event_service.py index 999fe8471..712685824 100644 --- a/stripe/v2/core/_event_service.py +++ b/stripe/v2/core/_event_service.py @@ -21,7 +21,7 @@ class ListParams(TypedDict): """ page: NotRequired[str] """ - The requested page number. + The requested page. """ class RetrieveParams(TypedDict): From 7c3a43d72772643aa69517ac173d77e97aa0d4ce Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Tue, 29 Oct 2024 14:17:35 -0700 Subject: [PATCH 125/179] Bump version to 11.2.0 --- CHANGELOG.md | 34 ++++++++++++++++++++++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e89347ffc..74c4b3e70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,37 @@ +## 11.2.0 - 2024-10-29 +* [#1411](https://github.com/stripe/stripe-python/pull/1411) Update generated code + * Add support for resource `stripe.v2.EventDestinations` + * Add support for `create`, `retrieve`, `update`, `list`, `delete`, `disable`, `enable` and `ping` methods on resource `V2.EventDestinations` + * Add support for `alma_payments`, `kakao_pay_payments`, `kr_card_payments`, `naver_pay_payments`, `payco_payments`, `samsung_pay_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `groups` on parameter class `stripe.Account.CreateParams` and resource `stripe.Account` + * Add support for `disable_stripe_user_authentication` on resource classes `stripe.AccountSession.Components.AccountManagement.Features`, `stripe.AccountSession.Components.AccountOnboarding.Features`, `stripe.AccountSession.Components.Balances.Features`, `stripe.AccountSession.Components.NotificationBanner.Features`, and `stripe.AccountSession.Components.Payouts.Features` and parameter classes `stripe.AccountSession.CreateParamsComponentsAccountManagementFeatures`, `stripe.AccountSession.CreateParamsComponentsAccountOnboardingFeatures`, `stripe.AccountSession.CreateParamsComponentsBalancesFeatures`, `stripe.AccountSession.CreateParamsComponentsNotificationBannerFeatures`, and `stripe.AccountSession.CreateParamsComponentsPayoutsFeatures` + * Add support for `alma` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.Refund.DestinationDetails`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` + * Add support for `kakao_pay`, `kr_card` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.Mandate.PaymentMethodDetails`, `stripe.PaymentIntent.PaymentMethodOptions`, `stripe.SetupAttempt.PaymentMethodDetails`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resource `stripe.PaymentMethod` + * Add support for `naver_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resource `stripe.PaymentMethod` + * Add support for `payco`, `samsung_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resource `stripe.PaymentMethod` + * Add support for `enhanced_evidence` on resource class `stripe.Dispute.Evidence` and parameter class `stripe.Dispute.ModifyParamsEvidence` + * Add support for `enhanced_eligibility` on resource class `stripe.Dispute.EvidenceDetails` + * Add support for `enhanced_eligibility_types` on resource `stripe.Dispute` + * Add support for `automatically_finalizes_at` on parameter classes `stripe.Invoice.CreateParams` and `stripe.Invoice.ModifyParams` + * Add support for `amazon_pay` on resource `stripe.PaymentMethodDomain` + * Add support for `flat_amount`, `rate_type` on resource `stripe.TaxRate` and resource class `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails` + * Add support for `schedule_at_period_end` on parameter classes `stripe.billing_portal.Configuration.CreateParamsFeaturesSubscriptionUpdate` and `stripe.billing_portal.Configuration.ModifyParamsFeaturesSubscriptionUpdate` and resource class `stripe.billing_portal.Configuration.Features.SubscriptionUpdate` + * Add support for `metadata` on parameter class `stripe.forwarding.Request.CreateParams` and resource `stripe.forwarding.Request` + * Add support for `_cls_submit_card` on resource `stripe.issuing.Card` + * Add support for `submit_card` on resource `stripe.issuing.Card` + * Add support for `by`, `cr`, `ec`, `ma`, `md`, `rs`, `ru`, `tz`, `uz` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `pln` on parameter classes `stripe.terminal.Configuration.CreateParamsTipping` and `stripe.terminal.Configuration.ModifyParamsTipping` and resource class `stripe.terminal.Configuration.Tipping` + * Change type of `business_profile` on `stripe.billing_portal.Configuration.CreateParams` from `Configuration.CreateParamsBusinessProfile` to `NotRequired[Configuration.CreateParamsBusinessProfile]` + * Add support for `by_tin`, `ma_vat`, `md_vat`, `tz_vat`, `uz_tin`, `uz_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `alma`, `kakao_pay`, `kr_card`, `naver_pay`, `payco` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `samsung_pay` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `auto` on enum `stripe.Customer.ModifyParamsTax.validate_location` + * Add support for `issuing_transaction.purchase_details_receipt_updated`, `refund.failed` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `jp_credit_transfer` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Add support for `retail_delivery_fee` on enums `stripe.Invoice.AddLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.Invoice.UpdateLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.InvoiceLineItem.ModifyParamsTaxAmountTaxRateData.tax_type`, `stripe.tax.Calculation.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.CalculationLineItem.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Transaction.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.TaxRate.tax_type`, `stripe.TaxRate.CreateParams.tax_type`, and `stripe.TaxRate.ModifyParams.tax_type` + * Add support for `state_retail_delivery_fee` on enums `stripe.tax.Registration.CountryOptions.Us.type` and `stripe.tax.Registration.CreateParamsCountryOptionsUs.type` + * Add support for `2024-10-28.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` + ## 11.1.1 - 2024-10-18 * [#1414](https://github.com/stripe/stripe-python/pull/1414) Deserialize into correct v2 EventData types * Fixes a bug where v2 EventData was not being deserialized into the appropriate type for `V1BillingMeterErrorReportTriggeredEvent` and `V1BillingMeterNoMeterFoundEvent` diff --git a/VERSION b/VERSION index 668182d21..b85c6c7b0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.1.1 +11.2.0 diff --git a/stripe/_version.py b/stripe/_version.py index 043e1f3c1..00a5f7802 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "11.1.1" +VERSION = "11.2.0" From 5c185815b7b9684af8d5fb13ef99c5151545ba75 Mon Sep 17 00:00:00 2001 From: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> Date: Wed, 30 Oct 2024 16:42:16 -0700 Subject: [PATCH 126/179] Update changelog with a note on 2024-10-28.acacia API version (#1420) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74c4b3e70..3e1073bdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## 11.2.0 - 2024-10-29 -* [#1411](https://github.com/stripe/stripe-python/pull/1411) Update generated code +* [#1411](https://github.com/stripe/stripe-python/pull/1411) This release changes the pinned API version to `2024-10-28.acacia`. * Add support for resource `stripe.v2.EventDestinations` * Add support for `create`, `retrieve`, `update`, `list`, `delete`, `disable`, `enable` and `ping` methods on resource `V2.EventDestinations` * Add support for `alma_payments`, `kakao_pay_payments`, `kr_card_payments`, `naver_pay_payments`, `payco_payments`, `samsung_pay_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` From 62558c7fa811189e244301b6cd0a9263150c59c4 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:28:07 -0800 Subject: [PATCH 127/179] Update generated code (#1424) * Update generated code for v1341 * Update generated code for v1347 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 60 ++++++- stripe/_account_person_service.py | 12 ++ stripe/_account_session.py | 12 +- stripe/_api_version.py | 2 +- stripe/_charge.py | 10 +- stripe/_confirmation_token.py | 8 +- stripe/_customer.py | 6 +- stripe/_customer_service.py | 3 +- stripe/_customer_tax_id_service.py | 3 +- stripe/_dispute.py | 2 +- stripe/_file.py | 2 + stripe/_file_link.py | 2 +- stripe/_file_link_service.py | 2 +- stripe/_file_service.py | 1 + stripe/_funding_instructions.py | 132 ++++++++++++++ stripe/_invoice.py | 14 +- stripe/_invoice_line_item.py | 1 + stripe/_invoice_line_item_service.py | 1 + stripe/_invoice_service.py | 8 +- stripe/_invoice_upcoming_lines_service.py | 3 +- stripe/_payment_intent.py | 144 +++++++++++++++- stripe/_payment_intent_service.py | 9 +- stripe/_payment_link.py | 16 +- stripe/_payment_link_service.py | 14 +- stripe/_payment_method.py | 8 +- stripe/_payout.py | 17 ++ stripe/_person.py | 4 + stripe/_refund.py | 8 + stripe/_setup_attempt.py | 4 +- stripe/_setup_intent.py | 14 +- stripe/_setup_intent_service.py | 11 +- stripe/_subscription.py | 13 +- stripe/_subscription_service.py | 8 +- stripe/_tax_id.py | 6 +- stripe/_tax_id_service.py | 3 +- stripe/_tax_rate.py | 3 + stripe/_tax_rate_service.py | 2 + stripe/_token.py | 4 + stripe/_token_service.py | 4 + stripe/_webhook_endpoint.py | 1 + stripe/_webhook_endpoint_service.py | 1 + stripe/billing/_credit_balance_summary.py | 2 +- .../_credit_balance_summary_service.py | 2 +- stripe/billing/_credit_grant.py | 63 ++++--- stripe/billing/_credit_grant_service.py | 28 +-- stripe/billing/_meter_event.py | 2 +- stripe/billing/_meter_event_service.py | 2 +- stripe/checkout/_session.py | 126 +++++++++++++- stripe/checkout/_session_service.py | 80 ++++++++- stripe/identity/_verification_report.py | 2 +- stripe/identity/_verification_session.py | 4 +- .../identity/_verification_session_service.py | 2 +- stripe/issuing/_authorization.py | 163 +++++++++++++++++- stripe/issuing/_card.py | 4 +- stripe/issuing/_cardholder.py | 2 +- stripe/tax/_calculation.py | 8 +- stripe/tax/_calculation_line_item.py | 1 + stripe/tax/_calculation_service.py | 3 +- stripe/tax/_transaction.py | 4 +- .../issuing/_authorization_service.py | 64 ++++++- stripe/treasury/_inbound_transfer.py | 2 +- 62 files changed, 992 insertions(+), 152 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c626f7dd8..7ab08411d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1319 \ No newline at end of file +v1347 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index b13e39411..8fa660038 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -798,9 +798,27 @@ class Error(StripeObject): """ Fields that need to be collected to keep the account enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. """ - disabled_reason: Optional[str] + disabled_reason: Optional[ + Literal[ + "action_required.requested_capabilities", + "listed", + "other", + "platform_paused", + "rejected.fraud", + "rejected.incomplete_verification", + "rejected.listed", + "rejected.other", + "rejected.platform_fraud", + "rejected.platform_other", + "rejected.platform_terms_of_service", + "rejected.terms_of_service", + "requirements.past_due", + "requirements.pending_verification", + "under_review", + ] + ] """ - This is typed as a string for consistency with `requirements.disabled_reason`. + This is typed as an enum for consistency with `requirements.disabled_reason`. """ errors: Optional[List[Error]] """ @@ -954,9 +972,27 @@ class Error(StripeObject): """ Fields that need to be collected to keep the account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. """ - disabled_reason: Optional[str] + disabled_reason: Optional[ + Literal[ + "action_required.requested_capabilities", + "listed", + "other", + "platform_paused", + "rejected.fraud", + "rejected.incomplete_verification", + "rejected.listed", + "rejected.other", + "rejected.platform_fraud", + "rejected.platform_other", + "rejected.platform_terms_of_service", + "rejected.terms_of_service", + "requirements.past_due", + "requirements.pending_verification", + "under_review", + ] + ] """ - If the account is disabled, this string describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). Can be `action_required.requested_capabilities`, `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.incomplete_verification`, `rejected.listed`, `rejected.other`, `rejected.terms_of_service`, `under_review`, or `other`. + If the account is disabled, this enum describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). """ errors: Optional[List[Error]] """ @@ -3252,6 +3288,10 @@ class CreatePersonParamsRegisteredAddress(TypedDict): """ class CreatePersonParamsRelationship(TypedDict): + authorizer: NotRequired[bool] + """ + Whether the person is the authorizer of the account's representative. + """ director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. @@ -3413,6 +3453,10 @@ class ListPersonsParams(RequestOptions): """ class ListPersonsParamsRelationship(TypedDict): + authorizer: NotRequired[bool] + """ + A filter on the list of people returned based on whether these people are authorizers of the account's representative. + """ director: NotRequired[bool] """ A filter on the list of people returned based on whether these people are directors of the account's company. @@ -3833,6 +3877,10 @@ class ModifyPersonParamsRegisteredAddress(TypedDict): """ class ModifyPersonParamsRelationship(TypedDict): + authorizer: NotRequired[bool] + """ + Whether the person is the authorizer of the account's representative. + """ director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. @@ -3917,6 +3965,10 @@ class PersonsParams(RequestOptions): """ class PersonsParamsRelationship(TypedDict): + authorizer: NotRequired[bool] + """ + A filter on the list of people returned based on whether these people are authorizers of the account's representative. + """ director: NotRequired[bool] """ A filter on the list of people returned based on whether these people are directors of the account's company. diff --git a/stripe/_account_person_service.py b/stripe/_account_person_service.py index 903d8e370..d19b8e948 100644 --- a/stripe/_account_person_service.py +++ b/stripe/_account_person_service.py @@ -321,6 +321,10 @@ class CreateParamsRegisteredAddress(TypedDict): """ class CreateParamsRelationship(TypedDict): + authorizer: NotRequired[bool] + """ + Whether the person is the authorizer of the account's representative. + """ director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. @@ -412,6 +416,10 @@ class ListParams(TypedDict): """ class ListParamsRelationship(TypedDict): + authorizer: NotRequired[bool] + """ + A filter on the list of people returned based on whether these people are authorizers of the account's representative. + """ director: NotRequired[bool] """ A filter on the list of people returned based on whether these people are directors of the account's company. @@ -750,6 +758,10 @@ class UpdateParamsRegisteredAddress(TypedDict): """ class UpdateParamsRelationship(TypedDict): + authorizer: NotRequired[bool] + """ + Whether the person is the authorizer of the account's representative. + """ director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. diff --git a/stripe/_account_session.py b/stripe/_account_session.py index eee61b8fb..74229cb25 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -3,7 +3,7 @@ from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack @@ -23,7 +23,7 @@ class AccountSession(CreateableAPIResource["AccountSession"]): class Components(StripeObject): class AccountManagement(StripeObject): class Features(StripeObject): - disable_stripe_user_authentication: Optional[bool] + disable_stripe_user_authentication: bool """ Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. """ @@ -41,7 +41,7 @@ class Features(StripeObject): class AccountOnboarding(StripeObject): class Features(StripeObject): - disable_stripe_user_authentication: Optional[bool] + disable_stripe_user_authentication: bool """ Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. """ @@ -59,7 +59,7 @@ class Features(StripeObject): class Balances(StripeObject): class Features(StripeObject): - disable_stripe_user_authentication: Optional[bool] + disable_stripe_user_authentication: bool """ Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. """ @@ -100,7 +100,7 @@ class Features(StripeObject): class NotificationBanner(StripeObject): class Features(StripeObject): - disable_stripe_user_authentication: Optional[bool] + disable_stripe_user_authentication: bool """ Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. """ @@ -170,7 +170,7 @@ class Features(StripeObject): class Payouts(StripeObject): class Features(StripeObject): - disable_stripe_user_authentication: Optional[bool] + disable_stripe_user_authentication: bool """ Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. """ diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 16c42a5c5..4f7ee9878 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 = "2024-10-28.acacia" + CURRENT = "2024-11-20.acacia" diff --git a/stripe/_charge.py b/stripe/_charge.py index 3a08da9f8..971bcad33 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -712,7 +712,7 @@ class ShippingAddress(StripeObject): """ brand: Optional[str] """ - Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ capture_before: Optional[int] """ @@ -779,7 +779,7 @@ class ShippingAddress(StripeObject): multicapture: Optional[Multicapture] network: Optional[str] """ - Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ network_token: Optional[NetworkToken] """ @@ -871,7 +871,7 @@ class Wallet(StripeObject): """ brand: Optional[str] """ - Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ brand_product: Optional[str] """ @@ -937,7 +937,7 @@ class Wallet(StripeObject): """ network: Optional[str] """ - Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ network_transaction_id: Optional[str] """ @@ -1260,7 +1260,7 @@ class Receipt(StripeObject): """ network: Optional[str] """ - Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ network_transaction_id: Optional[str] """ diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 4afa0d288..b3cdc1aca 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -285,7 +285,7 @@ class Wallet(StripeObject): """ brand: Optional[str] """ - Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ brand_product: Optional[str] """ @@ -351,7 +351,7 @@ class Wallet(StripeObject): """ network: Optional[str] """ - Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ network_transaction_id: Optional[str] """ @@ -630,7 +630,7 @@ class ShippingAddress(StripeObject): brand: str """ - Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ checks: Optional[Checks] """ @@ -733,7 +733,7 @@ class Wallet(StripeObject): brand: Optional[str] """ - Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ brand_product: Optional[str] """ diff --git a/stripe/_customer.py b/stripe/_customer.py index a4a2b108d..7381efdc7 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -558,6 +558,7 @@ class CreateParamsTaxIdDatum(TypedDict): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -594,7 +595,7 @@ class CreateParamsTaxIdDatum(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -668,6 +669,7 @@ class CreateTaxIdParams(RequestOptions): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -704,7 +706,7 @@ class CreateTaxIdParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 9caaa851d..472422454 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -320,6 +320,7 @@ class CreateParamsTaxIdDatum(TypedDict): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -356,7 +357,7 @@ class CreateParamsTaxIdDatum(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index 6ba3e2efd..15cd2be0b 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -62,6 +62,7 @@ class CreateParams(TypedDict): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -98,7 +99,7 @@ class CreateParams(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_dispute.py b/stripe/_dispute.py index 22f5c33e1..8021dfb17 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -348,7 +348,7 @@ class AmazonPay(StripeObject): class Card(StripeObject): brand: str """ - Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ case_type: Literal["chargeback", "inquiry"] """ diff --git a/stripe/_file.py b/stripe/_file.py index 7c36c1e5b..c5cc7091d 100644 --- a/stripe/_file.py +++ b/stripe/_file.py @@ -101,6 +101,7 @@ class ListParams(RequestOptions): "dispute_evidence", "document_provider_identity_document", "finance_report_run", + "financial_account_statement", "identity_document", "identity_document_downloadable", "issuing_regulatory_reporting", @@ -176,6 +177,7 @@ class RetrieveParams(RequestOptions): "dispute_evidence", "document_provider_identity_document", "finance_report_run", + "financial_account_statement", "identity_document", "identity_document_downloadable", "issuing_regulatory_reporting", diff --git a/stripe/_file_link.py b/stripe/_file_link.py index 02e1f2168..824af7dce 100644 --- a/stripe/_file_link.py +++ b/stripe/_file_link.py @@ -44,7 +44,7 @@ class CreateParams(RequestOptions): """ file: str """ - The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `issuing_regulatory_reporting`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. + The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `financial_account_statement`, `identity_document_downloadable`, `issuing_regulatory_reporting`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ diff --git a/stripe/_file_link_service.py b/stripe/_file_link_service.py index 73e955371..6b9fca0af 100644 --- a/stripe/_file_link_service.py +++ b/stripe/_file_link_service.py @@ -21,7 +21,7 @@ class CreateParams(TypedDict): """ file: str """ - The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `issuing_regulatory_reporting`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. + The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `financial_account_statement`, `identity_document_downloadable`, `issuing_regulatory_reporting`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ diff --git a/stripe/_file_service.py b/stripe/_file_service.py index 4c29215c4..ee4f7f26a 100644 --- a/stripe/_file_service.py +++ b/stripe/_file_service.py @@ -81,6 +81,7 @@ class ListParams(TypedDict): "dispute_evidence", "document_provider_identity_document", "finance_report_run", + "financial_account_statement", "identity_document", "identity_document_downloadable", "issuing_regulatory_reporting", diff --git a/stripe/_funding_instructions.py b/stripe/_funding_instructions.py index ccab42862..d3ee23e43 100644 --- a/stripe/_funding_instructions.py +++ b/stripe/_funding_instructions.py @@ -21,10 +21,72 @@ class FundingInstructions(StripeObject): class BankTransfer(StripeObject): class FinancialAddress(StripeObject): class Aba(StripeObject): + class AccountHolderAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class BankAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + account_holder_address: AccountHolderAddress + account_holder_name: str + """ + The account holder name + """ account_number: str """ The ABA account number """ + account_type: str + """ + The account type + """ + bank_address: BankAddress bank_name: str """ The bank name @@ -33,6 +95,10 @@ class Aba(StripeObject): """ The ABA routing number """ + _inner_class_types = { + "account_holder_address": AccountHolderAddress, + "bank_address": BankAddress, + } class Iban(StripeObject): account_holder_name: str @@ -81,10 +147,72 @@ class Spei(StripeObject): """ class Swift(StripeObject): + class AccountHolderAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class BankAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + account_holder_address: AccountHolderAddress + account_holder_name: str + """ + The account holder name + """ account_number: str """ The account number """ + account_type: str + """ + The account type + """ + bank_address: BankAddress bank_name: str """ The bank name @@ -93,6 +221,10 @@ class Swift(StripeObject): """ The SWIFT code """ + _inner_class_types = { + "account_holder_address": AccountHolderAddress, + "bank_address": BankAddress, + } class Zengin(StripeObject): account_holder_name: Optional[str] diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 8d7d66e0a..d0b52558d 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -257,6 +257,7 @@ class CustomerTaxId(StripeObject): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -294,7 +295,7 @@ class CustomerTaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` """ value: Optional[str] """ @@ -1252,6 +1253,7 @@ class AddLinesParamsLineTaxAmountTaxRateData(TypedDict): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] ] @@ -2134,6 +2136,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -2170,7 +2173,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -3990,6 +3993,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -4026,7 +4030,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -5131,6 +5135,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -5167,7 +5172,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -6165,6 +6170,7 @@ class UpdateLinesParamsLineTaxAmountTaxRateData(TypedDict): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] ] diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index f7a943ad8..dccfaaf85 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -322,6 +322,7 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] ] diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index 62dade07b..f5ba99936 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -219,6 +219,7 @@ class UpdateParamsTaxAmountTaxRateData(TypedDict): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] ] diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 0e17cf433..4825ff4ba 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -221,6 +221,7 @@ class AddLinesParamsLineTaxAmountTaxRateData(TypedDict): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] ] @@ -1115,6 +1116,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -1151,7 +1153,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -2340,6 +2342,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -2376,7 +2379,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -3382,6 +3385,7 @@ class UpdateLinesParamsLineTaxAmountTaxRateData(TypedDict): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] ] diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index 745aa73b2..a4b9338d5 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -323,6 +323,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -359,7 +360,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 482373185..c0bf5a297 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -431,10 +431,72 @@ class QrCode(StripeObject): class DisplayBankTransferInstructions(StripeObject): class FinancialAddress(StripeObject): class Aba(StripeObject): + class AccountHolderAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class BankAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + account_holder_address: AccountHolderAddress + account_holder_name: str + """ + The account holder name + """ account_number: str """ The ABA account number """ + account_type: str + """ + The account type + """ + bank_address: BankAddress bank_name: str """ The bank name @@ -443,6 +505,10 @@ class Aba(StripeObject): """ The ABA routing number """ + _inner_class_types = { + "account_holder_address": AccountHolderAddress, + "bank_address": BankAddress, + } class Iban(StripeObject): account_holder_name: str @@ -491,10 +557,72 @@ class Spei(StripeObject): """ class Swift(StripeObject): + class AccountHolderAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class BankAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + account_holder_address: AccountHolderAddress + account_holder_name: str + """ + The account holder name + """ account_number: str """ The account number """ + account_type: str + """ + The account type + """ + bank_address: BankAddress bank_name: str """ The bank name @@ -503,6 +631,10 @@ class Swift(StripeObject): """ The SWIFT code """ + _inner_class_types = { + "account_holder_address": AccountHolderAddress, + "bank_address": BankAddress, + } class Zengin(StripeObject): account_holder_name: Optional[str] @@ -1267,6 +1399,7 @@ class MandateOptions(StripeObject): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -3546,6 +3679,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -4719,7 +4853,7 @@ class CreateParams(RequestOptions): """ payment_method_configuration: NotRequired[str] """ - The ID of the payment method configuration to use with this PaymentIntent. + The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent. """ payment_method_data: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodData" @@ -4737,7 +4871,7 @@ class CreateParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, it defaults to ["card"]. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ radar_options: NotRequired["PaymentIntent.CreateParamsRadarOptions"] """ @@ -6086,6 +6220,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -7317,7 +7452,7 @@ class ModifyParams(RequestOptions): """ payment_method_configuration: NotRequired[str] """ - The ID of the payment method configuration to use with this PaymentIntent. + The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent. """ payment_method_data: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodData" @@ -8620,6 +8755,7 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -9869,7 +10005,7 @@ class VerifyMicrodepositsParams(RequestOptions): PaymentMethodConfigurationDetails ] """ - Information about the payment method configuration used for this PaymentIntent. + Information about the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) used for this PaymentIntent. """ payment_method_options: Optional[PaymentMethodOptions] """ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 8fa22ca1b..b3d7a76b3 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -1494,6 +1494,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -2667,7 +2668,7 @@ class CreateParams(TypedDict): """ payment_method_configuration: NotRequired[str] """ - The ID of the payment method configuration to use with this PaymentIntent. + The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent. """ payment_method_data: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodData" @@ -2685,7 +2686,7 @@ class CreateParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, it defaults to ["card"]. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ radar_options: NotRequired[ "PaymentIntentService.CreateParamsRadarOptions" @@ -4064,6 +4065,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -5323,7 +5325,7 @@ class UpdateParams(TypedDict): """ payment_method_configuration: NotRequired[str] """ - The ID of the payment method configuration to use with this PaymentIntent. + The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent. """ payment_method_data: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodData" @@ -6656,6 +6658,7 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 200e09f7e..69e806528 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -836,7 +836,9 @@ class CreateParams(RequestOptions): """ The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. """ - submit_type: NotRequired[Literal["auto", "book", "donate", "pay"]] + submit_type: NotRequired[ + Literal["auto", "book", "donate", "pay", "subscribe"] + ] """ Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). """ @@ -1473,7 +1475,7 @@ class CreateParamsShippingAddressCollection(TypedDict): ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for - shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + shipping locations. """ class CreateParamsShippingOption(TypedDict): @@ -1696,6 +1698,12 @@ class ModifyParams(RequestOptions): """ Configuration for collecting the customer's shipping address. """ + submit_type: NotRequired[ + Literal["auto", "book", "donate", "pay", "subscribe"] + ] + """ + Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). + """ subscription_data: NotRequired[ "PaymentLink.ModifyParamsSubscriptionData" ] @@ -2273,7 +2281,7 @@ class ModifyParamsShippingAddressCollection(TypedDict): ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for - shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + shipping locations. """ class ModifyParamsSubscriptionData(TypedDict): @@ -2481,7 +2489,7 @@ class RetrieveParams(RequestOptions): """ The shipping rate options applied to the session. """ - submit_type: Literal["auto", "book", "donate", "pay"] + submit_type: Literal["auto", "book", "donate", "pay", "subscribe"] """ Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. """ diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 0121889d8..a1d592b29 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -179,7 +179,9 @@ class CreateParams(TypedDict): """ The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. """ - submit_type: NotRequired[Literal["auto", "book", "donate", "pay"]] + submit_type: NotRequired[ + Literal["auto", "book", "donate", "pay", "subscribe"] + ] """ Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). """ @@ -826,7 +828,7 @@ class CreateParamsShippingAddressCollection(TypedDict): ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for - shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + shipping locations. """ class CreateParamsShippingOption(TypedDict): @@ -1039,6 +1041,12 @@ class UpdateParams(TypedDict): """ Configuration for collecting the customer's shipping address. """ + submit_type: NotRequired[ + Literal["auto", "book", "donate", "pay", "subscribe"] + ] + """ + Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). + """ subscription_data: NotRequired[ "PaymentLinkService.UpdateParamsSubscriptionData" ] @@ -1624,7 +1632,7 @@ class UpdateParamsShippingAddressCollection(TypedDict): ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for - shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + shipping locations. """ class UpdateParamsSubscriptionData(TypedDict): diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index bcbc2a95c..17861d3e0 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -242,7 +242,7 @@ class Wallet(StripeObject): """ brand: Optional[str] """ - Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ brand_product: Optional[str] """ @@ -308,7 +308,7 @@ class Wallet(StripeObject): """ network: Optional[str] """ - Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ network_transaction_id: Optional[str] """ @@ -587,7 +587,7 @@ class ShippingAddress(StripeObject): brand: str """ - Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ checks: Optional[Checks] """ @@ -688,7 +688,7 @@ class Wallet(StripeObject): brand: Optional[str] """ - Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ brand_product: Optional[str] """ diff --git a/stripe/_payout.py b/stripe/_payout.py index 62fbe67ee..852104d23 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -5,6 +5,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast, overload @@ -41,6 +42,16 @@ class Payout( OBJECT_NAME: ClassVar[Literal["payout"]] = "payout" + class TraceId(StripeObject): + status: str + """ + Possible values are `pending`, `supported`, and `unsupported`. When `payout.status` is `pending` or `in_transit`, this will be `pending`. When the payout transitions to `paid`, `failed`, or `canceled`, this status will become `supported` or `unsupported` shortly after in most cases. In some cases, this may appear as `pending` for up to 10 days after `arrival_date` until transitioning to `supported` or `unsupported`. + """ + value: Optional[str] + """ + The trace ID value if `trace_id.status` is `supported`, otherwise `nil`. + """ + class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -281,6 +292,10 @@ class ReverseParams(RequestOptions): """ Current status of the payout: `paid`, `pending`, `in_transit`, `canceled` or `failed`. A payout is `pending` until it's submitted to the bank, when it becomes `in_transit`. The status changes to `paid` if the transaction succeeds, or to `failed` or `canceled` (within 5 business days). Some payouts that fail might initially show as `paid`, then change to `failed`. """ + trace_id: Optional[TraceId] + """ + A value that generates from the beneficiary's bank that allows users to track payouts with their bank. Banks might call this a "reference number" or something similar. + """ type: Literal["bank_account", "card"] """ Can be `bank_account` or `card`. @@ -651,3 +666,5 @@ async def reverse_async( # pyright: ignore[reportGeneralTypeIssues] params=params, ), ) + + _inner_class_types = {"trace_id": TraceId} diff --git a/stripe/_person.py b/stripe/_person.py index 315874c14..2b9b5d1ac 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -313,6 +313,10 @@ class RegisteredAddress(StripeObject): """ class Relationship(StripeObject): + authorizer: Optional[bool] + """ + Whether the person is the authorizer of the account's representative. + """ director: Optional[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. diff --git a/stripe/_refund.py b/stripe/_refund.py index 7a79cbe89..c95586250 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -61,6 +61,10 @@ class AuBankTransfer(StripeObject): pass class Blik(StripeObject): + network_decline_code: Optional[str] + """ + For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed. + """ reference: Optional[str] """ The reference assigned to the refund. @@ -192,6 +196,10 @@ class Sofort(StripeObject): pass class Swish(StripeObject): + network_decline_code: Optional[str] + """ + For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed. + """ reference: Optional[str] """ The reference assigned to the refund. diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index f5c5943e9..da290bab4 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -177,7 +177,7 @@ class GooglePay(StripeObject): brand: Optional[str] """ - Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ checks: Optional[Checks] """ @@ -223,7 +223,7 @@ class GooglePay(StripeObject): """ network: Optional[str] """ - Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ three_d_secure: Optional[ThreeDSecure] """ diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index e55a0d367..11a77a371 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -526,6 +526,7 @@ class MandateOptions(StripeObject): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -1532,6 +1533,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -1842,7 +1844,7 @@ class CreateParams(RequestOptions): """ payment_method_configuration: NotRequired[str] """ - The ID of the payment method configuration to use with this SetupIntent. + The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this SetupIntent. """ payment_method_data: NotRequired[ "SetupIntent.CreateParamsPaymentMethodData" @@ -1859,7 +1861,7 @@ class CreateParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, it defaults to ["card"]. + The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ return_url: NotRequired[str] """ @@ -2725,6 +2727,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -3073,7 +3076,7 @@ class ModifyParams(RequestOptions): """ payment_method_configuration: NotRequired[str] """ - The ID of the payment method configuration to use with this SetupIntent. + The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this SetupIntent. """ payment_method_data: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodData" @@ -3090,7 +3093,7 @@ class ModifyParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this array, it defaults to ["card"]. + The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ class ModifyParamsPaymentMethodData(TypedDict): @@ -3885,6 +3888,7 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -4246,7 +4250,7 @@ class VerifyMicrodepositsParams(RequestOptions): PaymentMethodConfigurationDetails ] """ - Information about the payment method configuration used for this Setup Intent. + Information about the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) used for this Setup Intent. """ payment_method_options: Optional[PaymentMethodOptions] """ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 73cfb2e9e..cffbc4818 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -947,6 +947,7 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -1257,7 +1258,7 @@ class CreateParams(TypedDict): """ payment_method_configuration: NotRequired[str] """ - The ID of the payment method configuration to use with this SetupIntent. + The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this SetupIntent. """ payment_method_data: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodData" @@ -1274,7 +1275,7 @@ class CreateParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, it defaults to ["card"]. + The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ return_url: NotRequired[str] """ @@ -2178,6 +2179,7 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -2536,7 +2538,7 @@ class UpdateParams(TypedDict): """ payment_method_configuration: NotRequired[str] """ - The ID of the payment method configuration to use with this SetupIntent. + The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this SetupIntent. """ payment_method_data: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodData" @@ -2553,7 +2555,7 @@ class UpdateParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this array, it defaults to ["card"]. + The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ class UpdateParamsPaymentMethodData(TypedDict): @@ -3386,6 +3388,7 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 681c609b3..9cf48a0ee 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -223,6 +223,7 @@ class MandateOptions(StripeObject): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -1028,6 +1029,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -1431,7 +1433,7 @@ class ModifyParams(RequestOptions): "Literal['']|Subscription.ModifyParamsPauseCollection" ] """ - If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment). + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). """ payment_behavior: NotRequired[ Literal[ @@ -1864,6 +1866,7 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -2198,7 +2201,7 @@ class SearchParams(RequestOptions): """ pause_collection: Optional[PauseCollection] """ - If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment). + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). """ payment_settings: Optional[PaymentSettings] """ @@ -2241,7 +2244,7 @@ class SearchParams(RequestOptions): A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. - A subscription can only enter a `paused` status [when a trial ends without a payment method](https://stripe.com/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://stripe.com/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. + A subscription can only enter a `paused` status [when a trial ends without a payment method](https://stripe.com/docs/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). @@ -2643,7 +2646,7 @@ def modify( A trial starts or ends. - In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment). + In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment). If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). @@ -2680,7 +2683,7 @@ async def modify_async( A trial starts or ends. - In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment). + In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment). If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index b3160ca51..9c966572a 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -588,6 +588,7 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -1041,7 +1042,7 @@ class UpdateParams(TypedDict): "Literal['']|SubscriptionService.UpdateParamsPauseCollection" ] """ - If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment). + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). """ payment_behavior: NotRequired[ Literal[ @@ -1480,6 +1481,7 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): "girocard", "interac", "jcb", + "link", "mastercard", "unionpay", "unknown", @@ -1765,7 +1767,7 @@ def update( A trial starts or ends. - In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment). + In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment). If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). @@ -1809,7 +1811,7 @@ async def update_async( A trial starts or ends. - In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment). + In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment). If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index 3cf29c0b2..be1de50d7 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -125,6 +125,7 @@ class CreateParams(RequestOptions): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -161,7 +162,7 @@ class CreateParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ @@ -302,6 +303,7 @@ class RetrieveParams(RequestOptions): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -339,7 +341,7 @@ class RetrieveParams(RequestOptions): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` """ value: str """ diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py index 1f6cf5c58..43e88187f 100644 --- a/stripe/_tax_id_service.py +++ b/stripe/_tax_id_service.py @@ -66,6 +66,7 @@ class CreateParams(TypedDict): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -102,7 +103,7 @@ class CreateParams(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index fa5efcfe8..674aad3ff 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -89,6 +89,7 @@ class CreateParams(RequestOptions): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] ] @@ -191,6 +192,7 @@ class ModifyParams(RequestOptions): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] ] @@ -290,6 +292,7 @@ class RetrieveParams(RequestOptions): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] ] diff --git a/stripe/_tax_rate_service.py b/stripe/_tax_rate_service.py index b8de81f3b..f447346e1 100644 --- a/stripe/_tax_rate_service.py +++ b/stripe/_tax_rate_service.py @@ -65,6 +65,7 @@ class CreateParams(TypedDict): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] ] @@ -173,6 +174,7 @@ class UpdateParams(TypedDict): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] ] diff --git a/stripe/_token.py b/stripe/_token.py index 03ef8faa1..4e8e7ba7a 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -991,6 +991,10 @@ class CreateParamsPersonRegisteredAddress(TypedDict): """ class CreateParamsPersonRelationship(TypedDict): + authorizer: NotRequired[bool] + """ + Whether the person is the authorizer of the account's representative. + """ director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 30be56d21..2dd639f21 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -970,6 +970,10 @@ class CreateParamsPersonRegisteredAddress(TypedDict): """ class CreateParamsPersonRelationship(TypedDict): + authorizer: NotRequired[bool] + """ + Whether the person is the authorizer of the account's representative. + """ director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index d6200f448..614ee7c0f 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -136,6 +136,7 @@ class CreateParams(RequestOptions): "2024-06-20", "2024-09-30.acacia", "2024-10-28.acacia", + "2024-11-20.acacia", ] ] """ diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 30bd28342..597e5a698 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -117,6 +117,7 @@ class CreateParams(TypedDict): "2024-06-20", "2024-09-30.acacia", "2024-10-28.acacia", + "2024-11-20.acacia", ] ] """ diff --git a/stripe/billing/_credit_balance_summary.py b/stripe/billing/_credit_balance_summary.py index 03e1a5de3..ade19dcef 100644 --- a/stripe/billing/_credit_balance_summary.py +++ b/stripe/billing/_credit_balance_summary.py @@ -109,7 +109,7 @@ class RetrieveParamsFilter(TypedDict): class RetrieveParamsFilterApplicabilityScope(TypedDict): price_type: Literal["metered"] """ - The price type to which credit grants can apply to. We currently only support `metered` price type. + The price type for which credit grants can apply. We currently only support the `metered` price type. """ balances: List[Balance] diff --git a/stripe/billing/_credit_balance_summary_service.py b/stripe/billing/_credit_balance_summary_service.py index 096de2915..b31f13e46 100644 --- a/stripe/billing/_credit_balance_summary_service.py +++ b/stripe/billing/_credit_balance_summary_service.py @@ -41,7 +41,7 @@ class RetrieveParamsFilter(TypedDict): class RetrieveParamsFilterApplicabilityScope(TypedDict): price_type: Literal["metered"] """ - The price type to which credit grants can apply to. We currently only support `metered` price type. + The price type for which credit grants can apply. We currently only support the `metered` price type. """ def retrieve( diff --git a/stripe/billing/_credit_grant.py b/stripe/billing/_credit_grant.py index 29a9b52e7..090a172f4 100644 --- a/stripe/billing/_credit_grant.py +++ b/stripe/billing/_credit_grant.py @@ -31,7 +31,6 @@ class CreditGrant( A credit grant is an API resource that documents the allocation of some billing credits to a customer. Related guide: [Billing credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits) - end """ OBJECT_NAME: ClassVar[Literal["billing.credit_grant"]] = ( @@ -63,7 +62,7 @@ class ApplicabilityConfig(StripeObject): class Scope(StripeObject): price_type: Literal["metered"] """ - The price type to which credit grants can apply to. We currently only support `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. + The price type for which credit grants can apply. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. """ scope: Scope @@ -84,11 +83,11 @@ class CreateParams(RequestOptions): """ customer: str """ - ID of the customer to whom the billing credits should be granted. + ID of the customer to receive the billing credits. """ effective_at: NotRequired[int] """ - The time when the billing credits become effective i.e when they are eligible to be used. Defaults to the current timestamp if not specified. + The time when the billing credits become effective—when they're eligible for use. Defaults to the current timestamp if not specified. """ expand: NotRequired[List[str]] """ @@ -96,15 +95,15 @@ class CreateParams(RequestOptions): """ expires_at: NotRequired[int] """ - The time when the billing credits will expire. If not specified, the billing credits will never expire. + The time when the billing credits will expire. If not specified, the billing credits don't expire. """ metadata: NotRequired[Dict[str, str]] """ - Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (ex: cost basis) in a structured format. + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (for example, cost basis) in a structured format. """ name: NotRequired[str] """ - A descriptive name shown in dashboard. + A descriptive name shown in the Dashboard. """ class CreateParamsAmount(TypedDict): @@ -136,7 +135,7 @@ class CreateParamsApplicabilityConfig(TypedDict): class CreateParamsApplicabilityConfigScope(TypedDict): price_type: Literal["metered"] """ - The price type to which credit grants can apply to. We currently only support `metered` price type. + The price type for which credit grants can apply. We currently only support the `metered` price type. """ class ExpireParams(RequestOptions): @@ -174,11 +173,11 @@ class ModifyParams(RequestOptions): """ expires_at: NotRequired["Literal['']|int"] """ - The time when the billing credits created by this credit grant will expire. If set to empty, the billing credits will never expire. + The time when the billing credits created by this credit grant expire. If set to empty, the billing credits never expire. """ metadata: NotRequired[Dict[str, str]] """ - Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (ex: cost basis) in a structured format. + Set of key-value pairs you can attach to an object. This can be useful for storing additional information about the object (for example, cost basis) in a structured format. """ class RetrieveParams(RequestOptions): @@ -197,7 +196,7 @@ class VoidGrantParams(RequestOptions): applicability_config: ApplicabilityConfig category: Literal["paid", "promotional"] """ - The category of this credit grant. This is for tracking purposes and will not be displayed to the customer. + The category of this credit grant. This is for tracking purposes and isn't displayed to the customer. """ created: int """ @@ -205,15 +204,15 @@ class VoidGrantParams(RequestOptions): """ customer: ExpandableField["Customer"] """ - ID of the customer to whom the billing credits are granted. + ID of the customer receiving the billing credits. """ effective_at: Optional[int] """ - The time when the billing credits become effective i.e when they are eligible to be used. + The time when the billing credits become effective—when they're eligible for use. """ expires_at: Optional[int] """ - The time when the billing credits will expire. If not present, the billing credits will never expire. + The time when the billing credits expire. If not present, the billing credits don't expire. """ id: str """ @@ -285,7 +284,7 @@ def _cls_expire( cls, id: str, **params: Unpack["CreditGrant.ExpireParams"] ) -> "CreditGrant": """ - Expires a credit grant + Expires a credit grant. """ return cast( "CreditGrant", @@ -304,7 +303,7 @@ def expire( id: str, **params: Unpack["CreditGrant.ExpireParams"] ) -> "CreditGrant": """ - Expires a credit grant + Expires a credit grant. """ ... @@ -313,7 +312,7 @@ def expire( self, **params: Unpack["CreditGrant.ExpireParams"] ) -> "CreditGrant": """ - Expires a credit grant + Expires a credit grant. """ ... @@ -322,7 +321,7 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["CreditGrant.ExpireParams"] ) -> "CreditGrant": """ - Expires a credit grant + Expires a credit grant. """ return cast( "CreditGrant", @@ -340,7 +339,7 @@ async def _cls_expire_async( cls, id: str, **params: Unpack["CreditGrant.ExpireParams"] ) -> "CreditGrant": """ - Expires a credit grant + Expires a credit grant. """ return cast( "CreditGrant", @@ -359,7 +358,7 @@ async def expire_async( id: str, **params: Unpack["CreditGrant.ExpireParams"] ) -> "CreditGrant": """ - Expires a credit grant + Expires a credit grant. """ ... @@ -368,7 +367,7 @@ async def expire_async( self, **params: Unpack["CreditGrant.ExpireParams"] ) -> "CreditGrant": """ - Expires a credit grant + Expires a credit grant. """ ... @@ -377,7 +376,7 @@ async def expire_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["CreditGrant.ExpireParams"] ) -> "CreditGrant": """ - Expires a credit grant + Expires a credit grant. """ return cast( "CreditGrant", @@ -395,7 +394,7 @@ def list( cls, **params: Unpack["CreditGrant.ListParams"] ) -> ListObject["CreditGrant"]: """ - Retrieve a list of credit grants + Retrieve a list of credit grants. """ result = cls._static_request( "get", @@ -415,7 +414,7 @@ async def list_async( cls, **params: Unpack["CreditGrant.ListParams"] ) -> ListObject["CreditGrant"]: """ - Retrieve a list of credit grants + Retrieve a list of credit grants. """ result = await cls._static_request_async( "get", @@ -491,7 +490,7 @@ def _cls_void_grant( cls, id: str, **params: Unpack["CreditGrant.VoidGrantParams"] ) -> "CreditGrant": """ - Voids a credit grant + Voids a credit grant. """ return cast( "CreditGrant", @@ -510,7 +509,7 @@ def void_grant( id: str, **params: Unpack["CreditGrant.VoidGrantParams"] ) -> "CreditGrant": """ - Voids a credit grant + Voids a credit grant. """ ... @@ -519,7 +518,7 @@ def void_grant( self, **params: Unpack["CreditGrant.VoidGrantParams"] ) -> "CreditGrant": """ - Voids a credit grant + Voids a credit grant. """ ... @@ -528,7 +527,7 @@ def void_grant( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["CreditGrant.VoidGrantParams"] ) -> "CreditGrant": """ - Voids a credit grant + Voids a credit grant. """ return cast( "CreditGrant", @@ -546,7 +545,7 @@ async def _cls_void_grant_async( cls, id: str, **params: Unpack["CreditGrant.VoidGrantParams"] ) -> "CreditGrant": """ - Voids a credit grant + Voids a credit grant. """ return cast( "CreditGrant", @@ -565,7 +564,7 @@ async def void_grant_async( id: str, **params: Unpack["CreditGrant.VoidGrantParams"] ) -> "CreditGrant": """ - Voids a credit grant + Voids a credit grant. """ ... @@ -574,7 +573,7 @@ async def void_grant_async( self, **params: Unpack["CreditGrant.VoidGrantParams"] ) -> "CreditGrant": """ - Voids a credit grant + Voids a credit grant. """ ... @@ -583,7 +582,7 @@ async def void_grant_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["CreditGrant.VoidGrantParams"] ) -> "CreditGrant": """ - Voids a credit grant + Voids a credit grant. """ return cast( "CreditGrant", diff --git a/stripe/billing/_credit_grant_service.py b/stripe/billing/_credit_grant_service.py index 904df9c2b..54e6f8f3f 100644 --- a/stripe/billing/_credit_grant_service.py +++ b/stripe/billing/_credit_grant_service.py @@ -27,11 +27,11 @@ class CreateParams(TypedDict): """ customer: str """ - ID of the customer to whom the billing credits should be granted. + ID of the customer to receive the billing credits. """ effective_at: NotRequired[int] """ - The time when the billing credits become effective i.e when they are eligible to be used. Defaults to the current timestamp if not specified. + The time when the billing credits become effective—when they're eligible for use. Defaults to the current timestamp if not specified. """ expand: NotRequired[List[str]] """ @@ -39,15 +39,15 @@ class CreateParams(TypedDict): """ expires_at: NotRequired[int] """ - The time when the billing credits will expire. If not specified, the billing credits will never expire. + The time when the billing credits will expire. If not specified, the billing credits don't expire. """ metadata: NotRequired[Dict[str, str]] """ - Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (ex: cost basis) in a structured format. + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (for example, cost basis) in a structured format. """ name: NotRequired[str] """ - A descriptive name shown in dashboard. + A descriptive name shown in the Dashboard. """ class CreateParamsAmount(TypedDict): @@ -79,7 +79,7 @@ class CreateParamsApplicabilityConfig(TypedDict): class CreateParamsApplicabilityConfigScope(TypedDict): price_type: Literal["metered"] """ - The price type to which credit grants can apply to. We currently only support `metered` price type. + The price type for which credit grants can apply. We currently only support the `metered` price type. """ class ExpireParams(TypedDict): @@ -123,11 +123,11 @@ class UpdateParams(TypedDict): """ expires_at: NotRequired["Literal['']|int"] """ - The time when the billing credits created by this credit grant will expire. If set to empty, the billing credits will never expire. + The time when the billing credits created by this credit grant expire. If set to empty, the billing credits never expire. """ metadata: NotRequired[Dict[str, str]] """ - Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (ex: cost basis) in a structured format. + Set of key-value pairs you can attach to an object. This can be useful for storing additional information about the object (for example, cost basis) in a structured format. """ class VoidGrantParams(TypedDict): @@ -142,7 +142,7 @@ def list( options: RequestOptions = {}, ) -> ListObject[CreditGrant]: """ - Retrieve a list of credit grants + Retrieve a list of credit grants. """ return cast( ListObject[CreditGrant], @@ -161,7 +161,7 @@ async def list_async( options: RequestOptions = {}, ) -> ListObject[CreditGrant]: """ - Retrieve a list of credit grants + Retrieve a list of credit grants. """ return cast( ListObject[CreditGrant], @@ -299,7 +299,7 @@ def expire( options: RequestOptions = {}, ) -> CreditGrant: """ - Expires a credit grant + Expires a credit grant. """ return cast( CreditGrant, @@ -321,7 +321,7 @@ async def expire_async( options: RequestOptions = {}, ) -> CreditGrant: """ - Expires a credit grant + Expires a credit grant. """ return cast( CreditGrant, @@ -343,7 +343,7 @@ def void_grant( options: RequestOptions = {}, ) -> CreditGrant: """ - Voids a credit grant + Voids a credit grant. """ return cast( CreditGrant, @@ -365,7 +365,7 @@ async def void_grant_async( options: RequestOptions = {}, ) -> CreditGrant: """ - Voids a credit grant + Voids a credit grant. """ return cast( CreditGrant, diff --git a/stripe/billing/_meter_event.py b/stripe/billing/_meter_event.py index 46fc203e6..88731e50e 100644 --- a/stripe/billing/_meter_event.py +++ b/stripe/billing/_meter_event.py @@ -27,7 +27,7 @@ class CreateParams(RequestOptions): """ identifier: NotRequired[str] """ - A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period. + A unique identifier for the event. If not provided, one will be generated. We strongly advise using UUID-like identifiers. We will enforce uniqueness within a rolling period of at least 24 hours. The enforcement of uniqueness primarily addresses issues arising from accidental retries or other problems occurring within extremely brief time intervals. This approach helps prevent duplicate entries and ensures data integrity in high-frequency operations. """ payload: Dict[str, str] """ diff --git a/stripe/billing/_meter_event_service.py b/stripe/billing/_meter_event_service.py index 53214b534..ce29abd3b 100644 --- a/stripe/billing/_meter_event_service.py +++ b/stripe/billing/_meter_event_service.py @@ -19,7 +19,7 @@ class CreateParams(TypedDict): """ identifier: NotRequired[str] """ - A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period. + A unique identifier for the event. If not provided, one will be generated. We strongly advise using UUID-like identifiers. We will enforce uniqueness within a rolling period of at least 24 hours. The enforcement of uniqueness primarily addresses issues arising from accidental retries or other problems occurring within extremely brief time intervals. This approach helps prevent duplicate entries and ensures data integrity in high-frequency operations. """ payload: Dict[str, str] """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index d4fe136d1..60de97cca 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -56,6 +56,12 @@ class Session( OBJECT_NAME: ClassVar[Literal["checkout.session"]] = "checkout.session" + class AdaptivePricing(StripeObject): + enabled: bool + """ + Whether Adaptive Pricing is enabled. + """ + class AfterExpiration(StripeObject): class Recovery(StripeObject): allow_promotion_codes: bool @@ -384,6 +390,7 @@ class TaxId(StripeObject): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -421,7 +428,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` """ value: Optional[str] """ @@ -646,6 +653,10 @@ class AuBecsDebit(StripeObject): """ class BacsDebit(StripeObject): + class MandateOptions(StripeObject): + pass + + mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] @@ -658,6 +669,7 @@ class BacsDebit(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + _inner_class_types = {"mandate_options": MandateOptions} class Bancontact(StripeObject): setup_future_usage: Optional[Literal["none"]] @@ -697,6 +709,26 @@ class Installments(StripeObject): """ installments: Optional[Installments] + request_extended_authorization: Optional[ + Literal["if_available", "never"] + ] + """ + Request ability to [capture beyond the standard authorization validity window](https://stripe.com/payments/extended-authorization) for this CheckoutSession. + """ + request_incremental_authorization: Optional[ + Literal["if_available", "never"] + ] + """ + Request ability to [increment the authorization](https://stripe.com/payments/incremental-authorization) for this CheckoutSession. + """ + request_multicapture: Optional[Literal["if_available", "never"]] + """ + Request ability to make [multiple captures](https://stripe.com/payments/multicapture) for this CheckoutSession. + """ + request_overcapture: Optional[Literal["if_available", "never"]] + """ + Request ability to [overcapture](https://stripe.com/payments/overcapture) for this CheckoutSession. + """ request_three_d_secure: Literal["any", "automatic", "challenge"] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1052,6 +1084,10 @@ class SamsungPay(StripeObject): """ class SepaDebit(StripeObject): + class MandateOptions(StripeObject): + pass + + mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] @@ -1064,6 +1100,7 @@ class SepaDebit(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + _inner_class_types = {"mandate_options": MandateOptions} class Sofort(StripeObject): setup_future_usage: Optional[Literal["none"]] @@ -1692,6 +1729,10 @@ class Tax(StripeObject): _inner_class_types = {"breakdown": Breakdown} class CreateParams(RequestOptions): + adaptive_pricing: NotRequired["Session.CreateParamsAdaptivePricing"] + """ + Settings for price localization with [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing). + """ after_expiration: NotRequired["Session.CreateParamsAfterExpiration"] """ Configure actions after a Checkout Session has expired. @@ -1992,7 +2033,9 @@ class CreateParams(RequestOptions): """ The shipping rate options to apply to this Session. Up to a maximum of 5. """ - submit_type: NotRequired[Literal["auto", "book", "donate", "pay"]] + submit_type: NotRequired[ + Literal["auto", "book", "donate", "pay", "subscribe"] + ] """ Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. `submit_type` can only be @@ -2019,6 +2062,12 @@ class CreateParams(RequestOptions): The UI mode of the Session. Defaults to `hosted`. """ + class CreateParamsAdaptivePricing(TypedDict): + enabled: NotRequired[bool] + """ + Set to `true` to enable [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing). Defaults to your [dashboard setting](https://dashboard.stripe.com/settings/adaptive-pricing). + """ + class CreateParamsAfterExpiration(TypedDict): recovery: NotRequired["Session.CreateParamsAfterExpirationRecovery"] """ @@ -2699,7 +2748,7 @@ class CreateParamsPaymentMethodOptions(TypedDict): "Session.CreateParamsPaymentMethodOptionsNaverPay" ] """ - contains details about the Kakao Pay payment method options. + contains details about the Naver Pay payment method options. """ oxxo: NotRequired["Session.CreateParamsPaymentMethodOptionsOxxo"] """ @@ -2881,6 +2930,12 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] @@ -2894,6 +2949,9 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class CreateParamsPaymentMethodOptionsBancontact(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -2931,6 +2989,26 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Installment options for card payments """ + request_extended_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [capture beyond the standard authorization validity window](https://stripe.com/payments/extended-authorization) for this CheckoutSession. + """ + request_incremental_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [increment the authorization](https://stripe.com/payments/incremental-authorization) for this CheckoutSession. + """ + request_multicapture: NotRequired[Literal["if_available", "never"]] + """ + Request ability to make [multiple captures](https://stripe.com/payments/multicapture) for this CheckoutSession. + """ + request_overcapture: NotRequired[Literal["if_available", "never"]] + """ + Request ability to [overcapture](https://stripe.com/payments/overcapture) for this CheckoutSession. + """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] @@ -3106,6 +3184,10 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): """ class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): + capture_method: NotRequired[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3146,6 +3228,10 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): """ class CreateParamsPaymentMethodOptionsKrCard(TypedDict): + capture_method: NotRequired[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3194,6 +3280,10 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): """ class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): + capture_method: NotRequired[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3238,7 +3328,10 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): """ class CreateParamsPaymentMethodOptionsPayco(TypedDict): - pass + capture_method: NotRequired[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] @@ -3327,9 +3420,18 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): """ class CreateParamsPaymentMethodOptionsSamsungPay(TypedDict): - pass + capture_method: NotRequired[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): + mandate_options: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] @@ -3343,6 +3445,9 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): + pass + class CreateParamsPaymentMethodOptionsSofort(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -3701,7 +3806,7 @@ class CreateParamsShippingAddressCollection(TypedDict): ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for - shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + shipping locations. """ class CreateParamsShippingOption(TypedDict): @@ -4050,6 +4155,10 @@ class RetrieveParams(RequestOptions): Specifies which fields in the response should be expanded. """ + adaptive_pricing: Optional[AdaptivePricing] + """ + Settings for price localization with [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing). + """ after_expiration: Optional[AfterExpiration] """ When set, provides configuration for actions to take if this Checkout Session expires. @@ -4291,7 +4400,9 @@ class RetrieveParams(RequestOptions): """ The status of the Checkout Session, one of `open`, `complete`, or `expired`. """ - submit_type: Optional[Literal["auto", "book", "donate", "pay"]] + submit_type: Optional[ + Literal["auto", "book", "donate", "pay", "subscribe"] + ] """ Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. `submit_type` can only be @@ -4682,6 +4793,7 @@ async def retrieve_async( return instance _inner_class_types = { + "adaptive_pricing": AdaptivePricing, "after_expiration": AfterExpiration, "automatic_tax": AutomaticTax, "consent": Consent, diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index c83951d3f..1d9abf9f3 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -16,6 +16,12 @@ def __init__(self, requestor): self.line_items = SessionLineItemService(self._requestor) class CreateParams(TypedDict): + adaptive_pricing: NotRequired[ + "SessionService.CreateParamsAdaptivePricing" + ] + """ + Settings for price localization with [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing). + """ after_expiration: NotRequired[ "SessionService.CreateParamsAfterExpiration" ] @@ -326,7 +332,9 @@ class CreateParams(TypedDict): """ The shipping rate options to apply to this Session. Up to a maximum of 5. """ - submit_type: NotRequired[Literal["auto", "book", "donate", "pay"]] + submit_type: NotRequired[ + Literal["auto", "book", "donate", "pay", "subscribe"] + ] """ Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. `submit_type` can only be @@ -357,6 +365,12 @@ class CreateParams(TypedDict): The UI mode of the Session. Defaults to `hosted`. """ + class CreateParamsAdaptivePricing(TypedDict): + enabled: NotRequired[bool] + """ + Set to `true` to enable [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing). Defaults to your [dashboard setting](https://dashboard.stripe.com/settings/adaptive-pricing). + """ + class CreateParamsAfterExpiration(TypedDict): recovery: NotRequired[ "SessionService.CreateParamsAfterExpirationRecovery" @@ -1069,7 +1083,7 @@ class CreateParamsPaymentMethodOptions(TypedDict): "SessionService.CreateParamsPaymentMethodOptionsNaverPay" ] """ - contains details about the Kakao Pay payment method options. + contains details about the Naver Pay payment method options. """ oxxo: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsOxxo" @@ -1263,6 +1277,12 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] @@ -1276,6 +1296,9 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + pass + class CreateParamsPaymentMethodOptionsBancontact(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -1313,6 +1336,26 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Installment options for card payments """ + request_extended_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [capture beyond the standard authorization validity window](https://stripe.com/payments/extended-authorization) for this CheckoutSession. + """ + request_incremental_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [increment the authorization](https://stripe.com/payments/incremental-authorization) for this CheckoutSession. + """ + request_multicapture: NotRequired[Literal["if_available", "never"]] + """ + Request ability to make [multiple captures](https://stripe.com/payments/multicapture) for this CheckoutSession. + """ + request_overcapture: NotRequired[Literal["if_available", "never"]] + """ + Request ability to [overcapture](https://stripe.com/payments/overcapture) for this CheckoutSession. + """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] @@ -1488,6 +1531,10 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): """ class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): + capture_method: NotRequired[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1528,6 +1575,10 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): """ class CreateParamsPaymentMethodOptionsKrCard(TypedDict): + capture_method: NotRequired[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1576,6 +1627,10 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): """ class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): + capture_method: NotRequired[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1620,7 +1675,10 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): """ class CreateParamsPaymentMethodOptionsPayco(TypedDict): - pass + capture_method: NotRequired[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] @@ -1709,9 +1767,18 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): """ class CreateParamsPaymentMethodOptionsSamsungPay(TypedDict): - pass + capture_method: NotRequired[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): + mandate_options: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] @@ -1725,6 +1792,9 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): + pass + class CreateParamsPaymentMethodOptionsSofort(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -2083,7 +2153,7 @@ class CreateParamsShippingAddressCollection(TypedDict): ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for - shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + shipping locations. """ class CreateParamsShippingOption(TypedDict): diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index 9846ed5bd..edaafaddf 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -456,7 +456,7 @@ class RetrieveParams(RequestOptions): """ verification_flow: Optional[str] """ - The configuration token of a Verification Flow from the dashboard. + The configuration token of a verification flow from the dashboard. """ verification_session: Optional[str] """ diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 506924ed9..2029509ff 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -257,7 +257,7 @@ class CreateParams(RequestOptions): """ verification_flow: NotRequired[str] """ - The ID of a Verification Flow from the Dashboard. See https://docs.stripe.com/identity/verification-flows. + The ID of a verification flow from the Dashboard. See https://docs.stripe.com/identity/verification-flows. """ class CreateParamsOptions(TypedDict): @@ -489,7 +489,7 @@ class RetrieveParams(RequestOptions): """ verification_flow: Optional[str] """ - The configuration token of a Verification Flow from the dashboard. + The configuration token of a verification flow from the dashboard. """ verified_outputs: Optional[VerifiedOutputs] """ diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index 341b795d6..020d52ef1 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -53,7 +53,7 @@ class CreateParams(TypedDict): """ verification_flow: NotRequired[str] """ - The ID of a Verification Flow from the Dashboard. See https://docs.stripe.com/identity/verification-flows. + The ID of a verification flow from the Dashboard. See https://docs.stripe.com/identity/verification-flows. """ class CreateParamsOptions(TypedDict): diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index 2fa24ec97..20f1cf604 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -149,6 +149,24 @@ class Tax(StripeObject): "reported_breakdown": ReportedBreakdown, } + class FraudChallenge(StripeObject): + channel: Literal["sms"] + """ + The method by which the fraud challenge was delivered to the cardholder. + """ + status: Literal[ + "expired", "pending", "rejected", "undeliverable", "verified" + ] + """ + The status of the fraud challenge. + """ + undeliverable_reason: Optional[ + Literal["no_phone_number", "unsupported_phone_number"] + ] + """ + If the challenge is not deliverable, the reason why. + """ + class Fuel(StripeObject): industry_product_code: Optional[str] """ @@ -702,7 +720,7 @@ class CaptureParamsPurchaseDetailsReceipt(TypedDict): unit_cost: NotRequired[int] class CreateParams(RequestOptions): - amount: int + amount: NotRequired[int] """ The total amount to attempt to authorize. This amount is in the provided currency, or defaults to the card's currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ @@ -740,6 +758,14 @@ class CreateParams(RequestOptions): """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. """ + merchant_amount: NotRequired[int] + """ + The total amount to attempt to authorize. This amount is in the provided merchant currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + merchant_currency: NotRequired[str] + """ + The currency of the authorization. If not provided, defaults to the currency of the card. 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). + """ merchant_data: NotRequired["Authorization.CreateParamsMerchantData"] """ Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. @@ -1542,6 +1568,16 @@ class ModifyParams(RequestOptions): Set of [key-value pairs](https://stripe.com/docs/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`. """ + class RespondParams(RequestOptions): + confirmed: bool + """ + Whether to simulate the user confirming that the transaction was legitimate (true) or telling Stripe that it was fraudulent (false). + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -1582,7 +1618,7 @@ class ReverseParams(RequestOptions): """ card: "Card" """ - You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders. + You can [create physical or virtual cards](https://stripe.com/docs/issuing) that are issued to cardholders. """ cardholder: Optional[ExpandableField["Cardholder"]] """ @@ -1600,6 +1636,10 @@ class ReverseParams(RequestOptions): """ Fleet-specific information for authorizations using Fleet cards. """ + fraud_challenges: Optional[List[FraudChallenge]] + """ + Fraud challenges sent to the cardholder, if this authorization was declined for fraud risk reasons. + """ fuel: Optional[Fuel] """ Information about fuel that was purchased with this transaction. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. @@ -1658,6 +1698,10 @@ class ReverseParams(RequestOptions): [Treasury](https://stripe.com/docs/api/treasury) details related to this authorization if it was created on a [FinancialAccount](https://stripe.com/docs/api/treasury/financial_accounts). """ verification_data: VerificationData + verified_by_fraud_challenge: Optional[bool] + """ + Whether the authorization bypassed fraud risk checks because the cardholder has previously completed a fraud challenge on a similar high-risk authorization from the same merchant. + """ wallet: Optional[str] """ The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized. @@ -2498,6 +2542,120 @@ async def increment_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def _cls_respond( + cls, + authorization: str, + **params: Unpack["Authorization.RespondParams"], + ) -> "Authorization": + """ + Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy. + """ + return cast( + "Authorization", + cls._static_request( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond".format( + authorization=sanitize_id(authorization) + ), + params=params, + ), + ) + + @overload + @staticmethod + def respond( + authorization: str, **params: Unpack["Authorization.RespondParams"] + ) -> "Authorization": + """ + Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy. + """ + ... + + @overload + def respond( + self, **params: Unpack["Authorization.RespondParams"] + ) -> "Authorization": + """ + Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy. + """ + ... + + @class_method_variant("_cls_respond") + def respond( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Authorization.RespondParams"] + ) -> "Authorization": + """ + Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy. + """ + return cast( + "Authorization", + self.resource._request( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond".format( + authorization=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_respond_async( + cls, + authorization: str, + **params: Unpack["Authorization.RespondParams"], + ) -> "Authorization": + """ + Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy. + """ + return cast( + "Authorization", + await cls._static_request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond".format( + authorization=sanitize_id(authorization) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def respond_async( + authorization: str, **params: Unpack["Authorization.RespondParams"] + ) -> "Authorization": + """ + Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy. + """ + ... + + @overload + async def respond_async( + self, **params: Unpack["Authorization.RespondParams"] + ) -> "Authorization": + """ + Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy. + """ + ... + + @class_method_variant("_cls_respond_async") + async def respond_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Authorization.RespondParams"] + ) -> "Authorization": + """ + Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy. + """ + return cast( + "Authorization", + await self.resource._request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond".format( + authorization=sanitize_id(self.resource.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_reverse( cls, @@ -2619,6 +2777,7 @@ def test_helpers(self): _inner_class_types = { "amount_details": AmountDetails, "fleet": Fleet, + "fraud_challenges": FraudChallenge, "fuel": Fuel, "merchant_data": MerchantData, "network_data": NetworkData, diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index f87a51c09..b806d5eea 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -30,7 +30,7 @@ class Card( UpdateableAPIResource["Card"], ): """ - You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders. + You can [create physical or virtual cards](https://stripe.com/docs/issuing) that are issued to cardholders. """ OBJECT_NAME: ClassVar[Literal["issuing.card"]] = "issuing.card" @@ -3428,7 +3428,7 @@ class SubmitCardParams(RequestOptions): """ An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards. - Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards#create-cardholder) + Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards/virtual/issue-cards#create-cardholder) """ created: int """ diff --git a/stripe/issuing/_cardholder.py b/stripe/issuing/_cardholder.py index 4d5163009..7092c99d0 100644 --- a/stripe/issuing/_cardholder.py +++ b/stripe/issuing/_cardholder.py @@ -29,7 +29,7 @@ class Cardholder( """ An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards. - Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards#create-cardholder) + Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards/virtual/issue-cards#create-cardholder) """ OBJECT_NAME: ClassVar[Literal["issuing.cardholder"]] = "issuing.cardholder" diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 1e5f051eb..5e2759ff7 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -102,6 +102,7 @@ class TaxId(StripeObject): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -139,7 +140,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` """ value: str """ @@ -244,6 +245,7 @@ class TaxRateDetails(StripeObject): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] """ @@ -364,6 +366,7 @@ class FlatAmount(StripeObject): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] ] @@ -545,6 +548,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -581,7 +585,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/tax/_calculation_line_item.py b/stripe/tax/_calculation_line_item.py index 17f903b36..e0707da44 100644 --- a/stripe/tax/_calculation_line_item.py +++ b/stripe/tax/_calculation_line_item.py @@ -51,6 +51,7 @@ class TaxRateDetails(StripeObject): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] """ diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index fbe7ec2ab..3c26c11c5 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -158,6 +158,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -194,7 +195,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "za_vat", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index 3b4a299ba..3c363eb13 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -102,6 +102,7 @@ class TaxId(StripeObject): "kr_brn", "kz_bin", "li_uid", + "li_vat", "ma_vat", "md_vat", "mx_rfc", @@ -139,7 +140,7 @@ class TaxId(StripeObject): "za_vat", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` """ value: str """ @@ -250,6 +251,7 @@ class TaxRateDetails(StripeObject): "retail_delivery_fee", "rst", "sales_tax", + "service_tax", "vat", ] """ diff --git a/stripe/test_helpers/issuing/_authorization_service.py b/stripe/test_helpers/issuing/_authorization_service.py index ff3ed6b0e..4b97801a8 100644 --- a/stripe/test_helpers/issuing/_authorization_service.py +++ b/stripe/test_helpers/issuing/_authorization_service.py @@ -269,7 +269,7 @@ class CaptureParamsPurchaseDetailsReceipt(TypedDict): unit_cost: NotRequired[int] class CreateParams(TypedDict): - amount: int + amount: NotRequired[int] """ The total amount to attempt to authorize. This amount is in the provided currency, or defaults to the card's currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ @@ -309,6 +309,14 @@ class CreateParams(TypedDict): """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. """ + merchant_amount: NotRequired[int] + """ + The total amount to attempt to authorize. This amount is in the provided merchant currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + merchant_currency: NotRequired[str] + """ + The currency of the authorization. If not provided, defaults to the currency of the card. 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). + """ merchant_data: NotRequired[ "AuthorizationService.CreateParamsMerchantData" ] @@ -1045,6 +1053,16 @@ class IncrementParams(TypedDict): If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. """ + class RespondParams(TypedDict): + confirmed: bool + """ + Whether to simulate the user confirming that the transaction was legitimate (true) or telling Stripe that it was fraudulent (false). + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + class ReverseParams(TypedDict): expand: NotRequired[List[str]] """ @@ -1225,6 +1243,50 @@ async def finalize_amount_async( ), ) + def respond( + self, + authorization: str, + params: "AuthorizationService.RespondParams", + options: RequestOptions = {}, + ) -> Authorization: + """ + Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy. + """ + return cast( + Authorization, + self._request( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond".format( + authorization=sanitize_id(authorization), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def respond_async( + self, + authorization: str, + params: "AuthorizationService.RespondParams", + options: RequestOptions = {}, + ) -> Authorization: + """ + Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy. + """ + return cast( + Authorization, + await self._request_async( + "post", + "/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond".format( + authorization=sanitize_id(authorization), + ), + base_address="api", + params=params, + options=options, + ), + ) + def increment( self, authorization: str, diff --git a/stripe/treasury/_inbound_transfer.py b/stripe/treasury/_inbound_transfer.py index 5976aa1eb..0a046710b 100644 --- a/stripe/treasury/_inbound_transfer.py +++ b/stripe/treasury/_inbound_transfer.py @@ -330,7 +330,7 @@ class SucceedParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ - origin_payment_method: str + origin_payment_method: Optional[str] """ The origin payment method to be debited for an InboundTransfer. """ From 82928b03d041e500598c09e78984b8e002b078ed Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Wed, 20 Nov 2024 15:32:38 -0800 Subject: [PATCH 128/179] Bump version to 11.3.0 --- CHANGELOG.md | 86 +++++++++++++++++++++++++++++----------------- VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 57 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e1073bdf..c7295ebb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,42 +1,66 @@ +## 11.3.0 - 2024-11-20 +* [#1424](https://github.com/stripe/stripe-python/pull/1424) This release changes the pinned API version to `2024-11-20.acacia`. + * Add support for `authorizer` on parameter classes `stripe.Account.CreatePersonParamsRelationship`, `stripe.Account.ListPersonsParamsRelationship`, `stripe.Account.ModifyPersonParamsRelationship`, `stripe.Account.PersonsParamsRelationship`, and `stripe.Token.CreateParamsPersonRelationship` and resource class `stripe.Person.Relationship` + * Add support for `account_holder_address`, `account_holder_name`, `account_type` and `bank_address` on resource classes `stripe.FundingInstructions.BankTransfer.FinancialAddress.Aba`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Swift`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Aba`, and `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Swift` + * Add support for `submit_type` on parameter class `stripe.PaymentLink.ModifyParams` + * Add support for `trace_id` on resource `stripe.Payout` + * Add support for `network_decline_code` on resource classes `stripe.Refund.DestinationDetails.Blik` and `stripe.Refund.DestinationDetails.Swish` + * Add support for `adaptive_pricing` on parameter class `stripe.checkout.Session.CreateParams` and resource `stripe.checkout.Session` + * Add support for `mandate_options` on parameter classes `stripe.checkout.Session.CreateParamsPaymentMethodOptionsBacsDebit` and `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSepaDebit` and resource classes `stripe.checkout.Session.PaymentMethodOptions.BacsDebit` and `stripe.checkout.Session.PaymentMethodOptions.SepaDebit` + * Add support for `request_extended_authorization`, `request_incremental_authorization`, `request_multicapture` and `request_overcapture` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptionsCard` and resource class `stripe.checkout.Session.PaymentMethodOptions.Card` + * Add support for `capture_method` on parameter classes `stripe.checkout.Session.CreateParamsPaymentMethodOptionsKakaoPay`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsKrCard`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsNaverPay`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsPayco`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSamsungPay` + * Add support for `merchant_amount` and `merchant_currency` on parameter class `stripe.issuing.Authorization.CreateParams` + * Add support for `fraud_challenges`, `verified_by_fraud_challenge` and `respond` on resource `stripe.issuing.Authorization` + * Change type of `disabled_reason` on `stripe.Account.FutureRequirements` and `stripe.Account.Requirements` from `str` to `Literal['action_required.requested_capabilities', 'listed', 'other', 'platform_paused', 'rejected.fraud', 'rejected.incomplete_verification', 'rejected.listed', 'rejected.other', 'rejected.platform_fraud', 'rejected.platform_other', 'rejected.platform_terms_of_service', 'rejected.terms_of_service', 'requirements.past_due', 'requirements.pending_verification', 'under_review']` + * Change type of `disable_stripe_user_authentication` on `stripe.AccountSession.Components.AccountManagement.Features`, `stripe.AccountSession.Components.AccountOnboarding.Features`, `stripe.AccountSession.Components.Balances.Features`, `stripe.AccountSession.Components.NotificationBanner.Features`, and `stripe.AccountSession.Components.Payouts.Features` from `Optional[bool]` to `bool` + * Add support for `subscribe` on enums `stripe.checkout.Session.submit_type`, `stripe.checkout.Session.CreateParams.submit_type`, `stripe.PaymentLink.submit_type`, and `stripe.PaymentLink.CreateParams.submit_type` + * Add support for `li_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `financial_account_statement` on enums `stripe.File.purpose` and `stripe.File.ListParams.purpose` + * Add support for `service_tax` on enums `stripe.Invoice.AddLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.Invoice.UpdateLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.InvoiceLineItem.ModifyParamsTaxAmountTaxRateData.tax_type`, `stripe.tax.Calculation.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.CalculationLineItem.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Transaction.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.TaxRate.tax_type`, `stripe.TaxRate.CreateParams.tax_type`, and `stripe.TaxRate.ModifyParams.tax_type` + * Add support for `link` on enums `stripe.PaymentIntent.PaymentMethodOptions.Card.network`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsCard.network`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsCard.network`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsCard.network`, `stripe.SetupIntent.PaymentMethodOptions.Card.network`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptionsCard.network`, `stripe.SetupIntent.CreateParamsPaymentMethodOptionsCard.network`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptionsCard.network`, `stripe.Subscription.PaymentSettings.PaymentMethodOptions.Card.network`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsCard.network`, and `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsCard.network` + * Add support for `2024-11-20.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` + * Change type of `amount` on `stripe.issuing.Authorization.CreateParams` from `int` to `NotRequired[int]` + * Change type of `origin_payment_method` on `stripe.treasury.InboundTransfer` from `str` to `Optional[str]` + ## 11.2.0 - 2024-10-29 * [#1411](https://github.com/stripe/stripe-python/pull/1411) This release changes the pinned API version to `2024-10-28.acacia`. - * Add support for resource `stripe.v2.EventDestinations` - * Add support for `create`, `retrieve`, `update`, `list`, `delete`, `disable`, `enable` and `ping` methods on resource `V2.EventDestinations` - * Add support for `alma_payments`, `kakao_pay_payments`, `kr_card_payments`, `naver_pay_payments`, `payco_payments`, `samsung_pay_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` - * Add support for `groups` on parameter class `stripe.Account.CreateParams` and resource `stripe.Account` - * Add support for `disable_stripe_user_authentication` on resource classes `stripe.AccountSession.Components.AccountManagement.Features`, `stripe.AccountSession.Components.AccountOnboarding.Features`, `stripe.AccountSession.Components.Balances.Features`, `stripe.AccountSession.Components.NotificationBanner.Features`, and `stripe.AccountSession.Components.Payouts.Features` and parameter classes `stripe.AccountSession.CreateParamsComponentsAccountManagementFeatures`, `stripe.AccountSession.CreateParamsComponentsAccountOnboardingFeatures`, `stripe.AccountSession.CreateParamsComponentsBalancesFeatures`, `stripe.AccountSession.CreateParamsComponentsNotificationBannerFeatures`, and `stripe.AccountSession.CreateParamsComponentsPayoutsFeatures` - * Add support for `alma` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.Refund.DestinationDetails`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` - * Add support for `kakao_pay`, `kr_card` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.Mandate.PaymentMethodDetails`, `stripe.PaymentIntent.PaymentMethodOptions`, `stripe.SetupAttempt.PaymentMethodDetails`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resource `stripe.PaymentMethod` - * Add support for `naver_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resource `stripe.PaymentMethod` - * Add support for `payco`, `samsung_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resource `stripe.PaymentMethod` - * Add support for `enhanced_evidence` on resource class `stripe.Dispute.Evidence` and parameter class `stripe.Dispute.ModifyParamsEvidence` - * Add support for `enhanced_eligibility` on resource class `stripe.Dispute.EvidenceDetails` - * Add support for `enhanced_eligibility_types` on resource `stripe.Dispute` - * Add support for `automatically_finalizes_at` on parameter classes `stripe.Invoice.CreateParams` and `stripe.Invoice.ModifyParams` - * Add support for `amazon_pay` on resource `stripe.PaymentMethodDomain` - * Add support for `flat_amount`, `rate_type` on resource `stripe.TaxRate` and resource class `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails` - * Add support for `schedule_at_period_end` on parameter classes `stripe.billing_portal.Configuration.CreateParamsFeaturesSubscriptionUpdate` and `stripe.billing_portal.Configuration.ModifyParamsFeaturesSubscriptionUpdate` and resource class `stripe.billing_portal.Configuration.Features.SubscriptionUpdate` - * Add support for `metadata` on parameter class `stripe.forwarding.Request.CreateParams` and resource `stripe.forwarding.Request` - * Add support for `_cls_submit_card` on resource `stripe.issuing.Card` - * Add support for `submit_card` on resource `stripe.issuing.Card` - * Add support for `by`, `cr`, `ec`, `ma`, `md`, `rs`, `ru`, `tz`, `uz` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` - * Add support for `pln` on parameter classes `stripe.terminal.Configuration.CreateParamsTipping` and `stripe.terminal.Configuration.ModifyParamsTipping` and resource class `stripe.terminal.Configuration.Tipping` - * Change type of `business_profile` on `stripe.billing_portal.Configuration.CreateParams` from `Configuration.CreateParamsBusinessProfile` to `NotRequired[Configuration.CreateParamsBusinessProfile]` - * Add support for `by_tin`, `ma_vat`, `md_vat`, `tz_vat`, `uz_tin`, `uz_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` - * Add support for `alma`, `kakao_pay`, `kr_card`, `naver_pay`, `payco` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` - * Add support for `samsung_pay` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` - * Add support for `auto` on enum `stripe.Customer.ModifyParamsTax.validate_location` - * Add support for `issuing_transaction.purchase_details_receipt_updated`, `refund.failed` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` - * Add support for `jp_credit_transfer` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` - * Add support for `retail_delivery_fee` on enums `stripe.Invoice.AddLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.Invoice.UpdateLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.InvoiceLineItem.ModifyParamsTaxAmountTaxRateData.tax_type`, `stripe.tax.Calculation.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.CalculationLineItem.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Transaction.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.TaxRate.tax_type`, `stripe.TaxRate.CreateParams.tax_type`, and `stripe.TaxRate.ModifyParams.tax_type` - * Add support for `state_retail_delivery_fee` on enums `stripe.tax.Registration.CountryOptions.Us.type` and `stripe.tax.Registration.CreateParamsCountryOptionsUs.type` + * Add support for resource `stripe.v2.EventDestinations` + * Add support for `create`, `retrieve`, `update`, `list`, `delete`, `disable`, `enable` and `ping` methods on resource `V2.EventDestinations` + * Add support for `alma_payments`, `kakao_pay_payments`, `kr_card_payments`, `naver_pay_payments`, `payco_payments`, `samsung_pay_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `groups` on parameter class `stripe.Account.CreateParams` and resource `stripe.Account` + * Add support for `disable_stripe_user_authentication` on resource classes `stripe.AccountSession.Components.AccountManagement.Features`, `stripe.AccountSession.Components.AccountOnboarding.Features`, `stripe.AccountSession.Components.Balances.Features`, `stripe.AccountSession.Components.NotificationBanner.Features`, and `stripe.AccountSession.Components.Payouts.Features` and parameter classes `stripe.AccountSession.CreateParamsComponentsAccountManagementFeatures`, `stripe.AccountSession.CreateParamsComponentsAccountOnboardingFeatures`, `stripe.AccountSession.CreateParamsComponentsBalancesFeatures`, `stripe.AccountSession.CreateParamsComponentsNotificationBannerFeatures`, and `stripe.AccountSession.CreateParamsComponentsPayoutsFeatures` + * Add support for `alma` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.Refund.DestinationDetails`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` + * Add support for `kakao_pay`, `kr_card` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.Mandate.PaymentMethodDetails`, `stripe.PaymentIntent.PaymentMethodOptions`, `stripe.SetupAttempt.PaymentMethodDetails`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resource `stripe.PaymentMethod` + * Add support for `naver_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resource `stripe.PaymentMethod` + * Add support for `payco`, `samsung_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resource `stripe.PaymentMethod` + * Add support for `enhanced_evidence` on resource class `stripe.Dispute.Evidence` and parameter class `stripe.Dispute.ModifyParamsEvidence` + * Add support for `enhanced_eligibility` on resource class `stripe.Dispute.EvidenceDetails` + * Add support for `enhanced_eligibility_types` on resource `stripe.Dispute` + * Add support for `automatically_finalizes_at` on parameter classes `stripe.Invoice.CreateParams` and `stripe.Invoice.ModifyParams` + * Add support for `amazon_pay` on resource `stripe.PaymentMethodDomain` + * Add support for `flat_amount`, `rate_type` on resource `stripe.TaxRate` and resource class `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails` + * Add support for `schedule_at_period_end` on parameter classes `stripe.billing_portal.Configuration.CreateParamsFeaturesSubscriptionUpdate` and `stripe.billing_portal.Configuration.ModifyParamsFeaturesSubscriptionUpdate` and resource class `stripe.billing_portal.Configuration.Features.SubscriptionUpdate` + * Add support for `metadata` on parameter class `stripe.forwarding.Request.CreateParams` and resource `stripe.forwarding.Request` + * Add support for `_cls_submit_card` on resource `stripe.issuing.Card` + * Add support for `submit_card` on resource `stripe.issuing.Card` + * Add support for `by`, `cr`, `ec`, `ma`, `md`, `rs`, `ru`, `tz`, `uz` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `pln` on parameter classes `stripe.terminal.Configuration.CreateParamsTipping` and `stripe.terminal.Configuration.ModifyParamsTipping` and resource class `stripe.terminal.Configuration.Tipping` + * Change type of `business_profile` on `stripe.billing_portal.Configuration.CreateParams` from `Configuration.CreateParamsBusinessProfile` to `NotRequired[Configuration.CreateParamsBusinessProfile]` + * Add support for `by_tin`, `ma_vat`, `md_vat`, `tz_vat`, `uz_tin`, `uz_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `alma`, `kakao_pay`, `kr_card`, `naver_pay`, `payco` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `samsung_pay` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `auto` on enum `stripe.Customer.ModifyParamsTax.validate_location` + * Add support for `issuing_transaction.purchase_details_receipt_updated`, `refund.failed` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `jp_credit_transfer` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Add support for `retail_delivery_fee` on enums `stripe.Invoice.AddLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.Invoice.UpdateLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.InvoiceLineItem.ModifyParamsTaxAmountTaxRateData.tax_type`, `stripe.tax.Calculation.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.CalculationLineItem.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Transaction.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.TaxRate.tax_type`, `stripe.TaxRate.CreateParams.tax_type`, and `stripe.TaxRate.ModifyParams.tax_type` + * Add support for `state_retail_delivery_fee` on enums `stripe.tax.Registration.CountryOptions.Us.type` and `stripe.tax.Registration.CreateParamsCountryOptionsUs.type` * Add support for `2024-10-28.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` ## 11.1.1 - 2024-10-18 * [#1414](https://github.com/stripe/stripe-python/pull/1414) Deserialize into correct v2 EventData types * Fixes a bug where v2 EventData was not being deserialized into the appropriate type for `V1BillingMeterErrorReportTriggeredEvent` and `V1BillingMeterNoMeterFoundEvent` * [#1415](https://github.com/stripe/stripe-python/pull/1415) update object tags for meter-related classes - + - fixes a bug where the `object` property of the `MeterEvent`, `MeterEventAdjustment`, and `MeterEventSession` didn't match the server. * [#1412](https://github.com/stripe/stripe-python/pull/1412) Clean up examples diff --git a/VERSION b/VERSION index b85c6c7b0..f628d2eaf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.2.0 +11.3.0 diff --git a/stripe/_version.py b/stripe/_version.py index 00a5f7802..8942c237b 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "11.2.0" +VERSION = "11.3.0" From 12637de43efa1af5e4a2cd5948c94ac9b5ec11e7 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:00:31 -0800 Subject: [PATCH 129/179] fix deprecation warning in httpx @ 0.28 (#1431) --- stripe/_http_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stripe/_http_client.py b/stripe/_http_client.py index 0db2ef3f5..5940f6aad 100644 --- a/stripe/_http_client.py +++ b/stripe/_http_client.py @@ -1244,7 +1244,9 @@ def __init__( kwargs = {} if self._verify_ssl_certs: - kwargs["verify"] = stripe.ca_bundle_path + kwargs["verify"] = ssl.create_default_context( + capath=stripe.ca_bundle_path + ) else: kwargs["verify"] = False From 43d0937888e0ddcef2f64faa387dc9efa6eb34b2 Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Mon, 16 Dec 2024 12:19:14 -0800 Subject: [PATCH 130/179] fixed an issue where string http_body values passed into StripeError were discarded (#1435) --- stripe/_error.py | 22 ++++++++++++++-------- tests/test_error.py | 17 +++++++++++++++++ 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/stripe/_error.py b/stripe/_error.py index 3b486ee79..14bc2f9a9 100644 --- a/stripe/_error.py +++ b/stripe/_error.py @@ -26,14 +26,20 @@ def __init__( super(StripeError, self).__init__(message) body: Optional[str] = None - if http_body and hasattr(http_body, "decode"): - try: - body = cast(bytes, http_body).decode("utf-8") - except BaseException: - body = ( - "" - ) + if http_body: + # http_body can sometimes be a memoryview which must be cast + # to a "bytes" before calling decode, so we check for the + # decode attribute and then cast + if hasattr(http_body, "decode"): + try: + body = cast(bytes, http_body).decode("utf-8") + except BaseException: + body = ( + "" + ) + elif isinstance(http_body, str): + body = http_body self._message = message self.http_body = body diff --git a/tests/test_error.py b/tests/test_error.py index 6f96227a4..fe0e4a45b 100644 --- a/tests/test_error.py +++ b/tests/test_error.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- +import json from stripe import error @@ -28,6 +29,22 @@ def test_repr(self): "request_id='123')" ) + def test_error_string_body(self): + http_body = '{"error": {"code": "some_error"}}' + err = error.StripeError( + "message", http_body=http_body, json_body=json.loads(http_body) + ) + assert err.http_body is not None + assert err.http_body == json.dumps(err.json_body) + + def test_error_bytes_body(self): + http_body = '{"error": {"code": "some_error"}}'.encode("utf-8") + err = error.StripeError( + "message", http_body=http_body, json_body=json.loads(http_body) + ) + assert err.http_body is not None + assert err.http_body == json.dumps(err.json_body) + def test_error_object(self): err = error.StripeError( "message", json_body={"error": {"code": "some_error"}} From ef9d5b00858e80bb021bc172679bd7ab32b7f34c Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:53:26 -0800 Subject: [PATCH 131/179] Fix using `auto_paging_iter()` with `expand: [...]` (#1434) * deduplicate querystring using a pre-made url * fix tests --- stripe/_api_requestor.py | 43 ++++++++++++++++---- tests/api_resources/test_list_object.py | 53 +++++++++++++++++++++++++ tests/test_api_requestor.py | 9 +++-- 3 files changed, 94 insertions(+), 11 deletions(-) diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index 65bb449fe..c0fa8a561 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -20,7 +20,7 @@ Unpack, ) import uuid -from urllib.parse import urlsplit, urlunsplit +from urllib.parse import urlsplit, urlunsplit, parse_qs # breaking circular dependency import stripe # noqa: IMP101 @@ -556,6 +556,35 @@ def _args_for_request_with_retries( url, ) + params = params or {} + if params and (method == "get" or method == "delete"): + # if we're sending params in the querystring, then we have to make sure we're not + # duplicating anything we got back from the server already (like in a list iterator) + # so, we parse the querystring the server sends back so we can merge with what we (or the user) are trying to send + existing_params = {} + for k, v in parse_qs(urlsplit(url).query).items(): + # note: server sends back "expand[]" but users supply "expand", so we strip the brackets from the key name + if k.endswith("[]"): + existing_params[k[:-2]] = v + else: + # all querystrings are pulled out as lists. + # We want to keep the querystrings that actually are lists, but flatten the ones that are single values + existing_params[k] = v[0] if len(v) == 1 else v + + # if a user is expanding something that wasn't expanded before, add (and deduplicate) it + # this could theoretically work for other lists that we want to merge too, but that doesn't seem to be a use case + # it never would have worked before, so I think we can start with `expand` and go from there + if "expand" in existing_params and "expand" in params: + params["expand"] = list( # type:ignore - this is a dict + set([*existing_params["expand"], *params["expand"]]) + ) + + params = { + **existing_params, + # user_supplied params take precedence over server params + **params, + } + encoded_params = urlencode(list(_api_encode(params or {}, api_mode))) # Don't use strict form encoding by changing the square bracket control @@ -586,13 +615,13 @@ def _args_for_request_with_retries( if method == "get" or method == "delete": if params: - query = encoded_params - scheme, netloc, path, base_query, fragment = urlsplit(abs_url) + # if we're sending query params, we've already merged the incoming ones with the server's "url" + # so we can overwrite the whole thing + scheme, netloc, path, _, fragment = urlsplit(abs_url) - if base_query: - query = "%s&%s" % (base_query, query) - - abs_url = urlunsplit((scheme, netloc, path, query, fragment)) + abs_url = urlunsplit( + (scheme, netloc, path, encoded_params, fragment) + ) post_data = None elif method == "post": if ( diff --git a/tests/api_resources/test_list_object.py b/tests/api_resources/test_list_object.py index fe6340a14..6de3b4beb 100644 --- a/tests/api_resources/test_list_object.py +++ b/tests/api_resources/test_list_object.py @@ -3,6 +3,7 @@ import pytest import stripe +from tests.http_client_mock import HTTPClientMock class TestListObject(object): @@ -439,6 +440,58 @@ def test_forwards_api_key_to_nested_resources(self, http_client_mock): ) assert lo.data[0].api_key == "sk_test_iter_forwards_options" + def test_iter_with_params(self, http_client_mock: HTTPClientMock): + http_client_mock.stub_request( + "get", + path="/v1/invoices/upcoming/lines", + query_string="customer=cus_123&expand[0]=data.price&limit=1", + rbody=json.dumps( + { + "object": "list", + "data": [ + { + "id": "prod_001", + "object": "product", + "price": {"object": "price", "id": "price_123"}, + } + ], + "url": "/v1/invoices/upcoming/lines?customer=cus_123&expand%5B%5D=data.price", + "has_more": True, + } + ), + ) + # second page + http_client_mock.stub_request( + "get", + path="/v1/invoices/upcoming/lines", + query_string="customer=cus_123&expand[0]=data.price&limit=1&starting_after=prod_001", + rbody=json.dumps( + { + "object": "list", + "data": [ + { + "id": "prod_002", + "object": "product", + "price": {"object": "price", "id": "price_123"}, + } + ], + "url": "/v1/invoices/upcoming/lines?customer=cus_123&expand%5B%5D=data.price", + "has_more": False, + } + ), + ) + + lo = stripe.Invoice.upcoming_lines( + api_key="sk_test_invoice_lines", + customer="cus_123", + expand=["data.price"], + limit=1, + ) + + seen = [item["id"] for item in lo.auto_paging_iter()] + + assert seen == ["prod_001", "prod_002"] + class TestAutoPagingAsync: @staticmethod diff --git a/tests/test_api_requestor.py b/tests/test_api_requestor.py index 82f10e5a3..0c8b028d4 100644 --- a/tests/test_api_requestor.py +++ b/tests/test_api_requestor.py @@ -245,16 +245,17 @@ def test_ordereddict_encoding(self): def test_url_construction(self, requestor, http_client_mock): CASES = ( - ("%s?foo=bar" % stripe.api_base, "", {"foo": "bar"}), - ("%s?foo=bar" % stripe.api_base, "?", {"foo": "bar"}), + (f"{stripe.api_base}?foo=bar", "", {"foo": "bar"}), + (f"{stripe.api_base}?foo=bar", "?", {"foo": "bar"}), (stripe.api_base, "", {}), ( - "%s/%%20spaced?foo=bar%%24&baz=5" % stripe.api_base, + f"{stripe.api_base}/%20spaced?baz=5&foo=bar%24", "/%20spaced?foo=bar%24", {"baz": "5"}, ), + # duplicate query params keys should be deduped ( - "%s?foo=bar&foo=bar" % stripe.api_base, + f"{stripe.api_base}?foo=bar", "?foo=bar", {"foo": "bar"}, ), From c5c40079c50e0dde48a84f4b15f3b48ad784029d Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 23:30:40 +0000 Subject: [PATCH 132/179] Update generated code (#1430) * Update generated code for v1399 * Update generated code for v1402 * Update generated code for v1409 * Update generated code for v1412 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: jar-stripe --- OPENAPI_VERSION | 2 +- stripe/_account.py | 8 +- stripe/_account_service.py | 4 +- stripe/_account_session.py | 20 +- stripe/_account_session_service.py | 10 +- stripe/_api_version.py | 2 +- stripe/_balance_transaction.py | 6 +- stripe/_balance_transaction_service.py | 2 +- stripe/_capability.py | 6 +- stripe/_card.py | 8 + stripe/_charge.py | 90 ++++- stripe/_confirmation_token.py | 4 + stripe/_customer.py | 44 +- stripe/_customer_service.py | 23 +- stripe/_customer_tax_id_service.py | 21 +- stripe/_dispute.py | 30 ++ stripe/_dispute_service.py | 12 + stripe/_funding_instructions.py | 236 +++++++++++ stripe/_invoice.py | 115 +++++- stripe/_invoice_service.py | 52 ++- stripe/_invoice_upcoming_lines_service.py | 25 +- stripe/_payment_intent.py | 292 +++++++++++++- stripe/_payment_intent_service.py | 36 +- stripe/_payment_link.py | 12 +- stripe/_payment_link_service.py | 12 +- stripe/_payment_method.py | 4 + stripe/_person.py | 4 +- stripe/_setup_attempt.py | 8 + stripe/_setup_intent.py | 48 ++- stripe/_setup_intent_service.py | 30 +- stripe/_source.py | 4 + stripe/_subscription.py | 10 +- stripe/_subscription_schedule.py | 8 + stripe/_subscription_service.py | 6 +- stripe/_tax_id.py | 42 +- stripe/_tax_id_service.py | 21 +- stripe/_webhook_endpoint.py | 1 + stripe/_webhook_endpoint_service.py | 1 + stripe/billing/_credit_balance_summary.py | 6 +- .../_credit_balance_summary_service.py | 6 +- stripe/billing/_credit_balance_transaction.py | 31 +- .../_credit_balance_transaction_service.py | 8 +- stripe/billing/_credit_grant.py | 26 +- stripe/billing/_credit_grant_service.py | 22 +- stripe/billing/_meter.py | 52 +-- stripe/billing/_meter_event.py | 9 +- stripe/billing/_meter_event_adjustment.py | 4 +- .../_meter_event_adjustment_service.py | 4 +- stripe/billing/_meter_event_service.py | 6 +- stripe/billing/_meter_service.py | 26 +- stripe/billing_portal/_configuration.py | 2 +- stripe/checkout/_session.py | 45 ++- stripe/checkout/_session_service.py | 14 +- stripe/forwarding/_request.py | 14 +- stripe/forwarding/_request_service.py | 6 +- stripe/issuing/_authorization.py | 4 + stripe/issuing/_transaction.py | 4 + stripe/tax/_calculation.py | 42 +- stripe/tax/_calculation_service.py | 21 +- stripe/tax/_registration.py | 378 ++++++++++++++++++ stripe/tax/_registration_service.py | 210 ++++++++++ stripe/tax/_transaction.py | 21 +- stripe/terminal/_location.py | 2 +- stripe/terminal/_location_service.py | 2 +- .../treasury/_financial_account_features.py | 6 +- 65 files changed, 2009 insertions(+), 221 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 7ab08411d..bf0daa66a 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1347 \ No newline at end of file +v1412 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 8fa660038..e1c613c2f 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -792,7 +792,7 @@ class Error(StripeObject): """ current_deadline: Optional[int] """ - Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on its enablement state prior to transitioning. + Date on which `future_requirements` becomes the main `requirements` hash and `future_requirements` becomes empty. After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on its enablement state prior to transitioning. """ currently_due: Optional[List[str]] """ @@ -826,7 +826,7 @@ class Error(StripeObject): """ eventually_due: Optional[List[str]] """ - Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well. + Fields you must collect when all thresholds are reached. As they become required, they appear in `currently_due` as well. """ past_due: Optional[List[str]] """ @@ -1000,7 +1000,7 @@ class Error(StripeObject): """ eventually_due: Optional[List[str]] """ - Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. + Fields you must collect when all thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. """ past_due: Optional[List[str]] """ @@ -1362,7 +1362,7 @@ class CreateParams(RequestOptions): """ groups: NotRequired["Account.CreateParamsGroups"] """ - A hash of account group type to tokens. These are account groups this account should be added to + A hash of account group type to tokens. These are account groups this account should be added to. """ individual: NotRequired["Account.CreateParamsIndividual"] """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 9d973845c..7a8580967 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -89,7 +89,7 @@ class CreateParams(TypedDict): """ groups: NotRequired["AccountService.CreateParamsGroups"] """ - A hash of account group type to tokens. These are account groups this account should be added to + A hash of account group type to tokens. These are account groups this account should be added to. """ individual: NotRequired["AccountService.CreateParamsIndividual"] """ @@ -1861,7 +1861,7 @@ class UpdateParams(TypedDict): """ groups: NotRequired["AccountService.UpdateParamsGroups"] """ - A hash of account group type to tokens. These are account groups this account should be added to + A hash of account group type to tokens. These are account groups this account should be added to. """ individual: NotRequired["AccountService.UpdateParamsIndividual"] """ diff --git a/stripe/_account_session.py b/stripe/_account_session.py index 74229cb25..abf90e204 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -25,7 +25,7 @@ class AccountManagement(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ external_account_collection: bool """ @@ -43,7 +43,7 @@ class AccountOnboarding(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ external_account_collection: bool """ @@ -61,7 +61,7 @@ class Balances(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ edit_payout_schedule: bool """ @@ -102,7 +102,7 @@ class NotificationBanner(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ external_account_collection: bool """ @@ -172,7 +172,7 @@ class Payouts(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ edit_payout_schedule: bool """ @@ -347,7 +347,7 @@ class CreateParamsComponentsAccountManagement(TypedDict): class CreateParamsComponentsAccountManagementFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ external_account_collection: NotRequired[bool] """ @@ -369,7 +369,7 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ external_account_collection: NotRequired[bool] """ @@ -391,7 +391,7 @@ class CreateParamsComponentsBalances(TypedDict): class CreateParamsComponentsBalancesFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ edit_payout_schedule: NotRequired[bool] """ @@ -440,7 +440,7 @@ class CreateParamsComponentsNotificationBanner(TypedDict): class CreateParamsComponentsNotificationBannerFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ external_account_collection: NotRequired[bool] """ @@ -522,7 +522,7 @@ class CreateParamsComponentsPayouts(TypedDict): class CreateParamsComponentsPayoutsFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ edit_payout_schedule: NotRequired[bool] """ diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index fbdf22315..6304ddad2 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -105,7 +105,7 @@ class CreateParamsComponentsAccountManagement(TypedDict): class CreateParamsComponentsAccountManagementFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ external_account_collection: NotRequired[bool] """ @@ -127,7 +127,7 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ external_account_collection: NotRequired[bool] """ @@ -149,7 +149,7 @@ class CreateParamsComponentsBalances(TypedDict): class CreateParamsComponentsBalancesFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ edit_payout_schedule: NotRequired[bool] """ @@ -198,7 +198,7 @@ class CreateParamsComponentsNotificationBanner(TypedDict): class CreateParamsComponentsNotificationBannerFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ external_account_collection: NotRequired[bool] """ @@ -280,7 +280,7 @@ class CreateParamsComponentsPayouts(TypedDict): class CreateParamsComponentsPayoutsFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. """ edit_payout_schedule: NotRequired[bool] """ diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 4f7ee9878..7d2801e63 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 = "2024-11-20.acacia" + CURRENT = "2024-12-18.acacia" diff --git a/stripe/_balance_transaction.py b/stripe/_balance_transaction.py index efc7ab96e..35712d5ab 100644 --- a/stripe/_balance_transaction.py +++ b/stripe/_balance_transaction.py @@ -104,7 +104,7 @@ class ListParams(RequestOptions): """ type: NotRequired[str] """ - Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. """ class ListParamsCreated(TypedDict): @@ -236,6 +236,8 @@ class RetrieveParams(RequestOptions): "payout", "payout_cancel", "payout_failure", + "payout_minimum_balance_hold", + "payout_minimum_balance_release", "refund", "refund_failure", "reserve_transaction", @@ -251,7 +253,7 @@ class RetrieveParams(RequestOptions): "transfer_refund", ] """ - Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. + Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. """ @classmethod diff --git a/stripe/_balance_transaction_service.py b/stripe/_balance_transaction_service.py index 06ec1abce..4f75e6359 100644 --- a/stripe/_balance_transaction_service.py +++ b/stripe/_balance_transaction_service.py @@ -45,7 +45,7 @@ class ListParams(TypedDict): """ type: NotRequired[str] """ - Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. """ class ListParamsCreated(TypedDict): diff --git a/stripe/_capability.py b/stripe/_capability.py index d83ba3b62..c9575c8ea 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -140,7 +140,7 @@ class Error(StripeObject): """ current_deadline: Optional[int] """ - Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on the capability's enablement state prior to transitioning. + Date on which `future_requirements` becomes the main `requirements` hash and `future_requirements` becomes empty. After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on the capability's enablement state prior to transitioning. """ currently_due: List[str] """ @@ -169,7 +169,7 @@ class Error(StripeObject): """ eventually_due: List[str] """ - Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well. + Fields you must collect when all thresholds are reached. As they become required, they appear in `currently_due` as well. """ past_due: List[str] """ @@ -332,7 +332,7 @@ class Error(StripeObject): """ eventually_due: List[str] """ - Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. + Fields you must collect when all thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. """ past_due: List[str] """ diff --git a/stripe/_card.py b/stripe/_card.py index 631da0c36..1b1def6a1 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -72,6 +72,10 @@ class DeleteParams(RequestOptions): """ If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. """ + allow_redisplay: Optional[Literal["always", "limited", "unspecified"]] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. + """ available_payout_methods: Optional[List[Literal["instant", "standard"]]] """ A set of available payout methods for this card. Only values from this set should be passed as the `method` when creating a payout. @@ -155,6 +159,10 @@ class DeleteParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ + regulated_status: Optional[Literal["regulated", "unregulated"]] + """ + Status of a card based on the card issuer. + """ status: Optional[str] """ For external accounts that are cards, possible values are `new` and `errored`. If a payout fails, the status is set to `errored` and [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) are stopped until account details are updated. diff --git a/stripe/_charge.py b/stripe/_charge.py index 971bcad33..1d545a563 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -151,6 +151,14 @@ class Rule(StripeObject): The predicate to evaluate the payment against. """ + network_advice_code: Optional[str] + """ + For charges declined by the network, a 2 digit code which indicates the advice returned by the network on how to proceed with an error. + """ + network_decline_code: Optional[str] + """ + For charges declined by the network, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + """ network_status: Optional[str] """ Possible values are `approved_by_network`, `declined_by_network`, `not_sent_to_network`, and `reversed_after_approval`. The value `reversed_after_approval` indicates the payment was [blocked by Stripe](https://stripe.com/docs/declines#blocked-payments) after bank authorization, and may temporarily appear as "pending" on a cardholder's statement. @@ -286,7 +294,42 @@ class Alma(StripeObject): pass class AmazonPay(StripeObject): - pass + class Funding(StripeObject): + class Card(StripeObject): + brand: Optional[str] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + exp_month: Optional[int] + """ + Two-digit number representing the card's expiration month. + """ + exp_year: Optional[int] + """ + Four-digit number representing the card's expiration year. + """ + funding: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + + card: Optional[Card] + type: Optional[Literal["card"]] + """ + funding type of the underlying payment method. + """ + _inner_class_types = {"card": Card} + + funding: Optional[Funding] + _inner_class_types = {"funding": Funding} class AuBecsDebit(StripeObject): bsb_number: Optional[str] @@ -785,7 +828,15 @@ class ShippingAddress(StripeObject): """ If this card has network token credentials, this contains the details of the network token credentials. """ + network_transaction_id: Optional[str] + """ + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + """ overcapture: Optional[Overcapture] + regulated_status: Optional[Literal["regulated", "unregulated"]] + """ + Status of a card based on the card issuer. + """ three_d_secure: Optional[ThreeDSecure] """ Populated if this transaction used 3D Secure authentication. @@ -1545,7 +1596,42 @@ class Promptpay(StripeObject): """ class RevolutPay(StripeObject): - pass + class Funding(StripeObject): + class Card(StripeObject): + brand: Optional[str] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + exp_month: Optional[int] + """ + Two-digit number representing the card's expiration month. + """ + exp_year: Optional[int] + """ + Four-digit number representing the card's expiration year. + """ + funding: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + + card: Optional[Card] + type: Optional[Literal["card"]] + """ + funding type of the underlying payment method. + """ + _inner_class_types = {"card": Card} + + funding: Optional[Funding] + _inner_class_types = {"funding": Funding} class SamsungPay(StripeObject): buyer_id: Optional[str] diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index b3cdc1aca..5f5269085 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -686,6 +686,10 @@ class ShippingAddress(StripeObject): """ Contains information about card networks that can be used to process the payment. """ + regulated_status: Optional[Literal["regulated", "unregulated"]] + """ + Status of a card based on the card issuer. + """ three_d_secure_usage: Optional[ThreeDSecureUsage] """ Contains details on how this Card may be used for 3D Secure authentication. diff --git a/stripe/_customer.py b/stripe/_customer.py index 7381efdc7..311be1eef 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -514,14 +514,20 @@ class CreateParamsTaxIdDatum(TypedDict): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -529,6 +535,7 @@ class CreateParamsTaxIdDatum(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -544,6 +551,7 @@ class CreateParamsTaxIdDatum(TypedDict): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -555,12 +563,16 @@ class CreateParamsTaxIdDatum(TypedDict): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -568,6 +580,7 @@ class CreateParamsTaxIdDatum(TypedDict): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -580,12 +593,16 @@ class CreateParamsTaxIdDatum(TypedDict): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -593,9 +610,11 @@ class CreateParamsTaxIdDatum(TypedDict): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -625,14 +644,20 @@ class CreateTaxIdParams(RequestOptions): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -640,6 +665,7 @@ class CreateTaxIdParams(RequestOptions): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -655,6 +681,7 @@ class CreateTaxIdParams(RequestOptions): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -666,12 +693,16 @@ class CreateTaxIdParams(RequestOptions): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -679,6 +710,7 @@ class CreateTaxIdParams(RequestOptions): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -691,12 +723,16 @@ class CreateTaxIdParams(RequestOptions): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -704,9 +740,11 @@ class CreateTaxIdParams(RequestOptions): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -1193,7 +1231,7 @@ class ModifyParamsTax(TypedDict): Literal["auto", "deferred", "immediately"] ] """ - A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. + A flag that indicates when Stripe should validate the customer tax location. Defaults to `auto`. """ class ModifySourceParams(RequestOptions): diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 472422454..15fd4a4d2 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -276,14 +276,20 @@ class CreateParamsTaxIdDatum(TypedDict): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -291,6 +297,7 @@ class CreateParamsTaxIdDatum(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -306,6 +313,7 @@ class CreateParamsTaxIdDatum(TypedDict): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -317,12 +325,16 @@ class CreateParamsTaxIdDatum(TypedDict): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -330,6 +342,7 @@ class CreateParamsTaxIdDatum(TypedDict): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -342,12 +355,16 @@ class CreateParamsTaxIdDatum(TypedDict): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -355,9 +372,11 @@ class CreateParamsTaxIdDatum(TypedDict): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -665,7 +684,7 @@ class UpdateParamsTax(TypedDict): Literal["auto", "deferred", "immediately"] ] """ - A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. + A flag that indicates when Stripe should validate the customer tax location. Defaults to `auto`. """ def delete( diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index 15cd2be0b..b7abe3dcc 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -18,14 +18,20 @@ class CreateParams(TypedDict): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -33,6 +39,7 @@ class CreateParams(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -48,6 +55,7 @@ class CreateParams(TypedDict): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -59,12 +67,16 @@ class CreateParams(TypedDict): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -72,6 +84,7 @@ class CreateParams(TypedDict): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -84,12 +97,16 @@ class CreateParams(TypedDict): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -97,9 +114,11 @@ class CreateParams(TypedDict): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ diff --git a/stripe/_dispute.py b/stripe/_dispute.py index 8021dfb17..81d9856c7 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -176,9 +176,17 @@ class ShippingAddress(StripeObject): "prior_undisputed_transactions": PriorUndisputedTransaction, } + class VisaCompliance(StripeObject): + fee_acknowledged: bool + """ + A field acknowledging the fee incurred when countering a Visa compliance dispute. If this field is set to true, evidence can be submitted for the compliance dispute. Stripe collects a 500 USD (or local equivalent) amount to cover the network costs associated with resolving compliance disputes. Stripe refunds the 500 USD network fee if you win the dispute. + """ + visa_compelling_evidence_3: Optional[VisaCompellingEvidence3] + visa_compliance: Optional[VisaCompliance] _inner_class_types = { "visa_compelling_evidence_3": VisaCompellingEvidence3, + "visa_compliance": VisaCompliance, } access_activity_log: Optional[str] @@ -314,9 +322,19 @@ class VisaCompellingEvidence3(StripeObject): Visa Compelling Evidence 3.0 eligibility status. """ + class VisaCompliance(StripeObject): + status: Literal[ + "fee_acknowledged", "requires_fee_acknowledgement" + ] + """ + Visa compliance eligibility status. + """ + visa_compelling_evidence_3: Optional[VisaCompellingEvidence3] + visa_compliance: Optional[VisaCompliance] _inner_class_types = { "visa_compelling_evidence_3": VisaCompellingEvidence3, + "visa_compliance": VisaCompliance, } due_by: Optional[int] @@ -585,6 +603,12 @@ class ModifyParamsEvidenceEnhancedEvidence(TypedDict): """ Evidence provided for Visa Compelling Evidence 3.0 evidence submission. """ + visa_compliance: NotRequired[ + "Dispute.ModifyParamsEvidenceEnhancedEvidenceVisaCompliance" + ] + """ + Evidence provided for Visa compliance evidence submission. + """ class ModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3( TypedDict, @@ -738,6 +762,12 @@ class ModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputed State, county, province, or region. """ + class ModifyParamsEvidenceEnhancedEvidenceVisaCompliance(TypedDict): + fee_acknowledged: NotRequired[bool] + """ + A field acknowledging the fee incurred when countering a Visa compliance dispute. If this field is set to true, evidence can be submitted for the compliance dispute. Stripe collects a 500 USD (or local equivalent) amount to cover the network costs associated with resolving compliance disputes. Stripe refunds the 500 USD network fee if you win the dispute. + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ diff --git a/stripe/_dispute_service.py b/stripe/_dispute_service.py index 97c4f7897..f0b3e7c8e 100644 --- a/stripe/_dispute_service.py +++ b/stripe/_dispute_service.py @@ -211,6 +211,12 @@ class UpdateParamsEvidenceEnhancedEvidence(TypedDict): """ Evidence provided for Visa Compelling Evidence 3.0 evidence submission. """ + visa_compliance: NotRequired[ + "DisputeService.UpdateParamsEvidenceEnhancedEvidenceVisaCompliance" + ] + """ + Evidence provided for Visa compliance evidence submission. + """ class UpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3( TypedDict, @@ -364,6 +370,12 @@ class UpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputed State, county, province, or region. """ + class UpdateParamsEvidenceEnhancedEvidenceVisaCompliance(TypedDict): + fee_acknowledged: NotRequired[bool] + """ + A field acknowledging the fee incurred when countering a Visa compliance dispute. If this field is set to true, evidence can be submitted for the compliance dispute. Stripe collects a 500 USD (or local equivalent) amount to cover the network costs associated with resolving compliance disputes. Stripe refunds the 500 USD network fee if you win the dispute. + """ + def list( self, params: "DisputeService.ListParams" = {}, diff --git a/stripe/_funding_instructions.py b/stripe/_funding_instructions.py index d3ee23e43..adebafe34 100644 --- a/stripe/_funding_instructions.py +++ b/stripe/_funding_instructions.py @@ -101,10 +101,64 @@ class BankAddress(StripeObject): } class Iban(StripeObject): + class AccountHolderAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class BankAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + account_holder_address: AccountHolderAddress account_holder_name: str """ The name of the person or business that owns the bank account """ + bank_address: BankAddress bic: str """ The BIC/SWIFT code of the account. @@ -117,8 +171,65 @@ class Iban(StripeObject): """ The IBAN of the account. """ + _inner_class_types = { + "account_holder_address": AccountHolderAddress, + "bank_address": BankAddress, + } class SortCode(StripeObject): + class AccountHolderAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class BankAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + account_holder_address: AccountHolderAddress account_holder_name: str """ The name of the person or business that owns the bank account @@ -127,12 +238,75 @@ class SortCode(StripeObject): """ The account number """ + bank_address: BankAddress sort_code: str """ The six-digit sort code """ + _inner_class_types = { + "account_holder_address": AccountHolderAddress, + "bank_address": BankAddress, + } class Spei(StripeObject): + class AccountHolderAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class BankAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + account_holder_address: AccountHolderAddress + account_holder_name: str + """ + The account holder name + """ + bank_address: BankAddress bank_code: str """ The three-digit bank code @@ -145,6 +319,10 @@ class Spei(StripeObject): """ The CLABE number """ + _inner_class_types = { + "account_holder_address": AccountHolderAddress, + "bank_address": BankAddress, + } class Swift(StripeObject): class AccountHolderAddress(StripeObject): @@ -227,6 +405,59 @@ class BankAddress(StripeObject): } class Zengin(StripeObject): + class AccountHolderAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class BankAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + account_holder_address: AccountHolderAddress account_holder_name: Optional[str] """ The account holder name @@ -239,6 +470,7 @@ class Zengin(StripeObject): """ The bank account type. In Japan, this can only be `futsu` or `toza`. """ + bank_address: BankAddress bank_code: Optional[str] """ The bank code of the account @@ -255,6 +487,10 @@ class Zengin(StripeObject): """ The branch name of the account """ + _inner_class_types = { + "account_holder_address": AccountHolderAddress, + "bank_address": BankAddress, + } aba: Optional[Aba] """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index d0b52558d..a15b1a8ab 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -111,6 +111,15 @@ class Liability(StripeObject): Type of the account referenced. """ + disabled_reason: Optional[ + Literal[ + "finalization_requires_location_inputs", + "finalization_system_error", + ] + ] + """ + If Stripe disabled automatic tax, this enum describes why. + """ enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. @@ -213,14 +222,20 @@ class CustomerTaxId(StripeObject): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -228,6 +243,7 @@ class CustomerTaxId(StripeObject): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -243,6 +259,7 @@ class CustomerTaxId(StripeObject): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -254,12 +271,16 @@ class CustomerTaxId(StripeObject): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -267,6 +288,7 @@ class CustomerTaxId(StripeObject): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -279,12 +301,16 @@ class CustomerTaxId(StripeObject): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "unknown", "us_ein", "uy_ruc", @@ -293,9 +319,11 @@ class CustomerTaxId(StripeObject): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, or `unknown` """ value: Optional[str] """ @@ -518,6 +546,14 @@ class LastFinalizationError(StripeObject): """ A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. """ + network_advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + """ + network_decline_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + """ param: Optional[str] """ If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. @@ -1478,7 +1514,7 @@ class CreateParamsPaymentSettings(TypedDict): "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ - The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration """ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): @@ -2092,14 +2128,20 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -2107,6 +2149,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -2122,6 +2165,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -2133,12 +2177,16 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -2146,6 +2194,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -2158,12 +2207,16 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -2171,9 +2224,11 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -2771,7 +2826,7 @@ class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): """ clear_usage: NotRequired[bool] """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + 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. """ deleted: NotRequired[bool] """ @@ -3183,7 +3238,7 @@ class ModifyParamsPaymentSettings(TypedDict): "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ - The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration """ class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): @@ -3949,14 +4004,20 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -3964,6 +4025,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -3979,6 +4041,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -3990,12 +4053,16 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -4003,6 +4070,7 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -4015,12 +4083,16 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -4028,9 +4100,11 @@ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -4628,7 +4702,7 @@ class UpcomingLinesParamsSubscriptionDetailsItem(TypedDict): """ clear_usage: NotRequired[bool] """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + 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. """ deleted: NotRequired[bool] """ @@ -4742,7 +4816,7 @@ class UpcomingLinesParamsSubscriptionItem(TypedDict): """ clear_usage: NotRequired[bool] """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + 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. """ deleted: NotRequired[bool] """ @@ -5091,14 +5165,20 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -5106,6 +5186,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -5121,6 +5202,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -5132,12 +5214,16 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -5145,6 +5231,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -5157,12 +5244,16 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -5170,9 +5261,11 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -5754,7 +5847,7 @@ class UpcomingParamsSubscriptionDetailsItem(TypedDict): """ clear_usage: NotRequired[bool] """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + 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. """ deleted: NotRequired[bool] """ @@ -5866,7 +5959,7 @@ class UpcomingParamsSubscriptionItem(TypedDict): """ clear_usage: NotRequired[bool] """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + 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. """ deleted: NotRequired[bool] """ diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 4825ff4ba..7da0c5361 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -452,7 +452,7 @@ class CreateParamsPaymentSettings(TypedDict): "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ - The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration """ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): @@ -1072,14 +1072,20 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -1087,6 +1093,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -1102,6 +1109,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -1113,12 +1121,16 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -1126,6 +1138,7 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -1138,12 +1151,16 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -1151,9 +1168,11 @@ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -1755,7 +1774,7 @@ class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): """ clear_usage: NotRequired[bool] """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + 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. """ deleted: NotRequired[bool] """ @@ -2298,14 +2317,20 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -2313,6 +2338,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -2328,6 +2354,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -2339,12 +2366,16 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -2352,6 +2383,7 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -2364,12 +2396,16 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -2377,9 +2413,11 @@ class UpcomingParamsCustomerDetailsTaxId(TypedDict): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -2965,7 +3003,7 @@ class UpcomingParamsSubscriptionDetailsItem(TypedDict): """ clear_usage: NotRequired[bool] """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + 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. """ deleted: NotRequired[bool] """ @@ -3075,7 +3113,7 @@ class UpcomingParamsSubscriptionItem(TypedDict): """ clear_usage: NotRequired[bool] """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + 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. """ deleted: NotRequired[bool] """ @@ -3588,7 +3626,7 @@ class UpdateParamsPaymentSettings(TypedDict): "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ - The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration """ class UpdateParamsPaymentSettingsPaymentMethodOptions(TypedDict): diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py index a4b9338d5..5c53320f1 100644 --- a/stripe/_invoice_upcoming_lines_service.py +++ b/stripe/_invoice_upcoming_lines_service.py @@ -279,14 +279,20 @@ class ListParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -294,6 +300,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -309,6 +316,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -320,12 +328,16 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -333,6 +345,7 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -345,12 +358,16 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -358,9 +375,11 @@ class ListParamsCustomerDetailsTaxId(TypedDict): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -952,7 +971,7 @@ class ListParamsSubscriptionDetailsItem(TypedDict): """ clear_usage: NotRequired[bool] """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + 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. """ deleted: NotRequired[bool] """ @@ -1062,7 +1081,7 @@ class ListParamsSubscriptionItem(TypedDict): """ clear_usage: NotRequired[bool] """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + 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. """ deleted: NotRequired[bool] """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index c0bf5a297..209d363be 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -284,6 +284,14 @@ class LastPaymentError(StripeObject): """ A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. """ + network_advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + """ + network_decline_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + """ param: Optional[str] """ If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. @@ -511,10 +519,64 @@ class BankAddress(StripeObject): } class Iban(StripeObject): + class AccountHolderAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class BankAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + account_holder_address: AccountHolderAddress account_holder_name: str """ The name of the person or business that owns the bank account """ + bank_address: BankAddress bic: str """ The BIC/SWIFT code of the account. @@ -527,8 +589,65 @@ class Iban(StripeObject): """ The IBAN of the account. """ + _inner_class_types = { + "account_holder_address": AccountHolderAddress, + "bank_address": BankAddress, + } class SortCode(StripeObject): + class AccountHolderAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class BankAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + account_holder_address: AccountHolderAddress account_holder_name: str """ The name of the person or business that owns the bank account @@ -537,12 +656,75 @@ class SortCode(StripeObject): """ The account number """ + bank_address: BankAddress sort_code: str """ The six-digit sort code """ + _inner_class_types = { + "account_holder_address": AccountHolderAddress, + "bank_address": BankAddress, + } class Spei(StripeObject): + class AccountHolderAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class BankAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + account_holder_address: AccountHolderAddress + account_holder_name: str + """ + The account holder name + """ + bank_address: BankAddress bank_code: str """ The three-digit bank code @@ -555,6 +737,10 @@ class Spei(StripeObject): """ The CLABE number """ + _inner_class_types = { + "account_holder_address": AccountHolderAddress, + "bank_address": BankAddress, + } class Swift(StripeObject): class AccountHolderAddress(StripeObject): @@ -637,6 +823,59 @@ class BankAddress(StripeObject): } class Zengin(StripeObject): + class AccountHolderAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class BankAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + account_holder_address: AccountHolderAddress account_holder_name: Optional[str] """ The account holder name @@ -649,6 +888,7 @@ class Zengin(StripeObject): """ The bank account type. In Japan, this can only be `futsu` or `toza`. """ + bank_address: BankAddress bank_code: Optional[str] """ The bank code of the account @@ -665,6 +905,10 @@ class Zengin(StripeObject): """ The branch name of the account """ + _inner_class_types = { + "account_holder_address": AccountHolderAddress, + "bank_address": BankAddress, + } aba: Optional[Aba] """ @@ -1225,7 +1469,10 @@ class AuBecsDebit(StripeObject): class BacsDebit(StripeObject): class MandateOptions(StripeObject): - pass + reference_prefix: Optional[str] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ @@ -1883,7 +2130,10 @@ class SamsungPay(StripeObject): class SepaDebit(StripeObject): class MandateOptions(StripeObject): - pass + reference_prefix: Optional[str] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ @@ -1921,7 +2171,7 @@ class Sofort(StripeObject): class Swish(StripeObject): reference: Optional[str] """ - The order ID displayed in the Swish app after the payment is authorized. + A reference for this payment to be displayed in the Swish app. """ setup_future_usage: Optional[Literal["none"]] """ @@ -3576,7 +3826,10 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] @@ -4518,7 +4771,10 @@ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ @@ -4545,7 +4801,7 @@ class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ - The order ID displayed in the Swish app after the payment is authorized. + A reference for this payment to be displayed in the Swish app. """ setup_future_usage: NotRequired[Literal["none"]] """ @@ -6117,7 +6373,10 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] @@ -7059,7 +7318,10 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class CreateParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ @@ -7086,7 +7348,7 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): class CreateParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ - The order ID displayed in the Swish app after the payment is authorized. + A reference for this payment to be displayed in the Swish app. """ setup_future_usage: NotRequired[Literal["none"]] """ @@ -8652,7 +8914,10 @@ class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class ModifyParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class ModifyParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] @@ -9594,7 +9859,10 @@ class ModifyParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class ModifyParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ @@ -9621,7 +9889,7 @@ class ModifyParamsPaymentMethodOptionsSofort(TypedDict): class ModifyParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ - The order ID displayed in the Swish app after the payment is authorized. + A reference for this payment to be displayed in the Swish app. """ setup_future_usage: NotRequired[Literal["none"]] """ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index b3d7a76b3..1a832f8bb 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -1391,7 +1391,10 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] @@ -2333,7 +2336,10 @@ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ @@ -2360,7 +2366,7 @@ class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ - The order ID displayed in the Swish app after the payment is authorized. + A reference for this payment to be displayed in the Swish app. """ setup_future_usage: NotRequired[Literal["none"]] """ @@ -3962,7 +3968,10 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] @@ -4904,7 +4913,10 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class CreateParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ @@ -4931,7 +4943,7 @@ class CreateParamsPaymentMethodOptionsSofort(TypedDict): class CreateParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ - The order ID displayed in the Swish app after the payment is authorized. + A reference for this payment to be displayed in the Swish app. """ setup_future_usage: NotRequired[Literal["none"]] """ @@ -6555,7 +6567,10 @@ class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class UpdateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class UpdateParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] @@ -7497,7 +7512,10 @@ class UpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class UpdateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class UpdateParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ @@ -7524,7 +7542,7 @@ class UpdateParamsPaymentMethodOptionsSofort(TypedDict): class UpdateParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ - The order ID displayed in the Swish app after the payment is authorized. + A reference for this payment to be displayed in the Swish app. """ setup_future_usage: NotRequired[Literal["none"]] """ diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 69e806528..3b706d597 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -892,7 +892,9 @@ class CreateParamsAfterCompletionRedirect(TypedDict): class CreateParamsAutomaticTax(TypedDict): enabled: bool """ - If `true`, tax will be calculated automatically using the customer's location. + Set to `true` to [calculate tax automatically](https://docs.stripe.com/tax) using the customer's location. + + Enabling this parameter causes the payment link to collect any billing address information necessary for tax calculation. """ liability: NotRequired["PaymentLink.CreateParamsAutomaticTaxLiability"] """ @@ -1750,7 +1752,9 @@ class ModifyParamsAfterCompletionRedirect(TypedDict): class ModifyParamsAutomaticTax(TypedDict): enabled: bool """ - If `true`, tax will be calculated automatically using the customer's location. + Set to `true` to [calculate tax automatically](https://docs.stripe.com/tax) using the customer's location. + + Enabling this parameter causes the payment link to collect any billing address information necessary for tax calculation. """ liability: NotRequired["PaymentLink.ModifyParamsAutomaticTaxLiability"] """ @@ -2295,6 +2299,10 @@ class ModifyParamsSubscriptionData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ + trial_period_days: NotRequired["Literal['']|int"] + """ + Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. + """ trial_settings: NotRequired[ "Literal['']|PaymentLink.ModifyParamsSubscriptionDataTrialSettings" ] diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index a1d592b29..315c99835 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -237,7 +237,9 @@ class CreateParamsAfterCompletionRedirect(TypedDict): class CreateParamsAutomaticTax(TypedDict): enabled: bool """ - If `true`, tax will be calculated automatically using the customer's location. + Set to `true` to [calculate tax automatically](https://docs.stripe.com/tax) using the customer's location. + + Enabling this parameter causes the payment link to collect any billing address information necessary for tax calculation. """ liability: NotRequired[ "PaymentLinkService.CreateParamsAutomaticTaxLiability" @@ -1093,7 +1095,9 @@ class UpdateParamsAfterCompletionRedirect(TypedDict): class UpdateParamsAutomaticTax(TypedDict): enabled: bool """ - If `true`, tax will be calculated automatically using the customer's location. + Set to `true` to [calculate tax automatically](https://docs.stripe.com/tax) using the customer's location. + + Enabling this parameter causes the payment link to collect any billing address information necessary for tax calculation. """ liability: NotRequired[ "PaymentLinkService.UpdateParamsAutomaticTaxLiability" @@ -1646,6 +1650,10 @@ class UpdateParamsSubscriptionData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ + trial_period_days: NotRequired["Literal['']|int"] + """ + Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. + """ trial_settings: NotRequired[ "Literal['']|PaymentLinkService.UpdateParamsSubscriptionDataTrialSettings" ] diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 17861d3e0..f78c1fae1 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -643,6 +643,10 @@ class ShippingAddress(StripeObject): """ Contains information about card networks that can be used to process the payment. """ + regulated_status: Optional[Literal["regulated", "unregulated"]] + """ + Status of a card based on the card issuer. + """ three_d_secure_usage: Optional[ThreeDSecureUsage] """ Contains details on how this Card may be used for 3D Secure authentication. diff --git a/stripe/_person.py b/stripe/_person.py index 2b9b5d1ac..fc0697735 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -274,7 +274,7 @@ class Error(StripeObject): """ eventually_due: List[str] """ - Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and the account's `future_requirements[current_deadline]` becomes set. + Fields you must collect when all thresholds are reached. As they become required, they appear in `currently_due` as well, and the account's `future_requirements[current_deadline]` becomes set. """ past_due: List[str] """ @@ -476,7 +476,7 @@ class Error(StripeObject): """ eventually_due: List[str] """ - Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and the account's `current_deadline` becomes set. + Fields you must collect when all thresholds are reached. As they become required, they appear in `currently_due` as well, and the account's `current_deadline` becomes set. """ past_due: List[str] """ diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index da290bab4..5f7a6e6d2 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -630,6 +630,14 @@ class SetupError(StripeObject): """ A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. """ + network_advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + """ + network_decline_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + """ param: Optional[str] """ If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 11a77a371..8abbaccd7 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -269,6 +269,14 @@ class LastSetupError(StripeObject): """ A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. """ + network_advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + """ + network_decline_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + """ param: Optional[str] """ If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. @@ -464,7 +472,10 @@ class AmazonPay(StripeObject): class BacsDebit(StripeObject): class MandateOptions(StripeObject): - pass + reference_prefix: Optional[str] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ mandate_options: Optional[MandateOptions] _inner_class_types = {"mandate_options": MandateOptions} @@ -561,7 +572,10 @@ class Paypal(StripeObject): class SepaDebit(StripeObject): class MandateOptions(StripeObject): - pass + reference_prefix: Optional[str] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ mandate_options: Optional[MandateOptions] _inner_class_types = {"mandate_options": MandateOptions} @@ -1508,7 +1522,10 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ @@ -1699,7 +1716,10 @@ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ @@ -2702,7 +2722,10 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class CreateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ @@ -2893,7 +2916,10 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ @@ -3863,7 +3889,10 @@ class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class ModifyParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class ModifyParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ @@ -4054,7 +4083,10 @@ class ModifyParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index cffbc4818..4423e44b1 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -922,7 +922,10 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ @@ -1113,7 +1116,10 @@ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ @@ -2154,7 +2160,10 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class CreateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ @@ -2345,7 +2354,10 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ @@ -3363,7 +3375,10 @@ class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class UpdateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class UpdateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ @@ -3554,7 +3569,10 @@ class UpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class UpdateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ diff --git a/stripe/_source.py b/stripe/_source.py index 3af9dbfbe..7afc95f76 100644 --- a/stripe/_source.py +++ b/stripe/_source.py @@ -1013,6 +1013,10 @@ class VerifyParams(RequestOptions): ach_debit: Optional[AchDebit] acss_debit: Optional[AcssDebit] alipay: Optional[Alipay] + allow_redisplay: Optional[Literal["always", "limited", "unspecified"]] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. + """ amount: Optional[int] """ A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 9cf48a0ee..6d51e76d4 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -74,6 +74,10 @@ class Liability(StripeObject): Type of the account referenced. """ + disabled_reason: Optional[Literal["requires_location_inputs"]] + """ + If Stripe disabled automatic tax, this enum describes why. + """ enabled: bool """ Whether Stripe automatically computes tax on this subscription. @@ -931,7 +935,7 @@ class CreateParamsPaymentSettings(TypedDict): "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ - The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration """ save_default_payment_method: NotRequired[ Literal["off", "on_subscription"] @@ -1648,7 +1652,7 @@ class ModifyParamsItem(TypedDict): """ clear_usage: NotRequired[bool] """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + 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. """ deleted: NotRequired[bool] """ @@ -1768,7 +1772,7 @@ class ModifyParamsPaymentSettings(TypedDict): "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ - The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration """ save_default_payment_method: NotRequired[ Literal["off", "on_subscription"] diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index f241ad1b5..295fa204e 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -70,6 +70,10 @@ class Liability(StripeObject): Type of the account referenced. """ + disabled_reason: Optional[Literal["requires_location_inputs"]] + """ + If Stripe disabled automatic tax, this enum describes why. + """ enabled: bool """ Whether Stripe automatically computes tax on invoices created during this phase. @@ -210,6 +214,10 @@ class Liability(StripeObject): Type of the account referenced. """ + disabled_reason: Optional[Literal["requires_location_inputs"]] + """ + If Stripe disabled automatic tax, this enum describes why. + """ enabled: bool """ Whether Stripe automatically computes tax on invoices created during this phase. diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 9c966572a..8cf6732ce 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -490,7 +490,7 @@ class CreateParamsPaymentSettings(TypedDict): "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ - The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration """ save_default_payment_method: NotRequired[ Literal["off", "on_subscription"] @@ -1261,7 +1261,7 @@ class UpdateParamsItem(TypedDict): """ clear_usage: NotRequired[bool] """ - Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + 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. """ deleted: NotRequired[bool] """ @@ -1383,7 +1383,7 @@ class UpdateParamsPaymentSettings(TypedDict): "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ - The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration """ save_default_payment_method: NotRequired[ Literal["off", "on_subscription"] diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index be1de50d7..377f48866 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -81,14 +81,20 @@ class CreateParams(RequestOptions): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -96,6 +102,7 @@ class CreateParams(RequestOptions): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -111,6 +118,7 @@ class CreateParams(RequestOptions): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -122,12 +130,16 @@ class CreateParams(RequestOptions): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -135,6 +147,7 @@ class CreateParams(RequestOptions): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -147,12 +160,16 @@ class CreateParams(RequestOptions): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -160,9 +177,11 @@ class CreateParams(RequestOptions): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -259,14 +278,20 @@ class RetrieveParams(RequestOptions): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -274,6 +299,7 @@ class RetrieveParams(RequestOptions): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -289,6 +315,7 @@ class RetrieveParams(RequestOptions): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -300,12 +327,16 @@ class RetrieveParams(RequestOptions): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -313,6 +344,7 @@ class RetrieveParams(RequestOptions): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -325,12 +357,16 @@ class RetrieveParams(RequestOptions): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "unknown", "us_ein", "uy_ruc", @@ -339,9 +375,11 @@ class RetrieveParams(RequestOptions): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`. Note that some legacy tax IDs have type `unknown` """ value: str """ diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py index 43e88187f..79e120538 100644 --- a/stripe/_tax_id_service.py +++ b/stripe/_tax_id_service.py @@ -22,14 +22,20 @@ class CreateParams(TypedDict): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -37,6 +43,7 @@ class CreateParams(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -52,6 +59,7 @@ class CreateParams(TypedDict): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -63,12 +71,16 @@ class CreateParams(TypedDict): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -76,6 +88,7 @@ class CreateParams(TypedDict): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -88,12 +101,16 @@ class CreateParams(TypedDict): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -101,9 +118,11 @@ class CreateParams(TypedDict): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 614ee7c0f..91da9ae10 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -137,6 +137,7 @@ class CreateParams(RequestOptions): "2024-09-30.acacia", "2024-10-28.acacia", "2024-11-20.acacia", + "2024-12-18.acacia", ] ] """ diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 597e5a698..5df1e51fe 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -118,6 +118,7 @@ class CreateParams(TypedDict): "2024-09-30.acacia", "2024-10-28.acacia", "2024-11-20.acacia", + "2024-12-18.acacia", ] ] """ diff --git a/stripe/billing/_credit_balance_summary.py b/stripe/billing/_credit_balance_summary.py index ade19dcef..fe701a30b 100644 --- a/stripe/billing/_credit_balance_summary.py +++ b/stripe/billing/_credit_balance_summary.py @@ -109,7 +109,7 @@ class RetrieveParamsFilter(TypedDict): class RetrieveParamsFilterApplicabilityScope(TypedDict): price_type: Literal["metered"] """ - The price type for which credit grants can apply. We currently only support the `metered` price type. + The price type that credit grants can apply to. We currently only support the `metered` price type. """ balances: List[Balance] @@ -134,7 +134,7 @@ def retrieve( cls, **params: Unpack["CreditBalanceSummary.RetrieveParams"] ) -> "CreditBalanceSummary": """ - Retrieves the credit balance summary for a customer + Retrieves the credit balance summary for a customer. """ instance = cls(None, **params) instance.refresh() @@ -145,7 +145,7 @@ async def retrieve_async( cls, **params: Unpack["CreditBalanceSummary.RetrieveParams"] ) -> "CreditBalanceSummary": """ - Retrieves the credit balance summary for a customer + Retrieves the credit balance summary for a customer. """ instance = cls(None, **params) await instance.refresh_async() diff --git a/stripe/billing/_credit_balance_summary_service.py b/stripe/billing/_credit_balance_summary_service.py index b31f13e46..68d6a09b5 100644 --- a/stripe/billing/_credit_balance_summary_service.py +++ b/stripe/billing/_credit_balance_summary_service.py @@ -41,7 +41,7 @@ class RetrieveParamsFilter(TypedDict): class RetrieveParamsFilterApplicabilityScope(TypedDict): price_type: Literal["metered"] """ - The price type for which credit grants can apply. We currently only support the `metered` price type. + The price type that credit grants can apply to. We currently only support the `metered` price type. """ def retrieve( @@ -50,7 +50,7 @@ def retrieve( options: RequestOptions = {}, ) -> CreditBalanceSummary: """ - Retrieves the credit balance summary for a customer + Retrieves the credit balance summary for a customer. """ return cast( CreditBalanceSummary, @@ -69,7 +69,7 @@ async def retrieve_async( options: RequestOptions = {}, ) -> CreditBalanceSummary: """ - Retrieves the credit balance summary for a customer + Retrieves the credit balance summary for a customer. """ return cast( CreditBalanceSummary, diff --git a/stripe/billing/_credit_balance_transaction.py b/stripe/billing/_credit_balance_transaction.py index 712bd7f14..630cb3693 100644 --- a/stripe/billing/_credit_balance_transaction.py +++ b/stripe/billing/_credit_balance_transaction.py @@ -47,12 +47,31 @@ class Monetary(StripeObject): """ _inner_class_types = {"monetary": Monetary} + class CreditsApplicationInvoiceVoided(StripeObject): + invoice: ExpandableField["Invoice"] + """ + The invoice to which the reinstated billing credits were originally applied. + """ + invoice_line_item: str + """ + The invoice line item to which the reinstated billing credits were originally applied. + """ + amount: Amount - type: Literal["credits_granted"] + credits_application_invoice_voided: Optional[ + CreditsApplicationInvoiceVoided + ] + """ + Details of the invoice to which the reinstated credits were originally applied. Only present if `type` is `credits_application_invoice_voided`. + """ + type: Literal["credits_application_invoice_voided", "credits_granted"] """ The type of credit transaction. """ - _inner_class_types = {"amount": Amount} + _inner_class_types = { + "amount": Amount, + "credits_application_invoice_voided": CreditsApplicationInvoiceVoided, + } class Debit(StripeObject): class Amount(StripeObject): @@ -178,7 +197,7 @@ def list( cls, **params: Unpack["CreditBalanceTransaction.ListParams"] ) -> ListObject["CreditBalanceTransaction"]: """ - Retrieve a list of credit balance transactions + Retrieve a list of credit balance transactions. """ result = cls._static_request( "get", @@ -198,7 +217,7 @@ async def list_async( cls, **params: Unpack["CreditBalanceTransaction.ListParams"] ) -> ListObject["CreditBalanceTransaction"]: """ - Retrieve a list of credit balance transactions + Retrieve a list of credit balance transactions. """ result = await cls._static_request_async( "get", @@ -220,7 +239,7 @@ def retrieve( **params: Unpack["CreditBalanceTransaction.RetrieveParams"], ) -> "CreditBalanceTransaction": """ - Retrieves a credit balance transaction + Retrieves a credit balance transaction. """ instance = cls(id, **params) instance.refresh() @@ -233,7 +252,7 @@ async def retrieve_async( **params: Unpack["CreditBalanceTransaction.RetrieveParams"], ) -> "CreditBalanceTransaction": """ - Retrieves a credit balance transaction + Retrieves a credit balance transaction. """ instance = cls(id, **params) await instance.refresh_async() diff --git a/stripe/billing/_credit_balance_transaction_service.py b/stripe/billing/_credit_balance_transaction_service.py index 102258473..4aa061ffb 100644 --- a/stripe/billing/_credit_balance_transaction_service.py +++ b/stripe/billing/_credit_balance_transaction_service.py @@ -48,7 +48,7 @@ def list( options: RequestOptions = {}, ) -> ListObject[CreditBalanceTransaction]: """ - Retrieve a list of credit balance transactions + Retrieve a list of credit balance transactions. """ return cast( ListObject[CreditBalanceTransaction], @@ -67,7 +67,7 @@ async def list_async( options: RequestOptions = {}, ) -> ListObject[CreditBalanceTransaction]: """ - Retrieve a list of credit balance transactions + Retrieve a list of credit balance transactions. """ return cast( ListObject[CreditBalanceTransaction], @@ -87,7 +87,7 @@ def retrieve( options: RequestOptions = {}, ) -> CreditBalanceTransaction: """ - Retrieves a credit balance transaction + Retrieves a credit balance transaction. """ return cast( CreditBalanceTransaction, @@ -109,7 +109,7 @@ async def retrieve_async( options: RequestOptions = {}, ) -> CreditBalanceTransaction: """ - Retrieves a credit balance transaction + Retrieves a credit balance transaction. """ return cast( CreditBalanceTransaction, diff --git a/stripe/billing/_credit_grant.py b/stripe/billing/_credit_grant.py index 090a172f4..577982f79 100644 --- a/stripe/billing/_credit_grant.py +++ b/stripe/billing/_credit_grant.py @@ -62,7 +62,7 @@ class ApplicabilityConfig(StripeObject): class Scope(StripeObject): price_type: Literal["metered"] """ - The price type for which credit grants can apply. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. + The price type that credit grants can apply to. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. """ scope: Scope @@ -87,7 +87,7 @@ class CreateParams(RequestOptions): """ effective_at: NotRequired[int] """ - The time when the billing credits become effective—when they're eligible for use. Defaults to the current timestamp if not specified. + The time when the billing credits become effective-when they're eligible for use. It defaults to the current timestamp if not specified. """ expand: NotRequired[List[str]] """ @@ -95,11 +95,11 @@ class CreateParams(RequestOptions): """ expires_at: NotRequired[int] """ - The time when the billing credits will expire. If not specified, the billing credits don't expire. + The time when the billing credits expire. If not specified, the billing credits don't expire. """ metadata: NotRequired[Dict[str, str]] """ - Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (for example, cost basis) in a structured format. + Set of key-value pairs that you can attach to an object. You can use this to store additional information about the object (for example, cost basis) in a structured format. """ name: NotRequired[str] """ @@ -135,7 +135,7 @@ class CreateParamsApplicabilityConfig(TypedDict): class CreateParamsApplicabilityConfigScope(TypedDict): price_type: Literal["metered"] """ - The price type for which credit grants can apply. We currently only support the `metered` price type. + The price type that credit grants can apply to. We currently only support the `metered` price type. """ class ExpireParams(RequestOptions): @@ -177,7 +177,7 @@ class ModifyParams(RequestOptions): """ metadata: NotRequired[Dict[str, str]] """ - Set of key-value pairs you can attach to an object. This can be useful for storing additional information about the object (for example, cost basis) in a structured format. + Set of key-value pairs you can attach to an object. You can use this to store additional information about the object (for example, cost basis) in a structured format. """ class RetrieveParams(RequestOptions): @@ -208,7 +208,7 @@ class VoidGrantParams(RequestOptions): """ effective_at: Optional[int] """ - The time when the billing credits become effective—when they're eligible for use. + The time when the billing credits become effective-when they're eligible for use. """ expires_at: Optional[int] """ @@ -252,7 +252,7 @@ def create( cls, **params: Unpack["CreditGrant.CreateParams"] ) -> "CreditGrant": """ - Creates a credit grant + Creates a credit grant. """ return cast( "CreditGrant", @@ -268,7 +268,7 @@ async def create_async( cls, **params: Unpack["CreditGrant.CreateParams"] ) -> "CreditGrant": """ - Creates a credit grant + Creates a credit grant. """ return cast( "CreditGrant", @@ -434,7 +434,7 @@ def modify( cls, id: str, **params: Unpack["CreditGrant.ModifyParams"] ) -> "CreditGrant": """ - Updates a credit grant + Updates a credit grant. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( @@ -451,7 +451,7 @@ async def modify_async( cls, id: str, **params: Unpack["CreditGrant.ModifyParams"] ) -> "CreditGrant": """ - Updates a credit grant + Updates a credit grant. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( @@ -468,7 +468,7 @@ def retrieve( cls, id: str, **params: Unpack["CreditGrant.RetrieveParams"] ) -> "CreditGrant": """ - Retrieves a credit grant + Retrieves a credit grant. """ instance = cls(id, **params) instance.refresh() @@ -479,7 +479,7 @@ async def retrieve_async( cls, id: str, **params: Unpack["CreditGrant.RetrieveParams"] ) -> "CreditGrant": """ - Retrieves a credit grant + Retrieves a credit grant. """ instance = cls(id, **params) await instance.refresh_async() diff --git a/stripe/billing/_credit_grant_service.py b/stripe/billing/_credit_grant_service.py index 54e6f8f3f..f1a1ced5a 100644 --- a/stripe/billing/_credit_grant_service.py +++ b/stripe/billing/_credit_grant_service.py @@ -31,7 +31,7 @@ class CreateParams(TypedDict): """ effective_at: NotRequired[int] """ - The time when the billing credits become effective—when they're eligible for use. Defaults to the current timestamp if not specified. + The time when the billing credits become effective-when they're eligible for use. It defaults to the current timestamp if not specified. """ expand: NotRequired[List[str]] """ @@ -39,11 +39,11 @@ class CreateParams(TypedDict): """ expires_at: NotRequired[int] """ - The time when the billing credits will expire. If not specified, the billing credits don't expire. + The time when the billing credits expire. If not specified, the billing credits don't expire. """ metadata: NotRequired[Dict[str, str]] """ - Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (for example, cost basis) in a structured format. + Set of key-value pairs that you can attach to an object. You can use this to store additional information about the object (for example, cost basis) in a structured format. """ name: NotRequired[str] """ @@ -79,7 +79,7 @@ class CreateParamsApplicabilityConfig(TypedDict): class CreateParamsApplicabilityConfigScope(TypedDict): price_type: Literal["metered"] """ - The price type for which credit grants can apply. We currently only support the `metered` price type. + The price type that credit grants can apply to. We currently only support the `metered` price type. """ class ExpireParams(TypedDict): @@ -127,7 +127,7 @@ class UpdateParams(TypedDict): """ metadata: NotRequired[Dict[str, str]] """ - Set of key-value pairs you can attach to an object. This can be useful for storing additional information about the object (for example, cost basis) in a structured format. + Set of key-value pairs you can attach to an object. You can use this to store additional information about the object (for example, cost basis) in a structured format. """ class VoidGrantParams(TypedDict): @@ -180,7 +180,7 @@ def create( options: RequestOptions = {}, ) -> CreditGrant: """ - Creates a credit grant + Creates a credit grant. """ return cast( CreditGrant, @@ -199,7 +199,7 @@ async def create_async( options: RequestOptions = {}, ) -> CreditGrant: """ - Creates a credit grant + Creates a credit grant. """ return cast( CreditGrant, @@ -219,7 +219,7 @@ def retrieve( options: RequestOptions = {}, ) -> CreditGrant: """ - Retrieves a credit grant + Retrieves a credit grant. """ return cast( CreditGrant, @@ -239,7 +239,7 @@ async def retrieve_async( options: RequestOptions = {}, ) -> CreditGrant: """ - Retrieves a credit grant + Retrieves a credit grant. """ return cast( CreditGrant, @@ -259,7 +259,7 @@ def update( options: RequestOptions = {}, ) -> CreditGrant: """ - Updates a credit grant + Updates a credit grant. """ return cast( CreditGrant, @@ -279,7 +279,7 @@ async def update_async( options: RequestOptions = {}, ) -> CreditGrant: """ - Updates a credit grant + Updates a credit grant. """ return cast( CreditGrant, diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index bf7e3ec16..813325857 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -28,7 +28,7 @@ class Meter( UpdateableAPIResource["Meter"], ): """ - A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then attach the billing meter to a price and attach the price to a subscription to charge the user for the number of API calls they make. + Meters specify how to aggregate meter events over a billing period. Meter events represent the actions that customers take in your system. Meters attach to prices and form the basis of the bill. Related guide: [Usage based billing](https://docs.stripe.com/billing/subscriptions/usage-based) """ @@ -74,7 +74,7 @@ class CreateParams(RequestOptions): """ display_name: str """ - The meter's name. + The meter's name. Not visible to the customer. """ event_name: str """ @@ -96,7 +96,7 @@ class CreateParams(RequestOptions): class CreateParamsCustomerMapping(TypedDict): event_payload_key: str """ - The key in the usage event payload to use for mapping the event to a customer. + The key in the meter event payload to use for mapping the event to a customer. """ type: Literal["by_id"] """ @@ -180,7 +180,7 @@ class ListParams(RequestOptions): class ModifyParams(RequestOptions): display_name: NotRequired[str] """ - The meter's name. + The meter's name. Not visible to the customer. """ expand: NotRequired[List[str]] """ @@ -243,7 +243,7 @@ class RetrieveParams(RequestOptions): @classmethod def create(cls, **params: Unpack["Meter.CreateParams"]) -> "Meter": """ - Creates a billing meter + Creates a billing meter. """ return cast( "Meter", @@ -259,7 +259,7 @@ async def create_async( cls, **params: Unpack["Meter.CreateParams"] ) -> "Meter": """ - Creates a billing meter + Creates a billing meter. """ return cast( "Meter", @@ -275,7 +275,7 @@ def _cls_deactivate( cls, id: str, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ - Deactivates a billing meter + When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. """ return cast( "Meter", @@ -294,7 +294,7 @@ def deactivate( id: str, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ - Deactivates a billing meter + When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. """ ... @@ -303,7 +303,7 @@ def deactivate( self, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ - Deactivates a billing meter + When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. """ ... @@ -312,7 +312,7 @@ def deactivate( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ - Deactivates a billing meter + When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. """ return cast( "Meter", @@ -330,7 +330,7 @@ async def _cls_deactivate_async( cls, id: str, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ - Deactivates a billing meter + When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. """ return cast( "Meter", @@ -349,7 +349,7 @@ async def deactivate_async( id: str, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ - Deactivates a billing meter + When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. """ ... @@ -358,7 +358,7 @@ async def deactivate_async( self, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ - Deactivates a billing meter + When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. """ ... @@ -367,7 +367,7 @@ async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ - Deactivates a billing meter + When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. """ return cast( "Meter", @@ -423,7 +423,7 @@ def modify( cls, id: str, **params: Unpack["Meter.ModifyParams"] ) -> "Meter": """ - Updates a billing meter + Updates a billing meter. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( @@ -440,7 +440,7 @@ async def modify_async( cls, id: str, **params: Unpack["Meter.ModifyParams"] ) -> "Meter": """ - Updates a billing meter + Updates a billing meter. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( @@ -457,7 +457,7 @@ def _cls_reactivate( cls, id: str, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ - Reactivates a billing meter + When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. """ return cast( "Meter", @@ -476,7 +476,7 @@ def reactivate( id: str, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ - Reactivates a billing meter + When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. """ ... @@ -485,7 +485,7 @@ def reactivate( self, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ - Reactivates a billing meter + When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. """ ... @@ -494,7 +494,7 @@ def reactivate( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ - Reactivates a billing meter + When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. """ return cast( "Meter", @@ -512,7 +512,7 @@ async def _cls_reactivate_async( cls, id: str, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ - Reactivates a billing meter + When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. """ return cast( "Meter", @@ -531,7 +531,7 @@ async def reactivate_async( id: str, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ - Reactivates a billing meter + When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. """ ... @@ -540,7 +540,7 @@ async def reactivate_async( self, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ - Reactivates a billing meter + When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. """ ... @@ -549,7 +549,7 @@ async def reactivate_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ - Reactivates a billing meter + When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. """ return cast( "Meter", @@ -567,7 +567,7 @@ def retrieve( cls, id: str, **params: Unpack["Meter.RetrieveParams"] ) -> "Meter": """ - Retrieves a billing meter given an ID + Retrieves a billing meter given an ID. """ instance = cls(id, **params) instance.refresh() @@ -578,7 +578,7 @@ async def retrieve_async( cls, id: str, **params: Unpack["Meter.RetrieveParams"] ) -> "Meter": """ - Retrieves a billing meter given an ID + Retrieves a billing meter given an ID. """ instance = cls(id, **params) await instance.refresh_async() diff --git a/stripe/billing/_meter_event.py b/stripe/billing/_meter_event.py index 88731e50e..428d66604 100644 --- a/stripe/billing/_meter_event.py +++ b/stripe/billing/_meter_event.py @@ -8,8 +8,7 @@ class MeterEvent(CreateableAPIResource["MeterEvent"]): """ - A billing meter event represents a customer's usage of a product. Meter events are used to bill a customer based on their usage. - Meter events are associated with billing meters, which define the shape of the event's payload and how those events are aggregated for billing. + Meter events represent actions that customers take in your system. You can use meter events to bill a customer based on their usage. Meter events are associated with billing meters, which define both the contents of the event's payload and how to aggregate those events. """ OBJECT_NAME: ClassVar[Literal["billing.meter_event"]] = ( @@ -27,7 +26,7 @@ class CreateParams(RequestOptions): """ identifier: NotRequired[str] """ - A unique identifier for the event. If not provided, one will be generated. We strongly advise using UUID-like identifiers. We will enforce uniqueness within a rolling period of at least 24 hours. The enforcement of uniqueness primarily addresses issues arising from accidental retries or other problems occurring within extremely brief time intervals. This approach helps prevent duplicate entries and ensures data integrity in high-frequency operations. + A unique identifier for the event. If not provided, one is generated. We recommend using UUID-like identifiers. We will enforce uniqueness within a rolling period of at least 24 hours. The enforcement of uniqueness primarily addresses issues arising from accidental retries or other problems occurring within extremely brief time intervals. This approach helps prevent duplicate entries and ensures data integrity in high-frequency operations. """ payload: Dict[str, str] """ @@ -72,7 +71,7 @@ def create( cls, **params: Unpack["MeterEvent.CreateParams"] ) -> "MeterEvent": """ - Creates a billing meter event + Creates a billing meter event. """ return cast( "MeterEvent", @@ -88,7 +87,7 @@ async def create_async( cls, **params: Unpack["MeterEvent.CreateParams"] ) -> "MeterEvent": """ - Creates a billing meter event + Creates a billing meter event. """ return cast( "MeterEvent", diff --git a/stripe/billing/_meter_event_adjustment.py b/stripe/billing/_meter_event_adjustment.py index 23f7ab0ac..0304e7c7f 100644 --- a/stripe/billing/_meter_event_adjustment.py +++ b/stripe/billing/_meter_event_adjustment.py @@ -76,7 +76,7 @@ def create( cls, **params: Unpack["MeterEventAdjustment.CreateParams"] ) -> "MeterEventAdjustment": """ - Creates a billing meter event adjustment + Creates a billing meter event adjustment. """ return cast( "MeterEventAdjustment", @@ -92,7 +92,7 @@ async def create_async( cls, **params: Unpack["MeterEventAdjustment.CreateParams"] ) -> "MeterEventAdjustment": """ - Creates a billing meter event adjustment + Creates a billing meter event adjustment. """ return cast( "MeterEventAdjustment", diff --git a/stripe/billing/_meter_event_adjustment_service.py b/stripe/billing/_meter_event_adjustment_service.py index 383b4a764..ea84b93f4 100644 --- a/stripe/billing/_meter_event_adjustment_service.py +++ b/stripe/billing/_meter_event_adjustment_service.py @@ -38,7 +38,7 @@ def create( options: RequestOptions = {}, ) -> MeterEventAdjustment: """ - Creates a billing meter event adjustment + Creates a billing meter event adjustment. """ return cast( MeterEventAdjustment, @@ -57,7 +57,7 @@ async def create_async( options: RequestOptions = {}, ) -> MeterEventAdjustment: """ - Creates a billing meter event adjustment + Creates a billing meter event adjustment. """ return cast( MeterEventAdjustment, diff --git a/stripe/billing/_meter_event_service.py b/stripe/billing/_meter_event_service.py index ce29abd3b..7970e0190 100644 --- a/stripe/billing/_meter_event_service.py +++ b/stripe/billing/_meter_event_service.py @@ -19,7 +19,7 @@ class CreateParams(TypedDict): """ identifier: NotRequired[str] """ - A unique identifier for the event. If not provided, one will be generated. We strongly advise using UUID-like identifiers. We will enforce uniqueness within a rolling period of at least 24 hours. The enforcement of uniqueness primarily addresses issues arising from accidental retries or other problems occurring within extremely brief time intervals. This approach helps prevent duplicate entries and ensures data integrity in high-frequency operations. + A unique identifier for the event. If not provided, one is generated. We recommend using UUID-like identifiers. We will enforce uniqueness within a rolling period of at least 24 hours. The enforcement of uniqueness primarily addresses issues arising from accidental retries or other problems occurring within extremely brief time intervals. This approach helps prevent duplicate entries and ensures data integrity in high-frequency operations. """ payload: Dict[str, str] """ @@ -36,7 +36,7 @@ def create( options: RequestOptions = {}, ) -> MeterEvent: """ - Creates a billing meter event + Creates a billing meter event. """ return cast( MeterEvent, @@ -55,7 +55,7 @@ async def create_async( options: RequestOptions = {}, ) -> MeterEvent: """ - Creates a billing meter event + Creates a billing meter event. """ return cast( MeterEvent, diff --git a/stripe/billing/_meter_service.py b/stripe/billing/_meter_service.py index aed7176e0..da236bebe 100644 --- a/stripe/billing/_meter_service.py +++ b/stripe/billing/_meter_service.py @@ -30,7 +30,7 @@ class CreateParams(TypedDict): """ display_name: str """ - The meter's name. + The meter's name. Not visible to the customer. """ event_name: str """ @@ -52,7 +52,7 @@ class CreateParams(TypedDict): class CreateParamsCustomerMapping(TypedDict): event_payload_key: str """ - The key in the usage event payload to use for mapping the event to a customer. + The key in the meter event payload to use for mapping the event to a customer. """ type: Literal["by_id"] """ @@ -114,7 +114,7 @@ class RetrieveParams(TypedDict): class UpdateParams(TypedDict): display_name: NotRequired[str] """ - The meter's name. + The meter's name. Not visible to the customer. """ expand: NotRequired[List[str]] """ @@ -163,7 +163,7 @@ def create( self, params: "MeterService.CreateParams", options: RequestOptions = {} ) -> Meter: """ - Creates a billing meter + Creates a billing meter. """ return cast( Meter, @@ -180,7 +180,7 @@ async def create_async( self, params: "MeterService.CreateParams", options: RequestOptions = {} ) -> Meter: """ - Creates a billing meter + Creates a billing meter. """ return cast( Meter, @@ -200,7 +200,7 @@ def retrieve( options: RequestOptions = {}, ) -> Meter: """ - Retrieves a billing meter given an ID + Retrieves a billing meter given an ID. """ return cast( Meter, @@ -220,7 +220,7 @@ async def retrieve_async( options: RequestOptions = {}, ) -> Meter: """ - Retrieves a billing meter given an ID + Retrieves a billing meter given an ID. """ return cast( Meter, @@ -240,7 +240,7 @@ def update( options: RequestOptions = {}, ) -> Meter: """ - Updates a billing meter + Updates a billing meter. """ return cast( Meter, @@ -260,7 +260,7 @@ async def update_async( options: RequestOptions = {}, ) -> Meter: """ - Updates a billing meter + Updates a billing meter. """ return cast( Meter, @@ -280,7 +280,7 @@ def deactivate( options: RequestOptions = {}, ) -> Meter: """ - Deactivates a billing meter + When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. """ return cast( Meter, @@ -302,7 +302,7 @@ async def deactivate_async( options: RequestOptions = {}, ) -> Meter: """ - Deactivates a billing meter + When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. """ return cast( Meter, @@ -324,7 +324,7 @@ def reactivate( options: RequestOptions = {}, ) -> Meter: """ - Reactivates a billing meter + When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. """ return cast( Meter, @@ -346,7 +346,7 @@ async def reactivate_async( options: RequestOptions = {}, ) -> Meter: """ - Reactivates a billing meter + When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. """ return cast( Meter, diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index f42349e68..d5470243c 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -160,7 +160,7 @@ class Condition(StripeObject): """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. Defaults to a value of `none` if you don't set it during creation. """ - schedule_at_period_end: Optional[ScheduleAtPeriodEnd] + schedule_at_period_end: ScheduleAtPeriodEnd _inner_class_types = { "products": Product, "schedule_at_period_end": ScheduleAtPeriodEnd, diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 60de97cca..fe9bb5917 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -346,14 +346,20 @@ class TaxId(StripeObject): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -361,6 +367,7 @@ class TaxId(StripeObject): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -376,6 +383,7 @@ class TaxId(StripeObject): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -387,12 +395,16 @@ class TaxId(StripeObject): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -400,6 +412,7 @@ class TaxId(StripeObject): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -412,12 +425,16 @@ class TaxId(StripeObject): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "unknown", "us_ein", "uy_ruc", @@ -426,9 +443,11 @@ class TaxId(StripeObject): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, or `unknown` """ value: Optional[str] """ @@ -654,7 +673,10 @@ class AuBecsDebit(StripeObject): class BacsDebit(StripeObject): class MandateOptions(StripeObject): - pass + reference_prefix: Optional[str] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ @@ -1085,7 +1107,10 @@ class SamsungPay(StripeObject): class SepaDebit(StripeObject): class MandateOptions(StripeObject): - pass + reference_prefix: Optional[str] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ @@ -2089,7 +2114,9 @@ class CreateParamsAfterExpirationRecovery(TypedDict): class CreateParamsAutomaticTax(TypedDict): enabled: bool """ - Set to true to enable automatic taxes. + Set to `true` to [calculate tax automatically](https://docs.stripe.com/tax) using the customer's location. + + Enabling this parameter causes Checkout to collect any billing address information necessary for tax calculation. """ liability: NotRequired["Session.CreateParamsAutomaticTaxLiability"] """ @@ -2950,7 +2977,10 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): setup_future_usage: NotRequired[Literal["none"]] @@ -3446,7 +3476,10 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class CreateParamsPaymentMethodOptionsSofort(TypedDict): setup_future_usage: NotRequired[Literal["none"]] diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 1d9abf9f3..754d44fd7 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -394,7 +394,9 @@ class CreateParamsAfterExpirationRecovery(TypedDict): class CreateParamsAutomaticTax(TypedDict): enabled: bool """ - Set to true to enable automatic taxes. + Set to `true` to [calculate tax automatically](https://docs.stripe.com/tax) using the customer's location. + + Enabling this parameter causes Checkout to collect any billing address information necessary for tax calculation. """ liability: NotRequired[ "SessionService.CreateParamsAutomaticTaxLiability" @@ -1297,7 +1299,10 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): setup_future_usage: NotRequired[Literal["none"]] @@ -1793,7 +1798,10 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - pass + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ class CreateParamsPaymentMethodOptionsSofort(TypedDict): setup_future_usage: NotRequired[Literal["none"]] diff --git a/stripe/forwarding/_request.py b/stripe/forwarding/_request.py index 4fa54e14f..787704049 100644 --- a/stripe/forwarding/_request.py +++ b/stripe/forwarding/_request.py @@ -108,7 +108,11 @@ class CreateParams(RequestOptions): """ replacements: List[ Literal[ - "card_cvc", "card_expiry", "card_number", "cardholder_name" + "card_cvc", + "card_expiry", + "card_number", + "cardholder_name", + "request_signature", ] ] """ @@ -214,7 +218,13 @@ class RetrieveParams(RequestOptions): The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. """ replacements: List[ - Literal["card_cvc", "card_expiry", "card_number", "cardholder_name"] + Literal[ + "card_cvc", + "card_expiry", + "card_number", + "cardholder_name", + "request_signature", + ] ] """ The field kinds to be replaced in the forwarded request. diff --git a/stripe/forwarding/_request_service.py b/stripe/forwarding/_request_service.py index 7b95f680d..5460fcfc6 100644 --- a/stripe/forwarding/_request_service.py +++ b/stripe/forwarding/_request_service.py @@ -25,7 +25,11 @@ class CreateParams(TypedDict): """ replacements: List[ Literal[ - "card_cvc", "card_expiry", "card_number", "cardholder_name" + "card_cvc", + "card_expiry", + "card_number", + "cardholder_name", + "request_signature", ] ] """ diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index 20f1cf604..cc326c614 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -241,6 +241,10 @@ class MerchantData(StripeObject): """ State where the seller is located """ + tax_id: Optional[str] + """ + The seller's tax identification number. Currently populated for French merchants only. + """ terminal_id: Optional[str] """ An ID assigned by the seller to the location of the sale. diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index dbfde9e50..f8baaa07e 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -86,6 +86,10 @@ class MerchantData(StripeObject): """ State where the seller is located """ + tax_id: Optional[str] + """ + The seller's tax identification number. Currently populated for French merchants only. + """ terminal_id: Optional[str] """ An ID assigned by the seller to the location of the sale. diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 5e2759ff7..1d7247850 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -58,14 +58,20 @@ class TaxId(StripeObject): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -73,6 +79,7 @@ class TaxId(StripeObject): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -88,6 +95,7 @@ class TaxId(StripeObject): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -99,12 +107,16 @@ class TaxId(StripeObject): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -112,6 +124,7 @@ class TaxId(StripeObject): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -124,12 +137,16 @@ class TaxId(StripeObject): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "unknown", "us_ein", "uy_ruc", @@ -138,9 +155,11 @@ class TaxId(StripeObject): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, or `unknown` """ value: str """ @@ -504,14 +523,20 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -519,6 +544,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -534,6 +560,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -545,12 +572,16 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -558,6 +589,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -570,12 +602,16 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -583,9 +619,11 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index 3c26c11c5..d1b80a968 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -114,14 +114,20 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -129,6 +135,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -144,6 +151,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -155,12 +163,16 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -168,6 +180,7 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -180,12 +193,16 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "us_ein", "uy_ruc", "uz_tin", @@ -193,9 +210,11 @@ class CreateParamsCustomerDetailsTaxId(TypedDict): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index f779ceb69..fbcf45b8c 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -33,6 +33,24 @@ class Ae(StripeObject): Type of registration in `country`. """ + class Al(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + + class Am(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + + class Ao(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + class At(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -53,6 +71,18 @@ class Au(StripeObject): Type of registration in `country`. """ + class Ba(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + + class Bb(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + class Be(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -87,6 +117,12 @@ class Bh(StripeObject): Type of registration in `country`. """ + class Bs(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + class By(StripeObject): type: Literal["simplified"] """ @@ -107,6 +143,12 @@ class ProvinceStandard(StripeObject): """ _inner_class_types = {"province_standard": ProvinceStandard} + class Cd(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + class Ch(StripeObject): type: Literal["standard"] """ @@ -267,6 +309,12 @@ class Ge(StripeObject): Type of registration in `country`. """ + class Gn(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + class Gr(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -361,6 +409,12 @@ class Ke(StripeObject): Type of registration in `country`. """ + class Kh(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Kr(StripeObject): type: Literal["simplified"] """ @@ -427,6 +481,24 @@ class Md(StripeObject): Type of registration in `country`. """ + class Me(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + + class Mk(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + + class Mr(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + class Mt(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -479,6 +551,12 @@ class No(StripeObject): Type of registration in `country`. """ + class Np(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Nz(StripeObject): type: Literal["standard"] """ @@ -491,6 +569,12 @@ class Om(StripeObject): Type of registration in `country`. """ + class Pe(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Pl(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] @@ -599,12 +683,30 @@ class Standard(StripeObject): """ _inner_class_types = {"standard": Standard} + class Sn(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + + class Sr(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + class Th(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ + class Tj(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Tr(StripeObject): type: Literal["simplified"] """ @@ -617,6 +719,12 @@ class Tz(StripeObject): Type of registration in `country`. """ + class Ug(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Us(StripeObject): class LocalAmusementTax(StripeObject): jurisdiction: str @@ -674,6 +782,12 @@ class Election(StripeObject): "state_sales_tax": StateSalesTax, } + class Uy(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + class Uz(StripeObject): type: Literal["simplified"] """ @@ -692,14 +806,33 @@ class Za(StripeObject): Type of registration in `country`. """ + class Zm(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + + class Zw(StripeObject): + type: Literal["standard"] + """ + Type of registration in `country`. + """ + ae: Optional[Ae] + al: Optional[Al] + am: Optional[Am] + ao: Optional[Ao] at: Optional[At] au: Optional[Au] + ba: Optional[Ba] + bb: Optional[Bb] be: Optional[Be] bg: Optional[Bg] bh: Optional[Bh] + bs: Optional[Bs] by: Optional[By] ca: Optional[Ca] + cd: Optional[Cd] ch: Optional[Ch] cl: Optional[Cl] co: Optional[Co] @@ -716,6 +849,7 @@ class Za(StripeObject): fr: Optional[Fr] gb: Optional[Gb] ge: Optional[Ge] + gn: Optional[Gn] gr: Optional[Gr] hr: Optional[Hr] hu: Optional[Hu] @@ -725,6 +859,7 @@ class Za(StripeObject): it: Optional[It] jp: Optional[Jp] ke: Optional[Ke] + kh: Optional[Kh] kr: Optional[Kr] kz: Optional[Kz] lt: Optional[Lt] @@ -732,14 +867,19 @@ class Za(StripeObject): lv: Optional[Lv] ma: Optional[Ma] md: Optional[Md] + me: Optional[Me] + mk: Optional[Mk] + mr: Optional[Mr] mt: Optional[Mt] mx: Optional[Mx] my: Optional[My] ng: Optional[Ng] nl: Optional[Nl] no: Optional[No] + np: Optional[Np] nz: Optional[Nz] om: Optional[Om] + pe: Optional[Pe] pl: Optional[Pl] pt: Optional[Pt] ro: Optional[Ro] @@ -750,22 +890,36 @@ class Za(StripeObject): sg: Optional[Sg] si: Optional[Si] sk: Optional[Sk] + sn: Optional[Sn] + sr: Optional[Sr] th: Optional[Th] + tj: Optional[Tj] tr: Optional[Tr] tz: Optional[Tz] + ug: Optional[Ug] us: Optional[Us] + uy: Optional[Uy] uz: Optional[Uz] vn: Optional[Vn] za: Optional[Za] + zm: Optional[Zm] + zw: Optional[Zw] _inner_class_types = { "ae": Ae, + "al": Al, + "am": Am, + "ao": Ao, "at": At, "au": Au, + "ba": Ba, + "bb": Bb, "be": Be, "bg": Bg, "bh": Bh, + "bs": Bs, "by": By, "ca": Ca, + "cd": Cd, "ch": Ch, "cl": Cl, "co": Co, @@ -782,6 +936,7 @@ class Za(StripeObject): "fr": Fr, "gb": Gb, "ge": Ge, + "gn": Gn, "gr": Gr, "hr": Hr, "hu": Hu, @@ -791,6 +946,7 @@ class Za(StripeObject): "it": It, "jp": Jp, "ke": Ke, + "kh": Kh, "kr": Kr, "kz": Kz, "lt": Lt, @@ -798,14 +954,19 @@ class Za(StripeObject): "lv": Lv, "ma": Ma, "md": Md, + "me": Me, + "mk": Mk, + "mr": Mr, "mt": Mt, "mx": Mx, "my": My, "ng": Ng, "nl": Nl, "no": No, + "np": Np, "nz": Nz, "om": Om, + "pe": Pe, "pl": Pl, "pt": Pt, "ro": Ro, @@ -816,13 +977,20 @@ class Za(StripeObject): "sg": Sg, "si": Si, "sk": Sk, + "sn": Sn, + "sr": Sr, "th": Th, + "tj": Tj, "tr": Tr, "tz": Tz, + "ug": Ug, "us": Us, + "uy": Uy, "uz": Uz, "vn": Vn, "za": Za, + "zm": Zm, + "zw": Zw, } _field_remappings = {"is_": "is"} @@ -858,6 +1026,18 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in AE. """ + al: NotRequired["Registration.CreateParamsCountryOptionsAl"] + """ + Options for the registration in AL. + """ + am: NotRequired["Registration.CreateParamsCountryOptionsAm"] + """ + Options for the registration in AM. + """ + ao: NotRequired["Registration.CreateParamsCountryOptionsAo"] + """ + Options for the registration in AO. + """ at: NotRequired["Registration.CreateParamsCountryOptionsAt"] """ Options for the registration in AT. @@ -866,6 +1046,14 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in AU. """ + ba: NotRequired["Registration.CreateParamsCountryOptionsBa"] + """ + Options for the registration in BA. + """ + bb: NotRequired["Registration.CreateParamsCountryOptionsBb"] + """ + Options for the registration in BB. + """ be: NotRequired["Registration.CreateParamsCountryOptionsBe"] """ Options for the registration in BE. @@ -878,6 +1066,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in BH. """ + bs: NotRequired["Registration.CreateParamsCountryOptionsBs"] + """ + Options for the registration in BS. + """ by: NotRequired["Registration.CreateParamsCountryOptionsBy"] """ Options for the registration in BY. @@ -886,6 +1078,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in CA. """ + cd: NotRequired["Registration.CreateParamsCountryOptionsCd"] + """ + Options for the registration in CD. + """ ch: NotRequired["Registration.CreateParamsCountryOptionsCh"] """ Options for the registration in CH. @@ -950,6 +1146,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in GE. """ + gn: NotRequired["Registration.CreateParamsCountryOptionsGn"] + """ + Options for the registration in GN. + """ gr: NotRequired["Registration.CreateParamsCountryOptionsGr"] """ Options for the registration in GR. @@ -982,6 +1182,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in KE. """ + kh: NotRequired["Registration.CreateParamsCountryOptionsKh"] + """ + Options for the registration in KH. + """ kr: NotRequired["Registration.CreateParamsCountryOptionsKr"] """ Options for the registration in KR. @@ -1010,6 +1214,18 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in MD. """ + me: NotRequired["Registration.CreateParamsCountryOptionsMe"] + """ + Options for the registration in ME. + """ + mk: NotRequired["Registration.CreateParamsCountryOptionsMk"] + """ + Options for the registration in MK. + """ + mr: NotRequired["Registration.CreateParamsCountryOptionsMr"] + """ + Options for the registration in MR. + """ mt: NotRequired["Registration.CreateParamsCountryOptionsMt"] """ Options for the registration in MT. @@ -1034,6 +1250,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in NO. """ + np: NotRequired["Registration.CreateParamsCountryOptionsNp"] + """ + Options for the registration in NP. + """ nz: NotRequired["Registration.CreateParamsCountryOptionsNz"] """ Options for the registration in NZ. @@ -1042,6 +1262,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in OM. """ + pe: NotRequired["Registration.CreateParamsCountryOptionsPe"] + """ + Options for the registration in PE. + """ pl: NotRequired["Registration.CreateParamsCountryOptionsPl"] """ Options for the registration in PL. @@ -1082,10 +1306,22 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in SK. """ + sn: NotRequired["Registration.CreateParamsCountryOptionsSn"] + """ + Options for the registration in SN. + """ + sr: NotRequired["Registration.CreateParamsCountryOptionsSr"] + """ + Options for the registration in SR. + """ th: NotRequired["Registration.CreateParamsCountryOptionsTh"] """ Options for the registration in TH. """ + tj: NotRequired["Registration.CreateParamsCountryOptionsTj"] + """ + Options for the registration in TJ. + """ tr: NotRequired["Registration.CreateParamsCountryOptionsTr"] """ Options for the registration in TR. @@ -1094,10 +1330,18 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in TZ. """ + ug: NotRequired["Registration.CreateParamsCountryOptionsUg"] + """ + Options for the registration in UG. + """ us: NotRequired["Registration.CreateParamsCountryOptionsUs"] """ Options for the registration in US. """ + uy: NotRequired["Registration.CreateParamsCountryOptionsUy"] + """ + Options for the registration in UY. + """ uz: NotRequired["Registration.CreateParamsCountryOptionsUz"] """ Options for the registration in UZ. @@ -1110,6 +1354,14 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in ZA. """ + zm: NotRequired["Registration.CreateParamsCountryOptionsZm"] + """ + Options for the registration in ZM. + """ + zw: NotRequired["Registration.CreateParamsCountryOptionsZw"] + """ + Options for the registration in ZW. + """ class CreateParamsCountryOptionsAe(TypedDict): type: Literal["standard"] @@ -1117,6 +1369,24 @@ class CreateParamsCountryOptionsAe(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsAl(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsAm(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsAo(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsAt(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsAtStandard" @@ -1141,6 +1411,18 @@ class CreateParamsCountryOptionsAu(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsBa(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsBb(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsBe(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsBeStandard" @@ -1183,6 +1465,12 @@ class CreateParamsCountryOptionsBh(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsBs(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsBy(TypedDict): type: Literal["simplified"] """ @@ -1207,6 +1495,12 @@ class CreateParamsCountryOptionsCaProvinceStandard(TypedDict): Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ + class CreateParamsCountryOptionsCd(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsCh(TypedDict): type: Literal["standard"] """ @@ -1399,6 +1693,12 @@ class CreateParamsCountryOptionsGe(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsGn(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsGr(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsGrStandard" @@ -1513,6 +1813,12 @@ class CreateParamsCountryOptionsKe(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsKh(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsKr(TypedDict): type: Literal["simplified"] """ @@ -1591,6 +1897,24 @@ class CreateParamsCountryOptionsMd(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsMe(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsMk(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsMr(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsMt(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsMtStandard" @@ -1651,6 +1975,12 @@ class CreateParamsCountryOptionsNo(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsNp(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsNz(TypedDict): type: Literal["standard"] """ @@ -1663,6 +1993,12 @@ class CreateParamsCountryOptionsOm(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsPe(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsPl(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsPlStandard" @@ -1795,12 +2131,30 @@ class CreateParamsCountryOptionsSkStandard(TypedDict): Place of supply scheme used in an EU standard registration. """ + class CreateParamsCountryOptionsSn(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsSr(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsTh(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsTj(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsTr(TypedDict): type: Literal["simplified"] """ @@ -1813,6 +2167,12 @@ class CreateParamsCountryOptionsTz(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsUg(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsUs(TypedDict): local_amusement_tax: NotRequired[ "Registration.CreateParamsCountryOptionsUsLocalAmusementTax" @@ -1881,6 +2241,12 @@ class CreateParamsCountryOptionsUsStateSalesTaxElection(TypedDict): The type of the election for the state sales tax registration. """ + class CreateParamsCountryOptionsUy(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsUz(TypedDict): type: Literal["simplified"] """ @@ -1899,6 +2265,18 @@ class CreateParamsCountryOptionsZa(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsZm(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsZw(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class ListParams(RequestOptions): ending_before: NotRequired[str] """ diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index 86c979db5..3c9f17b3c 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -46,6 +46,18 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in AE. """ + al: NotRequired["RegistrationService.CreateParamsCountryOptionsAl"] + """ + Options for the registration in AL. + """ + am: NotRequired["RegistrationService.CreateParamsCountryOptionsAm"] + """ + Options for the registration in AM. + """ + ao: NotRequired["RegistrationService.CreateParamsCountryOptionsAo"] + """ + Options for the registration in AO. + """ at: NotRequired["RegistrationService.CreateParamsCountryOptionsAt"] """ Options for the registration in AT. @@ -54,6 +66,14 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in AU. """ + ba: NotRequired["RegistrationService.CreateParamsCountryOptionsBa"] + """ + Options for the registration in BA. + """ + bb: NotRequired["RegistrationService.CreateParamsCountryOptionsBb"] + """ + Options for the registration in BB. + """ be: NotRequired["RegistrationService.CreateParamsCountryOptionsBe"] """ Options for the registration in BE. @@ -66,6 +86,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in BH. """ + bs: NotRequired["RegistrationService.CreateParamsCountryOptionsBs"] + """ + Options for the registration in BS. + """ by: NotRequired["RegistrationService.CreateParamsCountryOptionsBy"] """ Options for the registration in BY. @@ -74,6 +98,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in CA. """ + cd: NotRequired["RegistrationService.CreateParamsCountryOptionsCd"] + """ + Options for the registration in CD. + """ ch: NotRequired["RegistrationService.CreateParamsCountryOptionsCh"] """ Options for the registration in CH. @@ -138,6 +166,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in GE. """ + gn: NotRequired["RegistrationService.CreateParamsCountryOptionsGn"] + """ + Options for the registration in GN. + """ gr: NotRequired["RegistrationService.CreateParamsCountryOptionsGr"] """ Options for the registration in GR. @@ -170,6 +202,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in KE. """ + kh: NotRequired["RegistrationService.CreateParamsCountryOptionsKh"] + """ + Options for the registration in KH. + """ kr: NotRequired["RegistrationService.CreateParamsCountryOptionsKr"] """ Options for the registration in KR. @@ -198,6 +234,18 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in MD. """ + me: NotRequired["RegistrationService.CreateParamsCountryOptionsMe"] + """ + Options for the registration in ME. + """ + mk: NotRequired["RegistrationService.CreateParamsCountryOptionsMk"] + """ + Options for the registration in MK. + """ + mr: NotRequired["RegistrationService.CreateParamsCountryOptionsMr"] + """ + Options for the registration in MR. + """ mt: NotRequired["RegistrationService.CreateParamsCountryOptionsMt"] """ Options for the registration in MT. @@ -222,6 +270,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in NO. """ + np: NotRequired["RegistrationService.CreateParamsCountryOptionsNp"] + """ + Options for the registration in NP. + """ nz: NotRequired["RegistrationService.CreateParamsCountryOptionsNz"] """ Options for the registration in NZ. @@ -230,6 +282,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in OM. """ + pe: NotRequired["RegistrationService.CreateParamsCountryOptionsPe"] + """ + Options for the registration in PE. + """ pl: NotRequired["RegistrationService.CreateParamsCountryOptionsPl"] """ Options for the registration in PL. @@ -270,10 +326,22 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in SK. """ + sn: NotRequired["RegistrationService.CreateParamsCountryOptionsSn"] + """ + Options for the registration in SN. + """ + sr: NotRequired["RegistrationService.CreateParamsCountryOptionsSr"] + """ + Options for the registration in SR. + """ th: NotRequired["RegistrationService.CreateParamsCountryOptionsTh"] """ Options for the registration in TH. """ + tj: NotRequired["RegistrationService.CreateParamsCountryOptionsTj"] + """ + Options for the registration in TJ. + """ tr: NotRequired["RegistrationService.CreateParamsCountryOptionsTr"] """ Options for the registration in TR. @@ -282,10 +350,18 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in TZ. """ + ug: NotRequired["RegistrationService.CreateParamsCountryOptionsUg"] + """ + Options for the registration in UG. + """ us: NotRequired["RegistrationService.CreateParamsCountryOptionsUs"] """ Options for the registration in US. """ + uy: NotRequired["RegistrationService.CreateParamsCountryOptionsUy"] + """ + Options for the registration in UY. + """ uz: NotRequired["RegistrationService.CreateParamsCountryOptionsUz"] """ Options for the registration in UZ. @@ -298,6 +374,14 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in ZA. """ + zm: NotRequired["RegistrationService.CreateParamsCountryOptionsZm"] + """ + Options for the registration in ZM. + """ + zw: NotRequired["RegistrationService.CreateParamsCountryOptionsZw"] + """ + Options for the registration in ZW. + """ class CreateParamsCountryOptionsAe(TypedDict): type: Literal["standard"] @@ -305,6 +389,24 @@ class CreateParamsCountryOptionsAe(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsAl(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsAm(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsAo(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsAt(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsAtStandard" @@ -329,6 +431,18 @@ class CreateParamsCountryOptionsAu(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsBa(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsBb(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsBe(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsBeStandard" @@ -371,6 +485,12 @@ class CreateParamsCountryOptionsBh(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsBs(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsBy(TypedDict): type: Literal["simplified"] """ @@ -395,6 +515,12 @@ class CreateParamsCountryOptionsCaProvinceStandard(TypedDict): Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ + class CreateParamsCountryOptionsCd(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsCh(TypedDict): type: Literal["standard"] """ @@ -587,6 +713,12 @@ class CreateParamsCountryOptionsGe(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsGn(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsGr(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsGrStandard" @@ -701,6 +833,12 @@ class CreateParamsCountryOptionsKe(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsKh(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsKr(TypedDict): type: Literal["simplified"] """ @@ -779,6 +917,24 @@ class CreateParamsCountryOptionsMd(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsMe(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsMk(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsMr(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsMt(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsMtStandard" @@ -839,6 +995,12 @@ class CreateParamsCountryOptionsNo(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsNp(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsNz(TypedDict): type: Literal["standard"] """ @@ -851,6 +1013,12 @@ class CreateParamsCountryOptionsOm(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsPe(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsPl(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsPlStandard" @@ -983,12 +1151,30 @@ class CreateParamsCountryOptionsSkStandard(TypedDict): Place of supply scheme used in an EU standard registration. """ + class CreateParamsCountryOptionsSn(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsSr(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsTh(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsTj(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsTr(TypedDict): type: Literal["simplified"] """ @@ -1001,6 +1187,12 @@ class CreateParamsCountryOptionsTz(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsUg(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsUs(TypedDict): local_amusement_tax: NotRequired[ "RegistrationService.CreateParamsCountryOptionsUsLocalAmusementTax" @@ -1069,6 +1261,12 @@ class CreateParamsCountryOptionsUsStateSalesTaxElection(TypedDict): The type of the election for the state sales tax registration. """ + class CreateParamsCountryOptionsUy(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsUz(TypedDict): type: Literal["simplified"] """ @@ -1087,6 +1285,18 @@ class CreateParamsCountryOptionsZa(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsZm(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + + class CreateParamsCountryOptionsZw(TypedDict): + type: Literal["standard"] + """ + Type of registration to be created in `country`. + """ + class ListParams(TypedDict): ending_before: NotRequired[str] """ diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index 3c363eb13..bb4ee4c69 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -58,14 +58,20 @@ class TaxId(StripeObject): type: Literal[ "ad_nrt", "ae_trn", + "al_tin", + "am_tin", + "ao_tin", "ar_cuit", "au_abn", "au_arn", + "ba_tin", + "bb_tin", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", + "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", @@ -73,6 +79,7 @@ class TaxId(StripeObject): "ca_pst_mb", "ca_pst_sk", "ca_qst", + "cd_nif", "ch_uid", "ch_vat", "cl_tin", @@ -88,6 +95,7 @@ class TaxId(StripeObject): "eu_vat", "gb_vat", "ge_vat", + "gn_nif", "hk_br", "hr_oib", "hu_tin", @@ -99,12 +107,16 @@ class TaxId(StripeObject): "jp_rn", "jp_trn", "ke_pin", + "kh_tin", "kr_brn", "kz_bin", "li_uid", "li_vat", "ma_vat", "md_vat", + "me_pib", + "mk_vat", + "mr_nif", "mx_rfc", "my_frp", "my_itn", @@ -112,6 +124,7 @@ class TaxId(StripeObject): "ng_tin", "no_vat", "no_voec", + "np_pan", "nz_gst", "om_vat", "pe_ruc", @@ -124,12 +137,16 @@ class TaxId(StripeObject): "sg_gst", "sg_uen", "si_tin", + "sn_ninea", + "sr_fin", "sv_nit", "th_vat", + "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", + "ug_tin", "unknown", "us_ein", "uy_ruc", @@ -138,9 +155,11 @@ class TaxId(StripeObject): "ve_rif", "vn_tin", "za_vat", + "zm_tin", + "zw_tin", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, or `unknown` """ value: str """ diff --git a/stripe/terminal/_location.py b/stripe/terminal/_location.py index e0a4cb4a2..91a63df2b 100644 --- a/stripe/terminal/_location.py +++ b/stripe/terminal/_location.py @@ -124,7 +124,7 @@ class ListParams(RequestOptions): class ModifyParams(RequestOptions): address: NotRequired["Location.ModifyParamsAddress"] """ - The full address of the location. If you're updating the `address` field, avoid changing the `country`. If you need to modify the `country` field, create a new `Location` object and re-register any existing readers to that location. + The full address of the location. You can't change the location's `country`. If you need to modify the `country` field, create a new `Location` object and re-register any existing readers to that location. """ configuration_overrides: NotRequired["Literal['']|str"] """ diff --git a/stripe/terminal/_location_service.py b/stripe/terminal/_location_service.py index bcbfed219..453f81b9e 100644 --- a/stripe/terminal/_location_service.py +++ b/stripe/terminal/_location_service.py @@ -88,7 +88,7 @@ class RetrieveParams(TypedDict): class UpdateParams(TypedDict): address: NotRequired["LocationService.UpdateParamsAddress"] """ - The full address of the location. If you're updating the `address` field, avoid changing the `country`. If you need to modify the `country` field, create a new `Location` object and re-register any existing readers to that location. + The full address of the location. You can't change the location's `country`. If you need to modify the `country` field, create a new `Location` object and re-register any existing readers to that location. """ configuration_overrides: NotRequired["Literal['']|str"] """ diff --git a/stripe/treasury/_financial_account_features.py b/stripe/treasury/_financial_account_features.py index 60c378efe..b787ad43c 100644 --- a/stripe/treasury/_financial_account_features.py +++ b/stripe/treasury/_financial_account_features.py @@ -209,7 +209,7 @@ class StatusDetail(StripeObject): ach: Optional[Ach] """ - Toggle settings for enabling/disabling an ACH specific feature + Toggle settings for enabling/disabling an inbound ACH specific feature """ _inner_class_types = {"ach": Ach} @@ -355,7 +355,7 @@ class StatusDetail(StripeObject): ach: Optional[Ach] """ - Toggle settings for enabling/disabling an ACH specific feature + Toggle settings for enabling/disabling an outbound ACH specific feature """ us_domestic_wire: Optional[UsDomesticWire] """ @@ -460,7 +460,7 @@ class StatusDetail(StripeObject): ach: Optional[Ach] """ - Toggle settings for enabling/disabling an ACH specific feature + Toggle settings for enabling/disabling an outbound ACH specific feature """ us_domestic_wire: Optional[UsDomesticWire] """ From 511d2447963c77fd1b3891733b198765a7ebec6a Mon Sep 17 00:00:00 2001 From: Jesse Rosalia Date: Wed, 18 Dec 2024 15:43:47 -0800 Subject: [PATCH 133/179] Bump version to 11.4.0 --- CHANGELOG.md | 68 ++++++++++++++++++++++++++++++++++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 70 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7295ebb6..9f780e967 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,71 @@ +## 11.4.0 - 2024-12-18 +* [#1430](https://github.com/stripe/stripe-python/pull/1430) This release changes the pinned API version to `2024-12-18.acacia`. + * Add support for `allow_redisplay` on resources `stripe.Card` and `stripe.Source` + * Add support for `regulated_status` on resource `stripe.Card` and resource classes `stripe.Charge.PaymentMethodDetails.Card`, `stripe.ConfirmationToken.PaymentMethodPreview.Card`, and `stripe.PaymentMethod.Card` + * Add support for `network_advice_code` on resource classes `stripe.Charge.Outcome`, `stripe.Invoice.LastFinalizationError`, `stripe.PaymentIntent.LastPaymentError`, `stripe.SetupAttempt.SetupError`, and `stripe.SetupIntent.LastSetupError` + * Add support for `network_decline_code` on resource classes `stripe.Charge.Outcome`, `stripe.Invoice.LastFinalizationError`, `stripe.PaymentIntent.LastPaymentError`, `stripe.SetupAttempt.SetupError`, and `stripe.SetupIntent.LastSetupError` + * Add support for `funding` on resource classes `stripe.Charge.PaymentMethodDetails.AmazonPay` and `stripe.Charge.PaymentMethodDetails.RevolutPay` + * Add support for `network_transaction_id` on resource class `stripe.Charge.PaymentMethodDetails.Card` + * Add support for `visa_compliance` on resource classes `stripe.Dispute.Evidence.EnhancedEvidence` and `stripe.Dispute.EvidenceDetails.EnhancedEligibility` and parameter class `stripe.Dispute.ModifyParamsEvidenceEnhancedEvidence` + * Add support for `account_holder_address` on resource classes `stripe.FundingInstructions.BankTransfer.FinancialAddress.Iban`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.SortCode`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Spei`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Zengin`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Iban`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.SortCode`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Spei`, and `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Zengin` + * Add support for `bank_address` on resource classes `stripe.FundingInstructions.BankTransfer.FinancialAddress.Iban`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.SortCode`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Spei`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Zengin`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Iban`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.SortCode`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Spei`, and `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Zengin` + * Add support for `account_holder_name` on resource classes `stripe.FundingInstructions.BankTransfer.FinancialAddress.Spei` and `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Spei` + * Add support for `disabled_reason` on resource classes `stripe.Invoice.AutomaticTax`, `stripe.Subscription.AutomaticTax`, `stripe.SubscriptionSchedule.DefaultSettings.AutomaticTax`, and `stripe.SubscriptionSchedule.Phase.AutomaticTax` + * Add support for `reference_prefix` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsBacsDebitMandateOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.SetupIntent.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions`, `stripe.SetupIntent.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptionsBacsDebitMandateOptions`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions` and resource classes `stripe.PaymentIntent.PaymentMethodOptions.BacsDebit.MandateOptions`, `stripe.PaymentIntent.PaymentMethodOptions.SepaDebit.MandateOptions`, `stripe.SetupIntent.PaymentMethodOptions.BacsDebit.MandateOptions`, `stripe.SetupIntent.PaymentMethodOptions.SepaDebit.MandateOptions`, `stripe.checkout.Session.PaymentMethodOptions.BacsDebit.MandateOptions`, and `stripe.checkout.Session.PaymentMethodOptions.SepaDebit.MandateOptions` + * Add support for `trial_period_days` on parameter class `stripe.PaymentLink.ModifyParamsSubscriptionData` + * Add support for `credits_application_invoice_voided` on resource class `stripe.billing.CreditBalanceTransaction.Credit` + * Add support for `tax_id` on resource classes `stripe.issuing.Authorization.MerchantData` and `stripe.issuing.Transaction.MerchantData` + * Add support for `al` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `am` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `ao` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `ba` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `bb` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `bs` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `cd` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `gn` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `kh` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `me` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `mk` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `mr` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `np` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `pe` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `sn` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `sr` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `tj` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `ug` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `uy` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `zm` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `zw` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `payout_minimum_balance_hold` on enum `stripe.BalanceTransaction.type` + * Add support for `payout_minimum_balance_release` on enum `stripe.BalanceTransaction.type` + * Add support for `credits_application_invoice_voided` on enum `stripe.billing.CreditBalanceTransaction.Credit.type` + * Add support for `al_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `am_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `ao_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `ba_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `bb_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `bs_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `cd_nif` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `gn_nif` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `kh_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `me_pib` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `mk_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `mr_nif` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `np_pan` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `sn_ninea` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `sr_fin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `tj_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `ug_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `zm_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `zw_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `request_signature` on enums `stripe.forwarding.Request.replacements` and `stripe.forwarding.Request.CreateParams.replacements` + * Add support for `2024-12-18.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` + * Change type of `schedule_at_period_end` on `stripe.billing_portal.Configuration.Features.SubscriptionUpdate` from `Optional[ScheduleAtPeriodEnd]` to `ScheduleAtPeriodEnd` +* [#1434](https://github.com/stripe/stripe-python/pull/1434) Fix using `auto_paging_iter()` with `expand: [...]` +* [#1435](https://github.com/stripe/stripe-python/pull/1435) Fix StripeError http_body + - Fixes an issue where `StripeError.http_body` may be None even when `json_body` is a valid dictionary. +* [#1431](https://github.com/stripe/stripe-python/pull/1431) fix deprecation warning in httpx @ 0.28 + ## 11.3.0 - 2024-11-20 * [#1424](https://github.com/stripe/stripe-python/pull/1424) This release changes the pinned API version to `2024-11-20.acacia`. * Add support for `authorizer` on parameter classes `stripe.Account.CreatePersonParamsRelationship`, `stripe.Account.ListPersonsParamsRelationship`, `stripe.Account.ModifyPersonParamsRelationship`, `stripe.Account.PersonsParamsRelationship`, and `stripe.Token.CreateParamsPersonRelationship` and resource class `stripe.Person.Relationship` diff --git a/VERSION b/VERSION index f628d2eaf..72773deb8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.3.0 +11.4.0 diff --git a/stripe/_version.py b/stripe/_version.py index 8942c237b..7ead38c02 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "11.3.0" +VERSION = "11.4.0" From 627c691135d65034b175e62743d37314bc235c41 Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Wed, 18 Dec 2024 16:47:33 -0800 Subject: [PATCH 134/179] Added pull request template (#1436) --- .github/pull_request_template.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..312540b61 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,11 @@ +### Why? + + +### What? + + +### See Also + From 27c68335698d7328e3ed3ed8c4dc928771e6840e Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:05:05 -0800 Subject: [PATCH 135/179] fix SSL context with local path (#1438) * fix SSL context with local path * added live client test class, and added a test specifically for testing https requests thru HTTPXClient --------- Co-authored-by: Jesse Rosalia --- stripe/_http_client.py | 2 +- tests/test_http_client.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/stripe/_http_client.py b/stripe/_http_client.py index 5940f6aad..5a1b69813 100644 --- a/stripe/_http_client.py +++ b/stripe/_http_client.py @@ -1245,7 +1245,7 @@ def __init__( kwargs = {} if self._verify_ssl_certs: kwargs["verify"] = ssl.create_default_context( - capath=stripe.ca_bundle_path + cafile=stripe.ca_bundle_path ) else: kwargs["verify"] = False diff --git a/tests/test_http_client.py b/tests/test_http_client.py index b671b1e7a..edc1523de 100644 --- a/tests/test_http_client.py +++ b/tests/test_http_client.py @@ -1,3 +1,4 @@ +import base64 from typing import Any, List from typing_extensions import Type from unittest.mock import call @@ -1971,3 +1972,33 @@ def test_timeout(self): def test_timeout_async(self): pass + + +class TestLiveHTTPClients: + """ + Tests that actually make HTTP requests in order to test functionality (like https) + end to end. + """ + + @pytest.mark.anyio + async def test_httpx_request_async_https(self): + """ + Test to ensure that httpx https calls succeed by making a live test call + to the public stripe API. + """ + method = "get" + abs_url = "https://api.stripe.com/v1/balance" + data = {} + + client = _http_client.HTTPXClient(verify_ssl_certs=True) + # the public test secret key, as found on https://docs.stripe.com/keys#obtain-api-keys + test_api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" + basic_auth = base64.b64encode( + (test_api_key + ":").encode("utf-8") + ).decode("utf-8") + headers = {"Authorization": "Basic " + basic_auth} + + _, code, _ = await client.request_with_retries_async( + method, abs_url, headers, data + ) + assert code >= 200 and code < 400 From b4df98eea8714ab0021fe6b2140f33df2aa32b33 Mon Sep 17 00:00:00 2001 From: Jesse Rosalia Date: Thu, 19 Dec 2024 15:16:33 -0800 Subject: [PATCH 136/179] Bump version to 11.4.1 --- CHANGELOG.md | 3 +++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f780e967..f3e6db142 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 11.4.1 - 2024-12-19 +* [#1438](https://github.com/stripe/stripe-python/pull/1438) Fix regression when using httpx HTTP client + ## 11.4.0 - 2024-12-18 * [#1430](https://github.com/stripe/stripe-python/pull/1430) This release changes the pinned API version to `2024-12-18.acacia`. * Add support for `allow_redisplay` on resources `stripe.Card` and `stripe.Source` diff --git a/VERSION b/VERSION index 72773deb8..a6e5b12f9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.4.0 +11.4.1 diff --git a/stripe/_version.py b/stripe/_version.py index 7ead38c02..eb0cce4d6 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "11.4.0" +VERSION = "11.4.1" From 39ce6f42b0e49662fd8e81eb5de8df745eb875c9 Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Mon, 13 Jan 2025 13:28:28 -0800 Subject: [PATCH 137/179] changed v2 ListObject data type from List[StripeObject] to List[T] (#1442) --- stripe/v2/_list_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stripe/v2/_list_object.py b/stripe/v2/_list_object.py index a9d73546c..a314650c6 100644 --- a/stripe/v2/_list_object.py +++ b/stripe/v2/_list_object.py @@ -17,7 +17,7 @@ class ListObject(StripeObject, Generic[T]): """ OBJECT_NAME = "list" - data: List[StripeObject] + data: List[T] next_page_url: Optional[str] def __getitem__(self, k): From bd73a3293523aa944d4c69121ced5b7a2c9854ef Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:21:09 -0800 Subject: [PATCH 138/179] add justfile, update readme, remove coveralls (#1440) * remove virtualenv * unremove virtualenv version * messy justfile, but maybe CI works? * remove quote * actually run tests with correct versions * fix comment * better logging, less mypy * skip tox, different pyright approach on older versions * break out test jobs * fix justfile * another CI run * install this package * remvove tox, makefile, update CI a bunch * fix mypy * fix pyright dep * final pass --- .github/workflows/ci.yml | 92 +++++++++---------- MANIFEST.in | 4 +- Makefile | 49 ---------- README.md | 32 ++++--- deps/build-requirements.txt | 4 + deps/dev-requirements.txt | 11 +++ .../test-requirements.txt | 6 +- justfile | 81 ++++++++++++++++ pyproject.toml | 13 ++- requirements.txt | 12 --- tox.ini | 56 ----------- 11 files changed, 172 insertions(+), 188 deletions(-) delete mode 100644 Makefile create mode 100644 deps/build-requirements.txt create mode 100644 deps/dev-requirements.txt rename test-requirements.txt => deps/test-requirements.txt (72%) create mode 100644 justfile delete mode 100644 requirements.txt delete mode 100644 tox.ini diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a59eb527..96cfa777a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,25 +19,37 @@ on: jobs: lint: - name: Lint & Mypy + name: Static Checks runs-on: ubuntu-latest steps: + - uses: extractions/setup-just@v2 - uses: actions/checkout@v3 - name: Set up Python 3 uses: actions/setup-python@v4 with: python-version: "3.10" - - name: mypy - run: make mypy - - name: lint - run: make lint - - name: fmtcheck - run: make fmtcheck + - name: check examples w/ mypy (against python@3.10) + run: just typecheck-examples + # skip deps on all these since mypy installed everything + - name: check linting + run: just --no-deps lint + - name: check formatting + run: just --no-deps format-check + # pyright depends on node, which it handles and installs for itself as needed + # we _could_ run setup-node to make it available for it if we're having reliability problems + - name: check types (all Python versions) + run: | + set -eox + + for minor in {6..12}; do + just --no-deps typecheck $minor + done build: name: Build runs-on: ubuntu-latest steps: + - uses: extractions/setup-just@v2 - uses: actions/checkout@v3 - name: Set up Python 3 @@ -45,15 +57,9 @@ jobs: with: python-version: "3.10" - - name: Install tools - run: make venv - - name: Build and check package run: | - set -x - source venv/bin/activate - python setup.py clean --all sdist bdist_wheel --universal - python -m twine check dist/* + just build - name: "Upload Artifact" uses: actions/upload-artifact@v3 @@ -69,45 +75,30 @@ jobs: strategy: fail-fast: false matrix: - python: - - { version: "3.6" , env: "py36" } - - { version: "3.7" , env: "py37" } - - { version: "3.8" , env: "py38" } - - { version: "3.9" , env: "py39" } - - { version: "3.10" , env: "py310" } - - { version: "3.11" , env: "py311" } - - { version: "3.12" , env: "py312" } - - { version: "pypy-3.7" , env: "py3.7" } - - { version: "pypy-3.8" , env: "py3.8" } - - { version: "pypy-3.9" , env: "py3.9" } - - { version: "pypy-3.10" , env: "py3.10" } - name: Test (${{ matrix.python.version }}) + python_version: + - "3.6" + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + - "pypy-3.7" + - "pypy-3.8" + - "pypy-3.9" + - "pypy-3.10" + name: Test (${{ matrix.python_version }}) steps: + - uses: extractions/setup-just@v2 - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python.version }} and 3.10 + - name: Set up Python ${{ matrix.python_version }} uses: actions/setup-python@v4 with: - python-version: | - ${{ matrix.python.version }} - 3.10 - + python-version: ${{ matrix.python_version }} - uses: stripe/openapi/actions/stripe-mock@master - - name: Typecheck with pyright - run: PYRIGHT_ARGS="-- --pythonversion ${{ matrix.python.version }}" make pyright - # Skip typecheking in pypy legs - if: ${{ !contains(matrix.python.version, 'pypy') }} - - - name: Test with pytest - run: TOX_ARGS="-e ${{ matrix.python.env }}" make ci-test - - - name: Calculate and publish coverage - run: make coveralls - if: env.COVERALLS_REPO_TOKEN && matrix.python.version == '3.10' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + - name: "run tests" + run: just test publish: name: Publish @@ -137,11 +128,12 @@ jobs: GPG_SIGNING_PRIVKEY: ${{ secrets.GPG_SIGNING_PRIVKEY }} GPG_SIGNING_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }} - name: Install tools - run: make venv - - name: Publish packages to PyPy + run: just install-build-deps + - name: Publish packages to PyPI + # could probably move this into a just recipe too? run: | set -ex - source venv/bin/activate + source .venv/bin/activate export VERSION=$(cat VERSION) gpg --detach-sign --local-user $GPG_SIGNING_KEYID --pinentry-mode loopback --passphrase $GPG_SIGNING_PASSPHRASE -a dist/stripe-$VERSION.tar.gz gpg --detach-sign --local-user $GPG_SIGNING_KEYID --pinentry-mode loopback --passphrase $GPG_SIGNING_PASSPHRASE -a dist/stripe-$VERSION-py2.py3-none-any.whl diff --git a/MANIFEST.in b/MANIFEST.in index ba34b83e6..ff12f246b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,5 @@ -include .coveragerc .flake8 CHANGELOG.md LICENSE LONG_DESCRIPTION.rst README.md VERSION pytest.ini tox.ini +# this file specifies what's included in a source distribution (https://packaging.python.org/en/latest/glossary/#term-Source-Distribution-or-sdist) +# see also: https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html +include .flake8 CHANGELOG.md LICENSE LONG_DESCRIPTION.rst README.md VERSION pytest.ini justfile recursive-include tests *.py recursive-include examples *.txt *.py diff --git a/Makefile b/Makefile deleted file mode 100644 index a85caa62a..000000000 --- a/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -VENV_NAME?=venv -PIP?=pip -PYTHON?=python3.10 -DEFAULT_TEST_ENV?=py310 - -venv: $(VENV_NAME)/bin/activate - -$(VENV_NAME)/bin/activate: setup.py requirements.txt - @test -d $(VENV_NAME) || $(PYTHON) -m venv --clear $(VENV_NAME) - ${VENV_NAME}/bin/python -m pip install -r requirements.txt - @touch $(VENV_NAME)/bin/activate - -test: venv pyright lint mypy - @${VENV_NAME}/bin/tox -p auto -e $(DEFAULT_TEST_ENV) $(TOX_ARGS) - -test-nomock: venv - @${VENV_NAME}/bin/tox -p auto -- --nomock $(TOX_ARGS) - -ci-test: venv - @${VENV_NAME}/bin/tox $(TOX_ARGS) - -coveralls: venv - @${VENV_NAME}/bin/tox -e coveralls - -pyright: venv - @${VENV_NAME}/bin/tox -e pyright $(PYRIGHT_ARGS) - -mypy: venv - @${VENV_NAME}/bin/tox -e mypy $(MYPY_ARGS) - -fmt: venv - @${VENV_NAME}/bin/tox -e fmt - -fmtcheck: venv - @${VENV_NAME}/bin/tox -e fmt -- --check --verbose - -lint: venv - @${VENV_NAME}/bin/tox -e lint - -clean: - @rm -rf $(VENV_NAME) .coverage .coverage.* build/ dist/ htmlcov/ - -update-version: - @echo "$(VERSION)" > VERSION - @perl -pi -e 's|VERSION = "[.\d\w]+"|VERSION = "$(VERSION)"|' stripe/_version.py - -codegen-format: fmt - -.PHONY: ci-test clean codegen-format coveralls fmt fmtcheck lint test test-nomock test-travis update-version venv pyright mypy diff --git a/README.md b/README.md index 62f399fd0..35cfa9912 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![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) -[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-python/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-python?branch=master) 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 @@ -341,46 +340,48 @@ go install github.com/stripe/stripe-mock@latest stripe-mock ``` -Run the following command to set up the development virtualenv: +We use [just](https://github.com/casey/just) for conveniently running development tasks. You can use them directly, or copy the commands out of the `justfile`. To our help docs, run `just`. By default, all commands will use an virtualenv created by your default python version (whatever comes out of `python --version`). We recommend using [mise](https://mise.jdx.dev/lang/python.html) or [pyenv](https://github.com/pyenv/pyenv) to control that version. -```sh -make -``` - -Run all tests on all supported Python versions: +Run the following command to set up the development virtualenv: ```sh -make test +just venv +# or: python -m venv venv && venv/bin/python -I -m pip install -e . ``` -Run all tests for a specific Python version (modify `-e` according to your Python target): +Run all tests: ```sh -TOX_ARGS="-e py37" make test +just test +# or: venv/bin/pytest ``` Run all tests in a single file: ```sh -TOX_ARGS="-e py37 -- tests/api_resources/abstract/test_updateable_api_resource.py" make test +just test tests/api_resources/abstract/test_updateable_api_resource.py +# or: venv/bin/pytest tests/api_resources/abstract/test_updateable_api_resource.py ``` Run a single test suite: ```sh -TOX_ARGS="-e py37 -- tests/api_resources/abstract/test_updateable_api_resource.py::TestUpdateableAPIResource" make test +just test tests/api_resources/abstract/test_updateable_api_resource.py::TestUpdateableAPIResource +# or: venv/bin/pytest tests/api_resources/abstract/test_updateable_api_resource.py::TestUpdateableAPIResource ``` Run a single test: ```sh -TOX_ARGS="-e py37 -- tests/api_resources/abstract/test_updateable_api_resource.py::TestUpdateableAPIResource::test_save" make test +just test tests/api_resources/abstract/test_updateable_api_resource.py::TestUpdateableAPIResource::test_save +# or: venv/bin/pytest tests/api_resources/abstract/test_updateable_api_resource.py::TestUpdateableAPIResource::test_save ``` Run the linter with: ```sh -make lint +just lint +# or: venv/bin/python -m flake8 --show-source stripe tests setup.py ``` The library uses [Ruff][ruff] for code formatting. Code must be formatted @@ -388,7 +389,8 @@ with Black before PRs are submitted, otherwise CI will fail. Run the formatter with: ```sh -make fmt +just format +# or: venv/bin/ruff format . --quiet ``` [api-keys]: https://dashboard.stripe.com/account/apikeys diff --git a/deps/build-requirements.txt b/deps/build-requirements.txt new file mode 100644 index 000000000..ae45d54c1 --- /dev/null +++ b/deps/build-requirements.txt @@ -0,0 +1,4 @@ +# packages needed to package & release + +twine +setuptools diff --git a/deps/dev-requirements.txt b/deps/dev-requirements.txt new file mode 100644 index 000000000..cedd76e2b --- /dev/null +++ b/deps/dev-requirements.txt @@ -0,0 +1,11 @@ +# packages needed to run static analysis (lints, types, etc) +# version requirements: any modern python version (currently 3.10) + +# typechecking for all versions +pyright == 1.1.336 +# general typechecking +mypy == 1.7.0 +# formatting +ruff == 0.4.4 +# linting +flake8 diff --git a/test-requirements.txt b/deps/test-requirements.txt similarity index 72% rename from test-requirements.txt rename to deps/test-requirements.txt index f2e9a43ba..a04785b92 100644 --- a/test-requirements.txt +++ b/deps/test-requirements.txt @@ -1,4 +1,5 @@ -# These requirements must be installable on all our supported versions +# packages needed to run unit tests (including extra supported http libraries) +# version requirements: all supported versions (currently 3.6-3.12) # This is the last version of httpx compatible with Python 3.6 httpx == 0.22.0; python_version == "3.6" @@ -8,10 +9,7 @@ aiohttp == 3.8.6; python_version <= "3.7" aiohttp == 3.9.4; python_version > "3.7" anyio[trio] == 3.6.2 -pytest-cov >= 2.8.1, < 2.11.0 pytest-mock >= 2.0.0 mock >= 4.0; python_version < "3.8" pytest-xdist >= 1.31.0 pytest >= 6.0.0 -coverage >= 4.5.3, < 5 -coveralls diff --git a/justfile b/justfile new file mode 100644 index 000000000..4e8c0fec8 --- /dev/null +++ b/justfile @@ -0,0 +1,81 @@ +set quiet + +import? '../sdk-codegen/justfile' + +VENV_NAME := ".venv" + +export PATH := `pwd` / VENV_NAME / "bin:" + env('PATH') + +_default: + just --list --unsorted + +# ⭐ run all unit tests +test *args: install-test-deps + # configured in pyproject.toml + pytest {{ args }} + +# ⭐ check for potential mistakes +lint: install-dev-deps + python -m flake8 --show-source stripe tests setup.py + +# verify types. optional argument to test as of a specific minor python version (e.g. `8` to test `python 3.8`); otherwise uses current version +typecheck minor_py_version="": install-test-deps install-dev-deps + # suppress version update warnings + PYRIGHT_PYTHON_IGNORE_WARNINGS=1 pyright {{ if minor_py_version == "" { "" } else { "--pythonversion 3." + minor_py_version } }} + +# ⭐ format all code +format: install-dev-deps + ruff format . --quiet + +# verify formatting, but don't modify files +format-check: install-dev-deps + ruff format . --check --quiet + +# remove venv +clean: + # clear old files too + rm -rf {{ VENV_NAME }} venv .tox + +# blow away and reinstall virtual env +reset: clean && venv + +# build the package for upload +build: install-build-deps + # --universal is deprecated, so we'll probably need to look at this eventually + # given that we don't care about universal 2 and 3 packages, we probably don't need it? + python -I setup.py clean --all sdist bdist_wheel --universal + python -m twine check dist/* + +# typecheck some examples w/ mypy +typecheck-examples: _install-all + # configured in pyproject.toml + mypy + +# install the tools for local development & static checks +install-dev-deps: (install "dev") + +# install everything for unit tests +install-test-deps: (install "test") + +# install dependencies to build the package +install-build-deps: (install "build") + +_install-all: install-dev-deps install-test-deps install-build-deps + +# installs files out of a {group}-requirements.txt into the local venv; mostly used by other recipes +install group: venv + python -I -m pip install -r deps/{{ group }}-requirements.txt --disable-pip-version-check {{ if is_dependency() == "true" {"--quiet"} else {""} }} + +# create a virtualenv if it doesn't exist; always installs the local package +[private] +venv: + [ -d {{ VENV_NAME }} ] || ( \ + python -m venv {{ VENV_NAME }} && \ + {{ VENV_NAME }}/bin/python -I -m pip install -e . --quiet --disable-pip-version-check \ + ) + +# called by tooling +[private] +update-version version: + @echo "{{ version }}" > VERSION + @perl -pi -e 's|VERSION = "[.\d\w]+"|VERSION = "{{ version }}"|' stripe/_version.py diff --git a/pyproject.toml b/pyproject.toml index 7ed6ba63c..dae143954 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,4 +33,15 @@ warn_unused_ignores = true no_implicit_reexport = true [tool.pytest.ini_options] -filterwarnings = "ignore::DeprecationWarning" +# use as many threads as available for tests +addopts = "-n auto" +# already the default, but will speed up searching a little, since this is the only place tests live +testpaths = "tests" +# these are warnings we show to users; we don't need them in our test logs +filterwarnings = [ + # single quotes so we don't have to re-backslack our backslashes + 'ignore:[\S\s]*stripe-python:DeprecationWarning', + 'ignore:[\S\s]*stripe\..* package:DeprecationWarning', + 'ignore:[\S\s]*RecipientTransfer:DeprecationWarning', + 'ignore:[\S\s]*`save` method is deprecated:DeprecationWarning', +] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index cfe397d29..000000000 --- a/requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -# These requirements must be installable only on py3.10 + -twine -# 4.5.0 is the last version that works with virtualenv<20.22.0 -tox == 4.5.0 -#Virtualenv 20.22.0 dropped support for all Python versions smaller or equal to Python 3.6. -virtualenv<20.22.0 -pyright == 1.1.336 -ruff == 0.4.4 -flake8 -mypy == 1.7.0 - --r test-requirements.txt diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 23ee4816e..000000000 --- a/tox.ini +++ /dev/null @@ -1,56 +0,0 @@ -# Tox (http://tox.testrun.org/) is a tool for running tests -# in multiple virtualenvs. This configuration file will run the -# test suite on all supported python versions. To use it, "pip install tox" -# and then run "tox" from this directory. - -[tox] -envlist = - fmt - lint - pyright - mypy - py{312,311,310,39,38,37,36,py3} -ignore_base_python_conflict = false - -[tool:pytest] -testpaths = tests -addopts = - --cov-report=term-missing - -[testenv] -description = run the unit tests under {basepython} -setenv = - COVERAGE_FILE = {toxworkdir}/.coverage.{envname} -deps = - -r test-requirements.txt - -# ignore stripe directory as all tests are inside ./tests -commands = pytest --cov {posargs:-n auto} --ignore stripe -# compilation flags can be useful when prebuilt wheels cannot be used, e.g. -# PyPy 2 needs to compile the `cryptography` module. On macOS this can be done -# by passing the following flags: -# LDFLAGS="-L$(brew --prefix openssl@1.1)/lib" -# CFLAGS="-I$(brew --prefix openssl@1.1)/include" -passenv = LDFLAGS,CFLAGS - -[testenv:{lint,fmt,pyright,mypy}] -basepython = python3.10 -skip_install = true -commands = - pyright: pyright {posargs} - lint: python -m flake8 --show-source stripe tests setup.py - fmt: ruff format . {posargs} - mypy: mypy {posargs} -deps = - -r requirements.txt - -[testenv:coveralls] -description = upload coverage to coveralls.io -skip_install = true -setenv = - COVERAGE_FILE = {toxworkdir}/.coverage -passenv = GITHUB_* -commands = - coverage combine - coveralls --service=github -depends = py{312,311,310,39,38,37,36,py3} From 7ea2fe4947677f6869560b4fafc2f3949c264fb8 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Thu, 16 Jan 2025 12:03:59 -0800 Subject: [PATCH 139/179] minor justfile fixes & pin CI version (#1445) * minor justfile fixes * pin most of CI to ubuntu 24 --- .github/workflows/ci.yml | 6 +-- justfile | 6 +-- tests/test_generated_examples.py | 86 ++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96cfa777a..6b02f17e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ on: jobs: lint: name: Static Checks - runs-on: ubuntu-latest + runs-on: "ubuntu-24.04" steps: - uses: extractions/setup-just@v2 - uses: actions/checkout@v3 @@ -47,7 +47,7 @@ jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: "ubuntu-24.04" steps: - uses: extractions/setup-just@v2 - uses: actions/checkout@v3 @@ -107,7 +107,7 @@ jobs: startsWith(github.ref, 'refs/tags/v') && endsWith(github.actor, '-stripe') needs: [build, test, lint] - runs-on: ubuntu-latest + runs-on: "ubuntu-24.04" steps: - uses: actions/checkout@v3 - name: Download all workflow run artifacts diff --git a/justfile b/justfile index 4e8c0fec8..011c346d6 100644 --- a/justfile +++ b/justfile @@ -1,6 +1,6 @@ set quiet -import? '../sdk-codegen/justfile' +import? '../sdk-codegen/utils.just' VENV_NAME := ".venv" @@ -77,5 +77,5 @@ venv: # called by tooling [private] update-version version: - @echo "{{ version }}" > VERSION - @perl -pi -e 's|VERSION = "[.\d\w]+"|VERSION = "{{ version }}"|' stripe/_version.py + echo "{{ version }}" > VERSION + perl -pi -e 's|VERSION = "[.\d\w]+"|VERSION = "{{ version }}"|' stripe/_version.py diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 3676af8ab..48a1ff85e 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -25865,6 +25865,92 @@ async def test_terminal_readers_process_payment_intent_post_service_async( post_data="payment_intent=pi_xxxxxxxxxxxxx", ) + def test_terminal_readers_process_setup_intent_post( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.terminal.Reader.process_setup_intent( + "tmr_xxxxxxxxxxxxx", + setup_intent="seti_xxxxxxxxxxxxx", + allow_redisplay="always", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + query_string="", + post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", + ) + + def test_terminal_readers_process_setup_intent_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.terminal.readers.process_setup_intent( + "tmr_xxxxxxxxxxxxx", + { + "setup_intent": "seti_xxxxxxxxxxxxx", + "allow_redisplay": "always", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + query_string="", + api_base="https://api.stripe.com", + post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", + ) + + @pytest.mark.anyio + async def test_terminal_readers_process_setup_intent_post_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.terminal.Reader.process_setup_intent_async( + "tmr_xxxxxxxxxxxxx", + setup_intent="seti_xxxxxxxxxxxxx", + allow_redisplay="always", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + query_string="", + post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", + ) + + @pytest.mark.anyio + async def test_terminal_readers_process_setup_intent_post_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.terminal.readers.process_setup_intent_async( + "tmr_xxxxxxxxxxxxx", + { + "setup_intent": "seti_xxxxxxxxxxxxx", + "allow_redisplay": "always", + }, + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + query_string="", + api_base="https://api.stripe.com", + post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", + ) + def test_test_helpers_customers_fund_cash_balance_post( self, http_client_mock: HTTPClientMock ) -> None: From 3682a9fd783de9151324d7cb9cf70b7511629dcf Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Thu, 16 Jan 2025 17:19:54 -0800 Subject: [PATCH 140/179] Added CONTRIBUTING.md file (#1444) --- CONTRIBUTING.md | 25 +++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..1615afa65 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,25 @@ + +# Contributing + +We welcome bug reports, feature requests, and code contributions in a pull request. + +For most pull requests, we request that you identify or create an associated issue that has the necessary context. We use these issues to reach agreement on an approach and save the PR author from having to redo work. Fixing typos or documentation issues likely do not need an issue; for any issue that introduces substantial code changes, changes the public interface, or if you aren't sure, please find or [create an issue](https://www.github.com/stripe/stripe-python/issues/new/choose). + +## Contributor License Agreement + +All contributors must sign the Contributor License Agreement (CLA) before we can accept their contribution. If you have not yet signed the agreement, you will be given an option to do so when you open a pull request. You can then sign by clicking on the badge in the comment from @CLAassistant. + +## Generated code + +This project has a combination of manually maintained code and code generated from our private code generator. If your contribution involves changes to generated code, please call this out in the issue or pull request as we will likely need to make a change to our code generator before accepting the contribution. + +To identify files with purely generated code, look for the comment `File generated from our OpenAPI spec.` at the start of the file. Generated blocks of code within hand-written files will be between comments that say `The beginning of the section generated from our OpenAPI spec` and `The end of the section generated from our OpenAPI spec`. + +## Compatibility with supported language and runtime versions + +This project supports [many different langauge and runtime versions](README.md#requirements) and we are unable to accept any contribution that does not work on _all_ supported versions. If, after discussing the approach in the associated issue, your change must use an API / feature that isn't available in all supported versions, please call this out explicitly in the issue or pull request so we can help figure out the best way forward. + +## Set up your dev environment + +Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment. + diff --git a/README.md b/README.md index 35cfa9912..aa4f0d2cd 100644 --- a/README.md +++ b/README.md @@ -331,6 +331,8 @@ New features and bug fixes are released on the latest major version of the Strip ## Development +[Contribution guidelines for this project](CONTRIBUTING.md) + The test suite depends on [stripe-mock], so make sure to fetch and run it from a background terminal ([stripe-mock's README][stripe-mock] also contains instructions for installing via Homebrew and other methods): From 8d5c6297182fb41ebbd7a1b7d78140c63fa56710 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:23:24 -0800 Subject: [PATCH 141/179] add just to publish CI (#1446) --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b02f17e6..272da414a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,6 +109,7 @@ jobs: needs: [build, test, lint] runs-on: "ubuntu-24.04" steps: + - uses: extractions/setup-just@v2 - uses: actions/checkout@v3 - name: Download all workflow run artifacts uses: actions/download-artifact@v3 From 288290bc7e1b79aa02ae2d8417084017dd427515 Mon Sep 17 00:00:00 2001 From: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> Date: Fri, 24 Jan 2025 21:26:31 -0500 Subject: [PATCH 142/179] Updated upload artifact ci action (#1448) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 272da414a..a4c73703b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: just build - name: "Upload Artifact" - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: dist path: dist/ From 46d65cdc9caa062d198bbdf628c575e78b8e0e58 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:43:31 +0000 Subject: [PATCH 143/179] Update generated code (#1443) * Update generated code for v1441 * Update generated code for v1455 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Co-authored-by: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 78 ++++++ stripe/_account_service.py | 94 +++++++ stripe/_account_session.py | 242 ++++++++++++++++++ stripe/_account_session_service.py | 138 ++++++++++ stripe/_api_version.py | 2 +- stripe/_charge.py | 15 ++ stripe/_confirmation_token.py | 20 ++ stripe/_credit_note.py | 2 +- stripe/_credit_note_line_item.py | 2 +- stripe/_customer.py | 1 + stripe/_customer_payment_method_service.py | 1 + stripe/_invoice.py | 4 + stripe/_payment_intent.py | 66 +++++ stripe/_payment_intent_service.py | 57 +++++ stripe/_payment_link.py | 21 +- stripe/_payment_link_service.py | 19 +- stripe/_payment_method.py | 26 ++ stripe/_payment_method_configuration.py | 64 +++++ .../_payment_method_configuration_service.py | 40 +++ stripe/_payment_method_service.py | 16 ++ stripe/_setup_attempt.py | 4 + stripe/_setup_intent.py | 34 +++ stripe/_setup_intent_service.py | 30 +++ stripe/_token.py | 23 ++ stripe/_token_service.py | 23 ++ stripe/_webhook_endpoint.py | 1 + stripe/_webhook_endpoint_service.py | 1 + stripe/billing_portal/_configuration.py | 4 +- .../billing_portal/_configuration_service.py | 4 +- stripe/checkout/_session.py | 33 ++- stripe/checkout/_session_service.py | 13 + stripe/financial_connections/_transaction.py | 2 +- .../_transaction_service.py | 2 +- stripe/terminal/_configuration.py | 52 ++++ stripe/terminal/_configuration_service.py | 36 +++ .../_confirmation_token_service.py | 10 + stripe/treasury/_financial_account.py | 175 +++++++++++++ stripe/treasury/_financial_account_service.py | 98 +++++++ stripe/treasury/_outbound_transfer.py | 30 ++- stripe/treasury/_outbound_transfer_service.py | 16 ++ stripe/treasury/_received_credit.py | 21 +- stripe/treasury/_received_credit_service.py | 6 +- 43 files changed, 1511 insertions(+), 17 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index bf0daa66a..217ac84ad 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1412 \ No newline at end of file +v1455 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index e1c613c2f..e8e90578c 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -316,6 +316,12 @@ class Capabilities(StripeObject): """ The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. """ + pay_by_bank_payments: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the pay_by_bank payments capability of the account, or whether the account can directly process pay_by_bank charges. + """ payco_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Payco capability of the account, or whether the account can directly process Payco payments. @@ -486,6 +492,20 @@ class AddressKanji(StripeObject): Town/cho-me. """ + class DirectorshipDeclaration(StripeObject): + date: Optional[int] + """ + The Unix timestamp marking when the directorship declaration attestation was made. + """ + ip: Optional[str] + """ + The IP address from which the directorship declaration attestation was made. + """ + user_agent: Optional[str] + """ + The user-agent string from the browser where the directorship declaration attestation was made. + """ + class OwnershipDeclaration(StripeObject): date: Optional[int] """ @@ -535,6 +555,10 @@ class Document(StripeObject): """ Whether the company's directors have been provided. This Boolean will be `true` if you've manually indicated that all directors are provided via [the `directors_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-directors_provided). """ + directorship_declaration: Optional[DirectorshipDeclaration] + """ + This hash is used to attest that the director information provided to Stripe is both current and correct. + """ executives_provided: Optional[bool] """ Whether the company's executives have been provided. This Boolean will be `true` if you've manually indicated that all executives are provided via [the `executives_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided. @@ -567,6 +591,12 @@ class Document(StripeObject): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ + ownership_exemption_reason: Optional[ + Literal[ + "qualified_entity_exceeds_ownership_threshold", + "qualifies_as_financial_institution", + ] + ] phone: Optional[str] """ The company's phone number (used for verification). @@ -621,6 +651,7 @@ class Document(StripeObject): "address": Address, "address_kana": AddressKana, "address_kanji": AddressKanji, + "directorship_declaration": DirectorshipDeclaration, "ownership_declaration": OwnershipDeclaration, "verification": Verification, } @@ -1731,6 +1762,12 @@ class CreateParamsCapabilities(TypedDict): """ The p24_payments capability. """ + pay_by_bank_payments: NotRequired[ + "Account.CreateParamsCapabilitiesPayByBankPayments" + ] + """ + The pay_by_bank_payments capability. + """ payco_payments: NotRequired[ "Account.CreateParamsCapabilitiesPaycoPayments" ] @@ -2046,6 +2083,12 @@ class CreateParamsCapabilitiesP24Payments(TypedDict): 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 CreateParamsCapabilitiesPayByBankPayments(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 CreateParamsCapabilitiesPaycoPayments(TypedDict): requested: NotRequired[bool] """ @@ -2190,6 +2233,12 @@ class CreateParamsCompany(TypedDict): """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ + directorship_declaration: NotRequired[ + "Account.CreateParamsCompanyDirectorshipDeclaration" + ] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. @@ -2224,6 +2273,9 @@ class CreateParamsCompany(TypedDict): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ + ownership_exemption_reason: NotRequired[ + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" + ] phone: NotRequired[str] """ The company's phone number (used for verification). @@ -2341,6 +2393,20 @@ class CreateParamsCompanyAddressKanji(TypedDict): Town or cho-me. """ + class CreateParamsCompanyDirectorshipDeclaration(TypedDict): + date: NotRequired[int] + """ + The Unix timestamp marking when the directorship declaration attestation was made. + """ + ip: NotRequired[str] + """ + The IP address from which the directorship declaration attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the directorship declaration attestation was made. + """ + class CreateParamsCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ @@ -2454,6 +2520,12 @@ class CreateParamsDocuments(TypedDict): """ One or more documents showing the company's proof of registration with the national business registry. """ + proof_of_ultimate_beneficial_ownership: NotRequired[ + "Account.CreateParamsDocumentsProofOfUltimateBeneficialOwnership" + ] + """ + One or more documents that demonstrate proof of ultimate beneficial ownership. + """ class CreateParamsDocumentsBankAccountOwnershipVerification(TypedDict): files: NotRequired[List[str]] @@ -2497,6 +2569,12 @@ class CreateParamsDocumentsProofOfRegistration(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class CreateParamsDocumentsProofOfUltimateBeneficialOwnership(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + class CreateParamsGroups(TypedDict): payments_pricing: NotRequired["Literal['']|str"] """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 7a8580967..2db685949 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -458,6 +458,12 @@ class CreateParamsCapabilities(TypedDict): """ The p24_payments capability. """ + pay_by_bank_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesPayByBankPayments" + ] + """ + The pay_by_bank_payments capability. + """ payco_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesPaycoPayments" ] @@ -777,6 +783,12 @@ class CreateParamsCapabilitiesP24Payments(TypedDict): 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 CreateParamsCapabilitiesPayByBankPayments(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 CreateParamsCapabilitiesPaycoPayments(TypedDict): requested: NotRequired[bool] """ @@ -925,6 +937,12 @@ class CreateParamsCompany(TypedDict): """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ + directorship_declaration: NotRequired[ + "AccountService.CreateParamsCompanyDirectorshipDeclaration" + ] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. @@ -959,6 +977,9 @@ class CreateParamsCompany(TypedDict): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ + ownership_exemption_reason: NotRequired[ + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" + ] phone: NotRequired[str] """ The company's phone number (used for verification). @@ -1078,6 +1099,20 @@ class CreateParamsCompanyAddressKanji(TypedDict): Town or cho-me. """ + class CreateParamsCompanyDirectorshipDeclaration(TypedDict): + date: NotRequired[int] + """ + The Unix timestamp marking when the directorship declaration attestation was made. + """ + ip: NotRequired[str] + """ + The IP address from which the directorship declaration attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the directorship declaration attestation was made. + """ + class CreateParamsCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ @@ -1191,6 +1226,12 @@ class CreateParamsDocuments(TypedDict): """ One or more documents showing the company's proof of registration with the national business registry. """ + proof_of_ultimate_beneficial_ownership: NotRequired[ + "AccountService.CreateParamsDocumentsProofOfUltimateBeneficialOwnership" + ] + """ + One or more documents that demonstrate proof of ultimate beneficial ownership. + """ class CreateParamsDocumentsBankAccountOwnershipVerification(TypedDict): files: NotRequired[List[str]] @@ -1234,6 +1275,12 @@ class CreateParamsDocumentsProofOfRegistration(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class CreateParamsDocumentsProofOfUltimateBeneficialOwnership(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + class CreateParamsGroups(TypedDict): payments_pricing: NotRequired["Literal['']|str"] """ @@ -2226,6 +2273,12 @@ class UpdateParamsCapabilities(TypedDict): """ The p24_payments capability. """ + pay_by_bank_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesPayByBankPayments" + ] + """ + The pay_by_bank_payments capability. + """ payco_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesPaycoPayments" ] @@ -2545,6 +2598,12 @@ class UpdateParamsCapabilitiesP24Payments(TypedDict): 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 UpdateParamsCapabilitiesPayByBankPayments(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 UpdateParamsCapabilitiesPaycoPayments(TypedDict): requested: NotRequired[bool] """ @@ -2693,6 +2752,12 @@ class UpdateParamsCompany(TypedDict): """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ + directorship_declaration: NotRequired[ + "AccountService.UpdateParamsCompanyDirectorshipDeclaration" + ] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. @@ -2727,6 +2792,9 @@ class UpdateParamsCompany(TypedDict): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ + ownership_exemption_reason: NotRequired[ + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" + ] phone: NotRequired[str] """ The company's phone number (used for verification). @@ -2846,6 +2914,20 @@ class UpdateParamsCompanyAddressKanji(TypedDict): Town or cho-me. """ + class UpdateParamsCompanyDirectorshipDeclaration(TypedDict): + date: NotRequired[int] + """ + The Unix timestamp marking when the directorship declaration attestation was made. + """ + ip: NotRequired[str] + """ + The IP address from which the directorship declaration attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the directorship declaration attestation was made. + """ + class UpdateParamsCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ @@ -2921,6 +3003,12 @@ class UpdateParamsDocuments(TypedDict): """ One or more documents showing the company's proof of registration with the national business registry. """ + proof_of_ultimate_beneficial_ownership: NotRequired[ + "AccountService.UpdateParamsDocumentsProofOfUltimateBeneficialOwnership" + ] + """ + One or more documents that demonstrate proof of ultimate beneficial ownership. + """ class UpdateParamsDocumentsBankAccountOwnershipVerification(TypedDict): files: NotRequired[List[str]] @@ -2964,6 +3052,12 @@ class UpdateParamsDocumentsProofOfRegistration(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class UpdateParamsDocumentsProofOfUltimateBeneficialOwnership(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + class UpdateParamsGroups(TypedDict): payments_pricing: NotRequired["Literal['']|str"] """ diff --git a/stripe/_account_session.py b/stripe/_account_session.py index abf90e204..cd416a24d 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -98,6 +98,102 @@ class Features(StripeObject): features: Features _inner_class_types = {"features": Features} + class FinancialAccount(StripeObject): + class Features(StripeObject): + disable_stripe_user_authentication: bool + """ + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + """ + external_account_collection: bool + """ + Whether to allow external accounts to be linked for money transfer. + """ + send_money: bool + """ + Whether to allow sending money. + """ + transfer_balance: bool + """ + Whether to allow transferring balance. + """ + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + + class FinancialAccountTransactions(StripeObject): + class Features(StripeObject): + card_spend_dispute_management: bool + """ + Whether to allow card spend dispute management features. + """ + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + + class IssuingCard(StripeObject): + class Features(StripeObject): + card_management: bool + """ + Whether to allow card management features. + """ + card_spend_dispute_management: bool + """ + Whether to allow card spend dispute management features. + """ + cardholder_management: bool + """ + Whether to allow cardholder management features. + """ + spend_control_management: bool + """ + Whether to allow spend control management features. + """ + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + + class IssuingCardsList(StripeObject): + class Features(StripeObject): + card_management: bool + """ + Whether to allow card management features. + """ + card_spend_dispute_management: bool + """ + Whether to allow card spend dispute management features. + """ + cardholder_management: bool + """ + Whether to allow cardholder management features. + """ + disable_stripe_user_authentication: bool + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + """ + spend_control_management: bool + """ + Whether to allow spend control management features. + """ + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + class NotificationBanner(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool @@ -235,6 +331,10 @@ class Features(StripeObject): account_onboarding: AccountOnboarding balances: Balances documents: Documents + financial_account: FinancialAccount + financial_account_transactions: FinancialAccountTransactions + issuing_card: IssuingCard + issuing_cards_list: IssuingCardsList notification_banner: NotificationBanner payment_details: PaymentDetails payments: Payments @@ -247,6 +347,10 @@ class Features(StripeObject): "account_onboarding": AccountOnboarding, "balances": Balances, "documents": Documents, + "financial_account": FinancialAccount, + "financial_account_transactions": FinancialAccountTransactions, + "issuing_card": IssuingCard, + "issuing_cards_list": IssuingCardsList, "notification_banner": NotificationBanner, "payment_details": PaymentDetails, "payments": Payments, @@ -293,6 +397,30 @@ class CreateParamsComponents(TypedDict): """ Configuration for the documents embedded component. """ + financial_account: NotRequired[ + "AccountSession.CreateParamsComponentsFinancialAccount" + ] + """ + Configuration for the financial account embedded component. + """ + financial_account_transactions: NotRequired[ + "AccountSession.CreateParamsComponentsFinancialAccountTransactions" + ] + """ + Configuration for the financial account transactions embedded component. + """ + issuing_card: NotRequired[ + "AccountSession.CreateParamsComponentsIssuingCard" + ] + """ + Configuration for the issuing card embedded component. + """ + issuing_cards_list: NotRequired[ + "AccountSession.CreateParamsComponentsIssuingCardsList" + ] + """ + Configuration for the issuing cards list embedded component. + """ notification_banner: NotRequired[ "AccountSession.CreateParamsComponentsNotificationBanner" ] @@ -425,6 +553,120 @@ class CreateParamsComponentsDocuments(TypedDict): class CreateParamsComponentsDocumentsFeatures(TypedDict): pass + class CreateParamsComponentsFinancialAccount(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsFinancialAccountFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsFinancialAccountFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + """ + external_account_collection: NotRequired[bool] + """ + Whether to allow external accounts to be linked for money transfer. + """ + send_money: NotRequired[bool] + """ + Whether to allow sending money. + """ + transfer_balance: NotRequired[bool] + """ + Whether to allow transferring balance. + """ + + class CreateParamsComponentsFinancialAccountTransactions(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsFinancialAccountTransactionsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsFinancialAccountTransactionsFeatures( + TypedDict + ): + card_spend_dispute_management: NotRequired[bool] + """ + Whether to allow card spend dispute management features. + """ + + class CreateParamsComponentsIssuingCard(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsIssuingCardFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsIssuingCardFeatures(TypedDict): + card_management: NotRequired[bool] + """ + Whether to allow card management features. + """ + card_spend_dispute_management: NotRequired[bool] + """ + Whether to allow card spend dispute management features. + """ + cardholder_management: NotRequired[bool] + """ + Whether to allow cardholder management features. + """ + spend_control_management: NotRequired[bool] + """ + Whether to allow spend control management features. + """ + + class CreateParamsComponentsIssuingCardsList(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsIssuingCardsListFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsIssuingCardsListFeatures(TypedDict): + card_management: NotRequired[bool] + """ + Whether to allow card management features. + """ + card_spend_dispute_management: NotRequired[bool] + """ + Whether to allow card spend dispute management features. + """ + cardholder_management: NotRequired[bool] + """ + Whether to allow cardholder management features. + """ + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + """ + spend_control_management: NotRequired[bool] + """ + Whether to allow spend control management features. + """ + class CreateParamsComponentsNotificationBanner(TypedDict): enabled: bool """ diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 6304ddad2..9a794d6da 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -47,6 +47,30 @@ class CreateParamsComponents(TypedDict): """ Configuration for the documents embedded component. """ + financial_account: NotRequired[ + "AccountSessionService.CreateParamsComponentsFinancialAccount" + ] + """ + Configuration for the financial account embedded component. + """ + financial_account_transactions: NotRequired[ + "AccountSessionService.CreateParamsComponentsFinancialAccountTransactions" + ] + """ + Configuration for the financial account transactions embedded component. + """ + issuing_card: NotRequired[ + "AccountSessionService.CreateParamsComponentsIssuingCard" + ] + """ + Configuration for the issuing card embedded component. + """ + issuing_cards_list: NotRequired[ + "AccountSessionService.CreateParamsComponentsIssuingCardsList" + ] + """ + Configuration for the issuing cards list embedded component. + """ notification_banner: NotRequired[ "AccountSessionService.CreateParamsComponentsNotificationBanner" ] @@ -183,6 +207,120 @@ class CreateParamsComponentsDocuments(TypedDict): class CreateParamsComponentsDocumentsFeatures(TypedDict): pass + class CreateParamsComponentsFinancialAccount(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsFinancialAccountFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsFinancialAccountFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + """ + external_account_collection: NotRequired[bool] + """ + Whether to allow external accounts to be linked for money transfer. + """ + send_money: NotRequired[bool] + """ + Whether to allow sending money. + """ + transfer_balance: NotRequired[bool] + """ + Whether to allow transferring balance. + """ + + class CreateParamsComponentsFinancialAccountTransactions(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsFinancialAccountTransactionsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsFinancialAccountTransactionsFeatures( + TypedDict + ): + card_spend_dispute_management: NotRequired[bool] + """ + Whether to allow card spend dispute management features. + """ + + class CreateParamsComponentsIssuingCard(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsIssuingCardFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsIssuingCardFeatures(TypedDict): + card_management: NotRequired[bool] + """ + Whether to allow card management features. + """ + card_spend_dispute_management: NotRequired[bool] + """ + Whether to allow card spend dispute management features. + """ + cardholder_management: NotRequired[bool] + """ + Whether to allow cardholder management features. + """ + spend_control_management: NotRequired[bool] + """ + Whether to allow spend control management features. + """ + + class CreateParamsComponentsIssuingCardsList(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsIssuingCardsListFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsIssuingCardsListFeatures(TypedDict): + card_management: NotRequired[bool] + """ + Whether to allow card management features. + """ + card_spend_dispute_management: NotRequired[bool] + """ + Whether to allow card spend dispute management features. + """ + cardholder_management: NotRequired[bool] + """ + Whether to allow cardholder management features. + """ + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + """ + spend_control_management: NotRequired[bool] + """ + Whether to allow spend control management features. + """ + class CreateParamsComponentsNotificationBanner(TypedDict): enabled: bool """ diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 7d2801e63..62acc96e0 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 = "2024-12-18.acacia" + CURRENT = "2025-01-27.acacia" diff --git a/stripe/_charge.py b/stripe/_charge.py index 1d545a563..405366097 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -151,6 +151,12 @@ class Rule(StripeObject): The predicate to evaluate the payment against. """ + advice_code: Optional[ + Literal["confirm_card_data", "do_not_try_again", "try_again_later"] + ] + """ + An enumerated value providing a more detailed explanation on [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines). + """ network_advice_code: Optional[str] """ For charges declined by the network, a 2 digit code which indicates the advice returned by the network on how to proceed with an error. @@ -1532,6 +1538,9 @@ class P24(StripeObject): Przelewy24 rarely provides this information so the attribute is usually empty. """ + class PayByBank(StripeObject): + pass + class Payco(StripeObject): buyer_id: Optional[str] """ @@ -1559,6 +1568,10 @@ class SellerProtection(StripeObject): Indicates whether the transaction is eligible for PayPal's seller protection. """ + country: Optional[str] + """ + Two-letter ISO code representing the buyer's country. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ payer_email: Optional[str] """ Owner's email. Values are provided by PayPal directly @@ -1824,6 +1837,7 @@ class Zip(StripeObject): naver_pay: Optional[NaverPay] oxxo: Optional[Oxxo] p24: Optional[P24] + pay_by_bank: Optional[PayByBank] payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] @@ -1881,6 +1895,7 @@ class Zip(StripeObject): "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "pay_by_bank": PayByBank, "payco": Payco, "paynow": Paynow, "paypal": Paypal, diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 5f5269085..75d231a32 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -1155,6 +1155,9 @@ class P24(StripeObject): The customer's bank, if provided. """ + class PayByBank(StripeObject): + pass + class Payco(StripeObject): pass @@ -1162,6 +1165,10 @@ class Paynow(StripeObject): pass class Paypal(StripeObject): + country: Optional[str] + """ + Two-letter ISO code representing the buyer's country. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ payer_email: Optional[str] """ Owner's email. Values are provided by PayPal directly @@ -1369,6 +1376,7 @@ class Zip(StripeObject): naver_pay: Optional[NaverPay] oxxo: Optional[Oxxo] p24: Optional[P24] + pay_by_bank: Optional[PayByBank] payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] @@ -1412,6 +1420,7 @@ class Zip(StripeObject): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -1466,6 +1475,7 @@ class Zip(StripeObject): "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "pay_by_bank": PayByBank, "payco": Payco, "paynow": Paynow, "paypal": Paypal, @@ -1735,6 +1745,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataPayco" ] @@ -1834,6 +1850,7 @@ class CreateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -2170,6 +2187,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodDataPayco(TypedDict): pass diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 0d298d755..aa3dbb9d2 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -734,7 +734,7 @@ class VoidCreditNoteParams(RequestOptions): """ The link to download the PDF of the credit note. """ - pretax_credit_amounts: Optional[List[PretaxCreditAmount]] + pretax_credit_amounts: List[PretaxCreditAmount] """ The pretax credit amounts (ex: discount, credit grants, etc) for all line items. """ diff --git a/stripe/_credit_note_line_item.py b/stripe/_credit_note_line_item.py index 9b22896f8..29527a814 100644 --- a/stripe/_credit_note_line_item.py +++ b/stripe/_credit_note_line_item.py @@ -128,7 +128,7 @@ class TaxAmount(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - pretax_credit_amounts: Optional[List[PretaxCreditAmount]] + pretax_credit_amounts: List[PretaxCreditAmount] """ The pretax credit amounts (ex: discount, credit grants, etc) for this line item. """ diff --git a/stripe/_customer.py b/stripe/_customer.py index 311be1eef..2def891ce 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -922,6 +922,7 @@ class ListPaymentMethodsParams(RequestOptions): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 6bc307d5b..6129e037c 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -64,6 +64,7 @@ class ListParams(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", diff --git a/stripe/_invoice.py b/stripe/_invoice.py index a15b1a8ab..9a9a918fe 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -351,6 +351,10 @@ class Issuer(StripeObject): """ class LastFinalizationError(StripeObject): + advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines) if they provide one. + """ charge: Optional[str] """ For card errors, the ID of the failed charge. diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 209d363be..ad979bd89 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -89,6 +89,10 @@ class AutomaticPaymentMethods(StripeObject): """ class LastPaymentError(StripeObject): + advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines) if they provide one. + """ charge: Optional[str] """ For card errors, the ID of the failed charge. @@ -2032,6 +2036,9 @@ class P24(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class PayByBank(StripeObject): + pass + class Payco(StripeObject): capture_method: Optional[Literal["manual"]] """ @@ -2332,6 +2339,7 @@ class Zip(StripeObject): naver_pay: Optional[NaverPay] oxxo: Optional[Oxxo] p24: Optional[P24] + pay_by_bank: Optional[PayByBank] payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] @@ -2378,6 +2386,7 @@ class Zip(StripeObject): "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "pay_by_bank": PayByBank, "payco": Payco, "paynow": Paynow, "paypal": Paypal, @@ -2862,6 +2871,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -2955,6 +2970,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -3291,6 +3307,9 @@ class ConfirmParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ConfirmParamsPaymentMethodDataPayByBank(TypedDict): + pass + class ConfirmParamsPaymentMethodDataPayco(TypedDict): pass @@ -3551,6 +3570,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ payco: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPayco" ] @@ -4600,6 +4625,9 @@ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class ConfirmParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class ConfirmParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -5409,6 +5437,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -5502,6 +5536,7 @@ class CreateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -5838,6 +5873,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodDataPayco(TypedDict): pass @@ -6098,6 +6136,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ payco: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPayco" ] @@ -7147,6 +7191,9 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -7950,6 +7997,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -8043,6 +8096,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -8379,6 +8433,9 @@ class ModifyParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ModifyParamsPaymentMethodDataPayByBank(TypedDict): + pass + class ModifyParamsPaymentMethodDataPayco(TypedDict): pass @@ -8639,6 +8696,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ payco: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsPayco" ] @@ -9688,6 +9751,9 @@ class ModifyParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class ModifyParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class ModifyParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 1a832f8bb..014a558df 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -417,6 +417,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataPayco" ] @@ -518,6 +524,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -856,6 +863,9 @@ class ConfirmParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ConfirmParamsPaymentMethodDataPayByBank(TypedDict): + pass + class ConfirmParamsPaymentMethodDataPayco(TypedDict): pass @@ -1116,6 +1126,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ payco: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPayco" ] @@ -2165,6 +2181,9 @@ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class ConfirmParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class ConfirmParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -2994,6 +3013,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataPayco" ] @@ -3095,6 +3120,7 @@ class CreateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -3433,6 +3459,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodDataPayco(TypedDict): pass @@ -3693,6 +3722,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ payco: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPayco" ] @@ -4742,6 +4777,9 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -5593,6 +5631,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataPayco" ] @@ -5694,6 +5738,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -6032,6 +6077,9 @@ class UpdateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class UpdateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class UpdateParamsPaymentMethodDataPayco(TypedDict): pass @@ -6292,6 +6340,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ payco: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsPayco" ] @@ -7341,6 +7395,9 @@ class UpdateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class UpdateParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class UpdateParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 3b706d597..354b4c7ba 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -540,6 +540,7 @@ class ShippingAddressCollection(StripeObject): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", @@ -795,6 +796,7 @@ class CreateParams(RequestOptions): "multibanco", "oxxo", "p24", + "pay_by_bank", "paynow", "paypal", "pix", @@ -1420,6 +1422,7 @@ class CreateParamsShippingAddressCollection(TypedDict): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", @@ -1683,11 +1686,19 @@ class ModifyParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', '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). """ + phone_number_collection: NotRequired[ + "PaymentLink.ModifyParamsPhoneNumberCollection" + ] + """ + Controls phone number collection settings during checkout. + + We recommend that you review your privacy policy and check with your legal contacts. + """ restrictions: NotRequired[ "Literal['']|PaymentLink.ModifyParamsRestrictions" ] @@ -2027,6 +2038,12 @@ class ModifyParamsPaymentIntentData(TypedDict): A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ + class ModifyParamsPhoneNumberCollection(TypedDict): + enabled: bool + """ + Set to `true` to enable phone number collection. + """ + class ModifyParamsRestrictions(TypedDict): completed_sessions: ( "PaymentLink.ModifyParamsRestrictionsCompletedSessions" @@ -2228,6 +2245,7 @@ class ModifyParamsShippingAddressCollection(TypedDict): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", @@ -2467,6 +2485,7 @@ class RetrieveParams(RequestOptions): "multibanco", "oxxo", "p24", + "pay_by_bank", "paynow", "paypal", "pix", diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 315c99835..7c4f2d139 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -136,6 +136,7 @@ class CreateParams(TypedDict): "multibanco", "oxxo", "p24", + "pay_by_bank", "paynow", "paypal", "pix", @@ -773,6 +774,7 @@ class CreateParamsShippingAddressCollection(TypedDict): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", @@ -1026,11 +1028,19 @@ class UpdateParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', '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). """ + phone_number_collection: NotRequired[ + "PaymentLinkService.UpdateParamsPhoneNumberCollection" + ] + """ + Controls phone number collection settings during checkout. + + We recommend that you review your privacy policy and check with your legal contacts. + """ restrictions: NotRequired[ "Literal['']|PaymentLinkService.UpdateParamsRestrictions" ] @@ -1378,6 +1388,12 @@ class UpdateParamsPaymentIntentData(TypedDict): A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ + class UpdateParamsPhoneNumberCollection(TypedDict): + enabled: bool + """ + Set to `true` to enable phone number collection. + """ + class UpdateParamsRestrictions(TypedDict): completed_sessions: ( "PaymentLinkService.UpdateParamsRestrictionsCompletedSessions" @@ -1579,6 +1595,7 @@ class UpdateParamsShippingAddressCollection(TypedDict): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index f78c1fae1..4afbd6015 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -1110,6 +1110,9 @@ class P24(StripeObject): The customer's bank, if provided. """ + class PayByBank(StripeObject): + pass + class Payco(StripeObject): pass @@ -1117,6 +1120,10 @@ class Paynow(StripeObject): pass class Paypal(StripeObject): + country: Optional[str] + """ + Two-letter ISO code representing the buyer's country. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ payer_email: Optional[str] """ Owner's email. Values are provided by PayPal directly @@ -1451,6 +1458,10 @@ class CreateParams(RequestOptions): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired["PaymentMethod.CreateParamsPayByBank"] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["PaymentMethod.CreateParamsPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -1534,6 +1545,7 @@ class CreateParams(RequestOptions): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -1899,6 +1911,9 @@ class CreateParamsP24(TypedDict): The customer's bank. """ + class CreateParamsPayByBank(TypedDict): + pass + class CreateParamsPayco(TypedDict): pass @@ -2030,6 +2045,7 @@ class ListParams(RequestOptions): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -2083,6 +2099,10 @@ class ModifyParams(RequestOptions): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + pay_by_bank: NotRequired["PaymentMethod.ModifyParamsPayByBank"] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ us_bank_account: NotRequired["PaymentMethod.ModifyParamsUsBankAccount"] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. @@ -2165,6 +2185,9 @@ class ModifyParamsNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class ModifyParamsPayByBank(TypedDict): + pass + class ModifyParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -2241,6 +2264,7 @@ class RetrieveParams(RequestOptions): """ oxxo: Optional[Oxxo] p24: Optional[P24] + pay_by_bank: Optional[PayByBank] payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] @@ -2288,6 +2312,7 @@ class RetrieveParams(RequestOptions): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -2799,6 +2824,7 @@ async def retrieve_async( "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "pay_by_bank": PayByBank, "payco": Payco, "paynow": Paynow, "paypal": Paypal, diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 4630c094e..d17f00313 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -697,6 +697,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class PayByBank(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 Paynow(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -1102,6 +1124,12 @@ class CreateParams(RequestOptions): """ Configuration's parent configuration. Specify to create a child configuration. """ + pay_by_bank: NotRequired[ + "PaymentMethodConfiguration.CreateParamsPayByBank" + ] + """ + Pay by bank is a redirect payment method backed by bank transfers. A customer is redirected to their bank to authorize a bank transfer for a given amount. This removes a lot of the error risks inherent in waiting for the customer to initiate a transfer themselves, and is less expensive than card payments. + """ paynow: NotRequired["PaymentMethodConfiguration.CreateParamsPaynow"] """ PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. Check this [page](https://stripe.com/docs/payments/paynow) for more details. @@ -1591,6 +1619,20 @@ class CreateParamsP24DisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsPayByBank(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsPayByBankDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsPayByBankDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsPaynow(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsPaynowDisplayPreference" @@ -1930,6 +1972,12 @@ class ModifyParams(RequestOptions): """ Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. Check this [page](https://stripe.com/docs/payments/p24) for more details. """ + pay_by_bank: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsPayByBank" + ] + """ + Pay by bank is a redirect payment method backed by bank transfers. A customer is redirected to their bank to authorize a bank transfer for a given amount. This removes a lot of the error risks inherent in waiting for the customer to initiate a transfer themselves, and is less expensive than card payments. + """ paynow: NotRequired["PaymentMethodConfiguration.ModifyParamsPaynow"] """ PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. Check this [page](https://stripe.com/docs/payments/paynow) for more details. @@ -2419,6 +2467,20 @@ class ModifyParamsP24DisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsPayByBank(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsPayByBankDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsPayByBankDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsPaynow(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsPaynowDisplayPreference" @@ -2641,6 +2703,7 @@ class RetrieveParams(RequestOptions): """ For child configs, the configuration's parent configuration. """ + pay_by_bank: Optional[PayByBank] paynow: Optional[Paynow] paypal: Optional[Paypal] promptpay: Optional[Promptpay] @@ -2820,6 +2883,7 @@ async def retrieve_async( "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, + "pay_by_bank": PayByBank, "paynow": Paynow, "paypal": Paypal, "promptpay": Promptpay, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index e0138a5ef..2b5d9c2c9 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -191,6 +191,12 @@ class CreateParams(TypedDict): """ Configuration's parent configuration. Specify to create a child configuration. """ + pay_by_bank: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsPayByBank" + ] + """ + Pay by bank is a redirect payment method backed by bank transfers. A customer is redirected to their bank to authorize a bank transfer for a given amount. This removes a lot of the error risks inherent in waiting for the customer to initiate a transfer themselves, and is less expensive than card payments. + """ paynow: NotRequired[ "PaymentMethodConfigurationService.CreateParamsPaynow" ] @@ -690,6 +696,20 @@ class CreateParamsP24DisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsPayByBank(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsPayByBankDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsPayByBankDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsPaynow(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsPaynowDisplayPreference" @@ -1053,6 +1073,12 @@ class UpdateParams(TypedDict): """ Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. Check this [page](https://stripe.com/docs/payments/p24) for more details. """ + pay_by_bank: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsPayByBank" + ] + """ + Pay by bank is a redirect payment method backed by bank transfers. A customer is redirected to their bank to authorize a bank transfer for a given amount. This removes a lot of the error risks inherent in waiting for the customer to initiate a transfer themselves, and is less expensive than card payments. + """ paynow: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsPaynow" ] @@ -1552,6 +1578,20 @@ class UpdateParamsP24DisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsPayByBank(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsPayByBankDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsPayByBankDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsPaynow(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsPaynowDisplayPreference" diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 741d1437b..e4ff4d04f 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -173,6 +173,10 @@ class CreateParams(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired["PaymentMethodService.CreateParamsPayByBank"] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["PaymentMethodService.CreateParamsPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -258,6 +262,7 @@ class CreateParams(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -625,6 +630,9 @@ class CreateParamsP24(TypedDict): The customer's bank. """ + class CreateParamsPayByBank(TypedDict): + pass + class CreateParamsPayco(TypedDict): pass @@ -756,6 +764,7 @@ class ListParams(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -815,6 +824,10 @@ class UpdateParams(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + pay_by_bank: NotRequired["PaymentMethodService.UpdateParamsPayByBank"] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ us_bank_account: NotRequired[ "PaymentMethodService.UpdateParamsUsBankAccount" ] @@ -899,6 +912,9 @@ class UpdateParamsNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class UpdateParamsPayByBank(TypedDict): + pass + class UpdateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 5f7a6e6d2..b3b375235 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -435,6 +435,10 @@ class UsBankAccount(StripeObject): } class SetupError(StripeObject): + advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines) if they provide one. + """ charge: Optional[str] """ For card errors, the ID of the failed charge. diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 8abbaccd7..35b324650 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -74,6 +74,10 @@ class AutomaticPaymentMethods(StripeObject): """ class LastSetupError(StripeObject): + advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines) if they provide one. + """ charge: Optional[str] """ For card errors, the ID of the failed charge. @@ -920,6 +924,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -1007,6 +1017,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -1341,6 +1352,9 @@ class ConfirmParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ConfirmParamsPaymentMethodDataPayByBank(TypedDict): + pass + class ConfirmParamsPaymentMethodDataPayco(TypedDict): pass @@ -2120,6 +2134,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["SetupIntent.CreateParamsPaymentMethodDataPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -2207,6 +2227,7 @@ class CreateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -2541,6 +2562,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodDataPayco(TypedDict): pass @@ -3287,6 +3311,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -3374,6 +3404,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -3708,6 +3739,9 @@ class ModifyParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ModifyParamsPaymentMethodDataPayByBank(TypedDict): + pass + class ModifyParamsPaymentMethodDataPayco(TypedDict): pass diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 4423e44b1..01b7cf10e 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -298,6 +298,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataPayco" ] @@ -399,6 +405,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -737,6 +744,9 @@ class ConfirmParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ConfirmParamsPaymentMethodDataPayByBank(TypedDict): + pass + class ConfirmParamsPaymentMethodDataPayco(TypedDict): pass @@ -1540,6 +1550,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataPayco" ] @@ -1639,6 +1655,7 @@ class CreateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -1975,6 +1992,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodDataPayco(TypedDict): pass @@ -2755,6 +2775,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataPayco" ] @@ -2854,6 +2880,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -3190,6 +3217,9 @@ class UpdateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class UpdateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class UpdateParamsPaymentMethodDataPayco(TypedDict): pass diff --git a/stripe/_token.py b/stripe/_token.py index 4e8e7ba7a..b537576cf 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -117,6 +117,12 @@ class CreateParamsAccountCompany(TypedDict): """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ + directorship_declaration: NotRequired[ + "Token.CreateParamsAccountCompanyDirectorshipDeclaration" + ] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. @@ -155,6 +161,9 @@ class CreateParamsAccountCompany(TypedDict): """ Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct. """ + ownership_exemption_reason: NotRequired[ + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" + ] phone: NotRequired[str] """ The company's phone number (used for verification). @@ -274,6 +283,20 @@ class CreateParamsAccountCompanyAddressKanji(TypedDict): Town or cho-me. """ + class CreateParamsAccountCompanyDirectorshipDeclaration(TypedDict): + date: NotRequired[int] + """ + The Unix timestamp marking when the directorship declaration attestation was made. + """ + ip: NotRequired[str] + """ + The IP address from which the directorship declaration attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the directorship declaration attestation was made. + """ + class CreateParamsAccountCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 2dd639f21..444e77605 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -84,6 +84,12 @@ class CreateParamsAccountCompany(TypedDict): """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ + directorship_declaration: NotRequired[ + "TokenService.CreateParamsAccountCompanyDirectorshipDeclaration" + ] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. @@ -122,6 +128,9 @@ class CreateParamsAccountCompany(TypedDict): """ Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct. """ + ownership_exemption_reason: NotRequired[ + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" + ] phone: NotRequired[str] """ The company's phone number (used for verification). @@ -241,6 +250,20 @@ class CreateParamsAccountCompanyAddressKanji(TypedDict): Town or cho-me. """ + class CreateParamsAccountCompanyDirectorshipDeclaration(TypedDict): + date: NotRequired[int] + """ + The Unix timestamp marking when the directorship declaration attestation was made. + """ + ip: NotRequired[str] + """ + The IP address from which the directorship declaration attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the directorship declaration attestation was made. + """ + class CreateParamsAccountCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 91da9ae10..0f9767879 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -138,6 +138,7 @@ class CreateParams(RequestOptions): "2024-10-28.acacia", "2024-11-20.acacia", "2024-12-18.acacia", + "2025-01-27.acacia", ] ] """ diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 5df1e51fe..dafe99043 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -119,6 +119,7 @@ class CreateParams(TypedDict): "2024-10-28.acacia", "2024-11-20.acacia", "2024-12-18.acacia", + "2025-01-27.acacia", ] ] """ diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index d5470243c..42beb6605 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -308,7 +308,7 @@ class CreateParamsFeaturesSubscriptionCancel(TypedDict): Literal["always_invoice", "create_prorations", "none"] ] """ - Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. + Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. Passing `always_invoice` will result in an error. No prorations are generated when canceling a subscription at the end of its natural billing period. """ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): @@ -546,7 +546,7 @@ class ModifyParamsFeaturesSubscriptionCancel(TypedDict): Literal["always_invoice", "create_prorations", "none"] ] """ - Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. + Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. Passing `always_invoice` will result in an error. No prorations are generated when canceling a subscription at the end of its natural billing period. """ class ModifyParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): diff --git a/stripe/billing_portal/_configuration_service.py b/stripe/billing_portal/_configuration_service.py index ae3a1e47c..2bf54fa64 100644 --- a/stripe/billing_portal/_configuration_service.py +++ b/stripe/billing_portal/_configuration_service.py @@ -127,7 +127,7 @@ class CreateParamsFeaturesSubscriptionCancel(TypedDict): Literal["always_invoice", "create_prorations", "none"] ] """ - Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. + Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. Passing `always_invoice` will result in an error. No prorations are generated when canceling a subscription at the end of its natural billing period. """ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): @@ -371,7 +371,7 @@ class UpdateParamsFeaturesSubscriptionCancel(TypedDict): Literal["always_invoice", "create_prorations", "none"] ] """ - Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. + Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. Passing `always_invoice` will result in an error. No prorations are generated when canceling a subscription at the end of its natural billing period. """ class UpdateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index fe9bb5917..48fa495cc 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -19,12 +19,14 @@ if TYPE_CHECKING: from stripe._account import Account + from stripe._coupon import Coupon from stripe._customer import Customer from stripe._discount import Discount as DiscountResource from stripe._invoice import Invoice from stripe._line_item import LineItem from stripe._payment_intent import PaymentIntent from stripe._payment_link import PaymentLink + from stripe._promotion_code import PromotionCode from stripe._setup_intent import SetupIntent from stripe._shipping_rate import ShippingRate from stripe._subscription import Subscription @@ -481,6 +483,16 @@ class TaxId(StripeObject): """ _inner_class_types = {"address": Address, "tax_ids": TaxId} + class Discount(StripeObject): + coupon: Optional[ExpandableField["Coupon"]] + """ + Coupon attached to the Checkout Session. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + Promotion code attached to the Checkout Session. + """ + class InvoiceCreation(StripeObject): class InvoiceData(StripeObject): class CustomField(StripeObject): @@ -1488,6 +1500,7 @@ class ShippingAddressCollection(StripeObject): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", @@ -1545,7 +1558,7 @@ class ShippingAddressCollection(StripeObject): ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for - shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SY, UM, VI`. """ class ShippingCost(StripeObject): @@ -1985,6 +1998,7 @@ class CreateParams(RequestOptions): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -2785,6 +2799,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the P24 payment method options. """ + pay_by_bank: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsPayByBank" + ] + """ + contains details about the Pay By Bank payment method options. + """ payco: NotRequired["Session.CreateParamsPaymentMethodOptionsPayco"] """ contains details about the PAYCO payment method options. @@ -3357,6 +3377,9 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired[Literal["manual"]] """ @@ -3567,6 +3590,8 @@ class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ Set to `true` to enable phone number collection. + + Can only be set in `payment` and `subscription` mode. """ class CreateParamsSavedPaymentMethodOptions(TypedDict): @@ -3782,6 +3807,7 @@ class CreateParamsShippingAddressCollection(TypedDict): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", @@ -4276,6 +4302,10 @@ class RetrieveParams(RequestOptions): on file. To access information about the customer once the payment flow is complete, use the `customer` attribute. """ + discounts: Optional[List[Discount]] + """ + List of coupons and promotion codes attached to the Checkout Session. + """ expires_at: int """ The timestamp at which the Checkout Session will expire. @@ -4835,6 +4865,7 @@ async def retrieve_async( "custom_fields": CustomField, "custom_text": CustomText, "customer_details": CustomerDetails, + "discounts": Discount, "invoice_creation": InvoiceCreation, "payment_method_configuration_details": PaymentMethodConfigurationDetails, "payment_method_options": PaymentMethodOptions, diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 754d44fd7..8ce6c0c8d 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -257,6 +257,7 @@ class CreateParams(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -1097,6 +1098,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the P24 payment method options. """ + pay_by_bank: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsPayByBank" + ] + """ + contains details about the Pay By Bank payment method options. + """ payco: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsPayco" ] @@ -1679,6 +1686,9 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired[Literal["manual"]] """ @@ -1889,6 +1899,8 @@ class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ Set to `true` to enable phone number collection. + + Can only be set in `payment` and `subscription` mode. """ class CreateParamsSavedPaymentMethodOptions(TypedDict): @@ -2104,6 +2116,7 @@ class CreateParamsShippingAddressCollection(TypedDict): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", diff --git a/stripe/financial_connections/_transaction.py b/stripe/financial_connections/_transaction.py index 1874a2b52..47188a1cb 100644 --- a/stripe/financial_connections/_transaction.py +++ b/stripe/financial_connections/_transaction.py @@ -30,7 +30,7 @@ class StatusTransitions(StripeObject): class ListParams(RequestOptions): account: str """ - The ID of the Stripe account whose transactions will be retrieved. + The ID of the Financial Connections Account whose transactions will be retrieved. """ ending_before: NotRequired[str] """ diff --git a/stripe/financial_connections/_transaction_service.py b/stripe/financial_connections/_transaction_service.py index 66683ae29..7835aa09f 100644 --- a/stripe/financial_connections/_transaction_service.py +++ b/stripe/financial_connections/_transaction_service.py @@ -13,7 +13,7 @@ class TransactionService(StripeService): class ListParams(TypedDict): account: str """ - The ID of the Stripe account whose transactions will be retrieved. + The ID of the Financial Connections Account whose transactions will be retrieved. """ ending_before: NotRequired[str] """ diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index 9982e73d4..c04039e2b 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -177,6 +177,20 @@ class Hkd(StripeObject): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class Jpy(StripeObject): + fixed_amounts: Optional[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: Optional[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: Optional[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class Myr(StripeObject): fixed_amounts: Optional[List[int]] """ @@ -283,6 +297,7 @@ class Usd(StripeObject): eur: Optional[Eur] gbp: Optional[Gbp] hkd: Optional[Hkd] + jpy: Optional[Jpy] myr: Optional[Myr] nok: Optional[Nok] nzd: Optional[Nzd] @@ -299,6 +314,7 @@ class Usd(StripeObject): "eur": Eur, "gbp": Gbp, "hkd": Hkd, + "jpy": Jpy, "myr": Myr, "nok": Nok, "nzd": Nzd, @@ -409,6 +425,10 @@ class CreateParamsTipping(TypedDict): """ Tipping configuration for HKD """ + jpy: NotRequired["Configuration.CreateParamsTippingJpy"] + """ + Tipping configuration for JPY + """ myr: NotRequired["Configuration.CreateParamsTippingMyr"] """ Tipping configuration for MYR @@ -550,6 +570,20 @@ class CreateParamsTippingHkd(TypedDict): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class CreateParamsTippingJpy(TypedDict): + fixed_amounts: NotRequired[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: NotRequired[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: NotRequired[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class CreateParamsTippingMyr(TypedDict): fixed_amounts: NotRequired[List[int]] """ @@ -782,6 +816,10 @@ class ModifyParamsTipping(TypedDict): """ Tipping configuration for HKD """ + jpy: NotRequired["Configuration.ModifyParamsTippingJpy"] + """ + Tipping configuration for JPY + """ myr: NotRequired["Configuration.ModifyParamsTippingMyr"] """ Tipping configuration for MYR @@ -923,6 +961,20 @@ class ModifyParamsTippingHkd(TypedDict): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class ModifyParamsTippingJpy(TypedDict): + fixed_amounts: NotRequired[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: NotRequired[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: NotRequired[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class ModifyParamsTippingMyr(TypedDict): fixed_amounts: NotRequired[List[int]] """ diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index ab58a57db..0966627c6 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -115,6 +115,10 @@ class CreateParamsTipping(TypedDict): """ Tipping configuration for HKD """ + jpy: NotRequired["ConfigurationService.CreateParamsTippingJpy"] + """ + Tipping configuration for JPY + """ myr: NotRequired["ConfigurationService.CreateParamsTippingMyr"] """ Tipping configuration for MYR @@ -256,6 +260,20 @@ class CreateParamsTippingHkd(TypedDict): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class CreateParamsTippingJpy(TypedDict): + fixed_amounts: NotRequired[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: NotRequired[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: NotRequired[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class CreateParamsTippingMyr(TypedDict): fixed_amounts: NotRequired[List[int]] """ @@ -498,6 +516,10 @@ class UpdateParamsTipping(TypedDict): """ Tipping configuration for HKD """ + jpy: NotRequired["ConfigurationService.UpdateParamsTippingJpy"] + """ + Tipping configuration for JPY + """ myr: NotRequired["ConfigurationService.UpdateParamsTippingMyr"] """ Tipping configuration for MYR @@ -639,6 +661,20 @@ class UpdateParamsTippingHkd(TypedDict): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class UpdateParamsTippingJpy(TypedDict): + fixed_amounts: NotRequired[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: NotRequired[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: NotRequired[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class UpdateParamsTippingMyr(TypedDict): fixed_amounts: NotRequired[List[int]] """ diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index d9eceea8e..662bf100c 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -229,6 +229,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataPayco" ] @@ -330,6 +336,7 @@ class CreateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -668,6 +675,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodDataPayco(TypedDict): pass diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index f4ba9cc49..687590976 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -112,6 +112,32 @@ class Closed(StripeObject): """ _inner_class_types = {"closed": Closed} + class CloseParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + forwarding_settings: NotRequired[ + "FinancialAccount.CloseParamsForwardingSettings" + ] + """ + A different bank account where funds can be deposited/debited in order to get the closing FA's balance to $0 + """ + + class CloseParamsForwardingSettings(TypedDict): + financial_account: NotRequired[str] + """ + The financial_account id + """ + payment_method: NotRequired[str] + """ + The payment_method or bank account id. This needs to be a verified bank account. + """ + type: Literal["financial_account", "payment_method"] + """ + The type of the bank account provided. This can be either "financial_account" or "payment_method" + """ + class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -125,6 +151,10 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + nickname: NotRequired["Literal['']|str"] + """ + The nickname for the FinancialAccount. + """ platform_restrictions: NotRequired[ "FinancialAccount.CreateParamsPlatformRestrictions" ] @@ -337,10 +367,20 @@ class ModifyParams(RequestOptions): """ Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. Stripe or the platform may control features via the requested field. """ + forwarding_settings: NotRequired[ + "FinancialAccount.ModifyParamsForwardingSettings" + ] + """ + A different bank account where funds can be deposited/debited in order to get the closing FA's balance to $0 + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + nickname: NotRequired["Literal['']|str"] + """ + The nickname for the FinancialAccount. + """ platform_restrictions: NotRequired[ "FinancialAccount.ModifyParamsPlatformRestrictions" ] @@ -490,6 +530,20 @@ class ModifyParamsFeaturesOutboundTransfersUsDomesticWire(TypedDict): Whether the FinancialAccount should have the Feature. """ + class ModifyParamsForwardingSettings(TypedDict): + financial_account: NotRequired[str] + """ + The financial_account id + """ + payment_method: NotRequired[str] + """ + The payment_method or bank account id. This needs to be a verified bank account. + """ + type: Literal["financial_account", "payment_method"] + """ + The type of the bank account provided. This can be either "financial_account" or "payment_method" + """ + class ModifyParamsPlatformRestrictions(TypedDict): inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ @@ -703,6 +757,7 @@ class UpdateFeaturesParamsOutboundTransfersUsDomesticWire(TypedDict): """ Unique identifier for the object. """ + 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. @@ -711,6 +766,10 @@ class UpdateFeaturesParamsOutboundTransfersUsDomesticWire(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ + nickname: Optional[str] + """ + The nickname for the FinancialAccount. + """ object: Literal["treasury.financial_account"] """ String representing the object's type. Objects of the same type share the same value. @@ -769,6 +828,122 @@ class UpdateFeaturesParamsOutboundTransfersUsDomesticWire(TypedDict): The currencies the FinancialAccount can hold a balance in. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. """ + @classmethod + def _cls_close( + cls, + financial_account: str, + **params: Unpack["FinancialAccount.CloseParams"], + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + return cast( + "FinancialAccount", + cls._static_request( + "post", + "/v1/treasury/financial_accounts/{financial_account}/close".format( + financial_account=sanitize_id(financial_account) + ), + params=params, + ), + ) + + @overload + @staticmethod + def close( + financial_account: str, + **params: Unpack["FinancialAccount.CloseParams"], + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + ... + + @overload + def close( + self, **params: Unpack["FinancialAccount.CloseParams"] + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + ... + + @class_method_variant("_cls_close") + def close( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["FinancialAccount.CloseParams"] + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + return cast( + "FinancialAccount", + self._request( + "post", + "/v1/treasury/financial_accounts/{financial_account}/close".format( + financial_account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_close_async( + cls, + financial_account: str, + **params: Unpack["FinancialAccount.CloseParams"], + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + return cast( + "FinancialAccount", + await cls._static_request_async( + "post", + "/v1/treasury/financial_accounts/{financial_account}/close".format( + financial_account=sanitize_id(financial_account) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def close_async( + financial_account: str, + **params: Unpack["FinancialAccount.CloseParams"], + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + ... + + @overload + async def close_async( + self, **params: Unpack["FinancialAccount.CloseParams"] + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + ... + + @class_method_variant("_cls_close_async") + async def close_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["FinancialAccount.CloseParams"] + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + return cast( + "FinancialAccount", + await self._request_async( + "post", + "/v1/treasury/financial_accounts/{financial_account}/close".format( + financial_account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create( cls, **params: Unpack["FinancialAccount.CreateParams"] diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index 87aa3ae03..72d176fce 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -17,6 +17,32 @@ def __init__(self, requestor): super().__init__(requestor) self.features = FinancialAccountFeaturesService(self._requestor) + class CloseParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + forwarding_settings: NotRequired[ + "FinancialAccountService.CloseParamsForwardingSettings" + ] + """ + A different bank account where funds can be deposited/debited in order to get the closing FA's balance to $0 + """ + + class CloseParamsForwardingSettings(TypedDict): + financial_account: NotRequired[str] + """ + The financial_account id + """ + payment_method: NotRequired[str] + """ + The payment_method or bank account id. This needs to be a verified bank account. + """ + type: Literal["financial_account", "payment_method"] + """ + The type of the bank account provided. This can be either "financial_account" or "payment_method" + """ + class CreateParams(TypedDict): expand: NotRequired[List[str]] """ @@ -30,6 +56,10 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + nickname: NotRequired["Literal['']|str"] + """ + The nickname for the FinancialAccount. + """ platform_restrictions: NotRequired[ "FinancialAccountService.CreateParamsPlatformRestrictions" ] @@ -248,10 +278,20 @@ class UpdateParams(TypedDict): """ Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. Stripe or the platform may control features via the requested field. """ + forwarding_settings: NotRequired[ + "FinancialAccountService.UpdateParamsForwardingSettings" + ] + """ + A different bank account where funds can be deposited/debited in order to get the closing FA's balance to $0 + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + nickname: NotRequired["Literal['']|str"] + """ + The nickname for the FinancialAccount. + """ platform_restrictions: NotRequired[ "FinancialAccountService.UpdateParamsPlatformRestrictions" ] @@ -401,6 +441,20 @@ class UpdateParamsFeaturesOutboundTransfersUsDomesticWire(TypedDict): Whether the FinancialAccount should have the Feature. """ + class UpdateParamsForwardingSettings(TypedDict): + financial_account: NotRequired[str] + """ + The financial_account id + """ + payment_method: NotRequired[str] + """ + The payment_method or bank account id. This needs to be a verified bank account. + """ + type: Literal["financial_account", "payment_method"] + """ + The type of the bank account provided. This can be either "financial_account" or "payment_method" + """ + class UpdateParamsPlatformRestrictions(TypedDict): inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ @@ -574,3 +628,47 @@ async def update_async( options=options, ), ) + + def close( + self, + financial_account: str, + params: "FinancialAccountService.CloseParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccount: + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + return cast( + FinancialAccount, + self._request( + "post", + "/v1/treasury/financial_accounts/{financial_account}/close".format( + financial_account=sanitize_id(financial_account), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def close_async( + self, + financial_account: str, + params: "FinancialAccountService.CloseParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccount: + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + return cast( + FinancialAccount, + await self._request_async( + "post", + "/v1/treasury/financial_accounts/{financial_account}/close".format( + financial_account=sanitize_id(financial_account), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index 1cfac43da..3316d23fd 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -78,6 +78,16 @@ class Address(StripeObject): """ _inner_class_types = {"address": Address} + class FinancialAccount(StripeObject): + id: str + """ + Token of the FinancialAccount. + """ + network: Literal["stripe"] + """ + The rails used to send funds. + """ + class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ @@ -113,13 +123,15 @@ class UsBankAccount(StripeObject): """ billing_details: BillingDetails - type: Literal["us_bank_account"] + financial_account: Optional[FinancialAccount] + type: Literal["financial_account", "us_bank_account"] """ The type of the payment method used in the OutboundTransfer. """ us_bank_account: Optional[UsBankAccount] _inner_class_types = { "billing_details": BillingDetails, + "financial_account": FinancialAccount, "us_bank_account": UsBankAccount, } @@ -214,6 +226,12 @@ class CreateParams(RequestOptions): """ The PaymentMethod to use as the payment instrument for the OutboundTransfer. """ + destination_payment_method_data: NotRequired[ + "OutboundTransfer.CreateParamsDestinationPaymentMethodData" + ] + """ + Hash used to generate the PaymentMethod to be used for this OutboundTransfer. Exclusive with `destination_payment_method`. + """ destination_payment_method_options: NotRequired[ "OutboundTransfer.CreateParamsDestinationPaymentMethodOptions" ] @@ -237,6 +255,16 @@ class CreateParams(RequestOptions): Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". """ + class CreateParamsDestinationPaymentMethodData(TypedDict): + financial_account: NotRequired[str] + """ + Required if type is set to `financial_account`. The FinancialAccount ID to send funds to. + """ + type: Literal["financial_account"] + """ + The type of the destination. + """ + class CreateParamsDestinationPaymentMethodOptions(TypedDict): us_bank_account: NotRequired[ "Literal['']|OutboundTransfer.CreateParamsDestinationPaymentMethodOptionsUsBankAccount" diff --git a/stripe/treasury/_outbound_transfer_service.py b/stripe/treasury/_outbound_transfer_service.py index 23f5e2275..12f7d0498 100644 --- a/stripe/treasury/_outbound_transfer_service.py +++ b/stripe/treasury/_outbound_transfer_service.py @@ -33,6 +33,12 @@ class CreateParams(TypedDict): """ The PaymentMethod to use as the payment instrument for the OutboundTransfer. """ + destination_payment_method_data: NotRequired[ + "OutboundTransferService.CreateParamsDestinationPaymentMethodData" + ] + """ + Hash used to generate the PaymentMethod to be used for this OutboundTransfer. Exclusive with `destination_payment_method`. + """ destination_payment_method_options: NotRequired[ "OutboundTransferService.CreateParamsDestinationPaymentMethodOptions" ] @@ -56,6 +62,16 @@ class CreateParams(TypedDict): Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". """ + class CreateParamsDestinationPaymentMethodData(TypedDict): + financial_account: NotRequired[str] + """ + Required if type is set to `financial_account`. The FinancialAccount ID to send funds to. + """ + type: Literal["financial_account"] + """ + The type of the destination. + """ + class CreateParamsDestinationPaymentMethodOptions(TypedDict): us_bank_account: NotRequired[ "Literal['']|OutboundTransferService.CreateParamsDestinationPaymentMethodOptionsUsBankAccount" diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 702c42b91..884199fb6 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -20,6 +20,7 @@ from stripe._payout import Payout from stripe.treasury._credit_reversal import CreditReversal from stripe.treasury._outbound_payment import OutboundPayment + from stripe.treasury._outbound_transfer import OutboundTransfer from stripe.treasury._transaction import Transaction @@ -136,6 +137,14 @@ class SourceFlowDetails(StripeObject): Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) """ + outbound_transfer: Optional["OutboundTransfer"] + """ + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + + Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + + Related guide: [Moving money with Treasury using OutboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) + """ payout: Optional["Payout"] """ A `Payout` object is created when you receive funds from Stripe, or when you @@ -148,7 +157,11 @@ class SourceFlowDetails(StripeObject): Related guide: [Receiving payouts](https://stripe.com/docs/payouts) """ type: Literal[ - "credit_reversal", "other", "outbound_payment", "payout" + "credit_reversal", + "other", + "outbound_payment", + "outbound_transfer", + "payout", ] """ The type of the source flow that originated the ReceivedCredit. @@ -288,7 +301,11 @@ class ListParams(RequestOptions): class ListParamsLinkedFlows(TypedDict): source_flow_type: Literal[ - "credit_reversal", "other", "outbound_payment", "payout" + "credit_reversal", + "other", + "outbound_payment", + "outbound_transfer", + "payout", ] """ The source flow type. diff --git a/stripe/treasury/_received_credit_service.py b/stripe/treasury/_received_credit_service.py index 0644fde0a..c67c6b58d 100644 --- a/stripe/treasury/_received_credit_service.py +++ b/stripe/treasury/_received_credit_service.py @@ -44,7 +44,11 @@ class ListParams(TypedDict): class ListParamsLinkedFlows(TypedDict): source_flow_type: Literal[ - "credit_reversal", "other", "outbound_payment", "payout" + "credit_reversal", + "other", + "outbound_payment", + "outbound_transfer", + "payout", ] """ The source flow type. From dde960d434047fd20a513f21dd21d10bd5b05205 Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Mon, 27 Jan 2025 15:22:11 -0500 Subject: [PATCH 144/179] Bump version to 11.5.0 --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3e6db142..a90edc966 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,38 @@ +## 11.5.0 - 2025-01-27 +* [#1443](https://github.com/stripe/stripe-python/pull/1443) Update generated code + * Add support for `pay_by_bank_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `directorship_declaration` on resource class `stripe.Account.Company` and parameter classes `stripe.Account.CreateParamsCompany` and `stripe.Token.CreateParamsAccountCompany` + * Add support for `ownership_exemption_reason` on resource class `stripe.Account.Company` and parameter classes `stripe.Account.CreateParamsCompany` and `stripe.Token.CreateParamsAccountCompany` + * Add support for `proof_of_ultimate_beneficial_ownership` on parameter class `stripe.Account.CreateParamsDocuments` + * Add support for `financial_account` on resource classes `stripe.AccountSession.Components` and `stripe.treasury.OutboundTransfer.DestinationPaymentMethodDetails` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `issuing_card` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `advice_code` on resource classes `stripe.Charge.Outcome`, `stripe.Invoice.LastFinalizationError`, `stripe.PaymentIntent.LastPaymentError`, `stripe.SetupAttempt.SetupError`, and `stripe.SetupIntent.LastSetupError` + * Add support for `country` on resource classes `stripe.Charge.PaymentMethodDetails.Paypal`, `stripe.ConfirmationToken.PaymentMethodPreview.Paypal`, and `stripe.PaymentMethod.Paypal` + * Add support for `pay_by_bank` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` + * Add support for `phone_number_collection` on parameter class `stripe.PaymentLink.ModifyParams` + * Add support for `discounts` on resource `stripe.checkout.Session` + * Add support for `jpy` on parameter classes `stripe.terminal.Configuration.CreateParamsTipping` and `stripe.terminal.Configuration.ModifyParamsTipping` and resource class `stripe.terminal.Configuration.Tipping` + * Add support for `nickname` on parameter classes `stripe.treasury.FinancialAccount.CreateParams` and `stripe.treasury.FinancialAccount.ModifyParams` and resource `stripe.treasury.FinancialAccount` + * Add support for `forwarding_settings` on parameter class `stripe.treasury.FinancialAccount.ModifyParams` + * Add support for `_cls_close` on resource `stripe.treasury.FinancialAccount` + * Add support for `close` on resource `stripe.treasury.FinancialAccount` + * Add support for `is_default` on resource `stripe.treasury.FinancialAccount` + * Add support for `destination_payment_method_data` on parameter class `stripe.treasury.OutboundTransfer.CreateParams` + * Add support for `outbound_transfer` on resource class `stripe.treasury.ReceivedCredit.LinkedFlows.SourceFlowDetails` + * Add support for `SD` on enums `stripe.checkout.Session.ShippingAddressCollection.allowed_countries`, `stripe.checkout.Session.CreateParamsShippingAddressCollection.allowed_countries`, `stripe.PaymentLink.ShippingAddressCollection.allowed_countries`, `stripe.PaymentLink.CreateParamsShippingAddressCollection.allowed_countries`, and `stripe.PaymentLink.ModifyParamsShippingAddressCollection.allowed_countries` + * Add support for `pay_by_bank` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `financial_account` on enum `stripe.treasury.OutboundTransfer.DestinationPaymentMethodDetails.type` + * Add support for `outbound_transfer` on enums `stripe.treasury.ReceivedCredit.LinkedFlows.SourceFlowDetails.type` and `stripe.treasury.ReceivedCredit.ListParamsLinkedFlows.source_flow_type` + * Add support for `2025-01-27.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` + * Change type of `pretax_credit_amounts` on `stripe.CreditNote` and `stripe.CreditNoteLineItem` from `Optional[List[PretaxCreditAmount]]` to `List[PretaxCreditAmount]` +* [#1448](https://github.com/stripe/stripe-python/pull/1448) Updated upload artifact ci action +* [#1446](https://github.com/stripe/stripe-python/pull/1446) add just to publish CI +* [#1444](https://github.com/stripe/stripe-python/pull/1444) Added CONTRIBUTING.md file +* [#1445](https://github.com/stripe/stripe-python/pull/1445) minor justfile fixes & pin CI version +* [#1440](https://github.com/stripe/stripe-python/pull/1440) add justfile, update readme, remove coveralls +* [#1442](https://github.com/stripe/stripe-python/pull/1442) Fix V2 ListObject.data type hint + - Change `stripe.v2.ListObject.data` type hint from `List[StripeObject]` to `List[T]` where T is the specific stripe object contained within the list + ## 11.4.1 - 2024-12-19 * [#1438](https://github.com/stripe/stripe-python/pull/1438) Fix regression when using httpx HTTP client diff --git a/VERSION b/VERSION index a6e5b12f9..7ef698131 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.4.1 +11.5.0 diff --git a/stripe/_version.py b/stripe/_version.py index eb0cce4d6..322f43c92 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "11.4.1" +VERSION = "11.5.0" From 97258cc63c4bfd1ac42ca43c5dab6d0320713681 Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Mon, 27 Jan 2025 13:13:11 -0800 Subject: [PATCH 145/179] Upgrade to download-artifact@v4 (#1451) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4c73703b..66b649c19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,7 @@ jobs: - uses: extractions/setup-just@v2 - uses: actions/checkout@v3 - name: Download all workflow run artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: dist path: dist From ccd9f6b12c512dad732e79a23387f02108eca551 Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Mon, 27 Jan 2025 13:19:20 -0800 Subject: [PATCH 146/179] Revert "Bump version to 11.5.0" (#1452) This reverts commit dde960d434047fd20a513f21dd21d10bd5b05205. --- CHANGELOG.md | 35 ----------------------------------- VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a90edc966..f3e6db142 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,38 +1,3 @@ -## 11.5.0 - 2025-01-27 -* [#1443](https://github.com/stripe/stripe-python/pull/1443) Update generated code - * Add support for `pay_by_bank_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` - * Add support for `directorship_declaration` on resource class `stripe.Account.Company` and parameter classes `stripe.Account.CreateParamsCompany` and `stripe.Token.CreateParamsAccountCompany` - * Add support for `ownership_exemption_reason` on resource class `stripe.Account.Company` and parameter classes `stripe.Account.CreateParamsCompany` and `stripe.Token.CreateParamsAccountCompany` - * Add support for `proof_of_ultimate_beneficial_ownership` on parameter class `stripe.Account.CreateParamsDocuments` - * Add support for `financial_account` on resource classes `stripe.AccountSession.Components` and `stripe.treasury.OutboundTransfer.DestinationPaymentMethodDetails` and parameter class `stripe.AccountSession.CreateParamsComponents` - * Add support for `issuing_card` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` - * Add support for `advice_code` on resource classes `stripe.Charge.Outcome`, `stripe.Invoice.LastFinalizationError`, `stripe.PaymentIntent.LastPaymentError`, `stripe.SetupAttempt.SetupError`, and `stripe.SetupIntent.LastSetupError` - * Add support for `country` on resource classes `stripe.Charge.PaymentMethodDetails.Paypal`, `stripe.ConfirmationToken.PaymentMethodPreview.Paypal`, and `stripe.PaymentMethod.Paypal` - * Add support for `pay_by_bank` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` - * Add support for `phone_number_collection` on parameter class `stripe.PaymentLink.ModifyParams` - * Add support for `discounts` on resource `stripe.checkout.Session` - * Add support for `jpy` on parameter classes `stripe.terminal.Configuration.CreateParamsTipping` and `stripe.terminal.Configuration.ModifyParamsTipping` and resource class `stripe.terminal.Configuration.Tipping` - * Add support for `nickname` on parameter classes `stripe.treasury.FinancialAccount.CreateParams` and `stripe.treasury.FinancialAccount.ModifyParams` and resource `stripe.treasury.FinancialAccount` - * Add support for `forwarding_settings` on parameter class `stripe.treasury.FinancialAccount.ModifyParams` - * Add support for `_cls_close` on resource `stripe.treasury.FinancialAccount` - * Add support for `close` on resource `stripe.treasury.FinancialAccount` - * Add support for `is_default` on resource `stripe.treasury.FinancialAccount` - * Add support for `destination_payment_method_data` on parameter class `stripe.treasury.OutboundTransfer.CreateParams` - * Add support for `outbound_transfer` on resource class `stripe.treasury.ReceivedCredit.LinkedFlows.SourceFlowDetails` - * Add support for `SD` on enums `stripe.checkout.Session.ShippingAddressCollection.allowed_countries`, `stripe.checkout.Session.CreateParamsShippingAddressCollection.allowed_countries`, `stripe.PaymentLink.ShippingAddressCollection.allowed_countries`, `stripe.PaymentLink.CreateParamsShippingAddressCollection.allowed_countries`, and `stripe.PaymentLink.ModifyParamsShippingAddressCollection.allowed_countries` - * Add support for `pay_by_bank` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` - * Add support for `financial_account` on enum `stripe.treasury.OutboundTransfer.DestinationPaymentMethodDetails.type` - * Add support for `outbound_transfer` on enums `stripe.treasury.ReceivedCredit.LinkedFlows.SourceFlowDetails.type` and `stripe.treasury.ReceivedCredit.ListParamsLinkedFlows.source_flow_type` - * Add support for `2025-01-27.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` - * Change type of `pretax_credit_amounts` on `stripe.CreditNote` and `stripe.CreditNoteLineItem` from `Optional[List[PretaxCreditAmount]]` to `List[PretaxCreditAmount]` -* [#1448](https://github.com/stripe/stripe-python/pull/1448) Updated upload artifact ci action -* [#1446](https://github.com/stripe/stripe-python/pull/1446) add just to publish CI -* [#1444](https://github.com/stripe/stripe-python/pull/1444) Added CONTRIBUTING.md file -* [#1445](https://github.com/stripe/stripe-python/pull/1445) minor justfile fixes & pin CI version -* [#1440](https://github.com/stripe/stripe-python/pull/1440) add justfile, update readme, remove coveralls -* [#1442](https://github.com/stripe/stripe-python/pull/1442) Fix V2 ListObject.data type hint - - Change `stripe.v2.ListObject.data` type hint from `List[StripeObject]` to `List[T]` where T is the specific stripe object contained within the list - ## 11.4.1 - 2024-12-19 * [#1438](https://github.com/stripe/stripe-python/pull/1438) Fix regression when using httpx HTTP client diff --git a/VERSION b/VERSION index 7ef698131..a6e5b12f9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.5.0 +11.4.1 diff --git a/stripe/_version.py b/stripe/_version.py index 322f43c92..eb0cce4d6 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "11.5.0" +VERSION = "11.4.1" From bb80436822d7f503098eb6357565a8dbe23cb59d Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Mon, 27 Jan 2025 16:24:47 -0500 Subject: [PATCH 147/179] Bump version to 11.5.0 --- CHANGELOG.md | 36 ++++++++++++++++++++++++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3e6db142..7d3cc76e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,39 @@ +## 11.5.0 - 2025-01-27 +* [#1443](https://github.com/stripe/stripe-python/pull/1443) Update generated code + * Add support for `pay_by_bank_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `directorship_declaration` on resource class `stripe.Account.Company` and parameter classes `stripe.Account.CreateParamsCompany` and `stripe.Token.CreateParamsAccountCompany` + * Add support for `ownership_exemption_reason` on resource class `stripe.Account.Company` and parameter classes `stripe.Account.CreateParamsCompany` and `stripe.Token.CreateParamsAccountCompany` + * Add support for `proof_of_ultimate_beneficial_ownership` on parameter class `stripe.Account.CreateParamsDocuments` + * Add support for `financial_account` on resource classes `stripe.AccountSession.Components` and `stripe.treasury.OutboundTransfer.DestinationPaymentMethodDetails` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `issuing_card` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `advice_code` on resource classes `stripe.Charge.Outcome`, `stripe.Invoice.LastFinalizationError`, `stripe.PaymentIntent.LastPaymentError`, `stripe.SetupAttempt.SetupError`, and `stripe.SetupIntent.LastSetupError` + * Add support for `country` on resource classes `stripe.Charge.PaymentMethodDetails.Paypal`, `stripe.ConfirmationToken.PaymentMethodPreview.Paypal`, and `stripe.PaymentMethod.Paypal` + * Add support for `pay_by_bank` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` + * Add support for `phone_number_collection` on parameter class `stripe.PaymentLink.ModifyParams` + * Add support for `discounts` on resource `stripe.checkout.Session` + * Add support for `jpy` on parameter classes `stripe.terminal.Configuration.CreateParamsTipping` and `stripe.terminal.Configuration.ModifyParamsTipping` and resource class `stripe.terminal.Configuration.Tipping` + * Add support for `nickname` on parameter classes `stripe.treasury.FinancialAccount.CreateParams` and `stripe.treasury.FinancialAccount.ModifyParams` and resource `stripe.treasury.FinancialAccount` + * Add support for `forwarding_settings` on parameter class `stripe.treasury.FinancialAccount.ModifyParams` + * Add support for `_cls_close` on resource `stripe.treasury.FinancialAccount` + * Add support for `close` on resource `stripe.treasury.FinancialAccount` + * Add support for `is_default` on resource `stripe.treasury.FinancialAccount` + * Add support for `destination_payment_method_data` on parameter class `stripe.treasury.OutboundTransfer.CreateParams` + * Add support for `outbound_transfer` on resource class `stripe.treasury.ReceivedCredit.LinkedFlows.SourceFlowDetails` + * Add support for `SD` on enums `stripe.checkout.Session.ShippingAddressCollection.allowed_countries`, `stripe.checkout.Session.CreateParamsShippingAddressCollection.allowed_countries`, `stripe.PaymentLink.ShippingAddressCollection.allowed_countries`, `stripe.PaymentLink.CreateParamsShippingAddressCollection.allowed_countries`, and `stripe.PaymentLink.ModifyParamsShippingAddressCollection.allowed_countries` + * Add support for `pay_by_bank` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `financial_account` on enum `stripe.treasury.OutboundTransfer.DestinationPaymentMethodDetails.type` + * Add support for `outbound_transfer` on enums `stripe.treasury.ReceivedCredit.LinkedFlows.SourceFlowDetails.type` and `stripe.treasury.ReceivedCredit.ListParamsLinkedFlows.source_flow_type` + * Add support for `2025-01-27.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` + * Change type of `pretax_credit_amounts` on `stripe.CreditNote` and `stripe.CreditNoteLineItem` from `Optional[List[PretaxCreditAmount]]` to `List[PretaxCreditAmount]` +* [#1451](https://github.com/stripe/stripe-python/pull/1451) Upgrade to download-artifact@v4 +* [#1448](https://github.com/stripe/stripe-python/pull/1448) Updated upload artifact ci action +* [#1446](https://github.com/stripe/stripe-python/pull/1446) add just to publish CI +* [#1444](https://github.com/stripe/stripe-python/pull/1444) Added CONTRIBUTING.md file +* [#1445](https://github.com/stripe/stripe-python/pull/1445) minor justfile fixes & pin CI version +* [#1440](https://github.com/stripe/stripe-python/pull/1440) add justfile, update readme, remove coveralls +* [#1442](https://github.com/stripe/stripe-python/pull/1442) Fix V2 ListObject.data type hint + - Change `stripe.v2.ListObject.data` type hint from `List[StripeObject]` to `List[T]` where T is the specific stripe object contained within the list + ## 11.4.1 - 2024-12-19 * [#1438](https://github.com/stripe/stripe-python/pull/1438) Fix regression when using httpx HTTP client diff --git a/VERSION b/VERSION index a6e5b12f9..7ef698131 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.4.1 +11.5.0 diff --git a/stripe/_version.py b/stripe/_version.py index eb0cce4d6..322f43c92 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "11.4.1" +VERSION = "11.5.0" From eac602188247ccb0b8cda637e9fdffa08859e09a Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Wed, 12 Feb 2025 16:19:12 -0800 Subject: [PATCH 148/179] upgrade ruff version (#1456) * upgrade ruff version * remove old comment * update comment --- deps/dev-requirements.txt | 5 ++++- stripe/_ephemeral_key.py | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/deps/dev-requirements.txt b/deps/dev-requirements.txt index cedd76e2b..7cc5b2374 100644 --- a/deps/dev-requirements.txt +++ b/deps/dev-requirements.txt @@ -2,10 +2,13 @@ # version requirements: any modern python version (currently 3.10) # typechecking for all versions +# can't use `>=1.1.339` since it flags override issues, e.g.: +# > Method "_cls_delete" overrides class "DeletableAPIResource" in an incompatible manner Parameter "**params" has no corresponding parameter Pylance(reportIncompatibleMethodOverride) +# can probably fix/ignore these issues and move forward, but we're stuck until then pyright == 1.1.336 # general typechecking mypy == 1.7.0 # formatting -ruff == 0.4.4 +ruff == 0.9.6 # linting flake8 diff --git a/stripe/_ephemeral_key.py b/stripe/_ephemeral_key.py index dca9fd62b..8347402a4 100644 --- a/stripe/_ephemeral_key.py +++ b/stripe/_ephemeral_key.py @@ -147,8 +147,7 @@ async def delete_async( # pyright: ignore[reportGeneralTypeIssues] def create(cls, **params): if params.get("stripe_version") is None: raise ValueError( - "stripe_version must be specified to create an ephemeral " - "key" + "stripe_version must be specified to create an ephemeral key" ) url = cls.class_url() From 4bccdedba25990658252f49f4b542bd96c8a643d Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Wed, 12 Feb 2025 16:49:11 -0800 Subject: [PATCH 149/179] add codeowners file (#1457) --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..8844b15a8 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# All files should be reviewed by a member of the SDKs team +* @stripe/api-library-reviewers From 3b38f6f9ec21eb011719b26a0b1096badba72f44 Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Tue, 18 Feb 2025 09:37:51 -0800 Subject: [PATCH 150/179] Remove incorrect changelog entry about parse_snapshot_event (#1461) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d3cc76e1..8605fb941 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -192,7 +192,6 @@ * Adjusted default values for HTTP requests. You can use the old defaults by setting them explicitly. New values are: - max retries: `0` -> `2` - max timeout (seconds): `2` -> `5` - * Add method `parse_thin_event()` on the `StripeClient` class to parse [thin events](https://docs.corp.stripe.com/event-destinations#events-overview). Rename `construct_event()` method on the same class to `parse_snapshot_event()` to clearly distinguish between the two kinds of events. ### Additions @@ -203,6 +202,7 @@ * Add support for `2024-09-30.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` * Add support for new Usage Billing APIs `stripe.v2.billing.MeterEvent`, `stripe.v2.billing.MeterEventAdjustments`, `stripe.v2.billing.MeterEventSession`, `stripe.v2.billing.MeterEventStream` and the new Events API `stripe.v2.core.Events` under the [v2 namespace ](https://docs.corp.stripe.com/api-v2-overview) * Add method [rawRequest()](https://github.com/stripe/stripe-python/tree/master?tab=readme-ov-file#custom-requests) on the `StripeClient` class that takes a HTTP method type, url and relevant parameters to make requests to the Stripe API that are not yet supported in the SDK. + * Add method `parse_thin_event()` on the `StripeClient` class to parse [thin events](https://docs.corp.stripe.com/event-destinations#events-overview) ### Other changes * Change type of `default_allowed_updates` on `stripe.billing_portal.Configuration.CreateParamsFeaturesSubscriptionUpdate` from `Union[Literal[''], List[Literal['price', 'promotion_code', 'quantity']]]` to `NotRequired[Literal['']|List[Literal['price', 'promotion_code', 'quantity']]]` From 5d2eccc7d9f3c736dbbf26258a9479fa114a3980 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 22:30:16 +0000 Subject: [PATCH 151/179] Update generated code (#1450) * Update generated code for v1463 * Update generated code for v1494 * Update generated code for v1495 * Update generated code for v1501 * Update generated code for v1505 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> --- CONTRIBUTING.md | 25 --- OPENAPI_VERSION | 2 +- stripe/_api_version.py | 2 +- stripe/_balance.py | 36 ++-- stripe/_charge.py | 8 +- stripe/_confirmation_token.py | 8 +- stripe/_credit_note.py | 4 +- stripe/_invoice.py | 4 +- stripe/_line_item.py | 4 +- stripe/_payment_intent.py | 94 +++++++- stripe/_payment_intent_service.py | 66 +++++- stripe/_payment_method.py | 8 +- stripe/_product.py | 4 + stripe/_product_service.py | 4 + stripe/_quote.py | 12 +- stripe/_setup_intent.py | 6 +- stripe/_setup_intent_service.py | 6 +- stripe/_tax_rate.py | 10 +- stripe/_tax_rate_service.py | 4 +- stripe/_webhook_endpoint.py | 1 + stripe/_webhook_endpoint_service.py | 1 + stripe/billing/_credit_balance_summary.py | 16 +- .../_credit_balance_summary_service.py | 16 +- stripe/billing/_credit_grant.py | 37 +++- stripe/billing/_credit_grant_service.py | 22 +- stripe/billing/_meter_event_summary.py | 2 + stripe/checkout/_session.py | 200 +++++++++++++++++- stripe/checkout/_session_service.py | 91 ++++++++ stripe/tax/_calculation.py | 2 +- stripe/tax/_calculation_line_item.py | 2 +- stripe/tax/_transaction.py | 2 +- 31 files changed, 592 insertions(+), 107 deletions(-) delete mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 1615afa65..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Contributing - -We welcome bug reports, feature requests, and code contributions in a pull request. - -For most pull requests, we request that you identify or create an associated issue that has the necessary context. We use these issues to reach agreement on an approach and save the PR author from having to redo work. Fixing typos or documentation issues likely do not need an issue; for any issue that introduces substantial code changes, changes the public interface, or if you aren't sure, please find or [create an issue](https://www.github.com/stripe/stripe-python/issues/new/choose). - -## Contributor License Agreement - -All contributors must sign the Contributor License Agreement (CLA) before we can accept their contribution. If you have not yet signed the agreement, you will be given an option to do so when you open a pull request. You can then sign by clicking on the badge in the comment from @CLAassistant. - -## Generated code - -This project has a combination of manually maintained code and code generated from our private code generator. If your contribution involves changes to generated code, please call this out in the issue or pull request as we will likely need to make a change to our code generator before accepting the contribution. - -To identify files with purely generated code, look for the comment `File generated from our OpenAPI spec.` at the start of the file. Generated blocks of code within hand-written files will be between comments that say `The beginning of the section generated from our OpenAPI spec` and `The end of the section generated from our OpenAPI spec`. - -## Compatibility with supported language and runtime versions - -This project supports [many different langauge and runtime versions](README.md#requirements) and we are unable to accept any contribution that does not work on _all_ supported versions. If, after discussing the approach in the associated issue, your change must use an API / feature that isn't available in all supported versions, please call this out explicitly in the issue or pull request so we can help figure out the best way forward. - -## Set up your dev environment - -Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment. - diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 217ac84ad..ddf5ac544 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1455 \ No newline at end of file +v1505 \ No newline at end of file diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 62acc96e0..5b7c592d6 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2025-01-27.acacia" + CURRENT = "2025-02-24.acacia" diff --git a/stripe/_balance.py b/stripe/_balance.py index ed80ed6ab..dee22403b 100644 --- a/stripe/_balance.py +++ b/stripe/_balance.py @@ -28,15 +28,15 @@ class Available(StripeObject): class SourceTypes(StripeObject): bank_account: Optional[int] """ - Amount for bank account. + Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated). """ card: Optional[int] """ - Amount for card. + 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 for FPX. + Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method. """ amount: int @@ -54,15 +54,15 @@ class ConnectReserved(StripeObject): class SourceTypes(StripeObject): bank_account: Optional[int] """ - Amount for bank account. + Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated). """ card: Optional[int] """ - Amount for card. + 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 for FPX. + Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method. """ amount: int @@ -81,15 +81,15 @@ class NetAvailable(StripeObject): class SourceTypes(StripeObject): bank_account: Optional[int] """ - Amount for bank account. + Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated). """ card: Optional[int] """ - Amount for card. + 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 for FPX. + Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method. """ amount: int @@ -106,15 +106,15 @@ class SourceTypes(StripeObject): class SourceTypes(StripeObject): bank_account: Optional[int] """ - Amount for bank account. + Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated). """ card: Optional[int] """ - Amount for card. + 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 for FPX. + Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method. """ amount: int @@ -140,15 +140,15 @@ class Available(StripeObject): class SourceTypes(StripeObject): bank_account: Optional[int] """ - Amount for bank account. + Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated). """ card: Optional[int] """ - Amount for card. + 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 for FPX. + Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method. """ amount: int @@ -172,15 +172,15 @@ class Pending(StripeObject): class SourceTypes(StripeObject): bank_account: Optional[int] """ - Amount for bank account. + Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated). """ card: Optional[int] """ - Amount for card. + 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 for FPX. + Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method. """ amount: int diff --git a/stripe/_charge.py b/stripe/_charge.py index 405366097..612e1196c 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -836,7 +836,7 @@ class ShippingAddress(StripeObject): """ network_transaction_id: Optional[str] """ - This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. """ overcapture: Optional[Overcapture] regulated_status: Optional[Literal["regulated", "unregulated"]] @@ -998,7 +998,7 @@ class Wallet(StripeObject): """ network_transaction_id: Optional[str] """ - This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. """ offline: Optional[Offline] """ @@ -1321,7 +1321,7 @@ class Receipt(StripeObject): """ network_transaction_id: Optional[str] """ - This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. """ preferred_locales: Optional[List[str]] """ @@ -1853,7 +1853,7 @@ class Zip(StripeObject): twint: Optional[Twint] type: str """ - The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`. + The type of transaction-specific details of the payment method used in the payment. See [PaymentMethod.type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type) for the full list of possible types. An additional hash is included on `payment_method_details` with a name matching this value. It contains information specific to the payment method. """ diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 75d231a32..53ce0d8ef 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -355,7 +355,7 @@ class Wallet(StripeObject): """ network_transaction_id: Optional[str] """ - This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. """ offline: Optional[Offline] """ @@ -418,7 +418,7 @@ class Wallet(StripeObject): class Networks(StripeObject): available: List[str] """ - All available networks for the card. + All networks available for selection via [payment_method_options.card.network](https://stripe.com/api/payment_intents/confirm#confirm_payment_intent-payment_method_options-card-network). """ preferred: Optional[str] """ @@ -710,7 +710,7 @@ class CardPresent(StripeObject): class Networks(StripeObject): available: List[str] """ - All available networks for the card. + All networks available for selection via [payment_method_options.card.network](https://stripe.com/api/payment_intents/confirm#confirm_payment_intent-payment_method_options-card-network). """ preferred: Optional[str] """ @@ -958,7 +958,7 @@ class InteracPresent(StripeObject): class Networks(StripeObject): available: List[str] """ - All available networks for the card. + All networks available for selection via [payment_method_options.card.network](https://stripe.com/api/payment_intents/confirm#confirm_payment_intent-payment_method_options-card-network). """ preferred: Optional[str] """ diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index aa3dbb9d2..79ae44b42 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -84,9 +84,9 @@ class Tax(StripeObject): """ rate: "TaxRate" """ - Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + Tax rates can be applied to [invoices](https://stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://stripe.com/payments/checkout/use-manual-tax-rates) to collect tax. - Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + Related guide: [Tax rates](https://stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 9a9a918fe..465de5fd1 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -865,9 +865,9 @@ class Tax(StripeObject): """ rate: "TaxRate" """ - Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + Tax rates can be applied to [invoices](https://stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://stripe.com/payments/checkout/use-manual-tax-rates) to collect tax. - Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + Related guide: [Tax rates](https://stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ diff --git a/stripe/_line_item.py b/stripe/_line_item.py index 19641c124..f4e0f558a 100644 --- a/stripe/_line_item.py +++ b/stripe/_line_item.py @@ -37,9 +37,9 @@ class Tax(StripeObject): """ rate: "TaxRate" """ - Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + Tax rates can be applied to [invoices](https://stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://stripe.com/payments/checkout/use-manual-tax-rates) to collect tax. - Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + Related guide: [Tax rates](https://stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index ad979bd89..bcbc7d011 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1374,6 +1374,10 @@ class MandateOptions(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] ] @@ -1470,6 +1474,10 @@ class AuBecsDebit(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class BacsDebit(StripeObject): class MandateOptions(StripeObject): @@ -1491,6 +1499,10 @@ class MandateOptions(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ _inner_class_types = {"mandate_options": MandateOptions} class Bancontact(StripeObject): @@ -2155,6 +2167,10 @@ class MandateOptions(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ _inner_class_types = {"mandate_options": MandateOptions} class Sofort(StripeObject): @@ -2265,6 +2281,10 @@ class MandateOptions(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] ] @@ -2476,13 +2496,13 @@ class Address(StripeObject): class TransferData(StripeObject): amount: Optional[int] """ - Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + The amount transferred to the destination account. This transfer will occur automatically after the payment succeeds. If no amount is specified, by default the entire payment amount is transferred to the destination account. + The amount must be less than or equal to the [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount), and must be a positive integer + representing how much to transfer in the smallest currency unit (e.g., 100 cents to charge $1.00). """ destination: ExpandableField["Account"] """ - The account (if any) that the payment is attributed to for tax - reporting, and where funds from the payment are transferred to after - payment success. + The account (if any) that the payment is attributed to for tax reporting, and where funds from the payment are transferred to after payment success. """ class ApplyCustomerBalanceParams(RequestOptions): @@ -3682,6 +3702,10 @@ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -3827,6 +3851,10 @@ class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): mandate_options: NotRequired[ @@ -3849,6 +3877,10 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -4797,6 +4829,10 @@ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -4897,6 +4933,10 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -4911,7 +4951,7 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Provide filters for the linked accounts that the customer can select for the payment method + Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ @@ -6248,6 +6288,10 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -6393,6 +6437,10 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): mandate_options: NotRequired[ @@ -6415,6 +6463,10 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -7363,6 +7415,10 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -7463,6 +7519,10 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -7477,7 +7537,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Provide filters for the linked accounts that the customer can select for the payment method + Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ @@ -8808,6 +8868,10 @@ class ModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -8953,6 +9017,10 @@ class ModifyParamsPaymentMethodOptionsAuBecsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): mandate_options: NotRequired[ @@ -8975,6 +9043,10 @@ class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class ModifyParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -9923,6 +9995,10 @@ class ModifyParamsPaymentMethodOptionsSepaDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -10023,6 +10099,10 @@ class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -10037,7 +10117,7 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( "PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Provide filters for the linked accounts that the customer can select for the payment method + Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 014a558df..397312be5 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -1238,6 +1238,10 @@ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -1383,6 +1387,10 @@ class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): mandate_options: NotRequired[ @@ -1405,6 +1413,10 @@ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -2353,6 +2365,10 @@ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -2453,6 +2469,10 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -2467,7 +2487,7 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Provide filters for the linked accounts that the customer can select for the payment method + Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ @@ -3834,6 +3854,10 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -3979,6 +4003,10 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): mandate_options: NotRequired[ @@ -4001,6 +4029,10 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -4949,6 +4981,10 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -5049,6 +5085,10 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -5063,7 +5103,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Provide filters for the linked accounts that the customer can select for the payment method + Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ @@ -6452,6 +6492,10 @@ class UpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -6597,6 +6641,10 @@ class UpdateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): mandate_options: NotRequired[ @@ -6619,6 +6667,10 @@ class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class UpdateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -7567,6 +7619,10 @@ class UpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class UpdateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -7667,6 +7723,10 @@ class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -7681,7 +7741,7 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( "PaymentIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Provide filters for the linked accounts that the customer can select for the payment method + Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 4afbd6015..532c30ac0 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -312,7 +312,7 @@ class Wallet(StripeObject): """ network_transaction_id: Optional[str] """ - This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. """ offline: Optional[Offline] """ @@ -375,7 +375,7 @@ class Wallet(StripeObject): class Networks(StripeObject): available: List[str] """ - All available networks for the card. + All networks available for selection via [payment_method_options.card.network](https://stripe.com/api/payment_intents/confirm#confirm_payment_intent-payment_method_options-card-network). """ preferred: Optional[str] """ @@ -667,7 +667,7 @@ class CardPresent(StripeObject): class Networks(StripeObject): available: List[str] """ - All available networks for the card. + All networks available for selection via [payment_method_options.card.network](https://stripe.com/api/payment_intents/confirm#confirm_payment_intent-payment_method_options-card-network). """ preferred: Optional[str] """ @@ -913,7 +913,7 @@ class InteracPresent(StripeObject): class Networks(StripeObject): available: List[str] """ - All available networks for the card. + All networks available for selection via [payment_method_options.card.network](https://stripe.com/api/payment_intents/confirm#confirm_payment_intent-payment_method_options-card-network). """ preferred: Optional[str] """ diff --git a/stripe/_product.py b/stripe/_product.py index 4bda6d1ca..09877ec38 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -182,6 +182,10 @@ class CreateParamsDefaultPriceData(TypedDict): """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ recurring: NotRequired["Product.CreateParamsDefaultPriceDataRecurring"] """ The recurring components of a price such as `interval` and `interval_count`. diff --git a/stripe/_product_service.py b/stripe/_product_service.py index 3e1b632c2..88f73bf34 100644 --- a/stripe/_product_service.py +++ b/stripe/_product_service.py @@ -111,6 +111,10 @@ class CreateParamsDefaultPriceData(TypedDict): """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ recurring: NotRequired[ "ProductService.CreateParamsDefaultPriceDataRecurring" ] diff --git a/stripe/_quote.py b/stripe/_quote.py index 4a6aada48..17bbf7050 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -93,9 +93,9 @@ class Tax(StripeObject): """ rate: "TaxRate" """ - Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + Tax rates can be applied to [invoices](https://stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://stripe.com/payments/checkout/use-manual-tax-rates) to collect tax. - Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + Related guide: [Tax rates](https://stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ @@ -191,9 +191,9 @@ class Tax(StripeObject): """ rate: "TaxRate" """ - Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + Tax rates can be applied to [invoices](https://stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://stripe.com/payments/checkout/use-manual-tax-rates) to collect tax. - Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + Related guide: [Tax rates](https://stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ @@ -351,9 +351,9 @@ class Tax(StripeObject): """ rate: "TaxRate" """ - Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + Tax rates can be applied to [invoices](https://stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://stripe.com/payments/checkout/use-manual-tax-rates) to collect tax. - Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + Related guide: [Tax rates](https://stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 35b324650..8be2ef01c 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -1768,7 +1768,7 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( "SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Provide filters for the linked accounts that the customer can select for the payment method + Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ @@ -2978,7 +2978,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( "SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Provide filters for the linked accounts that the customer can select for the payment method + Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ @@ -4155,7 +4155,7 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( "SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Provide filters for the linked accounts that the customer can select for the payment method + Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 01b7cf10e..316e159dd 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -1164,7 +1164,7 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( "SetupIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Provide filters for the linked accounts that the customer can select for the payment method + Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ @@ -2412,7 +2412,7 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( "SetupIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Provide filters for the linked accounts that the customer can select for the payment method + Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ @@ -3637,7 +3637,7 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( "SetupIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Provide filters for the linked accounts that the customer can select for the payment method + Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index 674aad3ff..c66ee964a 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -17,9 +17,9 @@ class TaxRate( UpdateableAPIResource["TaxRate"], ): """ - Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + Tax rates can be applied to [invoices](https://stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://stripe.com/payments/checkout/use-manual-tax-rates) to collect tax. - Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + Related guide: [Tax rates](https://stripe.com/billing/taxes/tax-rates) """ OBJECT_NAME: ClassVar[Literal["tax_rate"]] = "tax_rate" @@ -73,7 +73,7 @@ class CreateParams(RequestOptions): """ state: NotRequired[str] """ - [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ Literal[ @@ -176,7 +176,7 @@ class ModifyParams(RequestOptions): """ state: NotRequired[str] """ - [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ Literal[ @@ -276,7 +276,7 @@ class RetrieveParams(RequestOptions): """ state: Optional[str] """ - [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ tax_type: Optional[ Literal[ diff --git a/stripe/_tax_rate_service.py b/stripe/_tax_rate_service.py index f447346e1..9123d143d 100644 --- a/stripe/_tax_rate_service.py +++ b/stripe/_tax_rate_service.py @@ -49,7 +49,7 @@ class CreateParams(TypedDict): """ state: NotRequired[str] """ - [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ Literal[ @@ -158,7 +158,7 @@ class UpdateParams(TypedDict): """ state: NotRequired[str] """ - [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ Literal[ diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 0f9767879..8892ed94b 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -139,6 +139,7 @@ class CreateParams(RequestOptions): "2024-11-20.acacia", "2024-12-18.acacia", "2025-01-27.acacia", + "2025-02-24.acacia", ] ] """ diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index dafe99043..1faf5ab73 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -120,6 +120,7 @@ class CreateParams(TypedDict): "2024-11-20.acacia", "2024-12-18.acacia", "2025-01-27.acacia", + "2025-02-24.acacia", ] ] """ diff --git a/stripe/billing/_credit_balance_summary.py b/stripe/billing/_credit_balance_summary.py index fe701a30b..c5104d61b 100644 --- a/stripe/billing/_credit_balance_summary.py +++ b/stripe/billing/_credit_balance_summary.py @@ -107,10 +107,24 @@ class RetrieveParamsFilter(TypedDict): """ class RetrieveParamsFilterApplicabilityScope(TypedDict): - price_type: Literal["metered"] + price_type: NotRequired[Literal["metered"]] """ The price type that credit grants can apply to. We currently only support the `metered` price type. """ + prices: NotRequired[ + List[ + "CreditBalanceSummary.RetrieveParamsFilterApplicabilityScopePrice" + ] + ] + """ + A list of prices that the credit grant can apply to. We currently only support the `metered` prices. + """ + + class RetrieveParamsFilterApplicabilityScopePrice(TypedDict): + id: str + """ + The price ID this credit grant should apply to. + """ balances: List[Balance] """ diff --git a/stripe/billing/_credit_balance_summary_service.py b/stripe/billing/_credit_balance_summary_service.py index 68d6a09b5..973672edd 100644 --- a/stripe/billing/_credit_balance_summary_service.py +++ b/stripe/billing/_credit_balance_summary_service.py @@ -39,10 +39,24 @@ class RetrieveParamsFilter(TypedDict): """ class RetrieveParamsFilterApplicabilityScope(TypedDict): - price_type: Literal["metered"] + price_type: NotRequired[Literal["metered"]] """ The price type that credit grants can apply to. We currently only support the `metered` price type. """ + prices: NotRequired[ + List[ + "CreditBalanceSummaryService.RetrieveParamsFilterApplicabilityScopePrice" + ] + ] + """ + A list of prices that the credit grant can apply to. We currently only support the `metered` prices. + """ + + class RetrieveParamsFilterApplicabilityScopePrice(TypedDict): + id: str + """ + The price ID this credit grant should apply to. + """ def retrieve( self, diff --git a/stripe/billing/_credit_grant.py b/stripe/billing/_credit_grant.py index 577982f79..2eb9c67e6 100644 --- a/stripe/billing/_credit_grant.py +++ b/stripe/billing/_credit_grant.py @@ -60,10 +60,21 @@ class Monetary(StripeObject): class ApplicabilityConfig(StripeObject): class Scope(StripeObject): - price_type: Literal["metered"] + class Price(StripeObject): + id: Optional[str] + """ + Unique identifier for the object. + """ + + price_type: Optional[Literal["metered"]] """ The price type that credit grants can apply to. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. """ + prices: Optional[List[Price]] + """ + The prices that credit grants can apply to. We currently only support `metered` prices. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. + """ + _inner_class_types = {"prices": Price} scope: Scope _inner_class_types = {"scope": Scope} @@ -75,7 +86,7 @@ class CreateParams(RequestOptions): """ applicability_config: "CreditGrant.CreateParamsApplicabilityConfig" """ - Configuration specifying what this credit grant applies to. + Configuration specifying what this credit grant applies to. We currently only support `metered` prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. """ category: Literal["paid", "promotional"] """ @@ -105,6 +116,10 @@ class CreateParams(RequestOptions): """ A descriptive name shown in the Dashboard. """ + priority: NotRequired[int] + """ + The desired priority for applying this credit grant. If not specified, it will be set to the default value of 50. The highest priority is 0 and the lowest is 100. + """ class CreateParamsAmount(TypedDict): monetary: NotRequired["CreditGrant.CreateParamsAmountMonetary"] @@ -133,10 +148,22 @@ class CreateParamsApplicabilityConfig(TypedDict): """ class CreateParamsApplicabilityConfigScope(TypedDict): - price_type: Literal["metered"] + price_type: NotRequired[Literal["metered"]] """ The price type that credit grants can apply to. We currently only support the `metered` price type. """ + prices: NotRequired[ + List["CreditGrant.CreateParamsApplicabilityConfigScopePrice"] + ] + """ + A list of prices that the credit grant can apply to. We currently only support the `metered` prices. + """ + + class CreateParamsApplicabilityConfigScopePrice(TypedDict): + id: str + """ + The price ID this credit grant should apply to. + """ class ExpireParams(RequestOptions): expand: NotRequired[List[str]] @@ -234,6 +261,10 @@ class VoidGrantParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ + priority: Optional[int] + """ + The priority for applying this credit grant. The highest priority is 0 and the lowest is 100. + """ test_clock: Optional[ExpandableField["TestClock"]] """ ID of the test clock this credit grant belongs to. diff --git a/stripe/billing/_credit_grant_service.py b/stripe/billing/_credit_grant_service.py index f1a1ced5a..cd2614c84 100644 --- a/stripe/billing/_credit_grant_service.py +++ b/stripe/billing/_credit_grant_service.py @@ -19,7 +19,7 @@ class CreateParams(TypedDict): "CreditGrantService.CreateParamsApplicabilityConfig" ) """ - Configuration specifying what this credit grant applies to. + Configuration specifying what this credit grant applies to. We currently only support `metered` prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. """ category: Literal["paid", "promotional"] """ @@ -49,6 +49,10 @@ class CreateParams(TypedDict): """ A descriptive name shown in the Dashboard. """ + priority: NotRequired[int] + """ + The desired priority for applying this credit grant. If not specified, it will be set to the default value of 50. The highest priority is 0 and the lowest is 100. + """ class CreateParamsAmount(TypedDict): monetary: NotRequired["CreditGrantService.CreateParamsAmountMonetary"] @@ -77,10 +81,24 @@ class CreateParamsApplicabilityConfig(TypedDict): """ class CreateParamsApplicabilityConfigScope(TypedDict): - price_type: Literal["metered"] + price_type: NotRequired[Literal["metered"]] """ The price type that credit grants can apply to. We currently only support the `metered` price type. """ + prices: NotRequired[ + List[ + "CreditGrantService.CreateParamsApplicabilityConfigScopePrice" + ] + ] + """ + A list of prices that the credit grant can apply to. We currently only support the `metered` prices. + """ + + class CreateParamsApplicabilityConfigScopePrice(TypedDict): + id: str + """ + The price ID this credit grant should apply to. + """ class ExpireParams(TypedDict): expand: NotRequired[List[str]] diff --git a/stripe/billing/_meter_event_summary.py b/stripe/billing/_meter_event_summary.py index d613e0a0c..823b330c3 100644 --- a/stripe/billing/_meter_event_summary.py +++ b/stripe/billing/_meter_event_summary.py @@ -9,6 +9,8 @@ class MeterEventSummary(StripeObject): """ A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much usage was accrued by a customer for that period. + + Note: Meters events are aggregated asynchronously so the meter event summaries provide an eventually consistent view of the reported usage. """ OBJECT_NAME: ClassVar[Literal["billing.meter_event_summary"]] = ( diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 48fa495cc..730fe8e54 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -118,6 +118,59 @@ class Liability(StripeObject): """ _inner_class_types = {"liability": Liability} + class CollectedInformation(StripeObject): + class ShippingDetails(StripeObject): + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Optional[Address] + carrier: Optional[str] + """ + The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + """ + name: Optional[str] + """ + Recipient name. + """ + phone: Optional[str] + """ + Recipient phone (including extension). + """ + tracking_number: Optional[str] + """ + The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + """ + _inner_class_types = {"address": Address} + + shipping_details: Optional[ShippingDetails] + """ + Shipping information for this Checkout Session. + """ + _inner_class_types = {"shipping_details": ShippingDetails} + class Consent(StripeObject): promotions: Optional[Literal["opt_in", "opt_out"]] """ @@ -615,6 +668,10 @@ class MandateOptions(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] ] @@ -682,6 +739,10 @@ class AuBecsDebit(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class BacsDebit(StripeObject): class MandateOptions(StripeObject): @@ -703,6 +764,10 @@ class MandateOptions(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ _inner_class_types = {"mandate_options": MandateOptions} class Bancontact(StripeObject): @@ -742,6 +807,21 @@ class Installments(StripeObject): Indicates if installments are enabled """ + class Restrictions(StripeObject): + brands_blocked: Optional[ + List[ + Literal[ + "american_express", + "discover_global_network", + "mastercard", + "visa", + ] + ] + ] + """ + Specify the card brands to block in the Checkout Session. If a customer enters or selects a card belonging to a blocked brand, they can't complete the Session. + """ + installments: Optional[Installments] request_extended_authorization: Optional[ Literal["if_available", "never"] @@ -767,6 +847,7 @@ class Installments(StripeObject): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + restrictions: Optional[Restrictions] setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] @@ -787,7 +868,10 @@ class Installments(StripeObject): """ Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ - _inner_class_types = {"installments": Installments} + _inner_class_types = { + "installments": Installments, + "restrictions": Restrictions, + } class Cashapp(StripeObject): setup_future_usage: Optional[Literal["none"]] @@ -1137,6 +1221,10 @@ class MandateOptions(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ _inner_class_types = {"mandate_options": MandateOptions} class Sofort(StripeObject): @@ -1206,6 +1294,10 @@ class Filters(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: Optional[Literal["automatic", "instant"]] """ Bank account verification method. @@ -1569,9 +1661,9 @@ class Tax(StripeObject): """ rate: "TaxRate" """ - Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + Tax rates can be applied to [invoices](https://stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://stripe.com/payments/checkout/use-manual-tax-rates) to collect tax. - Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + Related guide: [Tax rates](https://stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ @@ -1710,9 +1802,9 @@ class Tax(StripeObject): """ rate: "TaxRate" """ - Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + Tax rates can be applied to [invoices](https://stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://stripe.com/payments/checkout/use-manual-tax-rates) to collect tax. - Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + Related guide: [Tax rates](https://stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ @@ -2883,6 +2975,10 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -2975,6 +3071,10 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): mandate_options: NotRequired[ @@ -2995,6 +3095,10 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -3065,6 +3169,12 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + restrictions: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsCardRestrictions" + ] + """ + Restrictions to apply to the card payment method. For example, you can block specific card brands. + """ setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3091,6 +3201,21 @@ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): Setting to false will prevent any installment plan from applying to a payment. """ + class CreateParamsPaymentMethodOptionsCardRestrictions(TypedDict): + brands_blocked: NotRequired[ + List[ + Literal[ + "american_express", + "discover_global_network", + "mastercard", + "visa", + ] + ] + ] + """ + Specify the card brands to block in the Checkout Session. If a customer enters or selects a card belonging to a blocked brand, they can't complete the Session. + """ + class CreateParamsPaymentMethodOptionsCashapp(TypedDict): setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] @@ -3497,6 +3622,10 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -3541,6 +3670,10 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[Literal["automatic", "instant"]] """ Verification method for the intent @@ -4199,6 +4332,12 @@ class ListParamsCustomerDetails(TypedDict): """ class ModifyParams(RequestOptions): + collected_information: NotRequired[ + "Session.ModifyParamsCollectedInformation" + ] + """ + Information about the customer collected within the Checkout Session. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -4208,6 +4347,52 @@ class ModifyParams(RequestOptions): Set of [key-value pairs](https://stripe.com/docs/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`. """ + class ModifyParamsCollectedInformation(TypedDict): + shipping_details: NotRequired[ + "Session.ModifyParamsCollectedInformationShippingDetails" + ] + """ + The shipping details to apply to this Session. + """ + + class ModifyParamsCollectedInformationShippingDetails(TypedDict): + address: ( + "Session.ModifyParamsCollectedInformationShippingDetailsAddress" + ) + """ + The address of the customer + """ + name: str + """ + The name of customer + """ + + class ModifyParamsCollectedInformationShippingDetailsAddress(TypedDict): + city: NotRequired[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: str + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -4253,6 +4438,10 @@ class RetrieveParams(RequestOptions): """ Client secret to be used when initializing Stripe.js embedded checkout. """ + collected_information: Optional[CollectedInformation] + """ + Information about the customer collected within the Checkout Session. + """ consent: Optional[Consent] """ Results of `consent_collection` for this session. @@ -4859,6 +5048,7 @@ async def retrieve_async( "adaptive_pricing": AdaptivePricing, "after_expiration": AfterExpiration, "automatic_tax": AutomaticTax, + "collected_information": CollectedInformation, "consent": Consent, "consent_collection": ConsentCollection, "currency_conversion": CurrencyConversion, diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 8ce6c0c8d..c930e615f 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -1192,6 +1192,10 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] @@ -1284,6 +1288,10 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): mandate_options: NotRequired[ @@ -1304,6 +1312,10 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -1374,6 +1386,12 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + restrictions: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsCardRestrictions" + ] + """ + Restrictions to apply to the card payment method. For example, you can block specific card brands. + """ setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1400,6 +1418,21 @@ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): Setting to false will prevent any installment plan from applying to a payment. """ + class CreateParamsPaymentMethodOptionsCardRestrictions(TypedDict): + brands_blocked: NotRequired[ + List[ + Literal[ + "american_express", + "discover_global_network", + "mastercard", + "visa", + ] + ] + ] + """ + Specify the card brands to block in the Checkout Session. If a customer enters or selects a card belonging to a blocked brand, they can't complete the Session. + """ + class CreateParamsPaymentMethodOptionsCashapp(TypedDict): setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] @@ -1806,6 +1839,10 @@ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): reference_prefix: NotRequired["Literal['']|str"] @@ -1850,6 +1887,10 @@ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ verification_method: NotRequired[Literal["automatic", "instant"]] """ Verification method for the intent @@ -2496,6 +2537,12 @@ class RetrieveParams(TypedDict): """ class UpdateParams(TypedDict): + collected_information: NotRequired[ + "SessionService.UpdateParamsCollectedInformation" + ] + """ + Information about the customer collected within the Checkout Session. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -2505,6 +2552,50 @@ class UpdateParams(TypedDict): Set of [key-value pairs](https://stripe.com/docs/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`. """ + class UpdateParamsCollectedInformation(TypedDict): + shipping_details: NotRequired[ + "SessionService.UpdateParamsCollectedInformationShippingDetails" + ] + """ + The shipping details to apply to this Session. + """ + + class UpdateParamsCollectedInformationShippingDetails(TypedDict): + address: "SessionService.UpdateParamsCollectedInformationShippingDetailsAddress" + """ + The address of the customer + """ + name: str + """ + The name of customer + """ + + class UpdateParamsCollectedInformationShippingDetailsAddress(TypedDict): + city: NotRequired[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: str + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + def list( self, params: "SessionService.ListParams" = {}, diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 1d7247850..4d71e5fef 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -239,7 +239,7 @@ class Jurisdiction(StripeObject): """ state: Optional[str] """ - [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ class TaxRateDetails(StripeObject): diff --git a/stripe/tax/_calculation_line_item.py b/stripe/tax/_calculation_line_item.py index e0707da44..380b1c293 100644 --- a/stripe/tax/_calculation_line_item.py +++ b/stripe/tax/_calculation_line_item.py @@ -26,7 +26,7 @@ class Jurisdiction(StripeObject): """ state: Optional[str] """ - [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ class TaxRateDetails(StripeObject): diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index bb4ee4c69..0489c5e5f 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -245,7 +245,7 @@ class Jurisdiction(StripeObject): """ state: Optional[str] """ - [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ class TaxRateDetails(StripeObject): From 4089cf2ac6fdb11ab90cbc9b9855817803f6bdf0 Mon Sep 17 00:00:00 2001 From: Prathmesh Ranaut Date: Mon, 24 Feb 2025 17:36:07 -0500 Subject: [PATCH 152/179] Bump version to 11.6.0 --- CHANGELOG.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++ VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8605fb941..096d1d531 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,53 @@ +## 11.6.0 - 2025-02-24 +* [#1450](https://github.com/stripe/stripe-python/pull/1450) Update generated code + * Add support for `target_date` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsAcssDebit`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsAuBecsDebit`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsBacsDebit`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebit`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccount`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsAcssDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsAuBecsDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsBacsDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccount`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsAcssDebit`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsAuBecsDebit`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsBacsDebit`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsSepaDebit`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccount`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsAcssDebit`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsAuBecsDebit`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsBacsDebit`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSepaDebit`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptionsUsBankAccount` and resource classes `stripe.PaymentIntent.PaymentMethodOptions.AcssDebit`, `stripe.PaymentIntent.PaymentMethodOptions.AuBecsDebit`, `stripe.PaymentIntent.PaymentMethodOptions.BacsDebit`, `stripe.PaymentIntent.PaymentMethodOptions.SepaDebit`, `stripe.PaymentIntent.PaymentMethodOptions.UsBankAccount`, `stripe.checkout.Session.PaymentMethodOptions.AcssDebit`, `stripe.checkout.Session.PaymentMethodOptions.AuBecsDebit`, `stripe.checkout.Session.PaymentMethodOptions.BacsDebit`, `stripe.checkout.Session.PaymentMethodOptions.SepaDebit`, and `stripe.checkout.Session.PaymentMethodOptions.UsBankAccount` + * Add support for `metadata` on parameter class `stripe.Product.CreateParamsDefaultPriceData` + * Add support for `prices` on parameter classes `stripe.billing.CreditBalanceSummary.RetrieveParamsFilterApplicabilityScope` and `stripe.billing.CreditGrant.CreateParamsApplicabilityConfigScope` and resource class `stripe.billing.CreditGrant.ApplicabilityConfig.Scope` + * Add support for `priority` on parameter class `stripe.billing.CreditGrant.CreateParams` and resource `stripe.billing.CreditGrant` + * Add support for `restrictions` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptionsCard` and resource class `stripe.checkout.Session.PaymentMethodOptions.Card` + * Add support for `collected_information` on parameter class `stripe.checkout.Session.ModifyParams` and resource `stripe.checkout.Session` + * Change type of `price_type` on `stripe.billing.CreditBalanceSummary.RetrieveParamsFilterApplicabilityScope` and `stripe.billing.CreditGrant.CreateParamsApplicabilityConfigScope` from `Literal['metered']` to `NotRequired[Literal['metered']]` + * Change type of `price_type` on `stripe.billing.CreditGrant.ApplicabilityConfig.Scope` from `Literal['metered']` to `Optional[Literal['metered']]` + * Add support for `2025-02-24.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` +* [#1461](https://github.com/stripe/stripe-python/pull/1461) Remove incorrect changelog entry about parse_snapshot_event +* [#1457](https://github.com/stripe/stripe-python/pull/1457) add codeowners file +* [#1456](https://github.com/stripe/stripe-python/pull/1456) upgrade ruff version +* [#1452](https://github.com/stripe/stripe-python/pull/1452) Revert "Bump version to 11.5.0" +* [#1451](https://github.com/stripe/stripe-python/pull/1451) Upgrade to download-artifact@v4 +* [#1443](https://github.com/stripe/stripe-python/pull/1443) Update generated code + * Add support for `pay_by_bank_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `directorship_declaration` on resource class `stripe.Account.Company` and parameter classes `stripe.Account.CreateParamsCompany` and `stripe.Token.CreateParamsAccountCompany` + * Add support for `ownership_exemption_reason` on resource class `stripe.Account.Company` and parameter classes `stripe.Account.CreateParamsCompany` and `stripe.Token.CreateParamsAccountCompany` + * Add support for `proof_of_ultimate_beneficial_ownership` on parameter class `stripe.Account.CreateParamsDocuments` + * Add support for `financial_account` on resource classes `stripe.AccountSession.Components` and `stripe.treasury.OutboundTransfer.DestinationPaymentMethodDetails` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `issuing_card` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `advice_code` on resource classes `stripe.Charge.Outcome`, `stripe.Invoice.LastFinalizationError`, `stripe.PaymentIntent.LastPaymentError`, `stripe.SetupAttempt.SetupError`, and `stripe.SetupIntent.LastSetupError` + * Add support for `country` on resource classes `stripe.Charge.PaymentMethodDetails.Paypal`, `stripe.ConfirmationToken.PaymentMethodPreview.Paypal`, and `stripe.PaymentMethod.Paypal` + * Add support for `pay_by_bank` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` + * Add support for `phone_number_collection` on parameter class `stripe.PaymentLink.ModifyParams` + * Add support for `discounts` on resource `stripe.checkout.Session` + * Add support for `jpy` on parameter classes `stripe.terminal.Configuration.CreateParamsTipping` and `stripe.terminal.Configuration.ModifyParamsTipping` and resource class `stripe.terminal.Configuration.Tipping` + * Add support for `nickname` on parameter classes `stripe.treasury.FinancialAccount.CreateParams` and `stripe.treasury.FinancialAccount.ModifyParams` and resource `stripe.treasury.FinancialAccount` + * Add support for `forwarding_settings` on parameter class `stripe.treasury.FinancialAccount.ModifyParams` + * Add support for `_cls_close` on resource `stripe.treasury.FinancialAccount` + * Add support for `close` on resource `stripe.treasury.FinancialAccount` + * Add support for `is_default` on resource `stripe.treasury.FinancialAccount` + * Add support for `destination_payment_method_data` on parameter class `stripe.treasury.OutboundTransfer.CreateParams` + * Add support for `outbound_transfer` on resource class `stripe.treasury.ReceivedCredit.LinkedFlows.SourceFlowDetails` + * Add support for `SD` on enums `stripe.checkout.Session.ShippingAddressCollection.allowed_countries`, `stripe.checkout.Session.CreateParamsShippingAddressCollection.allowed_countries`, `stripe.PaymentLink.ShippingAddressCollection.allowed_countries`, `stripe.PaymentLink.CreateParamsShippingAddressCollection.allowed_countries`, and `stripe.PaymentLink.ModifyParamsShippingAddressCollection.allowed_countries` + * Add support for `pay_by_bank` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `financial_account` on enum `stripe.treasury.OutboundTransfer.DestinationPaymentMethodDetails.type` + * Add support for `outbound_transfer` on enums `stripe.treasury.ReceivedCredit.LinkedFlows.SourceFlowDetails.type` and `stripe.treasury.ReceivedCredit.ListParamsLinkedFlows.source_flow_type` + * Add support for `2025-01-27.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` + * Change type of `pretax_credit_amounts` on `stripe.CreditNote` and `stripe.CreditNoteLineItem` from `Optional[List[PretaxCreditAmount]]` to `List[PretaxCreditAmount]` +* [#1448](https://github.com/stripe/stripe-python/pull/1448) Updated upload artifact ci action +* [#1446](https://github.com/stripe/stripe-python/pull/1446) add just to publish CI +* [#1444](https://github.com/stripe/stripe-python/pull/1444) Added CONTRIBUTING.md file +* [#1445](https://github.com/stripe/stripe-python/pull/1445) minor justfile fixes & pin CI version +* [#1440](https://github.com/stripe/stripe-python/pull/1440) add justfile, update readme, remove coveralls +* [#1442](https://github.com/stripe/stripe-python/pull/1442) Fix V2 ListObject.data type hint + - Change `stripe.v2.ListObject.data` type hint from `List[StripeObject]` to `List[T]` where T is the specific stripe object contained within the list + ## 11.5.0 - 2025-01-27 * [#1443](https://github.com/stripe/stripe-python/pull/1443) Update generated code * Add support for `pay_by_bank_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` diff --git a/VERSION b/VERSION index 7ef698131..146d5de79 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.5.0 +11.6.0 diff --git a/stripe/_version.py b/stripe/_version.py index 322f43c92..b025d4d4f 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "11.5.0" +VERSION = "11.6.0" From 57d41cdd8e5f92352c63bb8f478c7a235d5a19ab Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Thu, 6 Mar 2025 10:28:51 -0800 Subject: [PATCH 153/179] changed the public test api key to match what is currently published on docs.stripe.com (#1466) --- tests/test_http_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_http_client.py b/tests/test_http_client.py index edc1523de..f37427cc4 100644 --- a/tests/test_http_client.py +++ b/tests/test_http_client.py @@ -1992,7 +1992,7 @@ async def test_httpx_request_async_https(self): client = _http_client.HTTPXClient(verify_ssl_certs=True) # the public test secret key, as found on https://docs.stripe.com/keys#obtain-api-keys - test_api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" + test_api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" basic_auth = base64.b64encode( (test_api_key + ":").encode("utf-8") ).decode("utf-8") From bfb694b8329c2bfe0d9d5d1a358d191a93f5311c Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Thu, 13 Mar 2025 05:47:56 -0700 Subject: [PATCH 154/179] remove test using soon-to-be-gone endpoint (#1468) --- tests/api_resources/test_invoice.py | 5 -- tests/api_resources/test_list_object.py | 104 ++++++++++++------------ 2 files changed, 52 insertions(+), 57 deletions(-) diff --git a/tests/api_resources/test_invoice.py b/tests/api_resources/test_invoice.py index 904c36382..d29361280 100644 --- a/tests/api_resources/test_invoice.py +++ b/tests/api_resources/test_invoice.py @@ -117,11 +117,6 @@ def test_can_send_invoice_classmethod(self, http_client_mock): ) assert isinstance(resource, stripe.Invoice) - def test_can_upcoming(self, http_client_mock): - resource = stripe.Invoice.upcoming(customer="cus_123") - http_client_mock.assert_requested("get", path="/v1/invoices/upcoming") - assert isinstance(resource, stripe.Invoice) - def test_can_void_invoice(self, http_client_mock): resource = stripe.Invoice.retrieve(TEST_RESOURCE_ID) resource = resource.void_invoice() diff --git a/tests/api_resources/test_list_object.py b/tests/api_resources/test_list_object.py index 6de3b4beb..540e37c70 100644 --- a/tests/api_resources/test_list_object.py +++ b/tests/api_resources/test_list_object.py @@ -3,7 +3,6 @@ import pytest import stripe -from tests.http_client_mock import HTTPClientMock class TestListObject(object): @@ -440,57 +439,58 @@ def test_forwards_api_key_to_nested_resources(self, http_client_mock): ) assert lo.data[0].api_key == "sk_test_iter_forwards_options" - def test_iter_with_params(self, http_client_mock: HTTPClientMock): - http_client_mock.stub_request( - "get", - path="/v1/invoices/upcoming/lines", - query_string="customer=cus_123&expand[0]=data.price&limit=1", - rbody=json.dumps( - { - "object": "list", - "data": [ - { - "id": "prod_001", - "object": "product", - "price": {"object": "price", "id": "price_123"}, - } - ], - "url": "/v1/invoices/upcoming/lines?customer=cus_123&expand%5B%5D=data.price", - "has_more": True, - } - ), - ) - # second page - http_client_mock.stub_request( - "get", - path="/v1/invoices/upcoming/lines", - query_string="customer=cus_123&expand[0]=data.price&limit=1&starting_after=prod_001", - rbody=json.dumps( - { - "object": "list", - "data": [ - { - "id": "prod_002", - "object": "product", - "price": {"object": "price", "id": "price_123"}, - } - ], - "url": "/v1/invoices/upcoming/lines?customer=cus_123&expand%5B%5D=data.price", - "has_more": False, - } - ), - ) - - lo = stripe.Invoice.upcoming_lines( - api_key="sk_test_invoice_lines", - customer="cus_123", - expand=["data.price"], - limit=1, - ) - - seen = [item["id"] for item in lo.auto_paging_iter()] - - assert seen == ["prod_001", "prod_002"] + # TODO(xavdid): re-add test with a new endpoint + # def test_iter_with_params(self, http_client_mock: HTTPClientMock): + # http_client_mock.stub_request( + # "get", + # path="/v1/invoices/upcoming/lines", + # query_string="customer=cus_123&expand[0]=data.price&limit=1", + # rbody=json.dumps( + # { + # "object": "list", + # "data": [ + # { + # "id": "prod_001", + # "object": "product", + # "price": {"object": "price", "id": "price_123"}, + # } + # ], + # "url": "/v1/invoices/upcoming/lines?customer=cus_123&expand%5B%5D=data.price", + # "has_more": True, + # } + # ), + # ) + # # second page + # http_client_mock.stub_request( + # "get", + # path="/v1/invoices/upcoming/lines", + # query_string="customer=cus_123&expand[0]=data.price&limit=1&starting_after=prod_001", + # rbody=json.dumps( + # { + # "object": "list", + # "data": [ + # { + # "id": "prod_002", + # "object": "product", + # "price": {"object": "price", "id": "price_123"}, + # } + # ], + # "url": "/v1/invoices/upcoming/lines?customer=cus_123&expand%5B%5D=data.price", + # "has_more": False, + # } + # ), + # ) + + # lo = stripe.Invoice.upcoming_lines( + # api_key="sk_test_invoice_lines", + # customer="cus_123", + # expand=["data.price"], + # limit=1, + # ) + + # seen = [item["id"] for item in lo.auto_paging_iter()] + + # assert seen == ["prod_001", "prod_002"] class TestAutoPagingAsync: From 730e28bd401f6fd85c5df0829d913be7b16ebfbc Mon Sep 17 00:00:00 2001 From: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> Date: Wed, 19 Mar 2025 13:37:02 -0700 Subject: [PATCH 155/179] Fix incorrect property name on ThinEvent.related_object.type Co-authored-by: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> --- stripe/v2/_event.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stripe/v2/_event.py b/stripe/v2/_event.py index 693644b4f..215971a09 100644 --- a/stripe/v2/_event.py +++ b/stripe/v2/_event.py @@ -89,11 +89,11 @@ class RelatedObject: def __init__(self, d) -> None: self.id = d["id"] - self.type_ = d["type"] + self.type = d["type"] self.url = d["url"] def __repr__(self) -> str: - return f"" + return f"" class ThinEvent: From 6bfe32e08641ccea18f42db93d5aad0e0ab98c94 Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Wed, 26 Mar 2025 10:15:39 -0700 Subject: [PATCH 156/179] Remove tests for endpoints that were removed (#1473) --- tests/api_resources/test_subscription_item.py | 30 ------------------- tests/api_resources/test_usage_record.py | 28 ----------------- .../test_usage_record_summary.py | 15 ---------- 3 files changed, 73 deletions(-) delete mode 100644 tests/api_resources/test_usage_record.py delete mode 100644 tests/api_resources/test_usage_record_summary.py diff --git a/tests/api_resources/test_subscription_item.py b/tests/api_resources/test_subscription_item.py index 2a91b9c76..0f96c02db 100644 --- a/tests/api_resources/test_subscription_item.py +++ b/tests/api_resources/test_subscription_item.py @@ -68,33 +68,3 @@ def test_can_delete(self, http_client_mock): "delete", path="/v1/subscription_items/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True - - -class TestUsageRecords(object): - def test_is_creatable(self, http_client_mock): - resource = stripe.SubscriptionItem.create_usage_record( - TEST_RESOURCE_ID, - quantity=5000, - timestamp=1524182400, - action="increment", - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscription_items/%s/usage_records" % TEST_RESOURCE_ID, - post_data="action=increment&quantity=5000×tamp=1524182400", - ) - assert isinstance(resource, stripe.UsageRecord) - - -class TestUsageRecordSummaries(object): - def test_is_listable(self, http_client_mock): - resource = stripe.SubscriptionItem.list_usage_record_summaries( - TEST_RESOURCE_ID - ) - http_client_mock.assert_requested( - "get", - path="/v1/subscription_items/%s/usage_record_summaries" - % TEST_RESOURCE_ID, - ) - assert isinstance(resource.data, list) - assert isinstance(resource.data[0], stripe.UsageRecordSummary) diff --git a/tests/api_resources/test_usage_record.py b/tests/api_resources/test_usage_record.py deleted file mode 100644 index cbfbc0b4c..000000000 --- a/tests/api_resources/test_usage_record.py +++ /dev/null @@ -1,28 +0,0 @@ -import pytest - -import stripe - - -TEST_SUBSCRIPTION_ITEM_ID = "si_123" - - -class TestUsageRecord(object): - def test_is_creatable(self, http_client_mock): - resource = stripe.UsageRecord.create( - subscription_item=TEST_SUBSCRIPTION_ITEM_ID, - quantity=5000, - timestamp=1524182400, - action="increment", - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscription_items/%s/usage_records" - % (TEST_SUBSCRIPTION_ITEM_ID), - ) - assert isinstance(resource, stripe.UsageRecord) - - def test_raises_when_creating_without_subscription_item(self): - with pytest.raises(ValueError): - stripe.UsageRecord.create( - quantity=5000, timestamp=1524182400, action="increment" - ) diff --git a/tests/api_resources/test_usage_record_summary.py b/tests/api_resources/test_usage_record_summary.py deleted file mode 100644 index 4f504ac0b..000000000 --- a/tests/api_resources/test_usage_record_summary.py +++ /dev/null @@ -1,15 +0,0 @@ -import stripe - - -class TestUsageRecordSummary(object): - def test_is_listable(self, http_client_mock): - usage_record_summaries = ( - stripe.SubscriptionItem.list_usage_record_summaries("si_123") - ) - http_client_mock.assert_requested( - "get", path="/v1/subscription_items/si_123/usage_record_summaries" - ) - assert isinstance(usage_record_summaries.data, list) - assert isinstance( - usage_record_summaries.data[0], stripe.UsageRecordSummary - ) From 2906ad3f33c73a22884a6e63c09e4b1bd72a46c1 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 11:10:27 -0700 Subject: [PATCH 157/179] Support for APIs in the new API version 2025-03-31.basil (#1463) * Update generated code for v1520 * Update generated code for v1555 * Update generated code for v1565 * Update generated code for v1566 * Update generated code for v1572 * Update generated code for v1582 * Update generated code for v1583 * Update generated code for v1618 * Update generated code for v1620 * Update generated code for v1628 * Update generated code for v1635 * Update generated code for v1636 * Update generated code for v1638 * Update generated code for v1640 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/__init__.py | 17 +- stripe/_account.py | 100 +- stripe/_account_external_account_service.py | 2 +- stripe/_account_person_service.py | 4 +- stripe/_account_service.py | 96 + stripe/_api_version.py | 2 +- stripe/_application_fee.py | 2 +- stripe/_balance_transaction.py | 6 +- stripe/_balance_transaction_service.py | 2 +- stripe/_bank_account.py | 10 +- stripe/_capability.py | 8 + stripe/_card.py | 5 +- stripe/_charge.py | 57 +- stripe/_charge_service.py | 2 +- stripe/_confirmation_token.py | 95 + stripe/_credit_note.py | 146 +- stripe/_credit_note_line_item.py | 83 +- stripe/_credit_note_preview_lines_service.py | 20 +- stripe/_credit_note_service.py | 36 +- stripe/_customer.py | 19 +- stripe/_customer_balance_transaction.py | 9 +- stripe/_customer_payment_method_service.py | 3 + stripe/_customer_service.py | 10 - stripe/_event.py | 8 + stripe/_invoice.py | 2893 ++--------------- stripe/_invoice_item.py | 122 +- stripe/_invoice_item_service.py | 44 +- stripe/_invoice_line_item.py | 289 +- stripe/_invoice_line_item_service.py | 48 +- stripe/_invoice_payment.py | 208 ++ stripe/_invoice_payment_service.py | 139 + stripe/_invoice_service.py | 1585 ++------- stripe/_invoice_upcoming_lines_service.py | 1221 ------- stripe/_mandate.py | 10 + stripe/_object_classes.py | 3 +- stripe/_payment_intent.py | 336 +- stripe/_payment_intent_service.py | 280 +- stripe/_payment_link.py | 105 +- stripe/_payment_link_service.py | 66 +- stripe/_payment_method.py | 102 +- stripe/_payment_method_configuration.py | 188 ++ .../_payment_method_configuration_service.py | 120 + stripe/_payment_method_domain.py | 54 +- stripe/_payment_method_domain_service.py | 18 +- stripe/_payment_method_service.py | 59 +- stripe/_person.py | 26 +- stripe/_plan.py | 12 - stripe/_plan_service.py | 6 - stripe/_price.py | 18 +- stripe/_price_service.py | 12 +- stripe/_quote.py | 4 +- stripe/_quote_service.py | 4 +- stripe/_refund.py | 17 + stripe/_review.py | 11 +- stripe/_setup_attempt.py | 15 + stripe/_setup_intent.py | 148 + stripe/_setup_intent_service.py | 152 + stripe/_stripe_client.py | 2 + stripe/_subscription.py | 117 +- stripe/_subscription_item.py | 186 +- stripe/_subscription_item_service.py | 45 +- ..._subscription_item_usage_record_service.py | 84 - ...ption_item_usage_record_summary_service.py | 77 - stripe/_subscription_schedule.py | 153 +- stripe/_subscription_schedule_service.py | 104 +- stripe/_subscription_service.py | 84 +- stripe/_tax_rate.py | 2 +- stripe/_token.py | 5 +- stripe/_token_service.py | 5 +- stripe/_usage_record.py | 57 - stripe/_usage_record_summary.py | 52 - stripe/_webhook_endpoint.py | 18 + stripe/_webhook_endpoint_service.py | 18 + stripe/api_resources/__init__.py | 3 +- .../{usage_record.py => invoice_payment.py} | 10 +- stripe/api_resources/usage_record_summary.py | 21 - stripe/billing/_credit_balance_summary.py | 4 +- .../_credit_balance_summary_service.py | 4 +- stripe/billing/_credit_grant.py | 8 +- stripe/billing/_credit_grant_service.py | 4 +- stripe/billing/_meter.py | 6 +- stripe/billing/_meter_service.py | 4 +- stripe/checkout/_session.py | 385 ++- stripe/checkout/_session_service.py | 230 +- stripe/identity/_verification_session.py | 4 +- .../identity/_verification_session_service.py | 2 +- stripe/issuing/_authorization.py | 7 +- stripe/issuing/_authorization_service.py | 4 +- stripe/tax/_calculation.py | 2 +- stripe/tax/_registration.py | 2 +- stripe/tax/_registration_service.py | 2 +- stripe/terminal/_configuration.py | 234 +- stripe/terminal/_configuration_service.py | 164 +- .../_confirmation_token_service.py | 50 + stripe/treasury/_financial_account.py | 4 +- stripe/treasury/_financial_account_service.py | 4 +- stripe/v2/_event.py | 4 + stripe/v2/_event_destination.py | 4 + stripe/v2/core/_event_destination_service.py | 4 - stripe/v2/core/_event_service.py | 4 - tests/test_generated_examples.py | 639 ++-- 102 files changed, 4793 insertions(+), 7088 deletions(-) create mode 100644 stripe/_invoice_payment.py create mode 100644 stripe/_invoice_payment_service.py delete mode 100644 stripe/_invoice_upcoming_lines_service.py delete mode 100644 stripe/_subscription_item_usage_record_service.py delete mode 100644 stripe/_subscription_item_usage_record_summary_service.py delete mode 100644 stripe/_usage_record.py delete mode 100644 stripe/_usage_record_summary.py rename stripe/api_resources/{usage_record.py => invoice_payment.py} (51%) delete mode 100644 stripe/api_resources/usage_record_summary.py diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ddf5ac544..0fef50283 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1505 \ No newline at end of file +v1640 \ No newline at end of file diff --git a/stripe/__init__.py b/stripe/__init__.py index 3f28c4ecd..5b98fd411 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -429,6 +429,10 @@ def __getattr__(name): from stripe._invoice_line_item_service import ( InvoiceLineItemService as InvoiceLineItemService, ) +from stripe._invoice_payment import InvoicePayment as InvoicePayment +from stripe._invoice_payment_service import ( + InvoicePaymentService as InvoicePaymentService, +) from stripe._invoice_rendering_template import ( InvoiceRenderingTemplate as InvoiceRenderingTemplate, ) @@ -436,9 +440,6 @@ def __getattr__(name): InvoiceRenderingTemplateService as InvoiceRenderingTemplateService, ) from stripe._invoice_service import InvoiceService as InvoiceService -from stripe._invoice_upcoming_lines_service import ( - InvoiceUpcomingLinesService as InvoiceUpcomingLinesService, -) from stripe._issuing_service import IssuingService as IssuingService from stripe._line_item import LineItem as LineItem from stripe._login_link import LoginLink as LoginLink @@ -533,12 +534,6 @@ def __getattr__(name): from stripe._subscription_item_service import ( SubscriptionItemService as SubscriptionItemService, ) -from stripe._subscription_item_usage_record_service import ( - SubscriptionItemUsageRecordService as SubscriptionItemUsageRecordService, -) -from stripe._subscription_item_usage_record_summary_service import ( - SubscriptionItemUsageRecordSummaryService as SubscriptionItemUsageRecordSummaryService, -) from stripe._subscription_schedule import ( SubscriptionSchedule as SubscriptionSchedule, ) @@ -572,10 +567,6 @@ def __getattr__(name): ) from stripe._transfer_service import TransferService as TransferService from stripe._treasury_service import TreasuryService as TreasuryService -from stripe._usage_record import UsageRecord as UsageRecord -from stripe._usage_record_summary import ( - UsageRecordSummary as UsageRecordSummary, -) from stripe._v2_services import V2Services as V2Services from stripe._webhook_endpoint import WebhookEndpoint as WebhookEndpoint from stripe._webhook_endpoint_service import ( diff --git a/stripe/_account.py b/stripe/_account.py index e8e90578c..7e2cd78e2 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -198,6 +198,10 @@ class Capabilities(StripeObject): """ The status of the customer_balance payments capability of the account, or whether the account can directly process customer_balance charges. """ + billie_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the Billie capability of the account, or whether the account can directly process Billie payments. + """ blik_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the blik payments capability of the account, or whether the account can directly process blik charges. @@ -308,6 +312,12 @@ class Capabilities(StripeObject): """ The status of the NaverPay capability of the account, or whether the account can directly process NaverPay payments. """ + nz_bank_account_becs_debit_payments: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the New Zealand BECS Direct Debit payments capability of the account, or whether the account can directly process New Zealand BECS Direct Debit charges. + """ oxxo_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. @@ -346,6 +356,10 @@ class Capabilities(StripeObject): """ The status of the SamsungPay capability of the account, or whether the account can directly process SamsungPay payments. """ + satispay_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the Satispay capability of the account, or whether the account can directly process Satispay payments. + """ sepa_bank_transfer_payments: Optional[ Literal["active", "inactive", "pending"] ] @@ -573,15 +587,15 @@ class Document(StripeObject): """ name: Optional[str] """ - The company's legal name. + The company's legal name. Also available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`. """ name_kana: Optional[str] """ - The Kana variation of the company's legal name (Japan only). + The Kana variation of the company's legal name (Japan only). Also available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`. """ name_kanji: Optional[str] """ - The Kanji variation of the company's legal name (Japan only). + The Kanji variation of the company's legal name (Japan only). Also available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`. """ owners_provided: Optional[bool] """ @@ -597,6 +611,9 @@ class Document(StripeObject): "qualifies_as_financial_institution", ] ] + """ + This value is used to determine if a business is exempt from providing ultimate beneficial owners. See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details. + """ phone: Optional[str] """ The company's phone number (used for verification). @@ -629,7 +646,7 @@ class Document(StripeObject): ] ] """ - The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + The category identifying the legal structure of the company or legal entity. Also available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. """ tax_id_provided: Optional[bool] """ @@ -714,6 +731,7 @@ class Alternative(StripeObject): class Error(StripeObject): code: Literal[ + "information_missing", "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", @@ -726,6 +744,7 @@ class Error(StripeObject): "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", + "invalid_signator", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", @@ -787,6 +806,7 @@ class Error(StripeObject): "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", + "verification_failed_authorizer_authority", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", @@ -801,6 +821,7 @@ class Error(StripeObject): "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", + "verification_rejected_ownership_exemption_reason", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", "verification_supportability", @@ -888,6 +909,7 @@ class Alternative(StripeObject): class Error(StripeObject): code: Literal[ + "information_missing", "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", @@ -900,6 +922,7 @@ class Error(StripeObject): "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", + "invalid_signator", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", @@ -961,6 +984,7 @@ class Error(StripeObject): "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", + "verification_failed_authorizer_authority", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", @@ -975,6 +999,7 @@ class Error(StripeObject): "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", + "verification_rejected_ownership_exemption_reason", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", "verification_supportability", @@ -1131,6 +1156,12 @@ class Invoices(StripeObject): """ The list of default Account Tax IDs to automatically include on invoices. Account Tax IDs get added when an invoice is finalized. """ + hosted_payment_method_save: Optional[ + Literal["always", "never", "offer"] + ] + """ + Whether payment methods should be saved when a payment is completed for a one-time invoices on a hosted invoice page. + """ class Payments(StripeObject): statement_descriptor: Optional[str] @@ -1265,7 +1296,7 @@ class CreateExternalAccountParams(RequestOptions): "Account.CreateExternalAccountParamsCardToken", ] """ - Please refer to full [documentation](https://stripe.com/docs/api) instead. + A token, like the ones returned by [Stripe.js](https://stripe.com/docs/js) or a dictionary containing a user's external account details (with the options shown below). Please refer to full [documentation](https://stripe.com/docs/api/external_accounts) instead. """ metadata: NotRequired[Dict[str, str]] """ @@ -1600,6 +1631,12 @@ class CreateParamsCapabilities(TypedDict): """ The bank_transfer_payments capability. """ + billie_payments: NotRequired[ + "Account.CreateParamsCapabilitiesBilliePayments" + ] + """ + The billie_payments capability. + """ blik_payments: NotRequired[ "Account.CreateParamsCapabilitiesBlikPayments" ] @@ -1750,6 +1787,12 @@ class CreateParamsCapabilities(TypedDict): """ The naver_pay_payments capability. """ + nz_bank_account_becs_debit_payments: NotRequired[ + "Account.CreateParamsCapabilitiesNzBankAccountBecsDebitPayments" + ] + """ + The nz_bank_account_becs_debit_payments capability. + """ oxxo_payments: NotRequired[ "Account.CreateParamsCapabilitiesOxxoPayments" ] @@ -1798,6 +1841,12 @@ class CreateParamsCapabilities(TypedDict): """ The samsung_pay_payments capability. """ + satispay_payments: NotRequired[ + "Account.CreateParamsCapabilitiesSatispayPayments" + ] + """ + The satispay_payments capability. + """ sepa_bank_transfer_payments: NotRequired[ "Account.CreateParamsCapabilitiesSepaBankTransferPayments" ] @@ -1921,6 +1970,12 @@ class CreateParamsCapabilitiesBankTransferPayments(TypedDict): 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 CreateParamsCapabilitiesBilliePayments(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 CreateParamsCapabilitiesBlikPayments(TypedDict): requested: NotRequired[bool] """ @@ -2071,6 +2126,12 @@ class CreateParamsCapabilitiesNaverPayPayments(TypedDict): 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 CreateParamsCapabilitiesNzBankAccountBecsDebitPayments(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 CreateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired[bool] """ @@ -2119,6 +2180,12 @@ class CreateParamsCapabilitiesSamsungPayPayments(TypedDict): 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 CreateParamsCapabilitiesSatispayPayments(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 CreateParamsCapabilitiesSepaBankTransferPayments(TypedDict): requested: NotRequired[bool] """ @@ -2276,6 +2343,9 @@ class CreateParamsCompany(TypedDict): ownership_exemption_reason: NotRequired[ "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" ] + """ + This value is used to determine if a business is exempt from providing ultimate beneficial owners. See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details. + """ phone: NotRequired[str] """ The company's phone number (used for verification). @@ -2880,6 +2950,10 @@ class CreateParamsSettings(TypedDict): """ Settings specific to card charging on the account. """ + invoices: NotRequired["Account.CreateParamsSettingsInvoices"] + """ + Settings specific to the account's use of Invoices. + """ payments: NotRequired["Account.CreateParamsSettingsPayments"] """ Settings that apply across payment methods for charging on the account. @@ -2969,6 +3043,14 @@ class CreateParamsSettingsCardPaymentsDeclineOn(TypedDict): Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. """ + class CreateParamsSettingsInvoices(TypedDict): + hosted_payment_method_save: NotRequired[ + Literal["always", "never", "offer"] + ] + """ + Whether payment methods should be saved when a payment is completed for a one-time invoices on a hosted invoice page. + """ + class CreateParamsSettingsPayments(TypedDict): statement_descriptor: NotRequired[str] """ @@ -3160,7 +3242,7 @@ class CreatePersonParams(RequestOptions): """ The person's phone number. """ - political_exposure: NotRequired[str] + political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -3749,7 +3831,7 @@ class ModifyPersonParams(RequestOptions): """ The person's phone number. """ - political_exposure: NotRequired[str] + political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -4104,7 +4186,7 @@ class RetrievePersonParams(RequestOptions): Literal["company", "government_entity", "individual", "non_profit"] ] """ - The business type. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property is only returned for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + The business type. """ capabilities: Optional[Capabilities] charges_enabled: Optional[bool] @@ -4150,7 +4232,7 @@ class RetrievePersonParams(RequestOptions): """ This is an object representing a person associated with a Stripe account. - A platform cannot access a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. + A platform can only access a subset of data in a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. See the [Standard onboarding](https://stripe.com/connect/standard-accounts) or [Express onboarding](https://stripe.com/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](https://stripe.com/connect/handling-api-verification#person-information). """ diff --git a/stripe/_account_external_account_service.py b/stripe/_account_external_account_service.py index e708b784b..0a15d7b8f 100644 --- a/stripe/_account_external_account_service.py +++ b/stripe/_account_external_account_service.py @@ -27,7 +27,7 @@ class CreateParams(TypedDict): "AccountExternalAccountService.CreateParamsCardToken", ] """ - Please refer to full [documentation](https://stripe.com/docs/api) instead. + A token, like the ones returned by [Stripe.js](https://stripe.com/docs/js) or a dictionary containing a user's external account details (with the options shown below). Please refer to full [documentation](https://stripe.com/docs/api/external_accounts) instead. """ metadata: NotRequired[Dict[str, str]] """ diff --git a/stripe/_account_person_service.py b/stripe/_account_person_service.py index d19b8e948..76b35dea2 100644 --- a/stripe/_account_person_service.py +++ b/stripe/_account_person_service.py @@ -109,7 +109,7 @@ class CreateParams(TypedDict): """ The person's phone number. """ - political_exposure: NotRequired[str] + political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -546,7 +546,7 @@ class UpdateParams(TypedDict): """ The person's phone number. """ - political_exposure: NotRequired[str] + political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 2db685949..82866733b 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -296,6 +296,12 @@ class CreateParamsCapabilities(TypedDict): """ The bank_transfer_payments capability. """ + billie_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesBilliePayments" + ] + """ + The billie_payments capability. + """ blik_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesBlikPayments" ] @@ -446,6 +452,12 @@ class CreateParamsCapabilities(TypedDict): """ The naver_pay_payments capability. """ + nz_bank_account_becs_debit_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesNzBankAccountBecsDebitPayments" + ] + """ + The nz_bank_account_becs_debit_payments capability. + """ oxxo_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesOxxoPayments" ] @@ -494,6 +506,12 @@ class CreateParamsCapabilities(TypedDict): """ The samsung_pay_payments capability. """ + satispay_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesSatispayPayments" + ] + """ + The satispay_payments capability. + """ sepa_bank_transfer_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesSepaBankTransferPayments" ] @@ -621,6 +639,12 @@ class CreateParamsCapabilitiesBankTransferPayments(TypedDict): 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 CreateParamsCapabilitiesBilliePayments(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 CreateParamsCapabilitiesBlikPayments(TypedDict): requested: NotRequired[bool] """ @@ -771,6 +795,12 @@ class CreateParamsCapabilitiesNaverPayPayments(TypedDict): 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 CreateParamsCapabilitiesNzBankAccountBecsDebitPayments(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 CreateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired[bool] """ @@ -819,6 +849,12 @@ class CreateParamsCapabilitiesSamsungPayPayments(TypedDict): 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 CreateParamsCapabilitiesSatispayPayments(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 CreateParamsCapabilitiesSepaBankTransferPayments(TypedDict): requested: NotRequired[bool] """ @@ -980,6 +1016,9 @@ class CreateParamsCompany(TypedDict): ownership_exemption_reason: NotRequired[ "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" ] + """ + This value is used to determine if a business is exempt from providing ultimate beneficial owners. See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details. + """ phone: NotRequired[str] """ The company's phone number (used for verification). @@ -1598,6 +1637,10 @@ class CreateParamsSettings(TypedDict): """ Settings specific to card charging on the account. """ + invoices: NotRequired["AccountService.CreateParamsSettingsInvoices"] + """ + Settings specific to the account's use of Invoices. + """ payments: NotRequired["AccountService.CreateParamsSettingsPayments"] """ Settings that apply across payment methods for charging on the account. @@ -1687,6 +1730,14 @@ class CreateParamsSettingsCardPaymentsDeclineOn(TypedDict): Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. """ + class CreateParamsSettingsInvoices(TypedDict): + hosted_payment_method_save: NotRequired[ + Literal["always", "never", "offer"] + ] + """ + Whether payment methods should be saved when a payment is completed for a one-time invoices on a hosted invoice page. + """ + class CreateParamsSettingsPayments(TypedDict): statement_descriptor: NotRequired[str] """ @@ -2111,6 +2162,12 @@ class UpdateParamsCapabilities(TypedDict): """ The bank_transfer_payments capability. """ + billie_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesBilliePayments" + ] + """ + The billie_payments capability. + """ blik_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesBlikPayments" ] @@ -2261,6 +2318,12 @@ class UpdateParamsCapabilities(TypedDict): """ The naver_pay_payments capability. """ + nz_bank_account_becs_debit_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesNzBankAccountBecsDebitPayments" + ] + """ + The nz_bank_account_becs_debit_payments capability. + """ oxxo_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesOxxoPayments" ] @@ -2309,6 +2372,12 @@ class UpdateParamsCapabilities(TypedDict): """ The samsung_pay_payments capability. """ + satispay_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesSatispayPayments" + ] + """ + The satispay_payments capability. + """ sepa_bank_transfer_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesSepaBankTransferPayments" ] @@ -2436,6 +2505,12 @@ class UpdateParamsCapabilitiesBankTransferPayments(TypedDict): 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 UpdateParamsCapabilitiesBilliePayments(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 UpdateParamsCapabilitiesBlikPayments(TypedDict): requested: NotRequired[bool] """ @@ -2586,6 +2661,12 @@ class UpdateParamsCapabilitiesNaverPayPayments(TypedDict): 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 UpdateParamsCapabilitiesNzBankAccountBecsDebitPayments(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 UpdateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired[bool] """ @@ -2634,6 +2715,12 @@ class UpdateParamsCapabilitiesSamsungPayPayments(TypedDict): 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 UpdateParamsCapabilitiesSatispayPayments(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 UpdateParamsCapabilitiesSepaBankTransferPayments(TypedDict): requested: NotRequired[bool] """ @@ -2795,6 +2882,9 @@ class UpdateParamsCompany(TypedDict): ownership_exemption_reason: NotRequired[ "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" ] + """ + This value is used to determine if a business is exempt from providing ultimate beneficial owners. See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details. + """ phone: NotRequired[str] """ The company's phone number (used for verification). @@ -3473,6 +3563,12 @@ class UpdateParamsSettingsInvoices(TypedDict): """ The list of default Account Tax IDs to automatically include on invoices. Account Tax IDs get added when an invoice is finalized. """ + hosted_payment_method_save: NotRequired[ + Literal["always", "never", "offer"] + ] + """ + Whether payment methods should be saved when a payment is completed for a one-time invoices on a hosted invoice page. + """ class UpdateParamsSettingsPayments(TypedDict): statement_descriptor: NotRequired[str] diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 5b7c592d6..174f150b1 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2025-02-24.acacia" + CURRENT = "2025-03-31.basil" diff --git a/stripe/_application_fee.py b/stripe/_application_fee.py index b7051d248..70a782590 100644 --- a/stripe/_application_fee.py +++ b/stripe/_application_fee.py @@ -39,7 +39,7 @@ class FeeSource(StripeObject): """ type: Literal["charge", "payout"] """ - Type of object that created the application fee, either `charge` or `payout`. + Type of object that created the application fee. """ class CreateRefundParams(RequestOptions): diff --git a/stripe/_balance_transaction.py b/stripe/_balance_transaction.py index 35712d5ab..48a87a274 100644 --- a/stripe/_balance_transaction.py +++ b/stripe/_balance_transaction.py @@ -104,7 +104,7 @@ class ListParams(RequestOptions): """ type: NotRequired[str] """ - Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. """ class ListParamsCreated(TypedDict): @@ -242,6 +242,8 @@ class RetrieveParams(RequestOptions): "refund_failure", "reserve_transaction", "reserved_funds", + "stripe_balance_payment_debit", + "stripe_balance_payment_debit_reversal", "stripe_fee", "stripe_fx_fee", "tax_fee", @@ -253,7 +255,7 @@ class RetrieveParams(RequestOptions): "transfer_refund", ] """ - Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. + Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. """ @classmethod diff --git a/stripe/_balance_transaction_service.py b/stripe/_balance_transaction_service.py index 4f75e6359..a47dde87c 100644 --- a/stripe/_balance_transaction_service.py +++ b/stripe/_balance_transaction_service.py @@ -45,7 +45,7 @@ class ListParams(TypedDict): """ type: NotRequired[str] """ - Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. """ class ListParamsCreated(TypedDict): diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index fc827b93b..385cdbefa 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -37,6 +37,7 @@ class BankAccount( class FutureRequirements(StripeObject): class Error(StripeObject): code: Literal[ + "information_missing", "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", @@ -49,6 +50,7 @@ class Error(StripeObject): "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", + "invalid_signator", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", @@ -110,6 +112,7 @@ class Error(StripeObject): "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", + "verification_failed_authorizer_authority", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", @@ -124,6 +127,7 @@ class Error(StripeObject): "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", + "verification_rejected_ownership_exemption_reason", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", "verification_supportability", @@ -161,6 +165,7 @@ class Error(StripeObject): class Requirements(StripeObject): class Error(StripeObject): code: Literal[ + "information_missing", "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", @@ -173,6 +178,7 @@ class Error(StripeObject): "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", + "invalid_signator", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", @@ -234,6 +240,7 @@ class Error(StripeObject): "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", + "verification_failed_authorizer_authority", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", @@ -248,6 +255,7 @@ class Error(StripeObject): "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", + "verification_rejected_ownership_exemption_reason", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", "verification_supportability", @@ -287,7 +295,7 @@ class DeleteParams(RequestOptions): account: Optional[ExpandableField["Account"]] """ - The ID of the account that the bank account is associated with. + The account this bank account belongs to. Only applicable on Accounts (not customers or recipients) This property is only available when returned as an [External Account](https://stripe.com/api/external_account_bank_accounts/object) where [controller.is_controller](https://stripe.com/api/accounts/object#account_object-controller-is_controller) is `true`. """ account_holder_name: Optional[str] """ diff --git a/stripe/_capability.py b/stripe/_capability.py index c9575c8ea..4fa14dd4b 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -31,6 +31,7 @@ class Alternative(StripeObject): class Error(StripeObject): code: Literal[ + "information_missing", "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", @@ -43,6 +44,7 @@ class Error(StripeObject): "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", + "invalid_signator", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", @@ -104,6 +106,7 @@ class Error(StripeObject): "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", + "verification_failed_authorizer_authority", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", @@ -118,6 +121,7 @@ class Error(StripeObject): "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", + "verification_rejected_ownership_exemption_reason", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", "verification_supportability", @@ -194,6 +198,7 @@ class Alternative(StripeObject): class Error(StripeObject): code: Literal[ + "information_missing", "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", @@ -206,6 +211,7 @@ class Error(StripeObject): "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", + "invalid_signator", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", @@ -267,6 +273,7 @@ class Error(StripeObject): "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", + "verification_failed_authorizer_authority", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", @@ -281,6 +288,7 @@ class Error(StripeObject): "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", + "verification_rejected_ownership_exemption_reason", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", "verification_supportability", diff --git a/stripe/_card.py b/stripe/_card.py index 1b1def6a1..9fb1805f2 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -37,9 +37,6 @@ class DeleteParams(RequestOptions): pass account: Optional[ExpandableField["Account"]] - """ - The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. - """ address_city: Optional[str] """ City/District/Suburb/Town/Village. @@ -90,7 +87,7 @@ class DeleteParams(RequestOptions): """ currency: Optional[str] """ - Three-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. Must be a [supported currency](https://docs.stripe.com/currencies). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + Three-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. Must be a [supported currency](https://docs.stripe.com/currencies). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available when returned as an [External Account](https://stripe.com/api/external_account_cards/object) where [controller.is_controller](https://stripe.com/api/accounts/object#account_object-controller-is_controller) is `true`. """ customer: Optional[ExpandableField["Customer"]] """ diff --git a/stripe/_charge.py b/stripe/_charge.py index 612e1196c..fd71bd4cc 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -38,7 +38,6 @@ from stripe._bank_account import BankAccount from stripe._card import Card as CardResource from stripe._customer import Customer - from stripe._invoice import Invoice from stripe._mandate import Mandate from stripe._payment_intent import PaymentIntent from stripe._payment_method import PaymentMethod @@ -409,6 +408,9 @@ class Bancontact(StripeObject): (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ + class Billie(StripeObject): + pass + class Blik(StripeObject): buyer_id: Optional[str] """ @@ -1487,6 +1489,32 @@ class NaverPay(StripeObject): A unique identifier for the buyer as determined by the local payment processor. """ + class NzBankAccount(StripeObject): + account_holder_name: Optional[str] + """ + The name on the bank account. Only present if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + bank_name: str + """ + The name of the bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + last4: str + """ + Last four digits of the bank account number. + """ + suffix: Optional[str] + """ + The suffix of the bank account number. + """ + class Oxxo(StripeObject): number: Optional[str] """ @@ -1652,6 +1680,9 @@ class SamsungPay(StripeObject): A unique identifier for the buyer as determined by the local payment processor. """ + class Satispay(StripeObject): + pass + class SepaCreditTransfer(StripeObject): bank_name: Optional[str] """ @@ -1815,6 +1846,7 @@ class Zip(StripeObject): au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] + billie: Optional[Billie] blik: Optional[Blik] boleto: Optional[Boleto] card: Optional[Card] @@ -1835,6 +1867,7 @@ class Zip(StripeObject): mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] naver_pay: Optional[NaverPay] + nz_bank_account: Optional[NzBankAccount] oxxo: Optional[Oxxo] p24: Optional[P24] pay_by_bank: Optional[PayByBank] @@ -1845,6 +1878,7 @@ class Zip(StripeObject): promptpay: Optional[Promptpay] revolut_pay: Optional[RevolutPay] samsung_pay: Optional[SamsungPay] + satispay: Optional[Satispay] sepa_credit_transfer: Optional[SepaCreditTransfer] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] @@ -1873,6 +1907,7 @@ class Zip(StripeObject): "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, + "billie": Billie, "blik": Blik, "boleto": Boleto, "card": Card, @@ -1893,6 +1928,7 @@ class Zip(StripeObject): "mobilepay": Mobilepay, "multibanco": Multibanco, "naver_pay": NaverPay, + "nz_bank_account": NzBankAccount, "oxxo": Oxxo, "p24": P24, "pay_by_bank": PayByBank, @@ -1903,6 +1939,7 @@ class Zip(StripeObject): "promptpay": Promptpay, "revolut_pay": RevolutPay, "samsung_pay": SamsungPay, + "satispay": Satispay, "sepa_credit_transfer": SepaCreditTransfer, "sepa_debit": SepaDebit, "sofort": Sofort, @@ -1915,6 +1952,16 @@ class Zip(StripeObject): "zip": Zip, } + class PresentmentDetails(StripeObject): + presentment_amount: int + """ + Amount intended to be collected by this payment, denominated in presentment_currency. + """ + presentment_currency: str + """ + Currency presented to the customer during payment. + """ + class RadarOptions(StripeObject): session: Optional[str] """ @@ -1980,7 +2027,7 @@ class TransferData(StripeObject): class CaptureParams(RequestOptions): amount: NotRequired[int] """ - The amount to capture, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. + The amount to capture, which must be less than or equal to the original amount. """ application_fee: NotRequired[int] """ @@ -2442,10 +2489,6 @@ class SearchParams(RequestOptions): """ Unique identifier for the object. """ - invoice: Optional[ExpandableField["Invoice"]] - """ - ID of the invoice this charge is for if one exists. - """ level3: Optional[Level3] livemode: bool """ @@ -2483,6 +2526,7 @@ class SearchParams(RequestOptions): """ Details about the payment method at the time of the transaction. """ + presentment_details: Optional[PresentmentDetails] radar_options: Optional[RadarOptions] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. @@ -2960,6 +3004,7 @@ async def list_refunds_async( "level3": Level3, "outcome": Outcome, "payment_method_details": PaymentMethodDetails, + "presentment_details": PresentmentDetails, "radar_options": RadarOptions, "shipping": Shipping, "transfer_data": TransferData, diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index 28992cf71..d1179a588 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -14,7 +14,7 @@ class ChargeService(StripeService): class CaptureParams(TypedDict): amount: NotRequired[int] """ - The amount to capture, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. + The amount to capture, which must be less than or equal to the original amount. """ application_fee: NotRequired[int] """ diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 53ce0d8ef..531926f2a 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -144,6 +144,9 @@ class BacsDebit(StripeObject): class Bancontact(StripeObject): pass + class Billie(StripeObject): + pass + class BillingDetails(StripeObject): class Address(StripeObject): city: Optional[str] @@ -1112,11 +1115,41 @@ class Multibanco(StripeObject): pass class NaverPay(StripeObject): + buyer_id: Optional[str] + """ + Uniquely identifies this particular Naver Pay account. You can use this attribute to check whether two Naver Pay accounts are the same. + """ funding: Literal["card", "points"] """ Whether to fund this transaction with Naver Pay points or a card. """ + class NzBankAccount(StripeObject): + account_holder_name: Optional[str] + """ + The name on the bank account. Only present if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + bank_name: str + """ + The name of the bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + last4: str + """ + Last four digits of the bank account number. + """ + suffix: Optional[str] + """ + The suffix of the bank account number. + """ + class Oxxo(StripeObject): pass @@ -1191,6 +1224,9 @@ class RevolutPay(StripeObject): class SamsungPay(StripeObject): pass + class Satispay(StripeObject): + pass + class SepaDebit(StripeObject): class GeneratedFrom(StripeObject): charge: Optional[ExpandableField["Charge"]] @@ -1349,6 +1385,7 @@ class Zip(StripeObject): au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] + billie: Optional[Billie] billing_details: BillingDetails blik: Optional[Blik] boleto: Optional[Boleto] @@ -1374,6 +1411,7 @@ class Zip(StripeObject): mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] naver_pay: Optional[NaverPay] + nz_bank_account: Optional[NzBankAccount] oxxo: Optional[Oxxo] p24: Optional[P24] pay_by_bank: Optional[PayByBank] @@ -1384,6 +1422,7 @@ class Zip(StripeObject): promptpay: Optional[Promptpay] revolut_pay: Optional[RevolutPay] samsung_pay: Optional[SamsungPay] + satispay: Optional[Satispay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] @@ -1398,6 +1437,7 @@ class Zip(StripeObject): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -1418,6 +1458,7 @@ class Zip(StripeObject): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -1428,6 +1469,7 @@ class Zip(StripeObject): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -1452,6 +1494,7 @@ class Zip(StripeObject): "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, + "billie": Billie, "billing_details": BillingDetails, "blik": Blik, "boleto": Boleto, @@ -1473,6 +1516,7 @@ class Zip(StripeObject): "mobilepay": Mobilepay, "multibanco": Multibanco, "naver_pay": NaverPay, + "nz_bank_account": NzBankAccount, "oxxo": Oxxo, "p24": P24, "pay_by_bank": PayByBank, @@ -1483,6 +1527,7 @@ class Zip(StripeObject): "promptpay": Promptpay, "revolut_pay": RevolutPay, "samsung_pay": SamsungPay, + "satispay": Satispay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, @@ -1621,6 +1666,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataBillingDetails" ] @@ -1735,6 +1786,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataOxxo" ] @@ -1797,6 +1854,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataSepaDebit" ] @@ -1831,6 +1894,7 @@ class CreateParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -1848,6 +1912,7 @@ class CreateParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -1858,6 +1923,7 @@ class CreateParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -1938,6 +2004,9 @@ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): class CreateParamsPaymentMethodDataBancontact(TypedDict): pass + class CreateParamsPaymentMethodDataBillie(TypedDict): + pass + class CreateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|ConfirmationToken.CreateParamsPaymentMethodDataBillingDetailsAddress" @@ -2149,6 +2218,29 @@ class CreateParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class CreateParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2217,6 +2309,9 @@ class CreateParamsPaymentMethodDataRevolutPay(TypedDict): class CreateParamsPaymentMethodDataSamsungPay(TypedDict): pass + class CreateParamsPaymentMethodDataSatispay(TypedDict): + pass + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 79ae44b42..cf84c1d70 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -24,7 +24,7 @@ from stripe._customer_balance_transaction import CustomerBalanceTransaction from stripe._discount import Discount from stripe._invoice import Invoice - from stripe._refund import Refund + from stripe._refund import Refund as RefundResource from stripe._shipping_rate import ShippingRate from stripe._tax_rate import TaxRate from stripe.billing._credit_balance_transaction import ( @@ -76,6 +76,16 @@ class PretaxCreditAmount(StripeObject): Type of the pretax credit amount referenced. """ + class Refund(StripeObject): + amount_refunded: int + """ + Amount of the refund that applies to this credit note, in cents (or local equivalent). + """ + refund: ExpandableField["RefundResource"] + """ + ID of the refund. + """ + class ShippingCost(StripeObject): class Tax(StripeObject): amount: int @@ -137,37 +147,39 @@ class Tax(StripeObject): """ _inner_class_types = {"taxes": Tax} - class TaxAmount(StripeObject): + class TotalTax(StripeObject): + class TaxRateDetails(StripeObject): + tax_rate: str + amount: int """ - The amount, in cents (or local equivalent), of the tax. - """ - inclusive: bool - """ - Whether this tax amount is inclusive or exclusive. - """ - tax_rate: ExpandableField["TaxRate"] - """ - The tax rate that was applied to get this tax amount. - """ - taxability_reason: Optional[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", - ] + The amount of the tax, in cents (or local equivalent). + """ + tax_behavior: Literal["exclusive", "inclusive"] + """ + Whether this tax is inclusive or exclusive. + """ + tax_rate_details: Optional[TaxRateDetails] + """ + Additional details about the tax rate. Only present when `type` is `tax_rate_details`. + """ + taxability_reason: Literal[ + "customer_exempt", + "not_available", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. @@ -176,6 +188,11 @@ class TaxAmount(StripeObject): """ The amount on which tax is calculated, in cents (or local equivalent). """ + type: Literal["tax_rate_details"] + """ + The type of tax information. + """ + _inner_class_types = {"tax_rate_details": TaxRateDetails} class CreateParams(RequestOptions): amount: NotRequired[int] @@ -229,14 +246,14 @@ class CreateParams(RequestOptions): """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: NotRequired[str] - """ - ID of an existing refund to link this credit note to. - """ refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ + refunds: NotRequired[List["CreditNote.CreateParamsRefund"]] + """ + Refunds to link to this credit note. + """ shipping_cost: NotRequired["CreditNote.CreateParamsShippingCost"] """ When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. @@ -296,6 +313,16 @@ class CreateParamsLineTaxAmount(TypedDict): The amount on which tax is calculated, in cents (or local equivalent). """ + class CreateParamsRefund(TypedDict): + amount_refunded: NotRequired[int] + """ + Amount of the refund that applies to this credit note, in cents (or local equivalent). Defaults to the entire refund amount. + """ + refund: NotRequired[str] + """ + ID of an existing refund to link this credit note to. + """ + class CreateParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ @@ -442,14 +469,14 @@ class PreviewLinesParams(RequestOptions): """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: NotRequired[str] - """ - ID of an existing refund to link this credit note to. - """ refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ + refunds: NotRequired[List["CreditNote.PreviewLinesParamsRefund"]] + """ + Refunds to link to this credit note. + """ shipping_cost: NotRequired["CreditNote.PreviewLinesParamsShippingCost"] """ When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. @@ -513,6 +540,16 @@ class PreviewLinesParamsLineTaxAmount(TypedDict): The amount on which tax is calculated, in cents (or local equivalent). """ + class PreviewLinesParamsRefund(TypedDict): + amount_refunded: NotRequired[int] + """ + Amount of the refund that applies to this credit note, in cents (or local equivalent). Defaults to the entire refund amount. + """ + refund: NotRequired[str] + """ + ID of an existing refund to link this credit note to. + """ + class PreviewLinesParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ @@ -571,14 +608,14 @@ class PreviewParams(RequestOptions): """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: NotRequired[str] - """ - ID of an existing refund to link this credit note to. - """ refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ + refunds: NotRequired[List["CreditNote.PreviewParamsRefund"]] + """ + Refunds to link to this credit note. + """ shipping_cost: NotRequired["CreditNote.PreviewParamsShippingCost"] """ When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. @@ -638,6 +675,16 @@ class PreviewParamsLineTaxAmount(TypedDict): The amount on which tax is calculated, in cents (or local equivalent). """ + class PreviewParamsRefund(TypedDict): + amount_refunded: NotRequired[int] + """ + Amount of the refund that applies to this credit note, in cents (or local equivalent). Defaults to the entire refund amount. + """ + refund: NotRequired[str] + """ + ID of an existing refund to link this credit note to. + """ + class PreviewParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ @@ -746,9 +793,9 @@ class VoidCreditNoteParams(RequestOptions): """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: Optional[ExpandableField["Refund"]] + refunds: List[Refund] """ - Refund related to this credit note. + Refunds related to this credit note. """ shipping_cost: Optional[ShippingCost] """ @@ -766,10 +813,6 @@ class VoidCreditNoteParams(RequestOptions): """ The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts. """ - tax_amounts: List[TaxAmount] - """ - The aggregate amounts calculated per tax rate for all line items. - """ total: int """ The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount. @@ -778,6 +821,10 @@ class VoidCreditNoteParams(RequestOptions): """ The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts. """ + total_taxes: Optional[List[TotalTax]] + """ + The aggregate tax information for all line items. + """ type: Literal["post_payment", "pre_payment"] """ Type of this credit note, one of `pre_payment` or `post_payment`. A `pre_payment` credit note means it was issued when the invoice was open. A `post_payment` credit note means it was issued when the invoice was paid. @@ -1150,6 +1197,7 @@ async def list_lines_async( _inner_class_types = { "discount_amounts": DiscountAmount, "pretax_credit_amounts": PretaxCreditAmount, + "refunds": Refund, "shipping_cost": ShippingCost, - "tax_amounts": TaxAmount, + "total_taxes": TotalTax, } diff --git a/stripe/_credit_note_line_item.py b/stripe/_credit_note_line_item.py index 29527a814..2fe476012 100644 --- a/stripe/_credit_note_line_item.py +++ b/stripe/_credit_note_line_item.py @@ -52,37 +52,39 @@ class PretaxCreditAmount(StripeObject): Type of the pretax credit amount referenced. """ - class TaxAmount(StripeObject): + class Tax(StripeObject): + class TaxRateDetails(StripeObject): + tax_rate: str + amount: int """ - The amount, in cents (or local equivalent), of the tax. - """ - inclusive: bool - """ - Whether this tax amount is inclusive or exclusive. - """ - tax_rate: ExpandableField["TaxRate"] - """ - The tax rate that was applied to get this tax amount. - """ - taxability_reason: Optional[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", - ] + The amount of the tax, in cents (or local equivalent). + """ + tax_behavior: Literal["exclusive", "inclusive"] + """ + Whether this tax is inclusive or exclusive. + """ + tax_rate_details: Optional[TaxRateDetails] + """ + Additional details about the tax rate. Only present when `type` is `tax_rate_details`. + """ + taxability_reason: Literal[ + "customer_exempt", + "not_available", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. @@ -91,15 +93,16 @@ class TaxAmount(StripeObject): """ The amount on which tax is calculated, in cents (or local equivalent). """ + type: Literal["tax_rate_details"] + """ + The type of tax information. + """ + _inner_class_types = {"tax_rate_details": TaxRateDetails} amount: int """ The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. """ - amount_excluding_tax: Optional[int] - """ - The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts. - """ description: Optional[str] """ Description of the item being credited. @@ -136,14 +139,14 @@ class TaxAmount(StripeObject): """ The number of units of product being credited. """ - tax_amounts: List[TaxAmount] - """ - The amount of tax calculated per tax rate for this line item - """ tax_rates: List["TaxRate"] """ The tax rates which apply to the line item. """ + taxes: Optional[List[Tax]] + """ + The tax information of the line item. + """ type: Literal["custom_line_item", "invoice_line_item"] """ The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. @@ -156,12 +159,8 @@ class TaxAmount(StripeObject): """ Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. """ - unit_amount_excluding_tax: Optional[str] - """ - The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts. - """ _inner_class_types = { "discount_amounts": DiscountAmount, "pretax_credit_amounts": PretaxCreditAmount, - "tax_amounts": TaxAmount, + "taxes": Tax, } diff --git a/stripe/_credit_note_preview_lines_service.py b/stripe/_credit_note_preview_lines_service.py index bce76c93a..4923a5d63 100644 --- a/stripe/_credit_note_preview_lines_service.py +++ b/stripe/_credit_note_preview_lines_service.py @@ -71,14 +71,16 @@ class ListParams(TypedDict): """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: NotRequired[str] - """ - ID of an existing refund to link this credit note to. - """ refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ + refunds: NotRequired[ + List["CreditNotePreviewLinesService.ListParamsRefund"] + ] + """ + Refunds to link to this credit note. + """ shipping_cost: NotRequired[ "CreditNotePreviewLinesService.ListParamsShippingCost" ] @@ -144,6 +146,16 @@ class ListParamsLineTaxAmount(TypedDict): The amount on which tax is calculated, in cents (or local equivalent). """ + class ListParamsRefund(TypedDict): + amount_refunded: NotRequired[int] + """ + Amount of the refund that applies to this credit note, in cents (or local equivalent). Defaults to the entire refund amount. + """ + refund: NotRequired[str] + """ + ID of an existing refund to link this credit note to. + """ + class ListParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index f68cf465d..6735fd69d 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -71,14 +71,14 @@ class CreateParams(TypedDict): """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: NotRequired[str] - """ - ID of an existing refund to link this credit note to. - """ refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ + refunds: NotRequired[List["CreditNoteService.CreateParamsRefund"]] + """ + Refunds to link to this credit note. + """ shipping_cost: NotRequired[ "CreditNoteService.CreateParamsShippingCost" ] @@ -140,6 +140,16 @@ class CreateParamsLineTaxAmount(TypedDict): The amount on which tax is calculated, in cents (or local equivalent). """ + class CreateParamsRefund(TypedDict): + amount_refunded: NotRequired[int] + """ + Amount of the refund that applies to this credit note, in cents (or local equivalent). Defaults to the entire refund amount. + """ + refund: NotRequired[str] + """ + ID of an existing refund to link this credit note to. + """ + class CreateParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ @@ -246,14 +256,14 @@ class PreviewParams(TypedDict): """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ - refund: NotRequired[str] - """ - ID of an existing refund to link this credit note to. - """ refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ + refunds: NotRequired[List["CreditNoteService.PreviewParamsRefund"]] + """ + Refunds to link to this credit note. + """ shipping_cost: NotRequired[ "CreditNoteService.PreviewParamsShippingCost" ] @@ -315,6 +325,16 @@ class PreviewParamsLineTaxAmount(TypedDict): The amount on which tax is calculated, in cents (or local equivalent). """ + class PreviewParamsRefund(TypedDict): + amount_refunded: NotRequired[int] + """ + Amount of the refund that applies to this credit note, in cents (or local equivalent). Defaults to the entire refund amount. + """ + refund: NotRequired[str] + """ + ID of an existing refund to link this credit note to. + """ + class PreviewParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ diff --git a/stripe/_customer.py b/stripe/_customer.py index 2def891ce..f7aa227b2 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -187,7 +187,7 @@ class Tax(StripeObject): class Location(StripeObject): country: str """ - The customer's country as identified by Stripe Tax. + The identified tax country of the customer. """ source: Literal[ "billing_address", @@ -200,7 +200,7 @@ class Location(StripeObject): """ state: Optional[str] """ - The customer's state, county, province, or region as identified by Stripe Tax. + The identified tax state, county, province, or region of the customer. """ automatic_tax: Literal[ @@ -215,7 +215,7 @@ class Location(StripeObject): """ location: Optional[Location] """ - The customer's location as identified by Stripe Tax. + The identified tax location of the customer. """ _inner_class_types = {"location": Location} @@ -304,7 +304,6 @@ class CreateParams(RequestOptions): """ Balance information and default balance settings for this customer. """ - coupon: NotRequired[str] description: NotRequired[str] """ An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. @@ -346,10 +345,6 @@ class CreateParams(RequestOptions): """ Customer's preferred languages, ordered by preference. """ - promotion_code: NotRequired[str] - """ - The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. - """ shipping: NotRequired["Literal['']|Customer.CreateParamsShipping"] """ The customer's shipping information. Appears on invoices emailed to this customer. @@ -902,6 +897,7 @@ class ListPaymentMethodsParams(RequestOptions): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -920,6 +916,7 @@ class ListPaymentMethodsParams(RequestOptions): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -930,6 +927,7 @@ class ListPaymentMethodsParams(RequestOptions): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -1028,7 +1026,6 @@ class ModifyParams(RequestOptions): """ Balance information and default balance settings for this customer. """ - coupon: NotRequired[str] default_source: NotRequired[str] """ If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. @@ -1077,10 +1074,6 @@ class ModifyParams(RequestOptions): """ Customer's preferred languages, ordered by preference. """ - promotion_code: NotRequired[str] - """ - The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. - """ shipping: NotRequired["Literal['']|Customer.ModifyParamsShipping"] """ The customer's shipping information. Appears on invoices emailed to this customer. diff --git a/stripe/_customer_balance_transaction.py b/stripe/_customer_balance_transaction.py index 2befceca3..9ace24801 100644 --- a/stripe/_customer_balance_transaction.py +++ b/stripe/_customer_balance_transaction.py @@ -10,6 +10,7 @@ if TYPE_CHECKING: from stripe._credit_note import CreditNote from stripe._invoice import Invoice + from stripe.checkout._session import Session class CustomerBalanceTransaction(APIResource["CustomerBalanceTransaction"]): @@ -29,6 +30,10 @@ class CustomerBalanceTransaction(APIResource["CustomerBalanceTransaction"]): """ The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`. """ + checkout_session: Optional[ExpandableField["Session"]] + """ + The ID of the checkout session (if any) that created the transaction. + """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. @@ -76,6 +81,8 @@ class CustomerBalanceTransaction(APIResource["CustomerBalanceTransaction"]): type: Literal[ "adjustment", "applied_to_invoice", + "checkout_session_subscription_payment", + "checkout_session_subscription_payment_canceled", "credit_note", "initial", "invoice_overpaid", @@ -86,7 +93,7 @@ class CustomerBalanceTransaction(APIResource["CustomerBalanceTransaction"]): "unspent_receiver_credit", ] """ - Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. + Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, `unapplied_from_invoice`, `checkout_session_subscription_payment`, or `checkout_session_subscription_payment_canceled`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. """ def instance_url(self): diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 6129e037c..f1443bde8 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -44,6 +44,7 @@ class ListParams(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -62,6 +63,7 @@ class ListParams(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -72,6 +74,7 @@ class ListParams(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index 15fd4a4d2..2aed873e0 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -58,7 +58,6 @@ class CreateParams(TypedDict): """ Balance information and default balance settings for this customer. """ - coupon: NotRequired[str] description: NotRequired[str] """ An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. @@ -102,10 +101,6 @@ class CreateParams(TypedDict): """ Customer's preferred languages, ordered by preference. """ - promotion_code: NotRequired[str] - """ - The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. - """ shipping: NotRequired[ "Literal['']|CustomerService.CreateParamsShipping" ] @@ -474,7 +469,6 @@ class UpdateParams(TypedDict): """ Balance information and default balance settings for this customer. """ - coupon: NotRequired[str] default_source: NotRequired[str] """ If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. @@ -525,10 +519,6 @@ class UpdateParams(TypedDict): """ Customer's preferred languages, ordered by preference. """ - promotion_code: NotRequired[str] - """ - The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. - """ shipping: NotRequired[ "Literal['']|CustomerService.UpdateParamsShipping" ] diff --git a/stripe/_event.py b/stripe/_event.py index 1b9ed4c48..32d0468cd 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -245,6 +245,7 @@ class RetrieveParams(RequestOptions): "invoice.finalized", "invoice.marked_uncollectible", "invoice.overdue", + "invoice.overpaid", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", @@ -395,6 +396,13 @@ class RetrieveParams(RequestOptions): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", + "billing.credit_balance_transaction.created", + "billing.credit_grant.created", + "billing.credit_grant.updated", + "billing.meter.created", + "billing.meter.deactivated", + "billing.meter.reactivated", + "billing.meter.updated", ] """ Description of the event (for example, `invoice.created` or `charge.refunded`). diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 465de5fd1..3014f7d36 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -36,13 +36,12 @@ from stripe._application import Application from stripe._bank_account import BankAccount from stripe._card import Card as CardResource - from stripe._charge import Charge from stripe._customer import Customer from stripe._discount import Discount from stripe._invoice_line_item import InvoiceLineItem + from stripe._invoice_payment import InvoicePayment from stripe._payment_intent import PaymentIntent from stripe._payment_method import PaymentMethod - from stripe._quote import Quote from stripe._setup_intent import SetupIntent from stripe._shipping_rate import ShippingRate from stripe._source import Source @@ -136,6 +135,16 @@ class Liability(StripeObject): """ _inner_class_types = {"liability": Liability} + class ConfirmationSecret(StripeObject): + client_secret: str + """ + The client_secret of the payment that Stripe creates for the invoice after finalization. + """ + type: str + """ + The type of client_secret. Currently this is always payment_intent, referencing the default payment_intent that Stripe creates during invoice finalization + """ + class CustomField(StripeObject): name: str """ @@ -412,6 +421,7 @@ class LastFinalizationError(StripeObject): "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", + "forwarding_api_retryable_upstream_error", "forwarding_api_upstream_connection_error", "forwarding_api_upstream_connection_timeout", "idempotency_key_in_use", @@ -508,6 +518,7 @@ class LastFinalizationError(StripeObject): "setup_intent_authentication_failure", "setup_intent_invalid_parameter", "setup_intent_mandate_invalid", + "setup_intent_mobile_wallet_unsupported", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", "shipping_address_invalid", @@ -629,6 +640,45 @@ class LastFinalizationError(StripeObject): The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` """ + class Parent(StripeObject): + class QuoteDetails(StripeObject): + quote: str + """ + The quote that generated this invoice + """ + + class SubscriptionDetails(StripeObject): + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization. + *Note: This attribute is populated only for invoices created on or after June 29, 2023.* + """ + subscription: ExpandableField["Subscription"] + """ + The subscription that generated this invoice + """ + subscription_proration_date: Optional[int] + """ + Only set for upcoming invoices that preview prorations. The time used to calculate prorations. + """ + + quote_details: Optional[QuoteDetails] + """ + Details about the quote that generated this invoice + """ + subscription_details: Optional[SubscriptionDetails] + """ + Details about the subscription that generated this invoice + """ + type: Literal["quote_details", "subscription_details"] + """ + The type of parent that generated this invoice + """ + _inner_class_types = { + "quote_details": QuoteDetails, + "subscription_details": SubscriptionDetails, + } + class PaymentSettings(StripeObject): class PaymentMethodOptions(StripeObject): class AcssDebit(StripeObject): @@ -807,11 +857,13 @@ class Filters(StripeObject): "ideal", "jp_credit_transfer", "kakao_pay", + "klarna", "konbini", "kr_card", "link", "multibanco", "naver_pay", + "nz_bank_account", "p24", "payco", "paynow", @@ -982,13 +1034,6 @@ class StatusTransitions(StripeObject): The time that the invoice was voided. """ - class SubscriptionDetails(StripeObject): - metadata: Optional[Dict[str, str]] - """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization. - *Note: This attribute is populated only for invoices created on or after June 29, 2023.* - """ - class ThresholdReason(StripeObject): class ItemReason(StripeObject): line_item_ids: List[str] @@ -1040,37 +1085,39 @@ class TotalPretaxCreditAmount(StripeObject): Type of the pretax credit amount referenced. """ - class TotalTaxAmount(StripeObject): + class TotalTax(StripeObject): + class TaxRateDetails(StripeObject): + tax_rate: str + amount: int """ - The amount, in cents (or local equivalent), of the tax. + The amount of the tax, in cents (or local equivalent). """ - inclusive: bool + tax_behavior: Literal["exclusive", "inclusive"] """ - Whether this tax amount is inclusive or exclusive. + Whether this tax is inclusive or exclusive. """ - tax_rate: ExpandableField["TaxRate"] + tax_rate_details: Optional[TaxRateDetails] """ - The tax rate that was applied to get this tax amount. + Additional details about the tax rate. Only present when `type` is `tax_rate_details`. """ - taxability_reason: Optional[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", - ] + taxability_reason: Literal[ + "customer_exempt", + "not_available", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. @@ -1079,16 +1126,11 @@ class TotalTaxAmount(StripeObject): """ The amount on which tax is calculated, in cents (or local equivalent). """ - - class TransferData(StripeObject): - amount: Optional[int] - """ - The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. - """ - destination: ExpandableField["Account"] + type: Literal["tax_rate_details"] """ - The account where funds from the payment will be transferred to upon payment success. + The type of tax information. """ + _inner_class_types = {"tax_rate_details": TaxRateDetails} class AddLinesParams(RequestOptions): expand: NotRequired[List[str]] @@ -1135,13 +1177,13 @@ class AddLinesParamsLine(TypedDict): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired[str] + price_data: NotRequired["Invoice.AddLinesParamsLinePriceData"] """ - The ID of the price object. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - price_data: NotRequired["Invoice.AddLinesParamsLinePriceData"] + pricing: NotRequired["Invoice.AddLinesParamsLinePricing"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + The pricing information for the invoice item. """ quantity: NotRequired[int] """ @@ -1189,13 +1231,13 @@ class AddLinesParamsLinePriceData(TypedDict): """ product: NotRequired[str] """ - The ID of the product that this price will belong to. One of `product` or `product_data` is required. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required. """ product_data: NotRequired[ "Invoice.AddLinesParamsLinePriceDataProductData" ] """ - Data used to generate a new product object inline. One of `product` or `product_data` is required. + Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -1234,6 +1276,12 @@ class AddLinesParamsLinePriceDataProductData(TypedDict): A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ + class AddLinesParamsLinePricing(TypedDict): + price: NotRequired[str] + """ + The ID of the price object. + """ + class AddLinesParamsLineTaxAmount(TypedDict): amount: int """ @@ -1245,6 +1293,28 @@ class AddLinesParamsLineTaxAmount(TypedDict): Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. """ + taxability_reason: NotRequired[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ] + ] + """ + The reasoning behind this tax, for example, if the product is tax exempt. + """ taxable_amount: int """ The amount on which tax is calculated, in cents (or local equivalent). @@ -1271,6 +1341,14 @@ class AddLinesParamsLineTaxAmountTaxRateData(TypedDict): """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ + jurisdiction_level: NotRequired[ + Literal[ + "city", "country", "county", "district", "multiple", "state" + ] + ] + """ + The level of the jurisdiction that imposes this tax rate. + """ percentage: float """ The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. @@ -1515,7 +1593,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1937,10 +2015,6 @@ class CreatePreviewParams(RequestOptions): """ Settings for automatic tax lookup for this invoice preview. """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ currency: NotRequired[str] """ The currency to preview this invoice in. Defaults to that of `customer` if not specified. @@ -2356,7 +2430,7 @@ class CreatePreviewParamsInvoiceItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -2424,22 +2498,12 @@ class CreatePreviewParamsScheduleDetailsPhase(TypedDict): """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: NotRequired[ - "Literal['']|Invoice.CreatePreviewParamsScheduleDetailsPhaseBillingThresholds" - ] - """ - 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. - """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ currency: NotRequired[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). @@ -2566,7 +2630,7 @@ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData( """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -2607,16 +2671,6 @@ class CreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability( Type of the account referenced in the request. """ - class CreatePreviewParamsScheduleDetailsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class CreatePreviewParamsScheduleDetailsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ @@ -2660,12 +2714,6 @@ class CreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer( """ class CreatePreviewParamsScheduleDetailsPhaseItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|Invoice.CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ discounts: NotRequired[ "Literal['']|List[Invoice.CreatePreviewParamsScheduleDetailsPhaseItemDiscount]" ] @@ -2699,14 +2747,6 @@ class CreatePreviewParamsScheduleDetailsPhaseItem(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds( - TypedDict, - ): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class CreatePreviewParamsScheduleDetailsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -2728,7 +2768,7 @@ class CreatePreviewParamsScheduleDetailsPhaseItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "Invoice.CreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring" """ @@ -2822,12 +2862,6 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): """ class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|Invoice.CreatePreviewParamsSubscriptionDetailsItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ clear_usage: NotRequired[bool] """ 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. @@ -2873,14 +2907,6 @@ class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class CreatePreviewParamsSubscriptionDetailsItemBillingThresholds( - TypedDict, - ): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class CreatePreviewParamsSubscriptionDetailsItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -2902,7 +2928,7 @@ class CreatePreviewParamsSubscriptionDetailsItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "Invoice.CreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring" """ @@ -3239,7 +3265,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -3742,2482 +3768,188 @@ class SendInvoiceParams(RequestOptions): Specifies which fields in the response should be expanded. """ - class UpcomingLinesParams(RequestOptions): - automatic_tax: NotRequired["Invoice.UpcomingLinesParamsAutomaticTax"] - """ - Settings for automatic tax lookup for this invoice preview. - """ - coupon: NotRequired[str] + class UpdateLinesParams(RequestOptions): + expand: NotRequired[List[str]] """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + Specifies which fields in the response should be expanded. """ - currency: NotRequired[str] + invoice_metadata: NotRequired["Literal['']|Dict[str, str]"] """ - The currency to preview this invoice in. Defaults to that of `customer` if not specified. + Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. """ - customer: NotRequired[str] + lines: List["Invoice.UpdateLinesParamsLine"] """ - The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + The line items to update. """ - customer_details: NotRequired[ - "Invoice.UpcomingLinesParamsCustomerDetails" - ] + + class UpdateLinesParamsLine(TypedDict): + amount: NotRequired[int] """ - Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingLinesParamsDiscount]" - ] + description: NotRequired[str] """ - The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. + An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ - ending_before: NotRequired[str] + discountable: NotRequired[bool] """ - 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. + Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. """ - expand: NotRequired[List[str]] + discounts: NotRequired[ + "Literal['']|List[Invoice.UpdateLinesParamsLineDiscount]" + ] """ - Specifies which fields in the response should be expanded. + The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ - invoice_items: NotRequired[ - List["Invoice.UpcomingLinesParamsInvoiceItem"] - ] + id: str """ - List of invoice items to add or update in the upcoming invoice preview (up to 250). + ID of an existing line item on the invoice. """ - issuer: NotRequired["Invoice.UpcomingLinesParamsIssuer"] + metadata: NotRequired["Literal['']|Dict[str, str]"] """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. """ - limit: NotRequired[int] + period: NotRequired["Invoice.UpdateLinesParamsLinePeriod"] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - on_behalf_of: NotRequired["Literal['']|str"] + price_data: NotRequired["Invoice.UpdateLinesParamsLinePriceData"] """ - The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - preview_mode: NotRequired[Literal["next", "recurring"]] + pricing: NotRequired["Invoice.UpdateLinesParamsLinePricing"] """ - Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. + The pricing information for the invoice item. """ - schedule: NotRequired[str] + quantity: NotRequired[int] """ - The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. + Non-negative integer. The quantity of units for the line item. """ - schedule_details: NotRequired[ - "Invoice.UpcomingLinesParamsScheduleDetails" + tax_amounts: NotRequired[ + "Literal['']|List[Invoice.UpdateLinesParamsLineTaxAmount]" ] """ - The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. + A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. """ - starting_after: NotRequired[str] + tax_rates: NotRequired["Literal['']|List[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. + The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. """ - subscription: NotRequired[str] + + class UpdateLinesParamsLineDiscount(TypedDict): + coupon: NotRequired[str] """ - The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + ID of the coupon to create a new discount for. """ - subscription_billing_cycle_anchor: NotRequired[ - "Literal['now', 'unchanged']|int" - ] + discount: NotRequired[str] """ - For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. + ID of an existing discount on the object (or one of its ancestors) to reuse. """ - subscription_cancel_at: NotRequired["Literal['']|int"] + promotion_code: NotRequired[str] """ - A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. + ID of the promotion code to create a new discount for. """ - subscription_cancel_at_period_end: NotRequired[bool] + + class UpdateLinesParamsLinePeriod(TypedDict): + end: int """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. + The end of the period, which must be greater than or equal to the start. This value is inclusive. """ - subscription_cancel_now: NotRequired[bool] + start: int """ - This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. + The start of the period. This value is inclusive. """ - subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] + + class UpdateLinesParamsLinePriceData(TypedDict): + currency: str """ - If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. + 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). """ - subscription_details: NotRequired[ - "Invoice.UpcomingLinesParamsSubscriptionDetails" - ] + product: NotRequired[str] """ - The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required. """ - subscription_items: NotRequired[ - List["Invoice.UpcomingLinesParamsSubscriptionItem"] + product_data: NotRequired[ + "Invoice.UpdateLinesParamsLinePriceDataProductData" ] """ - A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. + Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required. """ - subscription_proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] ] """ - Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - subscription_proration_date: NotRequired[int] + unit_amount: NotRequired[int] """ - If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. + A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - subscription_resume_at: NotRequired[Literal["now"]] + unit_amount_decimal: NotRequired[str] """ - For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - subscription_start_date: NotRequired[int] + + class UpdateLinesParamsLinePriceDataProductData(TypedDict): + description: NotRequired[str] """ - Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ - subscription_trial_end: NotRequired["Literal['now']|int"] + images: NotRequired[List[str]] """ - If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ - subscription_trial_from_plan: NotRequired[bool] + metadata: NotRequired[Dict[str, str]] """ - Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + Set of [key-value pairs](https://stripe.com/docs/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`. """ - - class UpcomingLinesParamsAutomaticTax(TypedDict): - enabled: bool + name: str """ - Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + The product's name, meant to be displayable to the customer. """ - liability: NotRequired[ - "Invoice.UpcomingLinesParamsAutomaticTaxLiability" - ] + tax_code: NotRequired[str] """ - The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ - class UpcomingLinesParamsAutomaticTaxLiability(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] + class UpdateLinesParamsLinePricing(TypedDict): + price: NotRequired[str] """ - Type of the account referenced in the request. + The ID of the price object. """ - class UpcomingLinesParamsCustomerDetails(TypedDict): - address: NotRequired[ - "Literal['']|Invoice.UpcomingLinesParamsCustomerDetailsAddress" - ] + class UpdateLinesParamsLineTaxAmount(TypedDict): + amount: int """ - The customer's address. + The amount, in cents (or local equivalent), of the tax. """ - shipping: NotRequired[ - "Literal['']|Invoice.UpcomingLinesParamsCustomerDetailsShipping" - ] + tax_rate_data: "Invoice.UpdateLinesParamsLineTaxAmountTaxRateData" """ - The customer's shipping information. Appears on invoices emailed to this customer. + Data to find or create a TaxRate object. + + Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. """ - tax: NotRequired["Invoice.UpcomingLinesParamsCustomerDetailsTax"] - """ - Tax details about the customer. - """ - tax_exempt: NotRequired[ - "Literal['']|Literal['exempt', 'none', 'reverse']" - ] - """ - The customer's tax exemption. One of `none`, `exempt`, or `reverse`. - """ - tax_ids: NotRequired[ - List["Invoice.UpcomingLinesParamsCustomerDetailsTaxId"] - ] - """ - The customer's tax IDs. - """ - - class UpcomingLinesParamsCustomerDetailsAddress(TypedDict): - city: NotRequired[str] - """ - City, district, suburb, town, or village. - """ - country: NotRequired[str] - """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - """ - line1: NotRequired[str] - """ - Address line 1 (e.g., street, PO Box, or company name). - """ - line2: NotRequired[str] - """ - Address line 2 (e.g., apartment, suite, unit, or building). - """ - postal_code: NotRequired[str] - """ - ZIP or postal code. - """ - state: NotRequired[str] - """ - State, county, province, or region. - """ - - class UpcomingLinesParamsCustomerDetailsShipping(TypedDict): - address: "Invoice.UpcomingLinesParamsCustomerDetailsShippingAddress" - """ - Customer shipping address. - """ - name: str - """ - Customer name. - """ - phone: NotRequired[str] - """ - Customer phone (including extension). - """ - - class UpcomingLinesParamsCustomerDetailsShippingAddress(TypedDict): - city: NotRequired[str] - """ - City, district, suburb, town, or village. - """ - country: NotRequired[str] - """ - A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - """ - line1: NotRequired[str] - """ - Address line 1 (e.g., street, PO Box, or company name). - """ - line2: NotRequired[str] - """ - Address line 2 (e.g., apartment, suite, unit, or building). - """ - postal_code: NotRequired[str] - """ - ZIP or postal code. - """ - state: NotRequired[str] - """ - State, county, province, or region. - """ - - class UpcomingLinesParamsCustomerDetailsTax(TypedDict): - ip_address: NotRequired["Literal['']|str"] - """ - A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. - """ - - class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): - type: Literal[ - "ad_nrt", - "ae_trn", - "al_tin", - "am_tin", - "ao_tin", - "ar_cuit", - "au_abn", - "au_arn", - "ba_tin", - "bb_tin", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "bs_tin", - "by_tin", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "cd_nif", - "ch_uid", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "de_stn", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "eu_vat", - "gb_vat", - "ge_vat", - "gn_nif", - "hk_br", - "hr_oib", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kh_tin", - "kr_brn", - "kz_bin", - "li_uid", - "li_vat", - "ma_vat", - "md_vat", - "me_pib", - "mk_vat", - "mr_nif", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "np_pan", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sn_ninea", - "sr_fin", - "sv_nit", - "th_vat", - "tj_tin", - "tr_tin", - "tw_vat", - "tz_vat", - "ua_vat", - "ug_tin", - "us_ein", - "uy_ruc", - "uz_tin", - "uz_vat", - "ve_rif", - "vn_tin", - "za_vat", - "zm_tin", - "zw_tin", - ] - """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` - """ - value: str - """ - Value of the tax ID. - """ - - class UpcomingLinesParamsDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingLinesParamsInvoiceItem(TypedDict): - amount: NotRequired[int] - """ - The integer amount in cents (or local equivalent) of previewed invoice item. - """ - currency: NotRequired[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). Only applicable to new invoice items. - """ - description: NotRequired[str] - """ - An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - """ - discountable: NotRequired[bool] - """ - Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. - """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingLinesParamsInvoiceItemDiscount]" - ] - """ - The coupons to redeem into discounts for the invoice item in the preview. - """ - invoiceitem: NotRequired[str] - """ - The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - period: NotRequired["Invoice.UpcomingLinesParamsInvoiceItemPeriod"] - """ - The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. - """ - price_data: NotRequired[ - "Invoice.UpcomingLinesParamsInvoiceItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Non-negative integer. The quantity of units for the invoice item. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - tax_code: NotRequired["Literal['']|str"] - """ - A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. - """ - unit_amount: NotRequired[int] - """ - The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingLinesParamsInvoiceItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingLinesParamsInvoiceItemPeriod(TypedDict): - end: int - """ - The end of the period, which must be greater than or equal to the start. This value is inclusive. - """ - start: int - """ - The start of the period. This value is inclusive. - """ - - class UpcomingLinesParamsInvoiceItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingLinesParamsIssuer(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class UpcomingLinesParamsScheduleDetails(TypedDict): - end_behavior: NotRequired[Literal["cancel", "release"]] - """ - Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. - """ - phases: NotRequired[ - List["Invoice.UpcomingLinesParamsScheduleDetailsPhase"] - ] - """ - List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. - """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. - """ - - class UpcomingLinesParamsScheduleDetailsPhase(TypedDict): - add_invoice_items: NotRequired[ - List[ - "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItem" - ] - ] - """ - A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. - """ - application_fee_percent: NotRequired[float] - """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - """ - automatic_tax: NotRequired[ - "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAutomaticTax" - ] - """ - Automatic tax settings for this phase. - """ - billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] - """ - Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - """ - billing_thresholds: NotRequired[ - "Literal['']|Invoice.UpcomingLinesParamsScheduleDetailsPhaseBillingThresholds" - ] - """ - 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. - """ - collection_method: NotRequired[ - Literal["charge_automatically", "send_invoice"] - ] - """ - Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. - """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ - currency: NotRequired[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). - """ - default_payment_method: NotRequired[str] - """ - ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. - """ - default_tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. - """ - description: NotRequired["Literal['']|str"] - """ - Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingLinesParamsScheduleDetailsPhaseDiscount]" - ] - """ - The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. - """ - end_date: NotRequired["int|Literal['now']"] - """ - The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. - """ - invoice_settings: NotRequired[ - "Invoice.UpcomingLinesParamsScheduleDetailsPhaseInvoiceSettings" - ] - """ - All invoices will be billed using the specified settings. - """ - items: List["Invoice.UpcomingLinesParamsScheduleDetailsPhaseItem"] - """ - List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. - """ - iterations: NotRequired[int] - """ - Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. - """ - metadata: NotRequired[Dict[str, str]] - """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. - """ - on_behalf_of: NotRequired[str] - """ - The account on behalf of which to charge, for each of the associated subscription's invoices. - """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. - """ - start_date: NotRequired["int|Literal['now']"] - """ - The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. - """ - transfer_data: NotRequired[ - "Invoice.UpcomingLinesParamsScheduleDetailsPhaseTransferData" - ] - """ - The data with which to automatically create a Transfer for each of the associated subscription's invoices. - """ - trial: NotRequired[bool] - """ - If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. - """ - trial_end: NotRequired["int|Literal['now']"] - """ - Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` - """ - - class UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): - discounts: NotRequired[ - List[ - "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemDiscount" - ] - ] - """ - The coupons to redeem into discounts for the item. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. - """ - price_data: NotRequired[ - "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Quantity for this item. Defaults to 1. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. - """ - - class UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemDiscount( - TypedDict, - ): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemPriceData( - TypedDict, - ): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingLinesParamsScheduleDetailsPhaseAutomaticTax(TypedDict): - enabled: bool - """ - Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - """ - liability: NotRequired[ - "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAutomaticTaxLiability" - ] - """ - The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. - """ - - class UpcomingLinesParamsScheduleDetailsPhaseAutomaticTaxLiability( - TypedDict, - ): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class UpcomingLinesParamsScheduleDetailsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - - class UpcomingLinesParamsScheduleDetailsPhaseDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingLinesParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): - account_tax_ids: NotRequired["Literal['']|List[str]"] - """ - The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. - """ - days_until_due: NotRequired[int] - """ - Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. - """ - issuer: NotRequired[ - "Invoice.UpcomingLinesParamsScheduleDetailsPhaseInvoiceSettingsIssuer" - ] - """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. - """ - - class UpcomingLinesParamsScheduleDetailsPhaseInvoiceSettingsIssuer( - TypedDict, - ): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class UpcomingLinesParamsScheduleDetailsPhaseItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|Invoice.UpcomingLinesParamsScheduleDetailsPhaseItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingLinesParamsScheduleDetailsPhaseItemDiscount]" - ] - """ - The coupons to redeem into discounts for the subscription item. - """ - metadata: NotRequired[Dict[str, str]] - """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. - """ - plan: NotRequired[str] - """ - The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. - """ - price: NotRequired[str] - """ - The ID of the price object. - """ - price_data: NotRequired[ - "Invoice.UpcomingLinesParamsScheduleDetailsPhaseItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - """ - quantity: NotRequired[int] - """ - Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class UpcomingLinesParamsScheduleDetailsPhaseItemBillingThresholds( - TypedDict, - ): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - - class UpcomingLinesParamsScheduleDetailsPhaseItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingLinesParamsScheduleDetailsPhaseItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - recurring: "Invoice.UpcomingLinesParamsScheduleDetailsPhaseItemPriceDataRecurring" - """ - The recurring components of a price such as `interval` and `interval_count`. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingLinesParamsScheduleDetailsPhaseItemPriceDataRecurring( - TypedDict, - ): - interval: Literal["day", "month", "week", "year"] - """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. - """ - interval_count: NotRequired[int] - """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - """ - - class UpcomingLinesParamsScheduleDetailsPhaseTransferData(TypedDict): - amount_percent: NotRequired[float] - """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - """ - destination: str - """ - ID of an existing, connected Stripe account. - """ - - class UpcomingLinesParamsSubscriptionDetails(TypedDict): - billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] - """ - For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. - """ - cancel_at: NotRequired["Literal['']|int"] - """ - A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. - """ - cancel_at_period_end: NotRequired[bool] - """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. - """ - cancel_now: NotRequired[bool] - """ - This simulates the subscription being canceled or expired immediately. - """ - default_tax_rates: NotRequired["Literal['']|List[str]"] - """ - If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. - """ - items: NotRequired[ - List["Invoice.UpcomingLinesParamsSubscriptionDetailsItem"] - ] - """ - A list of up to 20 subscription items, each with an attached price. - """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. - """ - proration_date: NotRequired[int] - """ - If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. - """ - resume_at: NotRequired[Literal["now"]] - """ - For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. - """ - start_date: NotRequired[int] - """ - Date a subscription is intended to start (can be future or past). - """ - trial_end: NotRequired["Literal['now']|int"] - """ - If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. - """ - - class UpcomingLinesParamsSubscriptionDetailsItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|Invoice.UpcomingLinesParamsSubscriptionDetailsItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - clear_usage: NotRequired[bool] - """ - 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. - """ - deleted: NotRequired[bool] - """ - A flag that, if set to `true`, will delete the specified item. - """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingLinesParamsSubscriptionDetailsItemDiscount]" - ] - """ - The coupons to redeem into discounts for the subscription item. - """ - id: NotRequired[str] - """ - Subscription item to update. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - plan: NotRequired[str] - """ - Plan ID for this item, as a string. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - """ - price_data: NotRequired[ - "Invoice.UpcomingLinesParamsSubscriptionDetailsItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Quantity for this item. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class UpcomingLinesParamsSubscriptionDetailsItemBillingThresholds( - TypedDict, - ): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - - class UpcomingLinesParamsSubscriptionDetailsItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingLinesParamsSubscriptionDetailsItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - recurring: "Invoice.UpcomingLinesParamsSubscriptionDetailsItemPriceDataRecurring" - """ - The recurring components of a price such as `interval` and `interval_count`. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingLinesParamsSubscriptionDetailsItemPriceDataRecurring( - TypedDict, - ): - interval: Literal["day", "month", "week", "year"] - """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. - """ - interval_count: NotRequired[int] - """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - """ - - class UpcomingLinesParamsSubscriptionItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|Invoice.UpcomingLinesParamsSubscriptionItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - clear_usage: NotRequired[bool] - """ - 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. - """ - deleted: NotRequired[bool] - """ - A flag that, if set to `true`, will delete the specified item. - """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingLinesParamsSubscriptionItemDiscount]" - ] - """ - The coupons to redeem into discounts for the subscription item. - """ - id: NotRequired[str] - """ - Subscription item to update. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - plan: NotRequired[str] - """ - Plan ID for this item, as a string. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - """ - price_data: NotRequired[ - "Invoice.UpcomingLinesParamsSubscriptionItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Quantity for this item. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class UpcomingLinesParamsSubscriptionItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - - class UpcomingLinesParamsSubscriptionItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingLinesParamsSubscriptionItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - recurring: ( - "Invoice.UpcomingLinesParamsSubscriptionItemPriceDataRecurring" - ) - """ - The recurring components of a price such as `interval` and `interval_count`. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingLinesParamsSubscriptionItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] - """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. - """ - interval_count: NotRequired[int] - """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - """ - - class UpcomingParams(RequestOptions): - automatic_tax: NotRequired["Invoice.UpcomingParamsAutomaticTax"] - """ - Settings for automatic tax lookup for this invoice preview. - """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ - currency: NotRequired[str] - """ - The currency to preview this invoice in. Defaults to that of `customer` if not specified. - """ - customer: NotRequired[str] - """ - The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. - """ - customer_details: NotRequired["Invoice.UpcomingParamsCustomerDetails"] - """ - Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. - """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingParamsDiscount]" - ] - """ - The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. - """ - expand: NotRequired[List[str]] - """ - Specifies which fields in the response should be expanded. - """ - invoice_items: NotRequired[List["Invoice.UpcomingParamsInvoiceItem"]] - """ - List of invoice items to add or update in the upcoming invoice preview (up to 250). - """ - issuer: NotRequired["Invoice.UpcomingParamsIssuer"] - """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. - """ - on_behalf_of: NotRequired["Literal['']|str"] - """ - The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. - """ - preview_mode: NotRequired[Literal["next", "recurring"]] - """ - Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. - """ - schedule: NotRequired[str] - """ - The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. - """ - schedule_details: NotRequired["Invoice.UpcomingParamsScheduleDetails"] - """ - The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. - """ - subscription: NotRequired[str] - """ - The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. - """ - subscription_billing_cycle_anchor: NotRequired[ - "Literal['now', 'unchanged']|int" - ] - """ - For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. - """ - subscription_cancel_at: NotRequired["Literal['']|int"] - """ - A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. - """ - subscription_cancel_at_period_end: NotRequired[bool] - """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. - """ - subscription_cancel_now: NotRequired[bool] - """ - This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. - """ - subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] - """ - If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. - """ - subscription_details: NotRequired[ - "Invoice.UpcomingParamsSubscriptionDetails" - ] - """ - The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. - """ - subscription_items: NotRequired[ - List["Invoice.UpcomingParamsSubscriptionItem"] - ] - """ - A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. - """ - subscription_proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. - """ - subscription_proration_date: NotRequired[int] - """ - If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. - """ - subscription_resume_at: NotRequired[Literal["now"]] - """ - For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. - """ - subscription_start_date: NotRequired[int] - """ - Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. - """ - subscription_trial_end: NotRequired["Literal['now']|int"] - """ - If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. - """ - subscription_trial_from_plan: NotRequired[bool] - """ - Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - """ - - class UpcomingParamsAutomaticTax(TypedDict): - enabled: bool - """ - Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. - """ - liability: NotRequired["Invoice.UpcomingParamsAutomaticTaxLiability"] - """ - The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. - """ - - class UpcomingParamsAutomaticTaxLiability(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class UpcomingParamsCustomerDetails(TypedDict): - address: NotRequired[ - "Literal['']|Invoice.UpcomingParamsCustomerDetailsAddress" - ] - """ - The customer's address. - """ - shipping: NotRequired[ - "Literal['']|Invoice.UpcomingParamsCustomerDetailsShipping" - ] - """ - The customer's shipping information. Appears on invoices emailed to this customer. - """ - tax: NotRequired["Invoice.UpcomingParamsCustomerDetailsTax"] - """ - Tax details about the customer. - """ - tax_exempt: NotRequired[ - "Literal['']|Literal['exempt', 'none', 'reverse']" - ] - """ - The customer's tax exemption. One of `none`, `exempt`, or `reverse`. - """ - tax_ids: NotRequired[ - List["Invoice.UpcomingParamsCustomerDetailsTaxId"] - ] - """ - The customer's tax IDs. - """ - - class UpcomingParamsCustomerDetailsAddress(TypedDict): - city: NotRequired[str] - """ - City, district, suburb, town, or village. - """ - country: NotRequired[str] - """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - """ - line1: NotRequired[str] - """ - Address line 1 (e.g., street, PO Box, or company name). - """ - line2: NotRequired[str] - """ - Address line 2 (e.g., apartment, suite, unit, or building). - """ - postal_code: NotRequired[str] - """ - ZIP or postal code. - """ - state: NotRequired[str] - """ - State, county, province, or region. - """ - - class UpcomingParamsCustomerDetailsShipping(TypedDict): - address: "Invoice.UpcomingParamsCustomerDetailsShippingAddress" - """ - Customer shipping address. - """ - name: str - """ - Customer name. - """ - phone: NotRequired[str] - """ - Customer phone (including extension). - """ - - class UpcomingParamsCustomerDetailsShippingAddress(TypedDict): - city: NotRequired[str] - """ - City, district, suburb, town, or village. - """ - country: NotRequired[str] - """ - A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - """ - line1: NotRequired[str] - """ - Address line 1 (e.g., street, PO Box, or company name). - """ - line2: NotRequired[str] - """ - Address line 2 (e.g., apartment, suite, unit, or building). - """ - postal_code: NotRequired[str] - """ - ZIP or postal code. - """ - state: NotRequired[str] - """ - State, county, province, or region. - """ - - class UpcomingParamsCustomerDetailsTax(TypedDict): - ip_address: NotRequired["Literal['']|str"] - """ - A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. - """ - - class UpcomingParamsCustomerDetailsTaxId(TypedDict): - type: Literal[ - "ad_nrt", - "ae_trn", - "al_tin", - "am_tin", - "ao_tin", - "ar_cuit", - "au_abn", - "au_arn", - "ba_tin", - "bb_tin", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "bs_tin", - "by_tin", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "cd_nif", - "ch_uid", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "de_stn", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "eu_vat", - "gb_vat", - "ge_vat", - "gn_nif", - "hk_br", - "hr_oib", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kh_tin", - "kr_brn", - "kz_bin", - "li_uid", - "li_vat", - "ma_vat", - "md_vat", - "me_pib", - "mk_vat", - "mr_nif", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "np_pan", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sn_ninea", - "sr_fin", - "sv_nit", - "th_vat", - "tj_tin", - "tr_tin", - "tw_vat", - "tz_vat", - "ua_vat", - "ug_tin", - "us_ein", - "uy_ruc", - "uz_tin", - "uz_vat", - "ve_rif", - "vn_tin", - "za_vat", - "zm_tin", - "zw_tin", - ] - """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` - """ - value: str - """ - Value of the tax ID. - """ - - class UpcomingParamsDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsInvoiceItem(TypedDict): - amount: NotRequired[int] - """ - The integer amount in cents (or local equivalent) of previewed invoice item. - """ - currency: NotRequired[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). Only applicable to new invoice items. - """ - description: NotRequired[str] - """ - An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - """ - discountable: NotRequired[bool] - """ - Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. - """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingParamsInvoiceItemDiscount]" - ] - """ - The coupons to redeem into discounts for the invoice item in the preview. - """ - invoiceitem: NotRequired[str] - """ - The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - period: NotRequired["Invoice.UpcomingParamsInvoiceItemPeriod"] - """ - The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. - """ - price_data: NotRequired["Invoice.UpcomingParamsInvoiceItemPriceData"] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Non-negative integer. The quantity of units for the invoice item. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - tax_code: NotRequired["Literal['']|str"] - """ - A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. - """ - unit_amount: NotRequired[int] - """ - The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingParamsInvoiceItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsInvoiceItemPeriod(TypedDict): - end: int - """ - The end of the period, which must be greater than or equal to the start. This value is inclusive. - """ - start: int - """ - The start of the period. This value is inclusive. - """ - - class UpcomingParamsInvoiceItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingParamsIssuer(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class UpcomingParamsScheduleDetails(TypedDict): - end_behavior: NotRequired[Literal["cancel", "release"]] - """ - Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. - """ - phases: NotRequired[List["Invoice.UpcomingParamsScheduleDetailsPhase"]] - """ - List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. - """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. - """ - - class UpcomingParamsScheduleDetailsPhase(TypedDict): - add_invoice_items: NotRequired[ - List["Invoice.UpcomingParamsScheduleDetailsPhaseAddInvoiceItem"] - ] - """ - A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. - """ - application_fee_percent: NotRequired[float] - """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - """ - automatic_tax: NotRequired[ - "Invoice.UpcomingParamsScheduleDetailsPhaseAutomaticTax" - ] - """ - Automatic tax settings for this phase. - """ - billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] - """ - Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - """ - billing_thresholds: NotRequired[ - "Literal['']|Invoice.UpcomingParamsScheduleDetailsPhaseBillingThresholds" - ] - """ - 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. - """ - collection_method: NotRequired[ - Literal["charge_automatically", "send_invoice"] - ] - """ - Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. - """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ - currency: NotRequired[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). - """ - default_payment_method: NotRequired[str] - """ - ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. - """ - default_tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. - """ - description: NotRequired["Literal['']|str"] - """ - Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingParamsScheduleDetailsPhaseDiscount]" - ] - """ - The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. - """ - end_date: NotRequired["int|Literal['now']"] - """ - The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. - """ - invoice_settings: NotRequired[ - "Invoice.UpcomingParamsScheduleDetailsPhaseInvoiceSettings" - ] - """ - All invoices will be billed using the specified settings. - """ - items: List["Invoice.UpcomingParamsScheduleDetailsPhaseItem"] - """ - List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. - """ - iterations: NotRequired[int] - """ - Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. - """ - metadata: NotRequired[Dict[str, str]] - """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. - """ - on_behalf_of: NotRequired[str] - """ - The account on behalf of which to charge, for each of the associated subscription's invoices. - """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. - """ - start_date: NotRequired["int|Literal['now']"] - """ - The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. - """ - transfer_data: NotRequired[ - "Invoice.UpcomingParamsScheduleDetailsPhaseTransferData" - ] - """ - The data with which to automatically create a Transfer for each of the associated subscription's invoices. - """ - trial: NotRequired[bool] - """ - If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. - """ - trial_end: NotRequired["int|Literal['now']"] - """ - Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` - """ - - class UpcomingParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): - discounts: NotRequired[ - List[ - "Invoice.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemDiscount" - ] - ] - """ - The coupons to redeem into discounts for the item. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. - """ - price_data: NotRequired[ - "Invoice.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Quantity for this item. Defaults to 1. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. - """ - - class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingParamsScheduleDetailsPhaseAutomaticTax(TypedDict): - enabled: bool - """ - Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - """ - liability: NotRequired[ - "Invoice.UpcomingParamsScheduleDetailsPhaseAutomaticTaxLiability" - ] - """ - The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. - """ - - class UpcomingParamsScheduleDetailsPhaseAutomaticTaxLiability(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class UpcomingParamsScheduleDetailsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - - class UpcomingParamsScheduleDetailsPhaseDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): - account_tax_ids: NotRequired["Literal['']|List[str]"] - """ - The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. - """ - days_until_due: NotRequired[int] - """ - Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. - """ - issuer: NotRequired[ - "Invoice.UpcomingParamsScheduleDetailsPhaseInvoiceSettingsIssuer" - ] - """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. - """ - - class UpcomingParamsScheduleDetailsPhaseInvoiceSettingsIssuer(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class UpcomingParamsScheduleDetailsPhaseItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|Invoice.UpcomingParamsScheduleDetailsPhaseItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingParamsScheduleDetailsPhaseItemDiscount]" - ] - """ - The coupons to redeem into discounts for the subscription item. - """ - metadata: NotRequired[Dict[str, str]] - """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. - """ - plan: NotRequired[str] - """ - The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. - """ - price: NotRequired[str] - """ - The ID of the price object. - """ - price_data: NotRequired[ - "Invoice.UpcomingParamsScheduleDetailsPhaseItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - """ - quantity: NotRequired[int] - """ - Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class UpcomingParamsScheduleDetailsPhaseItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - - class UpcomingParamsScheduleDetailsPhaseItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsScheduleDetailsPhaseItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - recurring: ( - "Invoice.UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring" - ) - """ - The recurring components of a price such as `interval` and `interval_count`. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] - """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. - """ - interval_count: NotRequired[int] - """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - """ - - class UpcomingParamsScheduleDetailsPhaseTransferData(TypedDict): - amount_percent: NotRequired[float] - """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - """ - destination: str - """ - ID of an existing, connected Stripe account. - """ - - class UpcomingParamsSubscriptionDetails(TypedDict): - billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] - """ - For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. - """ - cancel_at: NotRequired["Literal['']|int"] - """ - A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. - """ - cancel_at_period_end: NotRequired[bool] - """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. - """ - cancel_now: NotRequired[bool] - """ - This simulates the subscription being canceled or expired immediately. - """ - default_tax_rates: NotRequired["Literal['']|List[str]"] - """ - If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. - """ - items: NotRequired[ - List["Invoice.UpcomingParamsSubscriptionDetailsItem"] - ] - """ - A list of up to 20 subscription items, each with an attached price. - """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. - """ - proration_date: NotRequired[int] - """ - If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. - """ - resume_at: NotRequired[Literal["now"]] - """ - For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. - """ - start_date: NotRequired[int] - """ - Date a subscription is intended to start (can be future or past). - """ - trial_end: NotRequired["Literal['now']|int"] - """ - If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. - """ - - class UpcomingParamsSubscriptionDetailsItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|Invoice.UpcomingParamsSubscriptionDetailsItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - clear_usage: NotRequired[bool] - """ - 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. - """ - deleted: NotRequired[bool] - """ - A flag that, if set to `true`, will delete the specified item. - """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingParamsSubscriptionDetailsItemDiscount]" - ] - """ - The coupons to redeem into discounts for the subscription item. - """ - id: NotRequired[str] - """ - Subscription item to update. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - plan: NotRequired[str] - """ - Plan ID for this item, as a string. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - """ - price_data: NotRequired[ - "Invoice.UpcomingParamsSubscriptionDetailsItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Quantity for this item. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class UpcomingParamsSubscriptionDetailsItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - - class UpcomingParamsSubscriptionDetailsItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsSubscriptionDetailsItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - recurring: ( - "Invoice.UpcomingParamsSubscriptionDetailsItemPriceDataRecurring" - ) - """ - The recurring components of a price such as `interval` and `interval_count`. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingParamsSubscriptionDetailsItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] - """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. - """ - interval_count: NotRequired[int] - """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - """ - - class UpcomingParamsSubscriptionItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|Invoice.UpcomingParamsSubscriptionItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - clear_usage: NotRequired[bool] - """ - 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. - """ - deleted: NotRequired[bool] - """ - A flag that, if set to `true`, will delete the specified item. - """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpcomingParamsSubscriptionItemDiscount]" - ] - """ - The coupons to redeem into discounts for the subscription item. - """ - id: NotRequired[str] - """ - Subscription item to update. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - plan: NotRequired[str] - """ - Plan ID for this item, as a string. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - """ - price_data: NotRequired[ - "Invoice.UpcomingParamsSubscriptionItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Quantity for this item. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class UpcomingParamsSubscriptionItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - - class UpcomingParamsSubscriptionItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsSubscriptionItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - recurring: "Invoice.UpcomingParamsSubscriptionItemPriceDataRecurring" - """ - The recurring components of a price such as `interval` and `interval_count`. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingParamsSubscriptionItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] - """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. - """ - interval_count: NotRequired[int] - """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - """ - - class UpdateLinesParams(RequestOptions): - expand: NotRequired[List[str]] - """ - Specifies which fields in the response should be expanded. - """ - invoice_metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. - """ - lines: List["Invoice.UpdateLinesParamsLine"] - """ - The line items to update. - """ - - class UpdateLinesParamsLine(TypedDict): - amount: NotRequired[int] - """ - The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. - """ - description: NotRequired[str] - """ - An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - """ - discountable: NotRequired[bool] - """ - Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. - """ - discounts: NotRequired[ - "Literal['']|List[Invoice.UpdateLinesParamsLineDiscount]" - ] - """ - The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. - """ - id: str - """ - ID of an existing line item on the invoice. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. - """ - period: NotRequired["Invoice.UpdateLinesParamsLinePeriod"] - """ - The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. - """ - price_data: NotRequired["Invoice.UpdateLinesParamsLinePriceData"] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Non-negative integer. The quantity of units for the line item. - """ - tax_amounts: NotRequired[ - "Literal['']|List[Invoice.UpdateLinesParamsLineTaxAmount]" - ] - """ - A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. - """ - - class UpdateLinesParamsLineDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpdateLinesParamsLinePeriod(TypedDict): - end: int - """ - The end of the period, which must be greater than or equal to the start. This value is inclusive. - """ - start: int - """ - The start of the period. This value is inclusive. - """ - - class UpdateLinesParamsLinePriceData(TypedDict): - 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). - """ - product: NotRequired[str] - """ - The ID of the product that this price will belong to. One of `product` or `product_data` is required. - """ - product_data: NotRequired[ - "Invoice.UpdateLinesParamsLinePriceDataProductData" - ] - """ - Data used to generate a new product object inline. One of `product` or `product_data` is required. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] + taxability_reason: NotRequired[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ] ] """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpdateLinesParamsLinePriceDataProductData(TypedDict): - description: NotRequired[str] - """ - The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - """ - images: NotRequired[List[str]] - """ - A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - """ - metadata: NotRequired[Dict[str, str]] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - name: str - """ - The product's name, meant to be displayable to the customer. - """ - tax_code: NotRequired[str] - """ - A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - """ - - class UpdateLinesParamsLineTaxAmount(TypedDict): - amount: int - """ - The amount, in cents (or local equivalent), of the tax. - """ - tax_rate_data: "Invoice.UpdateLinesParamsLineTaxAmountTaxRateData" - """ - Data to find or create a TaxRate object. - - Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. + The reasoning behind this tax, for example, if the product is tax exempt. """ taxable_amount: int """ @@ -6245,6 +3977,14 @@ class UpdateLinesParamsLineTaxAmountTaxRateData(TypedDict): """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ + jurisdiction_level: NotRequired[ + Literal[ + "city", "country", "county", "district", "multiple", "state" + ] + ] + """ + The level of the jurisdiction that imposes this tax rate. + """ percentage: float """ The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. @@ -6297,6 +4037,10 @@ class VoidInvoiceParams(RequestOptions): """ Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`. """ + amount_overpaid: int + """ + Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance. + """ amount_paid: int """ The amount, in cents (or local equivalent), that was paid. @@ -6313,10 +4057,6 @@ class VoidInvoiceParams(RequestOptions): """ ID of the Connect Application that created the invoice. """ - application_fee_amount: Optional[int] - """ - The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. - """ attempt_count: int """ Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. @@ -6358,14 +4098,14 @@ class VoidInvoiceParams(RequestOptions): * `subscription_update`: A subscription was updated. * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. """ - charge: Optional[ExpandableField["Charge"]] - """ - ID of the latest charge generated for this invoice, if any. - """ collection_method: Literal["charge_automatically", "send_invoice"] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. """ + confirmation_secret: Optional[ConfirmationSecret] + """ + The confirmation secret associated with this invoice. Currently, this contains the client_secret of the PaymentIntent that Stripe creates during invoice finalization. + """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. @@ -6430,10 +4170,6 @@ class VoidInvoiceParams(RequestOptions): """ An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. """ - discount: Optional["Discount"] - """ - Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. - """ discounts: List[ExpandableField["Discount"]] """ The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. @@ -6507,19 +4243,15 @@ class VoidInvoiceParams(RequestOptions): """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ - paid: bool - """ - Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. + parent: Optional[Parent] """ - paid_out_of_band: bool + The parent that generated this invoice """ - Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. - """ - payment_intent: Optional[ExpandableField["PaymentIntent"]] + payment_settings: PaymentSettings + payments: Optional[ListObject["InvoicePayment"]] """ - The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. + Payments for this invoice """ - payment_settings: PaymentSettings period_end: int """ End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. @@ -6536,10 +4268,6 @@ class VoidInvoiceParams(RequestOptions): """ Total amount of all pre-payment credit notes issued for this invoice. """ - quote: Optional[ExpandableField["Quote"]] - """ - The quote this invoice was generated from. - """ receipt_number: Optional[str] """ This is the transaction number that appears on email receipts sent for this invoice. @@ -6570,17 +4298,6 @@ class VoidInvoiceParams(RequestOptions): """ status_transitions: StatusTransitions subscription: Optional[ExpandableField["Subscription"]] - """ - The subscription that this invoice was prepared for, if any. - """ - subscription_details: Optional[SubscriptionDetails] - """ - Details about the subscription that created this invoice. - """ - subscription_proration_date: Optional[int] - """ - Only set for upcoming invoices that preview prorations. The time used to calculate prorations. - """ subtotal: int """ Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated @@ -6589,10 +4306,6 @@ class VoidInvoiceParams(RequestOptions): """ The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated """ - tax: Optional[int] - """ - The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. - """ test_clock: Optional[ExpandableField["TestClock"]] """ ID of the test clock this invoice belongs to. @@ -6614,13 +4327,9 @@ class VoidInvoiceParams(RequestOptions): """ Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items. """ - total_tax_amounts: List[TotalTaxAmount] - """ - The aggregate amounts calculated per tax rate for all line items. + total_taxes: Optional[List[TotalTax]] """ - transfer_data: Optional[TransferData] - """ - The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice. + The aggregate tax information of all line items. """ webhooks_delivered_at: Optional[int] """ @@ -7579,80 +5288,6 @@ async def send_invoice_async( # pyright: ignore[reportGeneralTypeIssues] ), ) - @classmethod - def upcoming(cls, **params: Unpack["Invoice.UpcomingParams"]) -> "Invoice": - """ - At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. - - Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - - You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. - - Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) - """ - return cast( - "Invoice", - cls._static_request( - "get", - "/v1/invoices/upcoming", - params=params, - ), - ) - - @classmethod - async def upcoming_async( - cls, **params: Unpack["Invoice.UpcomingParams"] - ) -> "Invoice": - """ - At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. - - Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - - You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. - - Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) - """ - return cast( - "Invoice", - await cls._static_request_async( - "get", - "/v1/invoices/upcoming", - params=params, - ), - ) - - @classmethod - def upcoming_lines( - cls, **params: Unpack["Invoice.UpcomingLinesParams"] - ) -> ListObject["InvoiceLineItem"]: - """ - When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - """ - return cast( - ListObject["InvoiceLineItem"], - cls._static_request( - "get", - "/v1/invoices/upcoming/lines", - params=params, - ), - ) - - @classmethod - async def upcoming_lines_async( - cls, **params: Unpack["Invoice.UpcomingLinesParams"] - ) -> ListObject["InvoiceLineItem"]: - """ - When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - """ - return cast( - ListObject["InvoiceLineItem"], - await cls._static_request_async( - "get", - "/v1/invoices/upcoming/lines", - params=params, - ), - ) - @classmethod def _cls_update_lines( cls, invoice: str, **params: Unpack["Invoice.UpdateLinesParams"] @@ -7965,6 +5600,7 @@ async def list_lines_async( _inner_class_types = { "automatic_tax": AutomaticTax, + "confirmation_secret": ConfirmationSecret, "custom_fields": CustomField, "customer_address": CustomerAddress, "customer_shipping": CustomerShipping, @@ -7972,15 +5608,14 @@ async def list_lines_async( "from_invoice": FromInvoice, "issuer": Issuer, "last_finalization_error": LastFinalizationError, + "parent": Parent, "payment_settings": PaymentSettings, "rendering": Rendering, "shipping_cost": ShippingCost, "shipping_details": ShippingDetails, "status_transitions": StatusTransitions, - "subscription_details": SubscriptionDetails, "threshold_reason": ThresholdReason, "total_discount_amounts": TotalDiscountAmount, "total_pretax_credit_amounts": TotalPretaxCreditAmount, - "total_tax_amounts": TotalTaxAmount, - "transfer_data": TransferData, + "total_taxes": TotalTax, } diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index 968f94dd0..4350ebb67 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -22,9 +22,6 @@ from stripe._customer import Customer from stripe._discount import Discount from stripe._invoice import Invoice - from stripe._plan import Plan - from stripe._price import Price - from stripe._subscription import Subscription from stripe._tax_rate import TaxRate from stripe.test_helpers._test_clock import TestClock @@ -51,6 +48,27 @@ class InvoiceItem( OBJECT_NAME: ClassVar[Literal["invoiceitem"]] = "invoiceitem" + class Parent(StripeObject): + class SubscriptionDetails(StripeObject): + subscription: str + """ + The subscription that generated this invoice item + """ + subscription_item: Optional[str] + """ + The subscription item that generated this invoice item + """ + + subscription_details: Optional[SubscriptionDetails] + """ + Details about the subscription that generated this invoice item + """ + type: Literal["subscription_details"] + """ + The type of parent that generated this invoice item + """ + _inner_class_types = {"subscription_details": SubscriptionDetails} + class Period(StripeObject): end: int """ @@ -61,6 +79,28 @@ class Period(StripeObject): The start of the period. This value is inclusive. """ + class Pricing(StripeObject): + class PriceDetails(StripeObject): + price: str + """ + The ID of the price this item is associated with. + """ + product: str + """ + The ID of the product this item is associated with. + """ + + price_details: Optional[PriceDetails] + type: Literal["price_details"] + """ + The type of the pricing details. + """ + unit_amount_decimal: Optional[str] + """ + The unit amount (in the `currency` specified) of the item which contains a decimal value with at most 12 decimal places. + """ + _inner_class_types = {"price_details": PriceDetails} + class CreateParams(RequestOptions): amount: NotRequired[int] """ @@ -104,13 +144,13 @@ class CreateParams(RequestOptions): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired[str] + price_data: NotRequired["InvoiceItem.CreateParamsPriceData"] """ - The ID of the price object. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - price_data: NotRequired["InvoiceItem.CreateParamsPriceData"] + pricing: NotRequired["InvoiceItem.CreateParamsPricing"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + The pricing information for the invoice item. """ quantity: NotRequired[int] """ @@ -134,13 +174,9 @@ class CreateParams(RequestOptions): """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. """ - unit_amount: NotRequired[int] - """ - The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. - """ unit_amount_decimal: NotRequired[str] """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + The decimal unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount_decimal` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount_decimal` will reduce the `amount_due` on the invoice. Accepts at most 12 decimal places. """ class CreateParamsDiscount(TypedDict): @@ -174,7 +210,7 @@ class CreateParamsPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -191,6 +227,12 @@ class CreateParamsPriceData(TypedDict): Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ + class CreateParamsPricing(TypedDict): + price: NotRequired[str] + """ + The ID of the price object. + """ + class DeleteParams(RequestOptions): pass @@ -277,13 +319,13 @@ class ModifyParams(RequestOptions): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired[str] + price_data: NotRequired["InvoiceItem.ModifyParamsPriceData"] """ - The ID of the price object. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - price_data: NotRequired["InvoiceItem.ModifyParamsPriceData"] + pricing: NotRequired["InvoiceItem.ModifyParamsPricing"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + The pricing information for the invoice item. """ quantity: NotRequired[int] """ @@ -303,13 +345,9 @@ class ModifyParams(RequestOptions): """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates. """ - unit_amount: NotRequired[int] - """ - The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. - """ unit_amount_decimal: NotRequired[str] """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + The decimal unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount_decimal` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount_decimal` will reduce the `amount_due` on the invoice. Accepts at most 12 decimal places. """ class ModifyParamsDiscount(TypedDict): @@ -343,7 +381,7 @@ class ModifyParamsPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -360,6 +398,12 @@ class ModifyParamsPriceData(TypedDict): Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ + class ModifyParamsPricing(TypedDict): + price: NotRequired[str] + """ + The ID of the price object. + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -414,14 +458,14 @@ class RetrieveParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ - period: Period - plan: Optional["Plan"] + parent: Optional[Parent] """ - If the invoice item is a proration, the plan of the subscription that the proration was computed for. + The parent that generated this invoice """ - price: Optional["Price"] + period: Period + pricing: Optional[Pricing] """ - The price of the invoice item. + The pricing information of the invoice item. """ proration: bool """ @@ -431,14 +475,6 @@ class RetrieveParams(RequestOptions): """ 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. """ - subscription: Optional[ExpandableField["Subscription"]] - """ - The subscription that this invoice item has been created for, if any. - """ - subscription_item: Optional[str] - """ - The subscription item that this invoice item has been created for, if any. - """ tax_rates: Optional[List["TaxRate"]] """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. @@ -447,14 +483,6 @@ class RetrieveParams(RequestOptions): """ ID of the test clock this invoice item belongs to. """ - unit_amount: Optional[int] - """ - Unit amount (in the `currency` specified) of the invoice item. - """ - unit_amount_decimal: Optional[str] - """ - Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. - """ deleted: Optional[Literal[True]] """ Always true for a deleted object @@ -686,4 +714,8 @@ async def retrieve_async( await instance.refresh_async() return instance - _inner_class_types = {"period": Period} + _inner_class_types = { + "parent": Parent, + "period": Period, + "pricing": Pricing, + } diff --git a/stripe/_invoice_item_service.py b/stripe/_invoice_item_service.py index 7a780a6b9..cfe596084 100644 --- a/stripe/_invoice_item_service.py +++ b/stripe/_invoice_item_service.py @@ -53,13 +53,13 @@ class CreateParams(TypedDict): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired[str] + price_data: NotRequired["InvoiceItemService.CreateParamsPriceData"] """ - The ID of the price object. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - price_data: NotRequired["InvoiceItemService.CreateParamsPriceData"] + pricing: NotRequired["InvoiceItemService.CreateParamsPricing"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + The pricing information for the invoice item. """ quantity: NotRequired[int] """ @@ -83,13 +83,9 @@ class CreateParams(TypedDict): """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. """ - unit_amount: NotRequired[int] - """ - The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. - """ unit_amount_decimal: NotRequired[str] """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + The decimal unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount_decimal` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount_decimal` will reduce the `amount_due` on the invoice. Accepts at most 12 decimal places. """ class CreateParamsDiscount(TypedDict): @@ -123,7 +119,7 @@ class CreateParamsPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -140,6 +136,12 @@ class CreateParamsPriceData(TypedDict): Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ + class CreateParamsPricing(TypedDict): + price: NotRequired[str] + """ + The ID of the price object. + """ + class DeleteParams(TypedDict): pass @@ -232,13 +234,13 @@ class UpdateParams(TypedDict): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired[str] + price_data: NotRequired["InvoiceItemService.UpdateParamsPriceData"] """ - The ID of the price object. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - price_data: NotRequired["InvoiceItemService.UpdateParamsPriceData"] + pricing: NotRequired["InvoiceItemService.UpdateParamsPricing"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + The pricing information for the invoice item. """ quantity: NotRequired[int] """ @@ -258,13 +260,9 @@ class UpdateParams(TypedDict): """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates. """ - unit_amount: NotRequired[int] - """ - The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. - """ unit_amount_decimal: NotRequired[str] """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + The decimal unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount_decimal` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount_decimal` will reduce the `amount_due` on the invoice. Accepts at most 12 decimal places. """ class UpdateParamsDiscount(TypedDict): @@ -298,7 +296,7 @@ class UpdateParamsPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -315,6 +313,12 @@ class UpdateParamsPriceData(TypedDict): Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ + class UpdateParamsPricing(TypedDict): + price: NotRequired[str] + """ + The ID of the price object. + """ + def delete( self, invoiceitem: str, diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index dccfaaf85..40a423069 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -16,12 +16,7 @@ if TYPE_CHECKING: from stripe._discount import Discount - from stripe._invoice_item import InvoiceItem - from stripe._plan import Plan - from stripe._price import Price from stripe._subscription import Subscription - from stripe._subscription_item import SubscriptionItem - from stripe._tax_rate import TaxRate from stripe.billing._credit_balance_transaction import ( CreditBalanceTransaction, ) @@ -46,6 +41,100 @@ class DiscountAmount(StripeObject): The discount that was applied to get this discount amount. """ + class Parent(StripeObject): + class InvoiceItemDetails(StripeObject): + class ProrationDetails(StripeObject): + class CreditedItems(StripeObject): + invoice: str + """ + Invoice containing the credited invoice line items + """ + invoice_line_items: List[str] + """ + Credited invoice line items + """ + + credited_items: Optional[CreditedItems] + """ + For a credit proration `line_item`, the original debit line_items to which the credit proration applies. + """ + _inner_class_types = {"credited_items": CreditedItems} + + invoice_item: str + """ + The invoice item that generated this line item + """ + proration: bool + """ + Whether this is a proration + """ + proration_details: Optional[ProrationDetails] + """ + Additional details for proration line items + """ + subscription: Optional[str] + """ + The subscription that the invoice item belongs to + """ + _inner_class_types = {"proration_details": ProrationDetails} + + class SubscriptionItemDetails(StripeObject): + class ProrationDetails(StripeObject): + class CreditedItems(StripeObject): + invoice: str + """ + Invoice containing the credited invoice line items + """ + invoice_line_items: List[str] + """ + Credited invoice line items + """ + + credited_items: Optional[CreditedItems] + """ + For a credit proration `line_item`, the original debit line_items to which the credit proration applies. + """ + _inner_class_types = {"credited_items": CreditedItems} + + invoice_item: Optional[str] + """ + The invoice item that generated this line item + """ + proration: bool + """ + Whether this is a proration + """ + proration_details: Optional[ProrationDetails] + """ + Additional details for proration line items + """ + subscription: str + """ + The subscription that the subscription item belongs to + """ + subscription_item: str + """ + The subscription item that generated this line item + """ + _inner_class_types = {"proration_details": ProrationDetails} + + invoice_item_details: Optional[InvoiceItemDetails] + """ + Details about the invoice item that generated this line item + """ + subscription_item_details: Optional[SubscriptionItemDetails] + """ + Details about the subscription item that generated this line item + """ + type: Literal["invoice_item_details", "subscription_item_details"] + """ + The type of parent that generated this line item + """ + _inner_class_types = { + "invoice_item_details": InvoiceItemDetails, + "subscription_item_details": SubscriptionItemDetails, + } + class Period(StripeObject): end: int """ @@ -76,54 +165,61 @@ class PretaxCreditAmount(StripeObject): Type of the pretax credit amount referenced. """ - class ProrationDetails(StripeObject): - class CreditedItems(StripeObject): - invoice: str + class Pricing(StripeObject): + class PriceDetails(StripeObject): + price: str """ - Invoice containing the credited invoice line items + The ID of the price this item is associated with. """ - invoice_line_items: List[str] + product: str """ - Credited invoice line items + The ID of the product this item is associated with. """ - credited_items: Optional[CreditedItems] - """ - For a credit proration `line_item`, the original debit line_items to which the credit proration applies. - """ - _inner_class_types = {"credited_items": CreditedItems} - - class TaxAmount(StripeObject): - amount: int + price_details: Optional[PriceDetails] + type: Literal["price_details"] """ - The amount, in cents (or local equivalent), of the tax. - """ - inclusive: bool + The type of the pricing details. """ - Whether this tax amount is inclusive or exclusive. + unit_amount_decimal: Optional[str] """ - tax_rate: ExpandableField["TaxRate"] + The unit amount (in the `currency` specified) of the item which contains a decimal value with at most 12 decimal places. """ - The tax rate that was applied to get this tax amount. + _inner_class_types = {"price_details": PriceDetails} + + class Tax(StripeObject): + class TaxRateDetails(StripeObject): + tax_rate: str + + amount: int """ - taxability_reason: Optional[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", - ] + The amount of the tax, in cents (or local equivalent). + """ + tax_behavior: Literal["exclusive", "inclusive"] + """ + Whether this tax is inclusive or exclusive. + """ + tax_rate_details: Optional[TaxRateDetails] + """ + Additional details about the tax rate. Only present when `type` is `tax_rate_details`. + """ + taxability_reason: Literal[ + "customer_exempt", + "not_available", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. @@ -132,6 +228,11 @@ class TaxAmount(StripeObject): """ The amount on which tax is calculated, in cents (or local equivalent). """ + type: Literal["tax_rate_details"] + """ + The type of tax information. + """ + _inner_class_types = {"tax_rate_details": TaxRateDetails} class ModifyParams(RequestOptions): amount: NotRequired[int] @@ -164,13 +265,13 @@ class ModifyParams(RequestOptions): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired[str] + price_data: NotRequired["InvoiceLineItem.ModifyParamsPriceData"] """ - The ID of the price object. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - price_data: NotRequired["InvoiceLineItem.ModifyParamsPriceData"] + pricing: NotRequired["InvoiceLineItem.ModifyParamsPricing"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + The pricing information for the invoice item. """ quantity: NotRequired[int] """ @@ -218,13 +319,13 @@ class ModifyParamsPriceData(TypedDict): """ product: NotRequired[str] """ - The ID of the product that this price will belong to. One of `product` or `product_data` is required. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required. """ product_data: NotRequired[ "InvoiceLineItem.ModifyParamsPriceDataProductData" ] """ - Data used to generate a new product object inline. One of `product` or `product_data` is required. + Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -263,6 +364,12 @@ class ModifyParamsPriceDataProductData(TypedDict): A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ + class ModifyParamsPricing(TypedDict): + price: NotRequired[str] + """ + The ID of the price object. + """ + class ModifyParamsTaxAmount(TypedDict): amount: int """ @@ -274,6 +381,28 @@ class ModifyParamsTaxAmount(TypedDict): Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. """ + taxability_reason: NotRequired[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ] + ] + """ + The reasoning behind this tax, for example, if the product is tax exempt. + """ taxable_amount: int """ The amount on which tax is calculated, in cents (or local equivalent). @@ -300,6 +429,14 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ + jurisdiction_level: NotRequired[ + Literal[ + "city", "country", "county", "district", "multiple", "state" + ] + ] + """ + The level of the jurisdiction that imposes this tax rate. + """ percentage: float """ The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. @@ -334,10 +471,6 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): """ The amount, in cents (or local equivalent). """ - amount_excluding_tax: Optional[int] - """ - The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. - """ 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). @@ -366,10 +499,6 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): """ The ID of the invoice that contains this line item. """ - invoice_item: Optional[ExpandableField["InvoiceItem"]] - """ - The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any. - """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. @@ -382,54 +511,27 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): """ String representing the object's type. Objects of the same type share the same value. """ - period: Period - plan: Optional["Plan"] + parent: Optional[Parent] """ - The plan of the subscription, if the line item is a subscription or a proration. + The parent that generated this invoice """ + period: Period pretax_credit_amounts: Optional[List[PretaxCreditAmount]] """ Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item. """ - price: Optional["Price"] + pricing: Optional[Pricing] """ - The price of the line item. - """ - proration: bool - """ - Whether this is a proration. - """ - proration_details: Optional[ProrationDetails] - """ - Additional details for proration line items + The pricing information of the line item. """ quantity: Optional[int] """ The quantity of the subscription, if the line item is a subscription or a proration. """ subscription: Optional[ExpandableField["Subscription"]] + taxes: Optional[List[Tax]] """ - The subscription that the invoice item pertains to, if any. - """ - subscription_item: Optional[ExpandableField["SubscriptionItem"]] - """ - The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription. - """ - tax_amounts: List[TaxAmount] - """ - The amount of tax calculated per tax rate for this line item - """ - tax_rates: List["TaxRate"] - """ - The tax rates which apply to the line item. - """ - type: Literal["invoiceitem", "subscription"] - """ - A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. - """ - unit_amount_excluding_tax: Optional[str] - """ - The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts. + The tax information of the line item. """ @classmethod @@ -474,8 +576,9 @@ async def modify_async( _inner_class_types = { "discount_amounts": DiscountAmount, + "parent": Parent, "period": Period, "pretax_credit_amounts": PretaxCreditAmount, - "proration_details": ProrationDetails, - "tax_amounts": TaxAmount, + "pricing": Pricing, + "taxes": Tax, } diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index f5ba99936..5d7b75a36 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -59,13 +59,13 @@ class UpdateParams(TypedDict): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired[str] + price_data: NotRequired["InvoiceLineItemService.UpdateParamsPriceData"] """ - The ID of the price object. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - price_data: NotRequired["InvoiceLineItemService.UpdateParamsPriceData"] + pricing: NotRequired["InvoiceLineItemService.UpdateParamsPricing"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + The pricing information for the invoice item. """ quantity: NotRequired[int] """ @@ -113,13 +113,13 @@ class UpdateParamsPriceData(TypedDict): """ product: NotRequired[str] """ - The ID of the product that this price will belong to. One of `product` or `product_data` is required. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required. """ product_data: NotRequired[ "InvoiceLineItemService.UpdateParamsPriceDataProductData" ] """ - Data used to generate a new product object inline. One of `product` or `product_data` is required. + Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -158,6 +158,12 @@ class UpdateParamsPriceDataProductData(TypedDict): A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ + class UpdateParamsPricing(TypedDict): + price: NotRequired[str] + """ + The ID of the price object. + """ + class UpdateParamsTaxAmount(TypedDict): amount: int """ @@ -171,6 +177,28 @@ class UpdateParamsTaxAmount(TypedDict): Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. """ + taxability_reason: NotRequired[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ] + ] + """ + The reasoning behind this tax, for example, if the product is tax exempt. + """ taxable_amount: int """ The amount on which tax is calculated, in cents (or local equivalent). @@ -197,6 +225,14 @@ class UpdateParamsTaxAmountTaxRateData(TypedDict): """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ + jurisdiction_level: NotRequired[ + Literal[ + "city", "country", "county", "district", "multiple", "state" + ] + ] + """ + The level of the jurisdiction that imposes this tax rate. + """ percentage: float """ The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. diff --git a/stripe/_invoice_payment.py b/stripe/_invoice_payment.py new file mode 100644 index 000000000..de13ad68a --- /dev/null +++ b/stripe/_invoice_payment.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from stripe._charge import Charge + from stripe._invoice import Invoice + from stripe._payment_intent import PaymentIntent + + +class InvoicePayment(ListableAPIResource["InvoicePayment"]): + """ + The invoice payment object + """ + + OBJECT_NAME: ClassVar[Literal["invoice_payment"]] = "invoice_payment" + + class Payment(StripeObject): + charge: Optional[ExpandableField["Charge"]] + """ + ID of the successful charge for this payment when `type` is `charge`. + """ + payment_intent: Optional[ExpandableField["PaymentIntent"]] + """ + ID of the PaymentIntent associated with this payment when `type` is `payment_intent`. Note: This property is only populated for invoices finalized on or after March 15th, 2019. + """ + type: Literal["charge", "payment_intent"] + """ + Type of payment object associated with this invoice payment. + """ + + class StatusTransitions(StripeObject): + canceled_at: Optional[int] + """ + The time that the payment was canceled. + """ + paid_at: Optional[int] + """ + The time that the payment succeeded. + """ + + class ListParams(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. + """ + invoice: NotRequired[str] + """ + The identifier of the invoice whose payments to return. + """ + 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. + """ + payment: NotRequired["InvoicePayment.ListParamsPayment"] + """ + The payment details of the invoice payments to return. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[Literal["canceled", "open", "paid"]] + """ + The status of the invoice payments to return. + """ + + class ListParamsPayment(TypedDict): + payment_intent: NotRequired[str] + """ + Only return invoice payments associated by this payment intent ID. + """ + type: Literal["payment_intent"] + """ + Only return invoice payments associated by this payment type. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + amount_paid: Optional[int] + """ + Amount that was actually paid for this invoice, in cents (or local equivalent). This field is null until the payment is `paid`. This amount can be less than the `amount_requested` if the PaymentIntent's `amount_received` is not sufficient to pay all of the invoices that it is attached to. + """ + amount_requested: int + """ + Amount intended to be paid toward this invoice, in cents (or local equivalent) + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + 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). + """ + id: str + """ + Unique identifier for the object. + """ + invoice: ExpandableField["Invoice"] + """ + The invoice that was paid. + """ + is_default: bool + """ + Stripe automatically creates a default InvoicePayment when the invoice is finalized, and keeps it synchronized with the invoice's `amount_remaining`. The PaymentIntent associated with the default payment can't be edited or canceled directly. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["invoice_payment"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payment: Payment + status: str + """ + The status of the payment, one of `open`, `paid`, or `canceled`. + """ + status_transitions: StatusTransitions + + @classmethod + def list( + cls, **params: Unpack["InvoicePayment.ListParams"] + ) -> ListObject["InvoicePayment"]: + """ + When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments. + """ + 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["InvoicePayment.ListParams"] + ) -> ListObject["InvoicePayment"]: + """ + When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments. + """ + 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["InvoicePayment.RetrieveParams"] + ) -> "InvoicePayment": + """ + Retrieves the invoice payment with the given ID. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["InvoicePayment.RetrieveParams"] + ) -> "InvoicePayment": + """ + Retrieves the invoice payment with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = { + "payment": Payment, + "status_transitions": StatusTransitions, + } diff --git a/stripe/_invoice_payment_service.py b/stripe/_invoice_payment_service.py new file mode 100644 index 000000000..3f0929c70 --- /dev/null +++ b/stripe/_invoice_payment_service.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._invoice_payment import InvoicePayment +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class InvoicePaymentService(StripeService): + class ListParams(TypedDict): + 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. + """ + invoice: NotRequired[str] + """ + The identifier of the invoice whose payments to return. + """ + 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. + """ + payment: NotRequired["InvoicePaymentService.ListParamsPayment"] + """ + The payment details of the invoice payments to return. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[Literal["canceled", "open", "paid"]] + """ + The status of the invoice payments to return. + """ + + class ListParamsPayment(TypedDict): + payment_intent: NotRequired[str] + """ + Only return invoice payments associated by this payment intent ID. + """ + type: Literal["payment_intent"] + """ + Only return invoice payments associated by this payment type. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "InvoicePaymentService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[InvoicePayment]: + """ + When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments. + """ + return cast( + ListObject[InvoicePayment], + self._request( + "get", + "/v1/invoice_payments", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "InvoicePaymentService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[InvoicePayment]: + """ + When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments. + """ + return cast( + ListObject[InvoicePayment], + await self._request_async( + "get", + "/v1/invoice_payments", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + invoice_payment: str, + params: "InvoicePaymentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> InvoicePayment: + """ + Retrieves the invoice payment with the given ID. + """ + return cast( + InvoicePayment, + self._request( + "get", + "/v1/invoice_payments/{invoice_payment}".format( + invoice_payment=sanitize_id(invoice_payment), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + invoice_payment: str, + params: "InvoicePaymentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> InvoicePayment: + """ + Retrieves the invoice payment with the given ID. + """ + return cast( + InvoicePayment, + await self._request_async( + "get", + "/v1/invoice_payments/{invoice_payment}".format( + invoice_payment=sanitize_id(invoice_payment), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 7da0c5361..8ba1aeb9a 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -2,7 +2,6 @@ # File generated from our OpenAPI spec from stripe._invoice import Invoice from stripe._invoice_line_item_service import InvoiceLineItemService -from stripe._invoice_upcoming_lines_service import InvoiceUpcomingLinesService from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject @@ -16,7 +15,6 @@ class InvoiceService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.line_items = InvoiceLineItemService(self._requestor) - self.upcoming_lines = InvoiceUpcomingLinesService(self._requestor) class AddLinesParams(TypedDict): expand: NotRequired[List[str]] @@ -63,13 +61,13 @@ class AddLinesParamsLine(TypedDict): """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - price: NotRequired[str] + price_data: NotRequired["InvoiceService.AddLinesParamsLinePriceData"] """ - The ID of the price object. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - price_data: NotRequired["InvoiceService.AddLinesParamsLinePriceData"] + pricing: NotRequired["InvoiceService.AddLinesParamsLinePricing"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + The pricing information for the invoice item. """ quantity: NotRequired[int] """ @@ -117,13 +115,13 @@ class AddLinesParamsLinePriceData(TypedDict): """ product: NotRequired[str] """ - The ID of the product that this price will belong to. One of `product` or `product_data` is required. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required. """ product_data: NotRequired[ "InvoiceService.AddLinesParamsLinePriceDataProductData" ] """ - Data used to generate a new product object inline. One of `product` or `product_data` is required. + Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -162,6 +160,12 @@ class AddLinesParamsLinePriceDataProductData(TypedDict): A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ + class AddLinesParamsLinePricing(TypedDict): + price: NotRequired[str] + """ + The ID of the price object. + """ + class AddLinesParamsLineTaxAmount(TypedDict): amount: int """ @@ -173,6 +177,28 @@ class AddLinesParamsLineTaxAmount(TypedDict): Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. """ + taxability_reason: NotRequired[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ] + ] + """ + The reasoning behind this tax, for example, if the product is tax exempt. + """ taxable_amount: int """ The amount on which tax is calculated, in cents (or local equivalent). @@ -199,6 +225,14 @@ class AddLinesParamsLineTaxAmountTaxRateData(TypedDict): """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ + jurisdiction_level: NotRequired[ + Literal[ + "city", "country", "county", "district", "multiple", "state" + ] + ] + """ + The level of the jurisdiction that imposes this tax rate. + """ percentage: float """ The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. @@ -449,7 +483,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -873,10 +907,6 @@ class CreatePreviewParams(TypedDict): """ Settings for automatic tax lookup for this invoice preview. """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ currency: NotRequired[str] """ The currency to preview this invoice in. Defaults to that of `customer` if not specified. @@ -1298,7 +1328,7 @@ class CreatePreviewParamsInvoiceItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -1366,22 +1396,12 @@ class CreatePreviewParamsScheduleDetailsPhase(TypedDict): """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: NotRequired[ - "Literal['']|InvoiceService.CreatePreviewParamsScheduleDetailsPhaseBillingThresholds" - ] - """ - 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. - """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ currency: NotRequired[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). @@ -1510,7 +1530,7 @@ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData( """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -1551,16 +1571,6 @@ class CreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability( Type of the account referenced in the request. """ - class CreatePreviewParamsScheduleDetailsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class CreatePreviewParamsScheduleDetailsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ @@ -1604,12 +1614,6 @@ class CreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer( """ class CreatePreviewParamsScheduleDetailsPhaseItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ discounts: NotRequired[ "Literal['']|List[InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemDiscount]" ] @@ -1643,14 +1647,6 @@ class CreatePreviewParamsScheduleDetailsPhaseItem(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds( - TypedDict, - ): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class CreatePreviewParamsScheduleDetailsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -1672,7 +1668,7 @@ class CreatePreviewParamsScheduleDetailsPhaseItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring" """ @@ -1766,12 +1762,6 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): """ class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|InvoiceService.CreatePreviewParamsSubscriptionDetailsItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ clear_usage: NotRequired[bool] """ 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. @@ -1817,14 +1807,6 @@ class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class CreatePreviewParamsSubscriptionDetailsItemBillingThresholds( - TypedDict, - ): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class CreatePreviewParamsSubscriptionDetailsItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -1846,7 +1828,7 @@ class CreatePreviewParamsSubscriptionDetailsItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "InvoiceService.CreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring" """ @@ -2063,1370 +2045,253 @@ class SendInvoiceParams(TypedDict): Specifies which fields in the response should be expanded. """ - class UpcomingParams(TypedDict): - automatic_tax: NotRequired["InvoiceService.UpcomingParamsAutomaticTax"] + class UpdateLinesParams(TypedDict): + expand: NotRequired[List[str]] """ - Settings for automatic tax lookup for this invoice preview. + Specifies which fields in the response should be expanded. """ - coupon: NotRequired[str] + invoice_metadata: NotRequired["Literal['']|Dict[str, str]"] """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. """ - currency: NotRequired[str] + lines: List["InvoiceService.UpdateLinesParamsLine"] """ - The currency to preview this invoice in. Defaults to that of `customer` if not specified. + The line items to update. """ - customer: NotRequired[str] + + class UpdateLinesParamsLine(TypedDict): + amount: NotRequired[int] """ - The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. """ - customer_details: NotRequired[ - "InvoiceService.UpcomingParamsCustomerDetails" - ] + description: NotRequired[str] """ - Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + """ + discountable: NotRequired[bool] + """ + Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. """ discounts: NotRequired[ - "Literal['']|List[InvoiceService.UpcomingParamsDiscount]" + "Literal['']|List[InvoiceService.UpdateLinesParamsLineDiscount]" ] """ - The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. + The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ - expand: NotRequired[List[str]] + id: str """ - Specifies which fields in the response should be expanded. + ID of an existing line item on the invoice. """ - invoice_items: NotRequired[ - List["InvoiceService.UpcomingParamsInvoiceItem"] - ] + metadata: NotRequired["Literal['']|Dict[str, str]"] """ - List of invoice items to add or update in the upcoming invoice preview (up to 250). + Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. """ - issuer: NotRequired["InvoiceService.UpcomingParamsIssuer"] + period: NotRequired["InvoiceService.UpdateLinesParamsLinePeriod"] """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ - on_behalf_of: NotRequired["Literal['']|str"] + price_data: NotRequired[ + "InvoiceService.UpdateLinesParamsLinePriceData" + ] """ - The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ - preview_mode: NotRequired[Literal["next", "recurring"]] + pricing: NotRequired["InvoiceService.UpdateLinesParamsLinePricing"] """ - Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. + The pricing information for the invoice item. """ - schedule: NotRequired[str] + quantity: NotRequired[int] """ - The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. + Non-negative integer. The quantity of units for the line item. """ - schedule_details: NotRequired[ - "InvoiceService.UpcomingParamsScheduleDetails" + tax_amounts: NotRequired[ + "Literal['']|List[InvoiceService.UpdateLinesParamsLineTaxAmount]" ] """ - The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. + A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. """ - subscription: NotRequired[str] + tax_rates: NotRequired["Literal['']|List[str]"] """ - The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. """ - subscription_billing_cycle_anchor: NotRequired[ - "Literal['now', 'unchanged']|int" - ] + + class UpdateLinesParamsLineDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] """ - For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. + ID of an existing discount on the object (or one of its ancestors) to reuse. """ - subscription_cancel_at: NotRequired["Literal['']|int"] + promotion_code: NotRequired[str] """ - A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. + ID of the promotion code to create a new discount for. """ - subscription_cancel_at_period_end: NotRequired[bool] + + class UpdateLinesParamsLinePeriod(TypedDict): + end: int """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. + The end of the period, which must be greater than or equal to the start. This value is inclusive. """ - subscription_cancel_now: NotRequired[bool] + start: int """ - This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. + The start of the period. This value is inclusive. """ - subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] + + class UpdateLinesParamsLinePriceData(TypedDict): + currency: str """ - If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. + 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). """ - subscription_details: NotRequired[ - "InvoiceService.UpcomingParamsSubscriptionDetails" - ] + product: NotRequired[str] """ - The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required. """ - subscription_items: NotRequired[ - List["InvoiceService.UpcomingParamsSubscriptionItem"] + product_data: NotRequired[ + "InvoiceService.UpdateLinesParamsLinePriceDataProductData" ] """ - A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. + Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required. """ - subscription_proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] ] """ - Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ - subscription_proration_date: NotRequired[int] + unit_amount: NotRequired[int] """ - If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. + A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - subscription_resume_at: NotRequired[Literal["now"]] + unit_amount_decimal: NotRequired[str] """ - For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - subscription_start_date: NotRequired[int] + + class UpdateLinesParamsLinePriceDataProductData(TypedDict): + description: NotRequired[str] """ - Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ - subscription_trial_end: NotRequired["Literal['now']|int"] + images: NotRequired[List[str]] """ - If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ - subscription_trial_from_plan: NotRequired[bool] + metadata: NotRequired[Dict[str, str]] """ - Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + Set of [key-value pairs](https://stripe.com/docs/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`. """ - - class UpcomingParamsAutomaticTax(TypedDict): - enabled: bool + name: str """ - Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + The product's name, meant to be displayable to the customer. """ - liability: NotRequired[ - "InvoiceService.UpcomingParamsAutomaticTaxLiability" - ] + tax_code: NotRequired[str] """ - The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ - class UpcomingParamsAutomaticTaxLiability(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] + class UpdateLinesParamsLinePricing(TypedDict): + price: NotRequired[str] """ - Type of the account referenced in the request. + The ID of the price object. """ - class UpcomingParamsCustomerDetails(TypedDict): - address: NotRequired[ - "Literal['']|InvoiceService.UpcomingParamsCustomerDetailsAddress" - ] - """ - The customer's address. - """ - shipping: NotRequired[ - "Literal['']|InvoiceService.UpcomingParamsCustomerDetailsShipping" - ] + class UpdateLinesParamsLineTaxAmount(TypedDict): + amount: int """ - The customer's shipping information. Appears on invoices emailed to this customer. + The amount, in cents (or local equivalent), of the tax. """ - tax: NotRequired["InvoiceService.UpcomingParamsCustomerDetailsTax"] + tax_rate_data: ( + "InvoiceService.UpdateLinesParamsLineTaxAmountTaxRateData" + ) """ - Tax details about the customer. + Data to find or create a TaxRate object. + + Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. """ - tax_exempt: NotRequired[ - "Literal['']|Literal['exempt', 'none', 'reverse']" + taxability_reason: NotRequired[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ] ] """ - The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + The reasoning behind this tax, for example, if the product is tax exempt. """ - tax_ids: NotRequired[ - List["InvoiceService.UpcomingParamsCustomerDetailsTaxId"] - ] + taxable_amount: int """ - The customer's tax IDs. + The amount on which tax is calculated, in cents (or local equivalent). """ - class UpcomingParamsCustomerDetailsAddress(TypedDict): - city: NotRequired[str] - """ - City, district, suburb, town, or village. - """ + class UpdateLinesParamsLineTaxAmountTaxRateData(TypedDict): country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - line1: NotRequired[str] + description: NotRequired[str] """ - Address line 1 (e.g., street, PO Box, or company name). + An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ - line2: NotRequired[str] + display_name: str """ - Address line 2 (e.g., apartment, suite, unit, or building). + The display name of the tax rate, which will be shown to users. """ - postal_code: NotRequired[str] + inclusive: bool """ - ZIP or postal code. + This specifies if the tax rate is inclusive or exclusive. """ - state: NotRequired[str] + jurisdiction: NotRequired[str] """ - State, county, province, or region. + The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ - - class UpcomingParamsCustomerDetailsShipping(TypedDict): - address: "InvoiceService.UpcomingParamsCustomerDetailsShippingAddress" + jurisdiction_level: NotRequired[ + Literal[ + "city", "country", "county", "district", "multiple", "state" + ] + ] """ - Customer shipping address. + The level of the jurisdiction that imposes this tax rate. """ - name: str + percentage: float """ - Customer name. + The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. """ - phone: NotRequired[str] + state: NotRequired[str] """ - Customer phone (including extension). + [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ - - class UpcomingParamsCustomerDetailsShippingAddress(TypedDict): - city: NotRequired[str] - """ - City, district, suburb, town, or village. - """ - country: NotRequired[str] - """ - A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - """ - line1: NotRequired[str] - """ - Address line 1 (e.g., street, PO Box, or company name). - """ - line2: NotRequired[str] - """ - Address line 2 (e.g., apartment, suite, unit, or building). - """ - postal_code: NotRequired[str] - """ - ZIP or postal code. - """ - state: NotRequired[str] - """ - State, county, province, or region. - """ - - class UpcomingParamsCustomerDetailsTax(TypedDict): - ip_address: NotRequired["Literal['']|str"] - """ - A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. - """ - - class UpcomingParamsCustomerDetailsTaxId(TypedDict): - type: Literal[ - "ad_nrt", - "ae_trn", - "al_tin", - "am_tin", - "ao_tin", - "ar_cuit", - "au_abn", - "au_arn", - "ba_tin", - "bb_tin", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "bs_tin", - "by_tin", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "cd_nif", - "ch_uid", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "de_stn", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "eu_vat", - "gb_vat", - "ge_vat", - "gn_nif", - "hk_br", - "hr_oib", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kh_tin", - "kr_brn", - "kz_bin", - "li_uid", - "li_vat", - "ma_vat", - "md_vat", - "me_pib", - "mk_vat", - "mr_nif", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "np_pan", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sn_ninea", - "sr_fin", - "sv_nit", - "th_vat", - "tj_tin", - "tr_tin", - "tw_vat", - "tz_vat", - "ua_vat", - "ug_tin", - "us_ein", - "uy_ruc", - "uz_tin", - "uz_vat", - "ve_rif", - "vn_tin", - "za_vat", - "zm_tin", - "zw_tin", - ] - """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` - """ - value: str - """ - Value of the tax ID. - """ - - class UpcomingParamsDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsInvoiceItem(TypedDict): - amount: NotRequired[int] - """ - The integer amount in cents (or local equivalent) of previewed invoice item. - """ - currency: NotRequired[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). Only applicable to new invoice items. - """ - description: NotRequired[str] - """ - An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - """ - discountable: NotRequired[bool] - """ - Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. - """ - discounts: NotRequired[ - "Literal['']|List[InvoiceService.UpcomingParamsInvoiceItemDiscount]" - ] - """ - The coupons to redeem into discounts for the invoice item in the preview. - """ - invoiceitem: NotRequired[str] - """ - The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - period: NotRequired["InvoiceService.UpcomingParamsInvoiceItemPeriod"] - """ - The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. - """ - price_data: NotRequired[ - "InvoiceService.UpcomingParamsInvoiceItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Non-negative integer. The quantity of units for the invoice item. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - tax_code: NotRequired["Literal['']|str"] - """ - A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. - """ - unit_amount: NotRequired[int] - """ - The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingParamsInvoiceItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsInvoiceItemPeriod(TypedDict): - end: int - """ - The end of the period, which must be greater than or equal to the start. This value is inclusive. - """ - start: int - """ - The start of the period. This value is inclusive. - """ - - class UpcomingParamsInvoiceItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingParamsIssuer(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class UpcomingParamsScheduleDetails(TypedDict): - end_behavior: NotRequired[Literal["cancel", "release"]] - """ - Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. - """ - phases: NotRequired[ - List["InvoiceService.UpcomingParamsScheduleDetailsPhase"] - ] - """ - List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. - """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. - """ - - class UpcomingParamsScheduleDetailsPhase(TypedDict): - add_invoice_items: NotRequired[ - List[ - "InvoiceService.UpcomingParamsScheduleDetailsPhaseAddInvoiceItem" - ] - ] - """ - A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. - """ - application_fee_percent: NotRequired[float] - """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - """ - automatic_tax: NotRequired[ - "InvoiceService.UpcomingParamsScheduleDetailsPhaseAutomaticTax" - ] - """ - Automatic tax settings for this phase. - """ - billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] - """ - Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - """ - billing_thresholds: NotRequired[ - "Literal['']|InvoiceService.UpcomingParamsScheduleDetailsPhaseBillingThresholds" - ] - """ - 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. - """ - collection_method: NotRequired[ - Literal["charge_automatically", "send_invoice"] - ] - """ - Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. - """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ - currency: NotRequired[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). - """ - default_payment_method: NotRequired[str] - """ - ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. - """ - default_tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. - """ - description: NotRequired["Literal['']|str"] - """ - Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - """ - discounts: NotRequired[ - "Literal['']|List[InvoiceService.UpcomingParamsScheduleDetailsPhaseDiscount]" - ] - """ - The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. - """ - end_date: NotRequired["int|Literal['now']"] - """ - The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. - """ - invoice_settings: NotRequired[ - "InvoiceService.UpcomingParamsScheduleDetailsPhaseInvoiceSettings" - ] - """ - All invoices will be billed using the specified settings. - """ - items: List["InvoiceService.UpcomingParamsScheduleDetailsPhaseItem"] - """ - List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. - """ - iterations: NotRequired[int] - """ - Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. - """ - metadata: NotRequired[Dict[str, str]] - """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. - """ - on_behalf_of: NotRequired[str] - """ - The account on behalf of which to charge, for each of the associated subscription's invoices. - """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. - """ - start_date: NotRequired["int|Literal['now']"] - """ - The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. - """ - transfer_data: NotRequired[ - "InvoiceService.UpcomingParamsScheduleDetailsPhaseTransferData" - ] - """ - The data with which to automatically create a Transfer for each of the associated subscription's invoices. - """ - trial: NotRequired[bool] - """ - If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. - """ - trial_end: NotRequired["int|Literal['now']"] - """ - Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` - """ - - class UpcomingParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): - discounts: NotRequired[ - List[ - "InvoiceService.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemDiscount" - ] - ] - """ - The coupons to redeem into discounts for the item. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. - """ - price_data: NotRequired[ - "InvoiceService.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Quantity for this item. Defaults to 1. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. - """ - - class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingParamsScheduleDetailsPhaseAutomaticTax(TypedDict): - enabled: bool - """ - Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - """ - liability: NotRequired[ - "InvoiceService.UpcomingParamsScheduleDetailsPhaseAutomaticTaxLiability" - ] - """ - The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. - """ - - class UpcomingParamsScheduleDetailsPhaseAutomaticTaxLiability(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class UpcomingParamsScheduleDetailsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - - class UpcomingParamsScheduleDetailsPhaseDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): - account_tax_ids: NotRequired["Literal['']|List[str]"] - """ - The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. - """ - days_until_due: NotRequired[int] - """ - Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. - """ - issuer: NotRequired[ - "InvoiceService.UpcomingParamsScheduleDetailsPhaseInvoiceSettingsIssuer" - ] - """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. - """ - - class UpcomingParamsScheduleDetailsPhaseInvoiceSettingsIssuer(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class UpcomingParamsScheduleDetailsPhaseItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|InvoiceService.UpcomingParamsScheduleDetailsPhaseItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - discounts: NotRequired[ - "Literal['']|List[InvoiceService.UpcomingParamsScheduleDetailsPhaseItemDiscount]" - ] - """ - The coupons to redeem into discounts for the subscription item. - """ - metadata: NotRequired[Dict[str, str]] - """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. - """ - plan: NotRequired[str] - """ - The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. - """ - price: NotRequired[str] - """ - The ID of the price object. - """ - price_data: NotRequired[ - "InvoiceService.UpcomingParamsScheduleDetailsPhaseItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - """ - quantity: NotRequired[int] - """ - Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class UpcomingParamsScheduleDetailsPhaseItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - - class UpcomingParamsScheduleDetailsPhaseItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsScheduleDetailsPhaseItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - recurring: "InvoiceService.UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring" - """ - The recurring components of a price such as `interval` and `interval_count`. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] - """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. - """ - interval_count: NotRequired[int] - """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - """ - - class UpcomingParamsScheduleDetailsPhaseTransferData(TypedDict): - amount_percent: NotRequired[float] - """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - """ - destination: str - """ - ID of an existing, connected Stripe account. - """ - - class UpcomingParamsSubscriptionDetails(TypedDict): - billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] - """ - For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. - """ - cancel_at: NotRequired["Literal['']|int"] - """ - A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. - """ - cancel_at_period_end: NotRequired[bool] - """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. - """ - cancel_now: NotRequired[bool] - """ - This simulates the subscription being canceled or expired immediately. - """ - default_tax_rates: NotRequired["Literal['']|List[str]"] - """ - If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. - """ - items: NotRequired[ - List["InvoiceService.UpcomingParamsSubscriptionDetailsItem"] - ] - """ - A list of up to 20 subscription items, each with an attached price. - """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. - """ - proration_date: NotRequired[int] - """ - If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. - """ - resume_at: NotRequired[Literal["now"]] - """ - For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. - """ - start_date: NotRequired[int] - """ - Date a subscription is intended to start (can be future or past). - """ - trial_end: NotRequired["Literal['now']|int"] - """ - If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. - """ - - class UpcomingParamsSubscriptionDetailsItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|InvoiceService.UpcomingParamsSubscriptionDetailsItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - clear_usage: NotRequired[bool] - """ - 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. - """ - deleted: NotRequired[bool] - """ - A flag that, if set to `true`, will delete the specified item. - """ - discounts: NotRequired[ - "Literal['']|List[InvoiceService.UpcomingParamsSubscriptionDetailsItemDiscount]" - ] - """ - The coupons to redeem into discounts for the subscription item. - """ - id: NotRequired[str] - """ - Subscription item to update. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - plan: NotRequired[str] - """ - Plan ID for this item, as a string. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - """ - price_data: NotRequired[ - "InvoiceService.UpcomingParamsSubscriptionDetailsItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Quantity for this item. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class UpcomingParamsSubscriptionDetailsItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - - class UpcomingParamsSubscriptionDetailsItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsSubscriptionDetailsItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - recurring: "InvoiceService.UpcomingParamsSubscriptionDetailsItemPriceDataRecurring" - """ - The recurring components of a price such as `interval` and `interval_count`. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingParamsSubscriptionDetailsItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] - """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. - """ - interval_count: NotRequired[int] - """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - """ - - class UpcomingParamsSubscriptionItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|InvoiceService.UpcomingParamsSubscriptionItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - clear_usage: NotRequired[bool] - """ - 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. - """ - deleted: NotRequired[bool] - """ - A flag that, if set to `true`, will delete the specified item. - """ - discounts: NotRequired[ - "Literal['']|List[InvoiceService.UpcomingParamsSubscriptionItemDiscount]" - ] - """ - The coupons to redeem into discounts for the subscription item. - """ - id: NotRequired[str] - """ - Subscription item to update. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - plan: NotRequired[str] - """ - Plan ID for this item, as a string. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - """ - price_data: NotRequired[ - "InvoiceService.UpcomingParamsSubscriptionItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Quantity for this item. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class UpcomingParamsSubscriptionItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - - class UpcomingParamsSubscriptionItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpcomingParamsSubscriptionItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - recurring: ( - "InvoiceService.UpcomingParamsSubscriptionItemPriceDataRecurring" - ) - """ - The recurring components of a price such as `interval` and `interval_count`. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpcomingParamsSubscriptionItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] - """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. - """ - interval_count: NotRequired[int] - """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - """ - - class UpdateLinesParams(TypedDict): - expand: NotRequired[List[str]] - """ - Specifies which fields in the response should be expanded. - """ - invoice_metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. - """ - lines: List["InvoiceService.UpdateLinesParamsLine"] - """ - The line items to update. - """ - - class UpdateLinesParamsLine(TypedDict): - amount: NotRequired[int] - """ - The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. - """ - description: NotRequired[str] - """ - An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - """ - discountable: NotRequired[bool] - """ - Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. - """ - discounts: NotRequired[ - "Literal['']|List[InvoiceService.UpdateLinesParamsLineDiscount]" - ] - """ - The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. - """ - id: str - """ - ID of an existing line item on the invoice. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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://stripe.com/docs/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. - """ - period: NotRequired["InvoiceService.UpdateLinesParamsLinePeriod"] - """ - The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. - """ - price_data: NotRequired[ - "InvoiceService.UpdateLinesParamsLinePriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Non-negative integer. The quantity of units for the line item. - """ - tax_amounts: NotRequired[ - "Literal['']|List[InvoiceService.UpdateLinesParamsLineTaxAmount]" - ] - """ - A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. - """ - - class UpdateLinesParamsLineDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class UpdateLinesParamsLinePeriod(TypedDict): - end: int - """ - The end of the period, which must be greater than or equal to the start. This value is inclusive. - """ - start: int - """ - The start of the period. This value is inclusive. - """ - - class UpdateLinesParamsLinePriceData(TypedDict): - 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). - """ - product: NotRequired[str] - """ - The ID of the product that this price will belong to. One of `product` or `product_data` is required. - """ - product_data: NotRequired[ - "InvoiceService.UpdateLinesParamsLinePriceDataProductData" - ] - """ - Data used to generate a new product object inline. One of `product` or `product_data` is required. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class UpdateLinesParamsLinePriceDataProductData(TypedDict): - description: NotRequired[str] - """ - The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - """ - images: NotRequired[List[str]] - """ - A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - """ - metadata: NotRequired[Dict[str, str]] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - name: str - """ - The product's name, meant to be displayable to the customer. - """ - tax_code: NotRequired[str] - """ - A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - """ - - class UpdateLinesParamsLineTaxAmount(TypedDict): - amount: int - """ - The amount, in cents (or local equivalent), of the tax. - """ - tax_rate_data: ( - "InvoiceService.UpdateLinesParamsLineTaxAmountTaxRateData" - ) - """ - Data to find or create a TaxRate object. - - Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. - """ - taxable_amount: int - """ - The amount on which tax is calculated, in cents (or local equivalent). - """ - - class UpdateLinesParamsLineTaxAmountTaxRateData(TypedDict): - country: NotRequired[str] - """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - """ - description: NotRequired[str] - """ - An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. - """ - display_name: str - """ - The display name of the tax rate, which will be shown to users. - """ - inclusive: bool - """ - This specifies if the tax rate is inclusive or exclusive. - """ - jurisdiction: NotRequired[str] - """ - The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. - """ - percentage: float - """ - The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. - """ - state: NotRequired[str] - """ - [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. - """ - tax_type: NotRequired[ - Literal[ - "amusement_tax", - "communications_tax", - "gst", - "hst", - "igst", - "jct", - "lease_tax", - "pst", - "qst", - "retail_delivery_fee", - "rst", - "sales_tax", - "service_tax", - "vat", - ] - ] + tax_type: NotRequired[ + Literal[ + "amusement_tax", + "communications_tax", + "gst", + "hst", + "igst", + "jct", + "lease_tax", + "pst", + "qst", + "retail_delivery_fee", + "rst", + "sales_tax", + "service_tax", + "vat", + ] + ] """ The high-level tax type, such as `vat` or `sales_tax`. """ @@ -3623,7 +2488,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -4296,56 +3161,6 @@ async def search_async( ), ) - def upcoming( - self, - params: "InvoiceService.UpcomingParams" = {}, - options: RequestOptions = {}, - ) -> Invoice: - """ - At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. - - Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - - You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. - - Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) - """ - return cast( - Invoice, - self._request( - "get", - "/v1/invoices/upcoming", - base_address="api", - params=params, - options=options, - ), - ) - - async def upcoming_async( - self, - params: "InvoiceService.UpcomingParams" = {}, - options: RequestOptions = {}, - ) -> Invoice: - """ - At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. - - Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - - You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. - - Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) - """ - return cast( - Invoice, - await self._request_async( - "get", - "/v1/invoices/upcoming", - base_address="api", - params=params, - options=options, - ), - ) - def add_lines( self, invoice: str, diff --git a/stripe/_invoice_upcoming_lines_service.py b/stripe/_invoice_upcoming_lines_service.py deleted file mode 100644 index 5c53320f1..000000000 --- a/stripe/_invoice_upcoming_lines_service.py +++ /dev/null @@ -1,1221 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe._invoice_line_item import InvoiceLineItem -from stripe._list_object import ListObject -from stripe._request_options import RequestOptions -from stripe._stripe_service import StripeService -from typing import Dict, List, cast -from typing_extensions import Literal, NotRequired, TypedDict - - -class InvoiceUpcomingLinesService(StripeService): - class ListParams(TypedDict): - automatic_tax: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsAutomaticTax" - ] - """ - Settings for automatic tax lookup for this invoice preview. - """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ - currency: NotRequired[str] - """ - The currency to preview this invoice in. Defaults to that of `customer` if not specified. - """ - customer: NotRequired[str] - """ - The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. - """ - customer_details: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsCustomerDetails" - ] - """ - Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. - """ - discounts: NotRequired[ - "Literal['']|List[InvoiceUpcomingLinesService.ListParamsDiscount]" - ] - """ - The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. - """ - 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. - """ - invoice_items: NotRequired[ - List["InvoiceUpcomingLinesService.ListParamsInvoiceItem"] - ] - """ - List of invoice items to add or update in the upcoming invoice preview (up to 250). - """ - issuer: NotRequired["InvoiceUpcomingLinesService.ListParamsIssuer"] - """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. - """ - 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. - """ - on_behalf_of: NotRequired["Literal['']|str"] - """ - The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. - """ - preview_mode: NotRequired[Literal["next", "recurring"]] - """ - Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. - """ - schedule: NotRequired[str] - """ - The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. - """ - schedule_details: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsScheduleDetails" - ] - """ - The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. - """ - 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. - """ - subscription: NotRequired[str] - """ - The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. - """ - subscription_billing_cycle_anchor: NotRequired[ - "Literal['now', 'unchanged']|int" - ] - """ - For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. - """ - subscription_cancel_at: NotRequired["Literal['']|int"] - """ - A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. - """ - subscription_cancel_at_period_end: NotRequired[bool] - """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. - """ - subscription_cancel_now: NotRequired[bool] - """ - This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. - """ - subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] - """ - If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. - """ - subscription_details: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsSubscriptionDetails" - ] - """ - The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. - """ - subscription_items: NotRequired[ - List["InvoiceUpcomingLinesService.ListParamsSubscriptionItem"] - ] - """ - A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. - """ - subscription_proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. - """ - subscription_proration_date: NotRequired[int] - """ - If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. - """ - subscription_resume_at: NotRequired[Literal["now"]] - """ - For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. - """ - subscription_start_date: NotRequired[int] - """ - Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. - """ - subscription_trial_end: NotRequired["Literal['now']|int"] - """ - If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. - """ - subscription_trial_from_plan: NotRequired[bool] - """ - Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - """ - - class ListParamsAutomaticTax(TypedDict): - enabled: bool - """ - Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. - """ - liability: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsAutomaticTaxLiability" - ] - """ - The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. - """ - - class ListParamsAutomaticTaxLiability(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class ListParamsCustomerDetails(TypedDict): - address: NotRequired[ - "Literal['']|InvoiceUpcomingLinesService.ListParamsCustomerDetailsAddress" - ] - """ - The customer's address. - """ - shipping: NotRequired[ - "Literal['']|InvoiceUpcomingLinesService.ListParamsCustomerDetailsShipping" - ] - """ - The customer's shipping information. Appears on invoices emailed to this customer. - """ - tax: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsCustomerDetailsTax" - ] - """ - Tax details about the customer. - """ - tax_exempt: NotRequired[ - "Literal['']|Literal['exempt', 'none', 'reverse']" - ] - """ - The customer's tax exemption. One of `none`, `exempt`, or `reverse`. - """ - tax_ids: NotRequired[ - List["InvoiceUpcomingLinesService.ListParamsCustomerDetailsTaxId"] - ] - """ - The customer's tax IDs. - """ - - class ListParamsCustomerDetailsAddress(TypedDict): - city: NotRequired[str] - """ - City, district, suburb, town, or village. - """ - country: NotRequired[str] - """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - """ - line1: NotRequired[str] - """ - Address line 1 (e.g., street, PO Box, or company name). - """ - line2: NotRequired[str] - """ - Address line 2 (e.g., apartment, suite, unit, or building). - """ - postal_code: NotRequired[str] - """ - ZIP or postal code. - """ - state: NotRequired[str] - """ - State, county, province, or region. - """ - - class ListParamsCustomerDetailsShipping(TypedDict): - address: "InvoiceUpcomingLinesService.ListParamsCustomerDetailsShippingAddress" - """ - Customer shipping address. - """ - name: str - """ - Customer name. - """ - phone: NotRequired[str] - """ - Customer phone (including extension). - """ - - class ListParamsCustomerDetailsShippingAddress(TypedDict): - city: NotRequired[str] - """ - City, district, suburb, town, or village. - """ - country: NotRequired[str] - """ - A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - """ - line1: NotRequired[str] - """ - Address line 1 (e.g., street, PO Box, or company name). - """ - line2: NotRequired[str] - """ - Address line 2 (e.g., apartment, suite, unit, or building). - """ - postal_code: NotRequired[str] - """ - ZIP or postal code. - """ - state: NotRequired[str] - """ - State, county, province, or region. - """ - - class ListParamsCustomerDetailsTax(TypedDict): - ip_address: NotRequired["Literal['']|str"] - """ - A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. - """ - - class ListParamsCustomerDetailsTaxId(TypedDict): - type: Literal[ - "ad_nrt", - "ae_trn", - "al_tin", - "am_tin", - "ao_tin", - "ar_cuit", - "au_abn", - "au_arn", - "ba_tin", - "bb_tin", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "bs_tin", - "by_tin", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "cd_nif", - "ch_uid", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "de_stn", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "eu_vat", - "gb_vat", - "ge_vat", - "gn_nif", - "hk_br", - "hr_oib", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kh_tin", - "kr_brn", - "kz_bin", - "li_uid", - "li_vat", - "ma_vat", - "md_vat", - "me_pib", - "mk_vat", - "mr_nif", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "np_pan", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sn_ninea", - "sr_fin", - "sv_nit", - "th_vat", - "tj_tin", - "tr_tin", - "tw_vat", - "tz_vat", - "ua_vat", - "ug_tin", - "us_ein", - "uy_ruc", - "uz_tin", - "uz_vat", - "ve_rif", - "vn_tin", - "za_vat", - "zm_tin", - "zw_tin", - ] - """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` - """ - value: str - """ - Value of the tax ID. - """ - - class ListParamsDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class ListParamsInvoiceItem(TypedDict): - amount: NotRequired[int] - """ - The integer amount in cents (or local equivalent) of previewed invoice item. - """ - currency: NotRequired[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). Only applicable to new invoice items. - """ - description: NotRequired[str] - """ - An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - """ - discountable: NotRequired[bool] - """ - Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. - """ - discounts: NotRequired[ - "Literal['']|List[InvoiceUpcomingLinesService.ListParamsInvoiceItemDiscount]" - ] - """ - The coupons to redeem into discounts for the invoice item in the preview. - """ - invoiceitem: NotRequired[str] - """ - The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - period: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsInvoiceItemPeriod" - ] - """ - The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. - """ - price_data: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsInvoiceItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Non-negative integer. The quantity of units for the invoice item. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - tax_code: NotRequired["Literal['']|str"] - """ - A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. - """ - unit_amount: NotRequired[int] - """ - The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class ListParamsInvoiceItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class ListParamsInvoiceItemPeriod(TypedDict): - end: int - """ - The end of the period, which must be greater than or equal to the start. This value is inclusive. - """ - start: int - """ - The start of the period. This value is inclusive. - """ - - class ListParamsInvoiceItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class ListParamsIssuer(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class ListParamsScheduleDetails(TypedDict): - end_behavior: NotRequired[Literal["cancel", "release"]] - """ - Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. - """ - phases: NotRequired[ - List["InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhase"] - ] - """ - List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. - """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. - """ - - class ListParamsScheduleDetailsPhase(TypedDict): - add_invoice_items: NotRequired[ - List[ - "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAddInvoiceItem" - ] - ] - """ - A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. - """ - application_fee_percent: NotRequired[float] - """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - """ - automatic_tax: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAutomaticTax" - ] - """ - Automatic tax settings for this phase. - """ - billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] - """ - Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - """ - billing_thresholds: NotRequired[ - "Literal['']|InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseBillingThresholds" - ] - """ - 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. - """ - collection_method: NotRequired[ - Literal["charge_automatically", "send_invoice"] - ] - """ - Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. - """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ - currency: NotRequired[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). - """ - default_payment_method: NotRequired[str] - """ - ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. - """ - default_tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. - """ - description: NotRequired["Literal['']|str"] - """ - Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - """ - discounts: NotRequired[ - "Literal['']|List[InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseDiscount]" - ] - """ - The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. - """ - end_date: NotRequired["int|Literal['now']"] - """ - The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. - """ - invoice_settings: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseInvoiceSettings" - ] - """ - All invoices will be billed using the specified settings. - """ - items: List[ - "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItem" - ] - """ - List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. - """ - iterations: NotRequired[int] - """ - Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. - """ - metadata: NotRequired[Dict[str, str]] - """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. - """ - on_behalf_of: NotRequired[str] - """ - The account on behalf of which to charge, for each of the associated subscription's invoices. - """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. - """ - start_date: NotRequired["int|Literal['now']"] - """ - The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. - """ - transfer_data: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseTransferData" - ] - """ - The data with which to automatically create a Transfer for each of the associated subscription's invoices. - """ - trial: NotRequired[bool] - """ - If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. - """ - trial_end: NotRequired["int|Literal['now']"] - """ - Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` - """ - - class ListParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): - discounts: NotRequired[ - List[ - "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAddInvoiceItemDiscount" - ] - ] - """ - The coupons to redeem into discounts for the item. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. - """ - price_data: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAddInvoiceItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Quantity for this item. Defaults to 1. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. - """ - - class ListParamsScheduleDetailsPhaseAddInvoiceItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class ListParamsScheduleDetailsPhaseAddInvoiceItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class ListParamsScheduleDetailsPhaseAutomaticTax(TypedDict): - enabled: bool - """ - Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - """ - liability: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAutomaticTaxLiability" - ] - """ - The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. - """ - - class ListParamsScheduleDetailsPhaseAutomaticTaxLiability(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class ListParamsScheduleDetailsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - - class ListParamsScheduleDetailsPhaseDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class ListParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): - account_tax_ids: NotRequired["Literal['']|List[str]"] - """ - The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. - """ - days_until_due: NotRequired[int] - """ - Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. - """ - issuer: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseInvoiceSettingsIssuer" - ] - """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. - """ - - class ListParamsScheduleDetailsPhaseInvoiceSettingsIssuer(TypedDict): - account: NotRequired[str] - """ - The connected account being referenced when `type` is `account`. - """ - type: Literal["account", "self"] - """ - Type of the account referenced in the request. - """ - - class ListParamsScheduleDetailsPhaseItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - discounts: NotRequired[ - "Literal['']|List[InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItemDiscount]" - ] - """ - The coupons to redeem into discounts for the subscription item. - """ - metadata: NotRequired[Dict[str, str]] - """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. - """ - plan: NotRequired[str] - """ - The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. - """ - price: NotRequired[str] - """ - The ID of the price object. - """ - price_data: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - """ - quantity: NotRequired[int] - """ - Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class ListParamsScheduleDetailsPhaseItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - - class ListParamsScheduleDetailsPhaseItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class ListParamsScheduleDetailsPhaseItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - recurring: "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItemPriceDataRecurring" - """ - The recurring components of a price such as `interval` and `interval_count`. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class ListParamsScheduleDetailsPhaseItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] - """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. - """ - interval_count: NotRequired[int] - """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - """ - - class ListParamsScheduleDetailsPhaseTransferData(TypedDict): - amount_percent: NotRequired[float] - """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - """ - destination: str - """ - ID of an existing, connected Stripe account. - """ - - class ListParamsSubscriptionDetails(TypedDict): - billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] - """ - For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. - """ - cancel_at: NotRequired["Literal['']|int"] - """ - A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. - """ - cancel_at_period_end: NotRequired[bool] - """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. - """ - cancel_now: NotRequired[bool] - """ - This simulates the subscription being canceled or expired immediately. - """ - default_tax_rates: NotRequired["Literal['']|List[str]"] - """ - If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. - """ - items: NotRequired[ - List[ - "InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItem" - ] - ] - """ - A list of up to 20 subscription items, each with an attached price. - """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] - ] - """ - Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. - """ - proration_date: NotRequired[int] - """ - If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. - """ - resume_at: NotRequired[Literal["now"]] - """ - For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. - """ - start_date: NotRequired[int] - """ - Date a subscription is intended to start (can be future or past). - """ - trial_end: NotRequired["Literal['now']|int"] - """ - If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. - """ - - class ListParamsSubscriptionDetailsItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - clear_usage: NotRequired[bool] - """ - 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. - """ - deleted: NotRequired[bool] - """ - A flag that, if set to `true`, will delete the specified item. - """ - discounts: NotRequired[ - "Literal['']|List[InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemDiscount]" - ] - """ - The coupons to redeem into discounts for the subscription item. - """ - id: NotRequired[str] - """ - Subscription item to update. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - plan: NotRequired[str] - """ - Plan ID for this item, as a string. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - """ - price_data: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Quantity for this item. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class ListParamsSubscriptionDetailsItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - - class ListParamsSubscriptionDetailsItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class ListParamsSubscriptionDetailsItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - recurring: "InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemPriceDataRecurring" - """ - The recurring components of a price such as `interval` and `interval_count`. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class ListParamsSubscriptionDetailsItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] - """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. - """ - interval_count: NotRequired[int] - """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - """ - - class ListParamsSubscriptionItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|InvoiceUpcomingLinesService.ListParamsSubscriptionItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ - clear_usage: NotRequired[bool] - """ - 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. - """ - deleted: NotRequired[bool] - """ - A flag that, if set to `true`, will delete the specified item. - """ - discounts: NotRequired[ - "Literal['']|List[InvoiceUpcomingLinesService.ListParamsSubscriptionItemDiscount]" - ] - """ - The coupons to redeem into discounts for the subscription item. - """ - id: NotRequired[str] - """ - Subscription item to update. - """ - metadata: NotRequired["Literal['']|Dict[str, str]"] - """ - Set of [key-value pairs](https://stripe.com/docs/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`. - """ - plan: NotRequired[str] - """ - Plan ID for this item, as a string. - """ - price: NotRequired[str] - """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - """ - price_data: NotRequired[ - "InvoiceUpcomingLinesService.ListParamsSubscriptionItemPriceData" - ] - """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - """ - quantity: NotRequired[int] - """ - Quantity for this item. - """ - tax_rates: NotRequired["Literal['']|List[str]"] - """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - """ - - class ListParamsSubscriptionItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - - class ListParamsSubscriptionItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] - """ - ID of an existing discount on the object (or one of its ancestors) to reuse. - """ - promotion_code: NotRequired[str] - """ - ID of the promotion code to create a new discount for. - """ - - class ListParamsSubscriptionItemPriceData(TypedDict): - 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). - """ - product: str - """ - The ID of the product that this price will belong to. - """ - recurring: "InvoiceUpcomingLinesService.ListParamsSubscriptionItemPriceDataRecurring" - """ - The recurring components of a price such as `interval` and `interval_count`. - """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] - """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - """ - unit_amount: NotRequired[int] - """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - """ - unit_amount_decimal: NotRequired[str] - """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - """ - - class ListParamsSubscriptionItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] - """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. - """ - interval_count: NotRequired[int] - """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - """ - - def list( - self, - params: "InvoiceUpcomingLinesService.ListParams" = {}, - options: RequestOptions = {}, - ) -> ListObject[InvoiceLineItem]: - """ - When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - """ - return cast( - ListObject[InvoiceLineItem], - self._request( - "get", - "/v1/invoices/upcoming/lines", - base_address="api", - params=params, - options=options, - ), - ) - - async def list_async( - self, - params: "InvoiceUpcomingLinesService.ListParams" = {}, - options: RequestOptions = {}, - ) -> ListObject[InvoiceLineItem]: - """ - When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - """ - return cast( - ListObject[InvoiceLineItem], - await self._request_async( - "get", - "/v1/invoices/upcoming/lines", - base_address="api", - params=params, - options=options, - ), - ) diff --git a/stripe/_mandate.py b/stripe/_mandate.py index a4bebee61..0260a4fd0 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -118,6 +118,12 @@ class KrCard(StripeObject): class Link(StripeObject): pass + class NaverPay(StripeObject): + pass + + class NzBankAccount(StripeObject): + pass + class Paypal(StripeObject): billing_agreement_id: Optional[str] """ @@ -156,6 +162,8 @@ class UsBankAccount(StripeObject): kakao_pay: Optional[KakaoPay] kr_card: Optional[KrCard] link: Optional[Link] + naver_pay: Optional[NaverPay] + nz_bank_account: Optional[NzBankAccount] paypal: Optional[Paypal] revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] @@ -174,6 +182,8 @@ class UsBankAccount(StripeObject): "kakao_pay": KakaoPay, "kr_card": KrCard, "link": Link, + "naver_pay": NaverPay, + "nz_bank_account": NzBankAccount, "paypal": Paypal, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index fe1b3d96f..0fdfe4da1 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -69,6 +69,7 @@ stripe.Invoice.OBJECT_NAME: stripe.Invoice, stripe.InvoiceItem.OBJECT_NAME: stripe.InvoiceItem, stripe.InvoiceLineItem.OBJECT_NAME: stripe.InvoiceLineItem, + stripe.InvoicePayment.OBJECT_NAME: stripe.InvoicePayment, stripe.InvoiceRenderingTemplate.OBJECT_NAME: stripe.InvoiceRenderingTemplate, stripe.issuing.Authorization.OBJECT_NAME: stripe.issuing.Authorization, stripe.issuing.Card.OBJECT_NAME: stripe.issuing.Card, @@ -142,8 +143,6 @@ stripe.treasury.ReceivedDebit.OBJECT_NAME: stripe.treasury.ReceivedDebit, stripe.treasury.Transaction.OBJECT_NAME: stripe.treasury.Transaction, stripe.treasury.TransactionEntry.OBJECT_NAME: stripe.treasury.TransactionEntry, - stripe.UsageRecord.OBJECT_NAME: stripe.UsageRecord, - stripe.UsageRecordSummary.OBJECT_NAME: stripe.UsageRecordSummary, stripe.WebhookEndpoint.OBJECT_NAME: stripe.WebhookEndpoint, # Object classes: The end of the section generated from our OpenAPI spec } diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index bcbc7d011..38cbfee64 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -37,7 +37,6 @@ from stripe._card import Card as CardResource from stripe._charge import Charge from stripe._customer import Customer - from stripe._invoice import Invoice from stripe._payment_method import PaymentMethod from stripe._review import Review from stripe._setup_intent import SetupIntent @@ -150,6 +149,7 @@ class LastPaymentError(StripeObject): "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", + "forwarding_api_retryable_upstream_error", "forwarding_api_upstream_connection_error", "forwarding_api_upstream_connection_timeout", "idempotency_key_in_use", @@ -246,6 +246,7 @@ class LastPaymentError(StripeObject): "setup_intent_authentication_failure", "setup_intent_invalid_parameter", "setup_intent_mandate_invalid", + "setup_intent_mobile_wallet_unsupported", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", "shipping_address_invalid", @@ -2019,6 +2020,34 @@ class NaverPay(StripeObject): """ Controls when the funds will be captured from the customer's account. """ + setup_future_usage: Optional[Literal["none", "off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + + class NzBankAccount(StripeObject): + 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://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://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://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://stripe.com/strong-customer-authentication). + """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class Oxxo(StripeObject): expires_after_days: int @@ -2357,6 +2386,7 @@ class Zip(StripeObject): mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] naver_pay: Optional[NaverPay] + nz_bank_account: Optional[NzBankAccount] oxxo: Optional[Oxxo] p24: Optional[P24] pay_by_bank: Optional[PayByBank] @@ -2404,6 +2434,7 @@ class Zip(StripeObject): "mobilepay": Mobilepay, "multibanco": Multibanco, "naver_pay": NaverPay, + "nz_bank_account": NzBankAccount, "oxxo": Oxxo, "p24": P24, "pay_by_bank": PayByBank, @@ -2423,6 +2454,16 @@ class Zip(StripeObject): "zip": Zip, } + class PresentmentDetails(StripeObject): + presentment_amount: int + """ + Amount intended to be collected by this payment, denominated in presentment_currency. + """ + presentment_currency: str + """ + Currency presented to the customer during payment. + """ + class Processing(StripeObject): class Card(StripeObject): class CustomerNotification(StripeObject): @@ -2540,11 +2581,11 @@ class CancelParams(RequestOptions): class CaptureParams(RequestOptions): amount_to_capture: NotRequired[int] """ - The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount is automatically refunded. Defaults to the full `amount_capturable` if it's not provided. + The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Defaults to the full `amount_capturable` if it's not provided. """ 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + 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://stripe.com/docs/payments/connected-accounts). """ expand: NotRequired[List[str]] """ @@ -2775,6 +2816,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataBillingDetails" ] @@ -2883,6 +2930,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -2941,6 +2994,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataSepaDebit" ] @@ -2971,6 +3030,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -2988,6 +3048,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -2998,6 +3059,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -3078,6 +3140,9 @@ class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): class ConfirmParamsPaymentMethodDataBancontact(TypedDict): pass + class ConfirmParamsPaymentMethodDataBillie(TypedDict): + pass + class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodDataBillingDetailsAddress" @@ -3289,6 +3354,29 @@ class ConfirmParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class ConfirmParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -3357,6 +3445,9 @@ class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): class ConfirmParamsPaymentMethodDataSamsungPay(TypedDict): pass + class ConfirmParamsPaymentMethodDataSatispay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -3578,6 +3669,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. """ + nz_bank_account: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsNzBankAccount" + ] + """ + If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsOxxo" ] @@ -4620,6 +4717,38 @@ class ConfirmParamsPaymentMethodOptionsNaverPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + + class ConfirmParamsPaymentMethodOptionsNzBankAccount(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|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://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://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://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://stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] @@ -5003,7 +5132,7 @@ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ - client: Literal["android", "ios", "web"] + client: NotRequired[Literal["android", "ios", "web"]] """ The client type that the end customer will pay from """ @@ -5095,7 +5224,7 @@ class CreateParams(RequestOptions): """ 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + 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://stripe.com/docs/payments/connected-accounts). """ automatic_payment_methods: NotRequired[ "PaymentIntent.CreateParamsAutomaticPaymentMethods" @@ -5361,6 +5490,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataBillingDetails" ] @@ -5469,6 +5604,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -5527,6 +5668,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataSepaDebit" ] @@ -5557,6 +5704,7 @@ class CreateParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -5574,6 +5722,7 @@ class CreateParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -5584,6 +5733,7 @@ class CreateParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -5664,6 +5814,9 @@ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): class CreateParamsPaymentMethodDataBancontact(TypedDict): pass + class CreateParamsPaymentMethodDataBillie(TypedDict): + pass + class CreateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodDataBillingDetailsAddress" @@ -5875,6 +6028,29 @@ class CreateParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class CreateParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -5943,6 +6119,9 @@ class CreateParamsPaymentMethodDataRevolutPay(TypedDict): class CreateParamsPaymentMethodDataSamsungPay(TypedDict): pass + class CreateParamsPaymentMethodDataSatispay(TypedDict): + pass + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -6164,6 +6343,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. """ + nz_bank_account: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsNzBankAccount" + ] + """ + If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsOxxo" ] @@ -7206,6 +7391,38 @@ class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + + class CreateParamsPaymentMethodOptionsNzBankAccount(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|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://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://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://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://stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] @@ -7589,7 +7806,7 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ - client: Literal["android", "ios", "web"] + client: NotRequired[Literal["android", "ios", "web"]] """ The client type that the end customer will pay from """ @@ -7700,7 +7917,7 @@ class IncrementAuthorizationParams(RequestOptions): """ 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + 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://stripe.com/docs/payments/connected-accounts). """ description: NotRequired[str] """ @@ -7783,7 +8000,7 @@ class ModifyParams(RequestOptions): """ application_fee_amount: NotRequired["Literal['']|int"] """ - The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + 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://stripe.com/docs/payments/connected-accounts). """ capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] @@ -7941,6 +8158,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataBillingDetails" ] @@ -8049,6 +8272,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -8107,6 +8336,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataSepaDebit" ] @@ -8137,6 +8372,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -8154,6 +8390,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -8164,6 +8401,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -8244,6 +8482,9 @@ class ModifyParamsPaymentMethodDataBacsDebit(TypedDict): class ModifyParamsPaymentMethodDataBancontact(TypedDict): pass + class ModifyParamsPaymentMethodDataBillie(TypedDict): + pass + class ModifyParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodDataBillingDetailsAddress" @@ -8455,6 +8696,29 @@ class ModifyParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class ModifyParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class ModifyParamsPaymentMethodDataOxxo(TypedDict): pass @@ -8523,6 +8787,9 @@ class ModifyParamsPaymentMethodDataRevolutPay(TypedDict): class ModifyParamsPaymentMethodDataSamsungPay(TypedDict): pass + class ModifyParamsPaymentMethodDataSatispay(TypedDict): + pass + class ModifyParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -8744,6 +9011,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. """ + nz_bank_account: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsNzBankAccount" + ] + """ + If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsOxxo" ] @@ -9786,6 +10059,38 @@ class ModifyParamsPaymentMethodOptionsNaverPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + + class ModifyParamsPaymentMethodOptionsNzBankAccount(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|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://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://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://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://stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class ModifyParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] @@ -10169,7 +10474,7 @@ class ModifyParamsPaymentMethodOptionsWechatPay(TypedDict): """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ - client: Literal["android", "ios", "web"] + client: NotRequired[Literal["android", "ios", "web"]] """ The client type that the end customer will pay from """ @@ -10315,7 +10620,7 @@ class VerifyMicrodepositsParams(RequestOptions): """ application_fee_amount: Optional[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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + 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://stripe.com/docs/payments/connected-accounts). """ automatic_payment_methods: Optional[AutomaticPaymentMethods] """ @@ -10330,6 +10635,7 @@ class VerifyMicrodepositsParams(RequestOptions): "abandoned", "automatic", "duplicate", + "expired", "failed_invoice", "fraudulent", "requested_by_customer", @@ -10337,7 +10643,7 @@ class VerifyMicrodepositsParams(RequestOptions): ] ] """ - Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). + Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, `automatic`, or `expired`). """ capture_method: Literal["automatic", "automatic_async", "manual"] """ @@ -10379,10 +10685,6 @@ class VerifyMicrodepositsParams(RequestOptions): """ Unique identifier for the object. """ - invoice: Optional[ExpandableField["Invoice"]] - """ - ID of the invoice that created this PaymentIntent, if it exists. - """ last_payment_error: Optional[LastPaymentError] """ The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. @@ -10427,8 +10729,9 @@ class VerifyMicrodepositsParams(RequestOptions): """ payment_method_types: List[str] """ - The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. A comprehensive list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ + presentment_details: Optional[PresentmentDetails] processing: Optional[Processing] """ If present, this property tells you about the processing state of the payment. @@ -11825,6 +12128,7 @@ async def search_auto_paging_iter_async( "next_action": NextAction, "payment_method_configuration_details": PaymentMethodConfigurationDetails, "payment_method_options": PaymentMethodOptions, + "presentment_details": PresentmentDetails, "processing": Processing, "shipping": Shipping, "transfer_data": TransferData, diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 397312be5..8704d8c80 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -46,11 +46,11 @@ class CancelParams(TypedDict): class CaptureParams(TypedDict): amount_to_capture: NotRequired[int] """ - The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount is automatically refunded. Defaults to the full `amount_capturable` if it's not provided. + The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Defaults to the full `amount_capturable` if it's not provided. """ 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + 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://stripe.com/docs/payments/connected-accounts). """ expand: NotRequired[List[str]] """ @@ -287,6 +287,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataBillingDetails" ] @@ -405,6 +411,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataOxxo" ] @@ -471,6 +483,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataSepaDebit" ] @@ -505,6 +523,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -522,6 +541,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -532,6 +552,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -614,6 +635,9 @@ class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): class ConfirmParamsPaymentMethodDataBancontact(TypedDict): pass + class ConfirmParamsPaymentMethodDataBillie(TypedDict): + pass + class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodDataBillingDetailsAddress" @@ -825,6 +849,29 @@ class ConfirmParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class ConfirmParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -893,6 +940,9 @@ class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): class ConfirmParamsPaymentMethodDataSamsungPay(TypedDict): pass + class ConfirmParamsPaymentMethodDataSatispay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -1114,6 +1164,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. """ + nz_bank_account: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsNzBankAccount" + ] + """ + If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsOxxo" ] @@ -2156,6 +2212,38 @@ class ConfirmParamsPaymentMethodOptionsNaverPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + + class ConfirmParamsPaymentMethodOptionsNzBankAccount(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|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://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://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://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://stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] @@ -2539,7 +2627,7 @@ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ - client: Literal["android", "ios", "web"] + client: NotRequired[Literal["android", "ios", "web"]] """ The client type that the end customer will pay from """ @@ -2631,7 +2719,7 @@ class CreateParams(TypedDict): """ 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + 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://stripe.com/docs/payments/connected-accounts). """ automatic_payment_methods: NotRequired[ "PaymentIntentService.CreateParamsAutomaticPaymentMethods" @@ -2903,6 +2991,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataBillingDetails" ] @@ -3021,6 +3115,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataOxxo" ] @@ -3087,6 +3187,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataSepaDebit" ] @@ -3121,6 +3227,7 @@ class CreateParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -3138,6 +3245,7 @@ class CreateParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -3148,6 +3256,7 @@ class CreateParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -3230,6 +3339,9 @@ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): class CreateParamsPaymentMethodDataBancontact(TypedDict): pass + class CreateParamsPaymentMethodDataBillie(TypedDict): + pass + class CreateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodDataBillingDetailsAddress" @@ -3441,6 +3553,29 @@ class CreateParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class CreateParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -3509,6 +3644,9 @@ class CreateParamsPaymentMethodDataRevolutPay(TypedDict): class CreateParamsPaymentMethodDataSamsungPay(TypedDict): pass + class CreateParamsPaymentMethodDataSatispay(TypedDict): + pass + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -3730,6 +3868,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. """ + nz_bank_account: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsNzBankAccount" + ] + """ + If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsOxxo" ] @@ -4772,6 +4916,38 @@ class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + + class CreateParamsPaymentMethodOptionsNzBankAccount(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|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://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://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://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://stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] @@ -5155,7 +5331,7 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ - client: Literal["android", "ios", "web"] + client: NotRequired[Literal["android", "ios", "web"]] """ The client type that the end customer will pay from """ @@ -5266,7 +5442,7 @@ class IncrementAuthorizationParams(TypedDict): """ 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + 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://stripe.com/docs/payments/connected-accounts). """ description: NotRequired[str] """ @@ -5377,7 +5553,7 @@ class UpdateParams(TypedDict): """ application_fee_amount: NotRequired["Literal['']|int"] """ - The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + 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://stripe.com/docs/payments/connected-accounts). """ capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] @@ -5541,6 +5717,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataBillingDetails" ] @@ -5659,6 +5841,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataOxxo" ] @@ -5725,6 +5913,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataSepaDebit" ] @@ -5759,6 +5953,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -5776,6 +5971,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -5786,6 +5982,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -5868,6 +6065,9 @@ class UpdateParamsPaymentMethodDataBacsDebit(TypedDict): class UpdateParamsPaymentMethodDataBancontact(TypedDict): pass + class UpdateParamsPaymentMethodDataBillie(TypedDict): + pass + class UpdateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodDataBillingDetailsAddress" @@ -6079,6 +6279,29 @@ class UpdateParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class UpdateParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class UpdateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -6147,6 +6370,9 @@ class UpdateParamsPaymentMethodDataRevolutPay(TypedDict): class UpdateParamsPaymentMethodDataSamsungPay(TypedDict): pass + class UpdateParamsPaymentMethodDataSatispay(TypedDict): + pass + class UpdateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -6368,6 +6594,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. """ + nz_bank_account: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsNzBankAccount" + ] + """ + If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. + """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsOxxo" ] @@ -7410,6 +7642,38 @@ class UpdateParamsPaymentMethodOptionsNaverPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_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://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://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://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://stripe.com/strong-customer-authentication). + """ + + class UpdateParamsPaymentMethodOptionsNzBankAccount(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|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://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://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://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://stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ class UpdateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] @@ -7793,7 +8057,7 @@ class UpdateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ - client: Literal["android", "ios", "web"] + client: NotRequired[Literal["android", "ios", "web"]] """ The client type that the end customer will pay from """ diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 354b4c7ba..53c60c42a 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -122,6 +122,10 @@ class Option(StripeObject): The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. """ + default_value: Optional[str] + """ + The value that will pre-fill on the payment page. + """ options: List[Option] """ The options available for the customer to select. Up to 200 options allowed. @@ -139,6 +143,10 @@ class Label(StripeObject): """ class Numeric(StripeObject): + default_value: Optional[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: Optional[int] """ The maximum character length constraint for the customer's input. @@ -149,6 +157,10 @@ class Numeric(StripeObject): """ class Text(StripeObject): + default_value: Optional[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: Optional[int] """ The maximum character length constraint for the customer's input. @@ -301,6 +313,26 @@ class RenderingOptions(StripeObject): """ _inner_class_types = {"invoice_data": InvoiceData} + class OptionalItem(StripeObject): + class AdjustableQuantity(StripeObject): + enabled: bool + """ + Set to true if the quantity can be adjusted to any non-negative integer. + """ + maximum: Optional[int] + """ + The maximum quantity of this item the customer can purchase. By default this value is 99. + """ + minimum: Optional[int] + """ + The minimum quantity of this item the customer must purchase, if they choose to purchase it. Because this item is optional, the customer will always be able to remove it from their order, even if the `minimum` configured here is greater than 0. By default this value is 0. + """ + + adjustable_quantity: Optional[AdjustableQuantity] + price: str + quantity: int + _inner_class_types = {"adjustable_quantity": AdjustableQuantity} + class PaymentIntentData(StripeObject): capture_method: Optional[ Literal["automatic", "automatic_async", "manual"] @@ -754,6 +786,14 @@ class CreateParams(RequestOptions): """ The account on behalf of which to charge. """ + optional_items: NotRequired[ + List["PaymentLink.CreateParamsOptionalItem"] + ] + """ + A list of optional items the customer can add to their order at checkout. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). + There is a maximum of 10 optional items allowed on a payment link, and the existing limits on the number of line items allowed on a payment link apply to the combined number of line items and optional items. + There is a maximum of 20 combined line items and optional items. + """ payment_intent_data: NotRequired[ "PaymentLink.CreateParamsPaymentIntentData" ] @@ -780,6 +820,7 @@ class CreateParams(RequestOptions): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -801,6 +842,7 @@ class CreateParams(RequestOptions): "paypal", "pix", "promptpay", + "satispay", "sepa_debit", "sofort", "swish", @@ -970,6 +1012,10 @@ class CreateParamsCustomField(TypedDict): """ class CreateParamsCustomFieldDropdown(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page.Must match a `value` in the `options` array. + """ options: List["PaymentLink.CreateParamsCustomFieldDropdownOption"] """ The options available for the customer to select. Up to 200 options allowed. @@ -996,6 +1042,10 @@ class CreateParamsCustomFieldLabel(TypedDict): """ class CreateParamsCustomFieldNumeric(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. @@ -1006,6 +1056,10 @@ class CreateParamsCustomFieldNumeric(TypedDict): """ class CreateParamsCustomFieldText(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. @@ -1171,6 +1225,36 @@ class CreateParamsLineItemAdjustableQuantity(TypedDict): The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. """ + class CreateParamsOptionalItem(TypedDict): + adjustable_quantity: NotRequired[ + "PaymentLink.CreateParamsOptionalItemAdjustableQuantity" + ] + """ + When set, provides configuration for the customer to adjust the quantity of the line item created when a customer chooses to add this optional item to their order. + """ + price: str + """ + The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. + """ + quantity: int + """ + The initial quantity of the line item created when a customer chooses to add this optional item to their order. + """ + + class CreateParamsOptionalItemAdjustableQuantity(TypedDict): + enabled: bool + """ + Set to true if the quantity can be adjusted to any non-negative integer. + """ + maximum: NotRequired[int] + """ + The maximum quantity of this item the customer can purchase. By default this value is 99. + """ + minimum: NotRequired[int] + """ + The minimum quantity of this item the customer must purchase, if they choose to purchase it. Because this item is optional, the customer will always be able to remove it from their order, even if the `minimum` configured here is greater than 0. By default this value is 0. + """ + class CreateParamsPaymentIntentData(TypedDict): capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] @@ -1686,7 +1770,7 @@ class ModifyParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', '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', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'pix', 'promptpay', 'satispay', 'sepa_debit', 'sofort', 'swish', 'twint', '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). @@ -1813,6 +1897,10 @@ class ModifyParamsCustomField(TypedDict): """ class ModifyParamsCustomFieldDropdown(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page.Must match a `value` in the `options` array. + """ options: List["PaymentLink.ModifyParamsCustomFieldDropdownOption"] """ The options available for the customer to select. Up to 200 options allowed. @@ -1839,6 +1927,10 @@ class ModifyParamsCustomFieldLabel(TypedDict): """ class ModifyParamsCustomFieldNumeric(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. @@ -1849,6 +1941,10 @@ class ModifyParamsCustomFieldNumeric(TypedDict): """ class ModifyParamsCustomFieldText(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. @@ -2451,6 +2547,10 @@ class RetrieveParams(RequestOptions): """ The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. """ + optional_items: Optional[List[OptionalItem]] + """ + The optional items presented to the customer at checkout. + """ payment_intent_data: Optional[PaymentIntentData] """ Indicates the parameters to be passed to PaymentIntent creation during checkout. @@ -2469,6 +2569,7 @@ class RetrieveParams(RequestOptions): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -2490,6 +2591,7 @@ class RetrieveParams(RequestOptions): "paypal", "pix", "promptpay", + "satispay", "sepa_debit", "sofort", "swish", @@ -2783,6 +2885,7 @@ async def retrieve_async( "custom_fields": CustomField, "custom_text": CustomText, "invoice_creation": InvoiceCreation, + "optional_items": OptionalItem, "payment_intent_data": PaymentIntentData, "phone_number_collection": PhoneNumberCollection, "restrictions": Restrictions, diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 7c4f2d139..628f4d055 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -94,6 +94,14 @@ class CreateParams(TypedDict): """ The account on behalf of which to charge. """ + optional_items: NotRequired[ + List["PaymentLinkService.CreateParamsOptionalItem"] + ] + """ + A list of optional items the customer can add to their order at checkout. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). + There is a maximum of 10 optional items allowed on a payment link, and the existing limits on the number of line items allowed on a payment link apply to the combined number of line items and optional items. + There is a maximum of 20 combined line items and optional items. + """ payment_intent_data: NotRequired[ "PaymentLinkService.CreateParamsPaymentIntentData" ] @@ -120,6 +128,7 @@ class CreateParams(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -141,6 +150,7 @@ class CreateParams(TypedDict): "paypal", "pix", "promptpay", + "satispay", "sepa_debit", "sofort", "swish", @@ -320,6 +330,10 @@ class CreateParamsCustomField(TypedDict): """ class CreateParamsCustomFieldDropdown(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page.Must match a `value` in the `options` array. + """ options: List[ "PaymentLinkService.CreateParamsCustomFieldDropdownOption" ] @@ -348,6 +362,10 @@ class CreateParamsCustomFieldLabel(TypedDict): """ class CreateParamsCustomFieldNumeric(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. @@ -358,6 +376,10 @@ class CreateParamsCustomFieldNumeric(TypedDict): """ class CreateParamsCustomFieldText(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. @@ -523,6 +545,36 @@ class CreateParamsLineItemAdjustableQuantity(TypedDict): The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. """ + class CreateParamsOptionalItem(TypedDict): + adjustable_quantity: NotRequired[ + "PaymentLinkService.CreateParamsOptionalItemAdjustableQuantity" + ] + """ + When set, provides configuration for the customer to adjust the quantity of the line item created when a customer chooses to add this optional item to their order. + """ + price: str + """ + The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. + """ + quantity: int + """ + The initial quantity of the line item created when a customer chooses to add this optional item to their order. + """ + + class CreateParamsOptionalItemAdjustableQuantity(TypedDict): + enabled: bool + """ + Set to true if the quantity can be adjusted to any non-negative integer. + """ + maximum: NotRequired[int] + """ + The maximum quantity of this item the customer can purchase. By default this value is 99. + """ + minimum: NotRequired[int] + """ + The minimum quantity of this item the customer must purchase, if they choose to purchase it. Because this item is optional, the customer will always be able to remove it from their order, even if the `minimum` configured here is greater than 0. By default this value is 0. + """ + class CreateParamsPaymentIntentData(TypedDict): capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] @@ -1028,7 +1080,7 @@ class UpdateParams(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://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', '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', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'pix', 'promptpay', 'satispay', 'sepa_debit', 'sofort', 'swish', 'twint', '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). @@ -1161,6 +1213,10 @@ class UpdateParamsCustomField(TypedDict): """ class UpdateParamsCustomFieldDropdown(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page.Must match a `value` in the `options` array. + """ options: List[ "PaymentLinkService.UpdateParamsCustomFieldDropdownOption" ] @@ -1189,6 +1245,10 @@ class UpdateParamsCustomFieldLabel(TypedDict): """ class UpdateParamsCustomFieldNumeric(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. @@ -1199,6 +1259,10 @@ class UpdateParamsCustomFieldNumeric(TypedDict): """ class UpdateParamsCustomFieldText(TypedDict): + default_value: NotRequired[str] + """ + The value that will pre-fill the field on the payment page. + """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 532c30ac0..406933cb7 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -106,6 +106,9 @@ class BacsDebit(StripeObject): class Bancontact(StripeObject): pass + class Billie(StripeObject): + pass + class BillingDetails(StripeObject): class Address(StripeObject): city: Optional[str] @@ -1067,11 +1070,41 @@ class Multibanco(StripeObject): pass class NaverPay(StripeObject): + buyer_id: Optional[str] + """ + Uniquely identifies this particular Naver Pay account. You can use this attribute to check whether two Naver Pay accounts are the same. + """ funding: Literal["card", "points"] """ Whether to fund this transaction with Naver Pay points or a card. """ + class NzBankAccount(StripeObject): + account_holder_name: Optional[str] + """ + The name on the bank account. Only present if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + bank_name: str + """ + The name of the bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + last4: str + """ + Last four digits of the bank account number. + """ + suffix: Optional[str] + """ + The suffix of the bank account number. + """ + class Oxxo(StripeObject): pass @@ -1152,6 +1185,9 @@ class RevolutPay(StripeObject): class SamsungPay(StripeObject): pass + class Satispay(StripeObject): + pass + class SepaDebit(StripeObject): class GeneratedFrom(StripeObject): charge: Optional[ExpandableField["Charge"]] @@ -1352,6 +1388,10 @@ class CreateParams(RequestOptions): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired["PaymentMethod.CreateParamsBillie"] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "PaymentMethod.CreateParamsBillingDetails" ] @@ -1450,6 +1490,10 @@ class CreateParams(RequestOptions): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired["PaymentMethod.CreateParamsNzBankAccount"] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired["PaymentMethod.CreateParamsOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -1498,6 +1542,10 @@ class CreateParams(RequestOptions): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired["PaymentMethod.CreateParamsSatispay"] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired["PaymentMethod.CreateParamsSepaDebit"] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. @@ -1525,6 +1573,7 @@ class CreateParams(RequestOptions): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -1543,6 +1592,7 @@ class CreateParams(RequestOptions): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -1553,6 +1603,7 @@ class CreateParams(RequestOptions): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -1630,6 +1681,9 @@ class CreateParamsBacsDebit(TypedDict): class CreateParamsBancontact(TypedDict): pass + class CreateParamsBillie(TypedDict): + pass + class CreateParamsBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentMethod.CreateParamsBillingDetailsAddress" @@ -1873,6 +1927,29 @@ class CreateParamsNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class CreateParamsNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class CreateParamsOxxo(TypedDict): pass @@ -1941,6 +2018,9 @@ class CreateParamsRevolutPay(TypedDict): class CreateParamsSamsungPay(TypedDict): pass + class CreateParamsSatispay(TypedDict): + pass + class CreateParamsSepaDebit(TypedDict): iban: str """ @@ -2025,6 +2105,7 @@ class ListParams(RequestOptions): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -2043,6 +2124,7 @@ class ListParams(RequestOptions): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -2053,6 +2135,7 @@ class ListParams(RequestOptions): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -2095,10 +2178,6 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - naver_pay: NotRequired["PaymentMethod.ModifyParamsNaverPay"] - """ - If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. - """ pay_by_bank: NotRequired["PaymentMethod.ModifyParamsPayByBank"] """ If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. @@ -2179,12 +2258,6 @@ class ModifyParamsCardNetworks(TypedDict): class ModifyParamsLink(TypedDict): pass - class ModifyParamsNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] - """ - Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. - """ - class ModifyParamsPayByBank(TypedDict): pass @@ -2217,6 +2290,7 @@ class RetrieveParams(RequestOptions): au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] + billie: Optional[Billie] billing_details: BillingDetails blik: Optional[Blik] boleto: Optional[Boleto] @@ -2258,6 +2332,7 @@ class RetrieveParams(RequestOptions): mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] naver_pay: Optional[NaverPay] + nz_bank_account: Optional[NzBankAccount] object: Literal["payment_method"] """ String representing the object's type. Objects of the same type share the same value. @@ -2276,6 +2351,7 @@ class RetrieveParams(RequestOptions): """ revolut_pay: Optional[RevolutPay] samsung_pay: Optional[SamsungPay] + satispay: Optional[Satispay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] @@ -2290,6 +2366,7 @@ class RetrieveParams(RequestOptions): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -2310,6 +2387,7 @@ class RetrieveParams(RequestOptions): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -2320,6 +2398,7 @@ class RetrieveParams(RequestOptions): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -2801,6 +2880,7 @@ async def retrieve_async( "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, + "billie": Billie, "billing_details": BillingDetails, "blik": Blik, "boleto": Boleto, @@ -2822,6 +2902,7 @@ async def retrieve_async( "mobilepay": Mobilepay, "multibanco": Multibanco, "naver_pay": NaverPay, + "nz_bank_account": NzBankAccount, "oxxo": Oxxo, "p24": P24, "pay_by_bank": PayByBank, @@ -2833,6 +2914,7 @@ async def retrieve_async( "radar_options": RadarOptions, "revolut_pay": RevolutPay, "samsung_pay": SamsungPay, + "satispay": Satispay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index d17f00313..15414148e 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -257,6 +257,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Billie(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 Blik(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -653,6 +675,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class NzBankAccount(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 Oxxo(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -807,6 +851,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Satispay(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 SepaDebit(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -1022,6 +1088,10 @@ class CreateParams(RequestOptions): """ Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. Check this [page](https://stripe.com/docs/payments/bancontact) for more details. """ + billie: NotRequired["PaymentMethodConfiguration.CreateParamsBillie"] + """ + Billie is a [single-use](https://docs.stripe.com/payments/payment-methods#usage) payment method that offers businesses Pay by Invoice where they offer payment terms ranging from 7-120 days. Customers are redirected from your website or app, authorize the payment with Billie, then return to your website or app. You get [immediate notification](https://stripe.com/payments/payment-methods#payment-notification) of whether the payment succeeded or failed. + """ blik: NotRequired["PaymentMethodConfiguration.CreateParamsBlik"] """ BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. Check this [page](https://stripe.com/docs/payments/blik) for more details. @@ -1112,6 +1182,12 @@ class CreateParams(RequestOptions): """ Configuration name. """ + nz_bank_account: NotRequired[ + "PaymentMethodConfiguration.CreateParamsNzBankAccount" + ] + """ + Stripe users in New Zealand can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with a New Zeland bank account. Check this [page](https://stripe.com/docs/payments/nz-bank-account) for more details. + """ oxxo: NotRequired["PaymentMethodConfiguration.CreateParamsOxxo"] """ OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. OXXO allows customers to pay bills and online purchases in-store with cash. Check this [page](https://stripe.com/docs/payments/oxxo) for more details. @@ -1150,6 +1226,12 @@ class CreateParams(RequestOptions): """ Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. Revolut Pay uses the customer's stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. """ + satispay: NotRequired[ + "PaymentMethodConfiguration.CreateParamsSatispay" + ] + """ + Satispay is a [single-use](https://docs.stripe.com/payments/payment-methods#usage) payment method where customers are required to [authenticate](https://stripe.com/payments/payment-methods#customer-actions) their payment. Customers pay by being redirected from your website or app, authorizing the payment with Satispay, then returning to your website or app. You get [immediate notification](https://stripe.com/payments/payment-methods#payment-notification) of whether the payment succeeded or failed. + """ sepa_debit: NotRequired[ "PaymentMethodConfiguration.CreateParamsSepaDebit" ] @@ -1339,6 +1421,20 @@ class CreateParamsBancontactDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsBillie(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsBillieDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsBillieDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsBlik(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsBlikDisplayPreference" @@ -1591,6 +1687,20 @@ class CreateParamsMultibancoDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsNzBankAccount(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsNzBankAccountDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsNzBankAccountDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsOxxoDisplayPreference" @@ -1689,6 +1799,20 @@ class CreateParamsRevolutPayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsSatispay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsSatispayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsSatispayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsSepaDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsSepaDebitDisplayPreference" @@ -1874,6 +1998,10 @@ class ModifyParams(RequestOptions): """ Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. Check this [page](https://stripe.com/docs/payments/bancontact) for more details. """ + billie: NotRequired["PaymentMethodConfiguration.ModifyParamsBillie"] + """ + Billie is a [single-use](https://docs.stripe.com/payments/payment-methods#usage) payment method that offers businesses Pay by Invoice where they offer payment terms ranging from 7-120 days. Customers are redirected from your website or app, authorize the payment with Billie, then return to your website or app. You get [immediate notification](https://stripe.com/payments/payment-methods#payment-notification) of whether the payment succeeded or failed. + """ blik: NotRequired["PaymentMethodConfiguration.ModifyParamsBlik"] """ BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. Check this [page](https://stripe.com/docs/payments/blik) for more details. @@ -1964,6 +2092,12 @@ class ModifyParams(RequestOptions): """ Configuration name. """ + nz_bank_account: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsNzBankAccount" + ] + """ + Stripe users in New Zealand can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with a New Zeland bank account. Check this [page](https://stripe.com/docs/payments/nz-bank-account) for more details. + """ oxxo: NotRequired["PaymentMethodConfiguration.ModifyParamsOxxo"] """ OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. OXXO allows customers to pay bills and online purchases in-store with cash. Check this [page](https://stripe.com/docs/payments/oxxo) for more details. @@ -1998,6 +2132,12 @@ class ModifyParams(RequestOptions): """ Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. Revolut Pay uses the customer's stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. """ + satispay: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsSatispay" + ] + """ + Satispay is a [single-use](https://docs.stripe.com/payments/payment-methods#usage) payment method where customers are required to [authenticate](https://stripe.com/payments/payment-methods#customer-actions) their payment. Customers pay by being redirected from your website or app, authorizing the payment with Satispay, then returning to your website or app. You get [immediate notification](https://stripe.com/payments/payment-methods#payment-notification) of whether the payment succeeded or failed. + """ sepa_debit: NotRequired[ "PaymentMethodConfiguration.ModifyParamsSepaDebit" ] @@ -2187,6 +2327,20 @@ class ModifyParamsBancontactDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsBillie(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsBillieDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsBillieDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsBlik(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsBlikDisplayPreference" @@ -2439,6 +2593,20 @@ class ModifyParamsMultibancoDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsNzBankAccount(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsNzBankAccountDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsNzBankAccountDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsOxxoDisplayPreference" @@ -2537,6 +2705,20 @@ class ModifyParamsRevolutPayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsSatispay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsSatispayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsSatispayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsSepaDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsSepaDebitDisplayPreference" @@ -2659,6 +2841,7 @@ class RetrieveParams(RequestOptions): au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] + billie: Optional[Billie] blik: Optional[Blik] boleto: Optional[Boleto] card: Optional[Card] @@ -2693,6 +2876,7 @@ class RetrieveParams(RequestOptions): """ The configuration's name. """ + nz_bank_account: Optional[NzBankAccount] object: Literal["payment_method_configuration"] """ String representing the object's type. Objects of the same type share the same value. @@ -2708,6 +2892,7 @@ class RetrieveParams(RequestOptions): paypal: Optional[Paypal] promptpay: Optional[Promptpay] revolut_pay: Optional[RevolutPay] + satispay: Optional[Satispay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] @@ -2863,6 +3048,7 @@ async def retrieve_async( "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, + "billie": Billie, "blik": Blik, "boleto": Boleto, "card": Card, @@ -2881,6 +3067,7 @@ async def retrieve_async( "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, + "nz_bank_account": NzBankAccount, "oxxo": Oxxo, "p24": P24, "pay_by_bank": PayByBank, @@ -2888,6 +3075,7 @@ async def retrieve_async( "paypal": Paypal, "promptpay": Promptpay, "revolut_pay": RevolutPay, + "satispay": Satispay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index 2b5d9c2c9..7b85669c1 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -75,6 +75,12 @@ class CreateParams(TypedDict): """ Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. Check this [page](https://stripe.com/docs/payments/bancontact) for more details. """ + billie: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsBillie" + ] + """ + Billie is a [single-use](https://docs.stripe.com/payments/payment-methods#usage) payment method that offers businesses Pay by Invoice where they offer payment terms ranging from 7-120 days. Customers are redirected from your website or app, authorize the payment with Billie, then return to your website or app. You get [immediate notification](https://stripe.com/payments/payment-methods#payment-notification) of whether the payment succeeded or failed. + """ blik: NotRequired["PaymentMethodConfigurationService.CreateParamsBlik"] """ BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. Check this [page](https://stripe.com/docs/payments/blik) for more details. @@ -179,6 +185,12 @@ class CreateParams(TypedDict): """ Configuration name. """ + nz_bank_account: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsNzBankAccount" + ] + """ + Stripe users in New Zealand can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with a New Zeland bank account. Check this [page](https://stripe.com/docs/payments/nz-bank-account) for more details. + """ oxxo: NotRequired["PaymentMethodConfigurationService.CreateParamsOxxo"] """ OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. OXXO allows customers to pay bills and online purchases in-store with cash. Check this [page](https://stripe.com/docs/payments/oxxo) for more details. @@ -221,6 +233,12 @@ class CreateParams(TypedDict): """ Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. Revolut Pay uses the customer's stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. """ + satispay: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsSatispay" + ] + """ + Satispay is a [single-use](https://docs.stripe.com/payments/payment-methods#usage) payment method where customers are required to [authenticate](https://stripe.com/payments/payment-methods#customer-actions) their payment. Customers pay by being redirected from your website or app, authorizing the payment with Satispay, then returning to your website or app. You get [immediate notification](https://stripe.com/payments/payment-methods#payment-notification) of whether the payment succeeded or failed. + """ sepa_debit: NotRequired[ "PaymentMethodConfigurationService.CreateParamsSepaDebit" ] @@ -416,6 +434,20 @@ class CreateParamsBancontactDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsBillie(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsBillieDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsBillieDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsBlik(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsBlikDisplayPreference" @@ -668,6 +700,20 @@ class CreateParamsMultibancoDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsNzBankAccount(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsNzBankAccountDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsNzBankAccountDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsOxxoDisplayPreference" @@ -766,6 +812,20 @@ class CreateParamsRevolutPayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsSatispay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsSatispayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsSatispayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsSepaDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsSepaDebitDisplayPreference" @@ -961,6 +1021,12 @@ class UpdateParams(TypedDict): """ Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. Check this [page](https://stripe.com/docs/payments/bancontact) for more details. """ + billie: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsBillie" + ] + """ + Billie is a [single-use](https://docs.stripe.com/payments/payment-methods#usage) payment method that offers businesses Pay by Invoice where they offer payment terms ranging from 7-120 days. Customers are redirected from your website or app, authorize the payment with Billie, then return to your website or app. You get [immediate notification](https://stripe.com/payments/payment-methods#payment-notification) of whether the payment succeeded or failed. + """ blik: NotRequired["PaymentMethodConfigurationService.UpdateParamsBlik"] """ BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. Check this [page](https://stripe.com/docs/payments/blik) for more details. @@ -1065,6 +1131,12 @@ class UpdateParams(TypedDict): """ Configuration name. """ + nz_bank_account: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsNzBankAccount" + ] + """ + Stripe users in New Zealand can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with a New Zeland bank account. Check this [page](https://stripe.com/docs/payments/nz-bank-account) for more details. + """ oxxo: NotRequired["PaymentMethodConfigurationService.UpdateParamsOxxo"] """ OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. OXXO allows customers to pay bills and online purchases in-store with cash. Check this [page](https://stripe.com/docs/payments/oxxo) for more details. @@ -1103,6 +1175,12 @@ class UpdateParams(TypedDict): """ Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. Revolut Pay uses the customer's stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. """ + satispay: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsSatispay" + ] + """ + Satispay is a [single-use](https://docs.stripe.com/payments/payment-methods#usage) payment method where customers are required to [authenticate](https://stripe.com/payments/payment-methods#customer-actions) their payment. Customers pay by being redirected from your website or app, authorizing the payment with Satispay, then returning to your website or app. You get [immediate notification](https://stripe.com/payments/payment-methods#payment-notification) of whether the payment succeeded or failed. + """ sepa_debit: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsSepaDebit" ] @@ -1298,6 +1376,20 @@ class UpdateParamsBancontactDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsBillie(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsBillieDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsBillieDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsBlik(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsBlikDisplayPreference" @@ -1550,6 +1642,20 @@ class UpdateParamsMultibancoDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsNzBankAccount(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsNzBankAccountDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsNzBankAccountDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsOxxoDisplayPreference" @@ -1648,6 +1754,20 @@ class UpdateParamsRevolutPayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsSatispay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsSatispayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsSatispayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsSepaDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsSepaDebitDisplayPreference" diff --git a/stripe/_payment_method_domain.py b/stripe/_payment_method_domain.py index 3fb016792..07ecdee8f 100644 --- a/stripe/_payment_method_domain.py +++ b/stripe/_payment_method_domain.py @@ -119,7 +119,7 @@ class CreateParams(RequestOptions): """ enabled: NotRequired[bool] """ - Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements or Embedded Checkout. """ expand: NotRequired[List[str]] """ @@ -133,7 +133,7 @@ class ListParams(RequestOptions): """ enabled: NotRequired[bool] """ - Whether this payment method domain is enabled. If the domain is not enabled, payment methods will not appear in Elements + Whether this payment method domain is enabled. If the domain is not enabled, payment methods will not appear in Elements or Embedded Checkout """ ending_before: NotRequired[str] """ @@ -155,7 +155,7 @@ class ListParams(RequestOptions): class ModifyParams(RequestOptions): enabled: NotRequired[bool] """ - Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements or Embedded Checkout. """ expand: NotRequired[List[str]] """ @@ -354,10 +354,10 @@ def _cls_validate( **params: Unpack["PaymentMethodDomain.ValidateParams"], ) -> "PaymentMethodDomain": """ - Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. - The payment method doesn't appear in Elements for this domain until it is active. + Some payment methods might require additional steps to register a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements or Embedded Checkout for this domain until it is active. - To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + To activate a payment method on an existing payment method domain, complete the required registration steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ @@ -379,10 +379,10 @@ def validate( **params: Unpack["PaymentMethodDomain.ValidateParams"], ) -> "PaymentMethodDomain": """ - Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. - The payment method doesn't appear in Elements for this domain until it is active. + Some payment methods might require additional steps to register a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements or Embedded Checkout for this domain until it is active. - To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + To activate a payment method on an existing payment method domain, complete the required registration steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ @@ -393,10 +393,10 @@ def validate( self, **params: Unpack["PaymentMethodDomain.ValidateParams"] ) -> "PaymentMethodDomain": """ - Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. - The payment method doesn't appear in Elements for this domain until it is active. + Some payment methods might require additional steps to register a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements or Embedded Checkout for this domain until it is active. - To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + To activate a payment method on an existing payment method domain, complete the required registration steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ @@ -407,10 +407,10 @@ def validate( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentMethodDomain.ValidateParams"] ) -> "PaymentMethodDomain": """ - Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. - The payment method doesn't appear in Elements for this domain until it is active. + Some payment methods might require additional steps to register a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements or Embedded Checkout for this domain until it is active. - To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + To activate a payment method on an existing payment method domain, complete the required registration steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ @@ -432,10 +432,10 @@ async def _cls_validate_async( **params: Unpack["PaymentMethodDomain.ValidateParams"], ) -> "PaymentMethodDomain": """ - Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. - The payment method doesn't appear in Elements for this domain until it is active. + Some payment methods might require additional steps to register a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements or Embedded Checkout for this domain until it is active. - To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + To activate a payment method on an existing payment method domain, complete the required registration steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ @@ -457,10 +457,10 @@ async def validate_async( **params: Unpack["PaymentMethodDomain.ValidateParams"], ) -> "PaymentMethodDomain": """ - Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. - The payment method doesn't appear in Elements for this domain until it is active. + Some payment methods might require additional steps to register a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements or Embedded Checkout for this domain until it is active. - To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + To activate a payment method on an existing payment method domain, complete the required registration steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ @@ -471,10 +471,10 @@ async def validate_async( self, **params: Unpack["PaymentMethodDomain.ValidateParams"] ) -> "PaymentMethodDomain": """ - Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. - The payment method doesn't appear in Elements for this domain until it is active. + Some payment methods might require additional steps to register a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements or Embedded Checkout for this domain until it is active. - To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + To activate a payment method on an existing payment method domain, complete the required registration steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ @@ -485,10 +485,10 @@ async def validate_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentMethodDomain.ValidateParams"] ) -> "PaymentMethodDomain": """ - Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. - The payment method doesn't appear in Elements for this domain until it is active. + Some payment methods might require additional steps to register a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements or Embedded Checkout for this domain until it is active. - To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + To activate a payment method on an existing payment method domain, complete the required registration steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ diff --git a/stripe/_payment_method_domain_service.py b/stripe/_payment_method_domain_service.py index 5452daa9b..bff309ee1 100644 --- a/stripe/_payment_method_domain_service.py +++ b/stripe/_payment_method_domain_service.py @@ -17,7 +17,7 @@ class CreateParams(TypedDict): """ enabled: NotRequired[bool] """ - Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements or Embedded Checkout. """ expand: NotRequired[List[str]] """ @@ -31,7 +31,7 @@ class ListParams(TypedDict): """ enabled: NotRequired[bool] """ - Whether this payment method domain is enabled. If the domain is not enabled, payment methods will not appear in Elements + Whether this payment method domain is enabled. If the domain is not enabled, payment methods will not appear in Elements or Embedded Checkout """ ending_before: NotRequired[str] """ @@ -59,7 +59,7 @@ class RetrieveParams(TypedDict): class UpdateParams(TypedDict): enabled: NotRequired[bool] """ - Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements or Embedded Checkout. """ expand: NotRequired[List[str]] """ @@ -243,10 +243,10 @@ def validate( options: RequestOptions = {}, ) -> PaymentMethodDomain: """ - Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. - The payment method doesn't appear in Elements for this domain until it is active. + Some payment methods might require additional steps to register a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements or Embedded Checkout for this domain until it is active. - To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + To activate a payment method on an existing payment method domain, complete the required registration steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ @@ -270,10 +270,10 @@ async def validate_async( options: RequestOptions = {}, ) -> PaymentMethodDomain: """ - Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. - The payment method doesn't appear in Elements for this domain until it is active. + Some payment methods might require additional steps to register a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. + The payment method doesn't appear in Elements or Embedded Checkout for this domain until it is active. - To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + To activate a payment method on an existing payment method domain, complete the required registration steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index e4ff4d04f..76320b54d 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -67,6 +67,10 @@ class CreateParams(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired["PaymentMethodService.CreateParamsBillie"] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "PaymentMethodService.CreateParamsBillingDetails" ] @@ -165,6 +169,12 @@ class CreateParams(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "PaymentMethodService.CreateParamsNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired["PaymentMethodService.CreateParamsOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -215,6 +225,10 @@ class CreateParams(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired["PaymentMethodService.CreateParamsSatispay"] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired["PaymentMethodService.CreateParamsSepaDebit"] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. @@ -242,6 +256,7 @@ class CreateParams(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -260,6 +275,7 @@ class CreateParams(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -270,6 +286,7 @@ class CreateParams(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -349,6 +366,9 @@ class CreateParamsBacsDebit(TypedDict): class CreateParamsBancontact(TypedDict): pass + class CreateParamsBillie(TypedDict): + pass + class CreateParamsBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentMethodService.CreateParamsBillingDetailsAddress" @@ -592,6 +612,29 @@ class CreateParamsNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class CreateParamsNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class CreateParamsOxxo(TypedDict): pass @@ -660,6 +703,9 @@ class CreateParamsRevolutPay(TypedDict): class CreateParamsSamsungPay(TypedDict): pass + class CreateParamsSatispay(TypedDict): + pass + class CreateParamsSepaDebit(TypedDict): iban: str """ @@ -744,6 +790,7 @@ class ListParams(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -762,6 +809,7 @@ class ListParams(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -772,6 +820,7 @@ class ListParams(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -820,10 +869,6 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ - naver_pay: NotRequired["PaymentMethodService.UpdateParamsNaverPay"] - """ - If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. - """ pay_by_bank: NotRequired["PaymentMethodService.UpdateParamsPayByBank"] """ If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. @@ -906,12 +951,6 @@ class UpdateParamsCardNetworks(TypedDict): class UpdateParamsLink(TypedDict): pass - class UpdateParamsNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] - """ - Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. - """ - class UpdateParamsPayByBank(TypedDict): pass diff --git a/stripe/_person.py b/stripe/_person.py index fc0697735..8dfc6097e 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -16,7 +16,7 @@ class Person(UpdateableAPIResource["Person"]): """ This is an object representing a person associated with a Stripe account. - A platform cannot access a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. + A platform can only access a subset of data in a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. See the [Standard onboarding](https://stripe.com/connect/standard-accounts) or [Express onboarding](https://stripe.com/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](https://stripe.com/connect/handling-api-verification#person-information). """ @@ -157,6 +157,7 @@ class Alternative(StripeObject): class Error(StripeObject): code: Literal[ + "information_missing", "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", @@ -169,6 +170,7 @@ class Error(StripeObject): "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", + "invalid_signator", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", @@ -230,6 +232,7 @@ class Error(StripeObject): "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", + "verification_failed_authorizer_authority", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", @@ -244,6 +247,7 @@ class Error(StripeObject): "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", + "verification_rejected_ownership_exemption_reason", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", "verification_supportability", @@ -359,6 +363,7 @@ class Alternative(StripeObject): class Error(StripeObject): code: Literal[ + "information_missing", "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", @@ -371,6 +376,7 @@ class Error(StripeObject): "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", + "invalid_signator", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", @@ -432,6 +438,7 @@ class Error(StripeObject): "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", + "verification_failed_authorizer_authority", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", @@ -446,6 +453,7 @@ class Error(StripeObject): "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", + "verification_rejected_ownership_exemption_reason", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", "verification_supportability", @@ -568,23 +576,23 @@ class Document(StripeObject): dob: Optional[Dob] email: Optional[str] """ - The person's email address. + The person's email address. Also available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`. """ first_name: Optional[str] """ - The person's first name. + The person's first name. Also available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`. """ first_name_kana: Optional[str] """ - The Kana variation of the person's first name (Japan only). + The Kana variation of the person's first name (Japan only). Also available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`. """ first_name_kanji: Optional[str] """ - The Kanji variation of the person's first name (Japan only). + The Kanji variation of the person's first name (Japan only). Also available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`. """ full_name_aliases: Optional[List[str]] """ - A list of alternate names or aliases that the person is known by. + A list of alternate names or aliases that the person is known by. Also available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`. """ future_requirements: Optional[FutureRequirements] """ @@ -608,15 +616,15 @@ class Document(StripeObject): """ last_name: Optional[str] """ - The person's last name. + The person's last name. Also available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`. """ last_name_kana: Optional[str] """ - The Kana variation of the person's last name (Japan only). + The Kana variation of the person's last name (Japan only). Also available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`. """ last_name_kanji: Optional[str] """ - The Kanji variation of the person's last name (Japan only). + The Kanji variation of the person's last name (Japan only). Also available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`. """ maiden_name: Optional[str] """ diff --git a/stripe/_plan.py b/stripe/_plan.py index 07bdb1c1a..f451ba286 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -78,12 +78,6 @@ class CreateParams(RequestOptions): """ Whether the plan is currently available for new subscriptions. Defaults to `true`. """ - aggregate_usage: NotRequired[ - Literal["last_during_period", "last_ever", "max", "sum"] - ] - """ - Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. - """ amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. @@ -301,12 +295,6 @@ class RetrieveParams(RequestOptions): """ Whether the plan can be used for new purchases. """ - aggregate_usage: Optional[ - Literal["last_during_period", "last_ever", "max", "sum"] - ] - """ - Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. - """ amount: Optional[int] """ The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. diff --git a/stripe/_plan_service.py b/stripe/_plan_service.py index 606b55fce..6a946c8fe 100644 --- a/stripe/_plan_service.py +++ b/stripe/_plan_service.py @@ -15,12 +15,6 @@ class CreateParams(TypedDict): """ Whether the plan is currently available for new subscriptions. Defaults to `true`. """ - aggregate_usage: NotRequired[ - Literal["last_during_period", "last_ever", "max", "sum"] - ] - """ - Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. - """ amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. diff --git a/stripe/_price.py b/stripe/_price.py index 3b2811826..3f9642882 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -128,12 +128,6 @@ class CustomUnitAmount(StripeObject): """ class Recurring(StripeObject): - aggregate_usage: Optional[ - Literal["last_during_period", "last_ever", "max", "sum"] - ] - """ - Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. - """ interval: Literal["day", "month", "week", "year"] """ The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. @@ -228,7 +222,7 @@ class CreateParams(RequestOptions): """ product: NotRequired[str] """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ product_data: NotRequired["Price.CreateParamsProductData"] """ @@ -386,12 +380,6 @@ class CreateParamsProductData(TypedDict): """ class CreateParamsRecurring(TypedDict): - aggregate_usage: NotRequired[ - Literal["last_during_period", "last_ever", "max", "sum"] - ] - """ - Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. - """ interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. @@ -743,7 +731,7 @@ class SearchParams(RequestOptions): @classmethod def create(cls, **params: Unpack["Price.CreateParams"]) -> "Price": """ - Creates a new price for an existing product. The price can be recurring or one-time. + Creates a new [Price for an existing Product](https://docs.stripe.com/api/prices). The Price can be recurring or one-time. """ return cast( "Price", @@ -759,7 +747,7 @@ async def create_async( cls, **params: Unpack["Price.CreateParams"] ) -> "Price": """ - Creates a new price for an existing product. The price can be recurring or one-time. + Creates a new [Price for an existing Product](https://docs.stripe.com/api/prices). The Price can be recurring or one-time. """ return cast( "Price", diff --git a/stripe/_price_service.py b/stripe/_price_service.py index 327d66fef..6e91150f9 100644 --- a/stripe/_price_service.py +++ b/stripe/_price_service.py @@ -54,7 +54,7 @@ class CreateParams(TypedDict): """ product: NotRequired[str] """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ product_data: NotRequired["PriceService.CreateParamsProductData"] """ @@ -216,12 +216,6 @@ class CreateParamsProductData(TypedDict): """ class CreateParamsRecurring(TypedDict): - aggregate_usage: NotRequired[ - Literal["last_during_period", "last_ever", "max", "sum"] - ] - """ - Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. - """ interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. @@ -525,7 +519,7 @@ def create( self, params: "PriceService.CreateParams", options: RequestOptions = {} ) -> Price: """ - Creates a new price for an existing product. The price can be recurring or one-time. + Creates a new [Price for an existing Product](https://docs.stripe.com/api/prices). The Price can be recurring or one-time. """ return cast( Price, @@ -542,7 +536,7 @@ async def create_async( self, params: "PriceService.CreateParams", options: RequestOptions = {} ) -> Price: """ - Creates a new price for an existing product. The price can be recurring or one-time. + Creates a new [Price for an existing Product](https://docs.stripe.com/api/prices). The Price can be recurring or one-time. """ return cast( Price, diff --git a/stripe/_quote.py b/stripe/_quote.py index 17bbf7050..ade96c173 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -628,7 +628,7 @@ class CreateParamsLineItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: NotRequired["Quote.CreateParamsLineItemPriceDataRecurring"] """ @@ -950,7 +950,7 @@ class ModifyParamsLineItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: NotRequired["Quote.ModifyParamsLineItemPriceDataRecurring"] """ diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 31ea86ee9..018d88d69 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -238,7 +238,7 @@ class CreateParamsLineItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: NotRequired[ "QuoteService.CreateParamsLineItemPriceDataRecurring" @@ -546,7 +546,7 @@ class UpdateParamsLineItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: NotRequired[ "QuoteService.UpdateParamsLineItemPriceDataRecurring" diff --git a/stripe/_refund.py b/stripe/_refund.py index c95586250..20147f9d2 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -170,6 +170,9 @@ class MxBankTransfer(StripeObject): Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. """ + class NzBankTransfer(StripeObject): + pass + class P24(StripeObject): reference: Optional[str] """ @@ -255,6 +258,7 @@ class Zip(StripeObject): klarna: Optional[Klarna] multibanco: Optional[Multibanco] mx_bank_transfer: Optional[MxBankTransfer] + nz_bank_transfer: Optional[NzBankTransfer] p24: Optional[P24] paynow: Optional[Paynow] paypal: Optional[Paypal] @@ -291,6 +295,7 @@ class Zip(StripeObject): "klarna": Klarna, "multibanco": Multibanco, "mx_bank_transfer": MxBankTransfer, + "nz_bank_transfer": NzBankTransfer, "p24": P24, "paynow": Paynow, "paypal": Paypal, @@ -330,6 +335,16 @@ class EmailSent(StripeObject): """ _inner_class_types = {"display_details": DisplayDetails} + class PresentmentDetails(StripeObject): + presentment_amount: int + """ + Amount intended to be collected by this payment, denominated in presentment_currency. + """ + presentment_currency: str + """ + Currency presented to the customer during payment. + """ + class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -513,6 +528,7 @@ class RetrieveParams(RequestOptions): """ ID of the PaymentIntent that's refunded. """ + presentment_details: Optional[PresentmentDetails] reason: Optional[ Literal[ "duplicate", @@ -933,6 +949,7 @@ def test_helpers(self): _inner_class_types = { "destination_details": DestinationDetails, "next_action": NextAction, + "presentment_details": PresentmentDetails, } diff --git a/stripe/_review.py b/stripe/_review.py index 691e8335a..475a19a4f 100644 --- a/stripe/_review.py +++ b/stripe/_review.py @@ -132,11 +132,16 @@ class RetrieveParams(RequestOptions): """ closed_reason: Optional[ Literal[ - "approved", "disputed", "redacted", "refunded", "refunded_as_fraud" + "approved", + "canceled", + "disputed", + "redacted", + "refunded", + "refunded_as_fraud", ] ] """ - The reason the review was closed, or null if it has not yet been closed. One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. + The reason the review was closed, or null if it has not yet been closed. One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, `redacted`, or `canceled`. """ created: int """ @@ -176,7 +181,7 @@ class RetrieveParams(RequestOptions): """ reason: str """ - The reason the review is currently open or closed. One of `rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. + The reason the review is currently open or closed. One of `rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, `redacted`, or `canceled`. """ session: Optional[Session] """ diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index b3b375235..ba1122881 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -341,6 +341,15 @@ class KrCard(StripeObject): class Link(StripeObject): pass + class NaverPay(StripeObject): + buyer_id: Optional[str] + """ + Uniquely identifies this particular Naver Pay account. You can use this attribute to check whether two Naver Pay accounts are the same. + """ + + class NzBankAccount(StripeObject): + pass + class Paypal(StripeObject): pass @@ -403,6 +412,8 @@ class UsBankAccount(StripeObject): klarna: Optional[Klarna] kr_card: Optional[KrCard] link: Optional[Link] + naver_pay: Optional[NaverPay] + nz_bank_account: Optional[NzBankAccount] paypal: Optional[Paypal] revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] @@ -427,6 +438,8 @@ class UsBankAccount(StripeObject): "klarna": Klarna, "kr_card": KrCard, "link": Link, + "naver_pay": NaverPay, + "nz_bank_account": NzBankAccount, "paypal": Paypal, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, @@ -496,6 +509,7 @@ class SetupError(StripeObject): "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", + "forwarding_api_retryable_upstream_error", "forwarding_api_upstream_connection_error", "forwarding_api_upstream_connection_timeout", "idempotency_key_in_use", @@ -592,6 +606,7 @@ class SetupError(StripeObject): "setup_intent_authentication_failure", "setup_intent_invalid_parameter", "setup_intent_mandate_invalid", + "setup_intent_mobile_wallet_unsupported", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", "shipping_address_invalid", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 8be2ef01c..c3485d0e2 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -135,6 +135,7 @@ class LastSetupError(StripeObject): "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", + "forwarding_api_retryable_upstream_error", "forwarding_api_upstream_connection_error", "forwarding_api_upstream_connection_timeout", "idempotency_key_in_use", @@ -231,6 +232,7 @@ class LastSetupError(StripeObject): "setup_intent_authentication_failure", "setup_intent_invalid_parameter", "setup_intent_mandate_invalid", + "setup_intent_mobile_wallet_unsupported", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", "shipping_address_invalid", @@ -812,6 +814,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataBillie"] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataBillingDetails" ] @@ -916,6 +922,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -970,6 +982,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataSepaDebit" ] @@ -998,6 +1016,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -1015,6 +1034,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -1025,6 +1045,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -1105,6 +1126,9 @@ class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): class ConfirmParamsPaymentMethodDataBancontact(TypedDict): pass + class ConfirmParamsPaymentMethodDataBillie(TypedDict): + pass + class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|SetupIntent.ConfirmParamsPaymentMethodDataBillingDetailsAddress" @@ -1314,6 +1338,29 @@ class ConfirmParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class ConfirmParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -1382,6 +1429,9 @@ class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): class ConfirmParamsPaymentMethodDataSamsungPay(TypedDict): pass + class ConfirmParamsPaymentMethodDataSatispay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -1904,6 +1954,8 @@ class CreateParams(RequestOptions): single_use: NotRequired["SetupIntent.CreateParamsSingleUse"] """ If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion. + + Single-use mandates are only valid for the following payment methods: `acss_debit`, `alipay`, `au_becs_debit`, `bacs_debit`, `bancontact`, `boleto`, `ideal`, `link`, `sepa_debit`, and `us_bank_account`. """ usage: NotRequired[Literal["off_session", "on_session"]] """ @@ -2024,6 +2076,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired["SetupIntent.CreateParamsPaymentMethodDataBillie"] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataBillingDetails" ] @@ -2126,6 +2182,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired["SetupIntent.CreateParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -2180,6 +2242,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataSepaDebit" ] @@ -2208,6 +2276,7 @@ class CreateParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -2225,6 +2294,7 @@ class CreateParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -2235,6 +2305,7 @@ class CreateParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -2315,6 +2386,9 @@ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): class CreateParamsPaymentMethodDataBancontact(TypedDict): pass + class CreateParamsPaymentMethodDataBillie(TypedDict): + pass + class CreateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|SetupIntent.CreateParamsPaymentMethodDataBillingDetailsAddress" @@ -2524,6 +2598,29 @@ class CreateParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class CreateParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2592,6 +2689,9 @@ class CreateParamsPaymentMethodDataRevolutPay(TypedDict): class CreateParamsPaymentMethodDataSamsungPay(TypedDict): pass + class CreateParamsPaymentMethodDataSatispay(TypedDict): + pass + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -3201,6 +3301,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataBillie"] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataBillingDetails" ] @@ -3303,6 +3407,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @@ -3357,6 +3467,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataSepaDebit" ] @@ -3385,6 +3501,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -3402,6 +3519,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -3412,6 +3530,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -3492,6 +3611,9 @@ class ModifyParamsPaymentMethodDataBacsDebit(TypedDict): class ModifyParamsPaymentMethodDataBancontact(TypedDict): pass + class ModifyParamsPaymentMethodDataBillie(TypedDict): + pass + class ModifyParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|SetupIntent.ModifyParamsPaymentMethodDataBillingDetailsAddress" @@ -3701,6 +3823,29 @@ class ModifyParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class ModifyParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class ModifyParamsPaymentMethodDataOxxo(TypedDict): pass @@ -3769,6 +3914,9 @@ class ModifyParamsPaymentMethodDataRevolutPay(TypedDict): class ModifyParamsPaymentMethodDataSamsungPay(TypedDict): pass + class ModifyParamsPaymentMethodDataSatispay(TypedDict): + pass + class ModifyParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 316e159dd..fd468782c 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -168,6 +168,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataBillingDetails" ] @@ -286,6 +292,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataOxxo" ] @@ -352,6 +364,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataSepaDebit" ] @@ -386,6 +404,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -403,6 +422,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -413,6 +433,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -495,6 +516,9 @@ class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): class ConfirmParamsPaymentMethodDataBancontact(TypedDict): pass + class ConfirmParamsPaymentMethodDataBillie(TypedDict): + pass + class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|SetupIntentService.ConfirmParamsPaymentMethodDataBillingDetailsAddress" @@ -706,6 +730,29 @@ class ConfirmParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class ConfirmParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass @@ -774,6 +821,9 @@ class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): class ConfirmParamsPaymentMethodDataSamsungPay(TypedDict): pass + class ConfirmParamsPaymentMethodDataSatispay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -1300,6 +1350,8 @@ class CreateParams(TypedDict): single_use: NotRequired["SetupIntentService.CreateParamsSingleUse"] """ If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion. + + Single-use mandates are only valid for the following payment methods: `acss_debit`, `alipay`, `au_becs_debit`, `bacs_debit`, `bancontact`, `boleto`, `ideal`, `link`, `sepa_debit`, and `us_bank_account`. """ usage: NotRequired[Literal["off_session", "on_session"]] """ @@ -1426,6 +1478,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataBillingDetails" ] @@ -1540,6 +1598,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataOxxo" ] @@ -1602,6 +1666,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataSepaDebit" ] @@ -1636,6 +1706,7 @@ class CreateParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -1653,6 +1724,7 @@ class CreateParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -1663,6 +1735,7 @@ class CreateParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -1743,6 +1816,9 @@ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): class CreateParamsPaymentMethodDataBancontact(TypedDict): pass + class CreateParamsPaymentMethodDataBillie(TypedDict): + pass + class CreateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|SetupIntentService.CreateParamsPaymentMethodDataBillingDetailsAddress" @@ -1954,6 +2030,29 @@ class CreateParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class CreateParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -2022,6 +2121,9 @@ class CreateParamsPaymentMethodDataRevolutPay(TypedDict): class CreateParamsPaymentMethodDataSamsungPay(TypedDict): pass + class CreateParamsPaymentMethodDataSatispay(TypedDict): + pass + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ @@ -2651,6 +2753,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataBillingDetails" ] @@ -2765,6 +2873,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataOxxo" ] @@ -2827,6 +2941,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataSepaDebit" ] @@ -2861,6 +2981,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -2878,6 +2999,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -2888,6 +3010,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -2968,6 +3091,9 @@ class UpdateParamsPaymentMethodDataBacsDebit(TypedDict): class UpdateParamsPaymentMethodDataBancontact(TypedDict): pass + class UpdateParamsPaymentMethodDataBillie(TypedDict): + pass + class UpdateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|SetupIntentService.UpdateParamsPaymentMethodDataBillingDetailsAddress" @@ -3179,6 +3305,29 @@ class UpdateParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class UpdateParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class UpdateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -3247,6 +3396,9 @@ class UpdateParamsPaymentMethodDataRevolutPay(TypedDict): class UpdateParamsPaymentMethodDataSamsungPay(TypedDict): pass + class UpdateParamsPaymentMethodDataSatispay(TypedDict): + pass + class UpdateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 5ef477d9d..f1d289b0e 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -66,6 +66,7 @@ from stripe._forwarding_service import ForwardingService from stripe._identity_service import IdentityService from stripe._invoice_service import InvoiceService +from stripe._invoice_payment_service import InvoicePaymentService from stripe._invoice_rendering_template_service import ( InvoiceRenderingTemplateService, ) @@ -218,6 +219,7 @@ def __init__( self.forwarding = ForwardingService(self._requestor) self.identity = IdentityService(self._requestor) self.invoices = InvoiceService(self._requestor) + self.invoice_payments = InvoicePaymentService(self._requestor) self.invoice_rendering_templates = InvoiceRenderingTemplateService( self._requestor, ) diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 6d51e76d4..71d1b35a9 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -110,16 +110,6 @@ class BillingCycleAnchorConfig(StripeObject): The second of the minute of the billing_cycle_anchor. """ - class BillingThresholds(StripeObject): - amount_gte: Optional[int] - """ - Monetary threshold that triggers the subscription to create an invoice - """ - reset_billing_cycle_anchor: Optional[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. - """ - class CancellationDetails(StripeObject): comment: Optional[str] """ @@ -379,11 +369,13 @@ class Filters(StripeObject): "ideal", "jp_credit_transfer", "kakao_pay", + "klarna", "konbini", "kr_card", "link", "multibanco", "naver_pay", + "nz_bank_account", "p24", "payco", "paynow", @@ -528,12 +520,6 @@ class CreateParams(RequestOptions): """ Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. """ - billing_thresholds: NotRequired[ - "Literal['']|Subscription.CreateParamsBillingThresholds" - ] - """ - 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. - """ cancel_at: NotRequired[int] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. @@ -548,10 +534,6 @@ class CreateParams(RequestOptions): """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ currency: NotRequired[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). @@ -645,10 +627,6 @@ class CreateParams(RequestOptions): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ - promotion_code: NotRequired[str] - """ - The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -723,7 +701,7 @@ class CreateParamsAddInvoiceItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -784,16 +762,6 @@ class CreateParamsBillingCycleAnchorConfig(TypedDict): The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. """ - class CreateParamsBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ @@ -829,12 +797,6 @@ class CreateParamsInvoiceSettingsIssuer(TypedDict): """ class CreateParamsItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|Subscription.CreateParamsItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ discounts: NotRequired[ "Literal['']|List[Subscription.CreateParamsItemDiscount]" ] @@ -866,12 +828,6 @@ class CreateParamsItem(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class CreateParamsItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class CreateParamsItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -893,7 +849,7 @@ class CreateParamsItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "Subscription.CreateParamsItemPriceDataRecurring" """ @@ -932,7 +888,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1351,12 +1307,6 @@ class ModifyParams(RequestOptions): """ Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: NotRequired[ - "Literal['']|Subscription.ModifyParamsBillingThresholds" - ] - """ - 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. - """ cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. @@ -1377,10 +1327,6 @@ class ModifyParams(RequestOptions): """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ days_until_due: NotRequired[int] """ Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. @@ -1468,10 +1414,6 @@ class ModifyParams(RequestOptions): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ - promotion_code: NotRequired[str] - """ - The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -1548,7 +1490,7 @@ class ModifyParamsAddInvoiceItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -1587,16 +1529,6 @@ class ModifyParamsAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class ModifyParamsBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class ModifyParamsCancellationDetails(TypedDict): comment: NotRequired["Literal['']|str"] """ @@ -1644,12 +1576,6 @@ class ModifyParamsInvoiceSettingsIssuer(TypedDict): """ class ModifyParamsItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|Subscription.ModifyParamsItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ clear_usage: NotRequired[bool] """ 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. @@ -1693,12 +1619,6 @@ class ModifyParamsItem(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class ModifyParamsItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class ModifyParamsItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -1720,7 +1640,7 @@ class ModifyParamsItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "Subscription.ModifyParamsItemPriceDataRecurring" """ @@ -1769,7 +1689,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -2090,15 +2010,11 @@ class SearchParams(RequestOptions): """ The fixed values used to calculate the `billing_cycle_anchor`. """ - billing_thresholds: Optional[BillingThresholds] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period - """ cancel_at: Optional[int] """ A date in the future at which the subscription will automatically get canceled """ - cancel_at_period_end: bool + cancel_at_period_end: Optional[bool] """ Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. """ @@ -2122,14 +2038,6 @@ class SearchParams(RequestOptions): """ 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). """ - current_period_end: int - """ - End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. - """ - current_period_start: int - """ - Start of the current period that the subscription has been invoiced for. - """ customer: ExpandableField["Customer"] """ ID of the customer who owns the subscription. @@ -2158,10 +2066,6 @@ class SearchParams(RequestOptions): """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ - discount: Optional["Discount"] - """ - Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ discounts: List[ExpandableField["Discount"]] """ The discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. @@ -2201,7 +2105,7 @@ class SearchParams(RequestOptions): """ on_behalf_of: Optional[ExpandableField["Account"]] """ - The account (if any) the charge was made on behalf of for charges associated with this subscription. See the Connect documentation for details. + The account (if any) the charge was made on behalf of for charges associated with this subscription. See the [Connect documentation](https://stripe.com/docs/connect/subscriptions#on-behalf-of) for details. """ pause_collection: Optional[PauseCollection] """ @@ -2880,7 +2784,6 @@ async def search_auto_paging_iter_async( _inner_class_types = { "automatic_tax": AutomaticTax, "billing_cycle_anchor_config": BillingCycleAnchorConfig, - "billing_thresholds": BillingThresholds, "cancellation_details": CancellationDetails, "invoice_settings": InvoiceSettings, "pause_collection": PauseCollection, diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index b6264fe12..9a99ad88f 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -5,9 +5,7 @@ from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource -from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions -from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload @@ -24,12 +22,8 @@ from stripe._plan import Plan from stripe._price import Price from stripe._tax_rate import TaxRate - from stripe._usage_record import UsageRecord - from stripe._usage_record_summary import UsageRecordSummary -@nested_resource_class_methods("usage_record") -@nested_resource_class_methods("usage_record_summary") class SubscriptionItem( CreateableAPIResource["SubscriptionItem"], DeletableAPIResource["SubscriptionItem"], @@ -43,19 +37,7 @@ class SubscriptionItem( OBJECT_NAME: ClassVar[Literal["subscription_item"]] = "subscription_item" - class BillingThresholds(StripeObject): - usage_gte: Optional[int] - """ - Usage threshold that triggers the subscription to create an invoice - """ - class CreateParams(RequestOptions): - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionItem.CreateParamsBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ discounts: NotRequired[ "Literal['']|List[SubscriptionItem.CreateParamsDiscount]" ] @@ -122,12 +104,6 @@ class CreateParams(RequestOptions): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class CreateParamsBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ @@ -149,7 +125,7 @@ class CreateParamsPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "SubscriptionItem.CreateParamsPriceDataRecurring" """ @@ -180,24 +156,6 @@ class CreateParamsPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ - class CreateUsageRecordParams(RequestOptions): - action: NotRequired[Literal["increment", "set"]] - """ - Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. - """ - expand: NotRequired[List[str]] - """ - Specifies which fields in the response should be expanded. - """ - quantity: int - """ - The usage quantity for the specified timestamp. - """ - timestamp: NotRequired["Literal['now']|int"] - """ - The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. When passing `"now"`, Stripe records usage for the current time. Default is `"now"` if a value is not provided. - """ - class DeleteParams(RequestOptions): clear_usage: NotRequired[bool] """ @@ -236,31 +194,7 @@ class ListParams(RequestOptions): The ID of the subscription whose items will be retrieved. """ - class ListUsageRecordSummariesParams(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. - """ - class ModifyParams(RequestOptions): - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionItem.ModifyParamsBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ discounts: NotRequired[ "Literal['']|List[SubscriptionItem.ModifyParamsDiscount]" ] @@ -327,12 +261,6 @@ class ModifyParams(RequestOptions): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class ModifyParamsBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class ModifyParamsDiscount(TypedDict): coupon: NotRequired[str] """ @@ -354,7 +282,7 @@ class ModifyParamsPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "SubscriptionItem.ModifyParamsPriceDataRecurring" """ @@ -391,14 +319,18 @@ class RetrieveParams(RequestOptions): Specifies which fields in the response should be expanded. """ - billing_thresholds: Optional[BillingThresholds] - """ - Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period - """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + current_period_end: int + """ + The end time of this subscription item's current billing period. + """ + current_period_start: int + """ + The start time of this subscription item's current billing period. + """ discounts: List[ExpandableField["Discount"]] """ The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. @@ -677,101 +609,3 @@ async def retrieve_async( instance = cls(id, **params) await instance.refresh_async() return instance - - @classmethod - def create_usage_record( - cls, - subscription_item: str, - **params: Unpack["SubscriptionItem.CreateUsageRecordParams"], - ) -> "UsageRecord": - """ - Creates a usage record for a specified subscription item and date, and fills it with a quantity. - - Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. - - The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. - - The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. - """ - return cast( - "UsageRecord", - cls._static_request( - "post", - "/v1/subscription_items/{subscription_item}/usage_records".format( - subscription_item=sanitize_id(subscription_item) - ), - params=params, - ), - ) - - @classmethod - async def create_usage_record_async( - cls, - subscription_item: str, - **params: Unpack["SubscriptionItem.CreateUsageRecordParams"], - ) -> "UsageRecord": - """ - Creates a usage record for a specified subscription item and date, and fills it with a quantity. - - Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. - - The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. - - The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. - """ - return cast( - "UsageRecord", - await cls._static_request_async( - "post", - "/v1/subscription_items/{subscription_item}/usage_records".format( - subscription_item=sanitize_id(subscription_item) - ), - params=params, - ), - ) - - @classmethod - def list_usage_record_summaries( - cls, - subscription_item: str, - **params: Unpack["SubscriptionItem.ListUsageRecordSummariesParams"], - ) -> ListObject["UsageRecordSummary"]: - """ - For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). - - The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. - """ - return cast( - ListObject["UsageRecordSummary"], - cls._static_request( - "get", - "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( - subscription_item=sanitize_id(subscription_item) - ), - params=params, - ), - ) - - @classmethod - async def list_usage_record_summaries_async( - cls, - subscription_item: str, - **params: Unpack["SubscriptionItem.ListUsageRecordSummariesParams"], - ) -> ListObject["UsageRecordSummary"]: - """ - For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). - - The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. - """ - return cast( - ListObject["UsageRecordSummary"], - await cls._static_request_async( - "get", - "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( - subscription_item=sanitize_id(subscription_item) - ), - params=params, - ), - ) - - _inner_class_types = {"billing_thresholds": BillingThresholds} diff --git a/stripe/_subscription_item_service.py b/stripe/_subscription_item_service.py index 2fea81ff9..2c27e5f0f 100644 --- a/stripe/_subscription_item_service.py +++ b/stripe/_subscription_item_service.py @@ -4,36 +4,13 @@ from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._subscription_item import SubscriptionItem -from stripe._subscription_item_usage_record_service import ( - SubscriptionItemUsageRecordService, -) -from stripe._subscription_item_usage_record_summary_service import ( - SubscriptionItemUsageRecordSummaryService, -) from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class SubscriptionItemService(StripeService): - def __init__(self, requestor): - super().__init__(requestor) - self.usage_records = SubscriptionItemUsageRecordService( - self._requestor - ) - self.usage_record_summaries = ( - SubscriptionItemUsageRecordSummaryService( - self._requestor, - ) - ) - class CreateParams(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionItemService.CreateParamsBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ discounts: NotRequired[ "Literal['']|List[SubscriptionItemService.CreateParamsDiscount]" ] @@ -102,12 +79,6 @@ class CreateParams(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class CreateParamsBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ @@ -129,7 +100,7 @@ class CreateParamsPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "SubscriptionItemService.CreateParamsPriceDataRecurring" """ @@ -205,12 +176,6 @@ class RetrieveParams(TypedDict): """ class UpdateParams(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionItemService.UpdateParamsBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ discounts: NotRequired[ "Literal['']|List[SubscriptionItemService.UpdateParamsDiscount]" ] @@ -279,12 +244,6 @@ class UpdateParams(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class UpdateParamsBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class UpdateParamsDiscount(TypedDict): coupon: NotRequired[str] """ @@ -306,7 +265,7 @@ class UpdateParamsPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "SubscriptionItemService.UpdateParamsPriceDataRecurring" """ diff --git a/stripe/_subscription_item_usage_record_service.py b/stripe/_subscription_item_usage_record_service.py deleted file mode 100644 index 76826d6f9..000000000 --- a/stripe/_subscription_item_usage_record_service.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe._request_options import RequestOptions -from stripe._stripe_service import StripeService -from stripe._usage_record import UsageRecord -from stripe._util import sanitize_id -from typing import List, cast -from typing_extensions import Literal, NotRequired, TypedDict - - -class SubscriptionItemUsageRecordService(StripeService): - class CreateParams(TypedDict): - action: NotRequired[Literal["increment", "set"]] - """ - Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. - """ - expand: NotRequired[List[str]] - """ - Specifies which fields in the response should be expanded. - """ - quantity: int - """ - The usage quantity for the specified timestamp. - """ - timestamp: NotRequired["Literal['now']|int"] - """ - The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. When passing `"now"`, Stripe records usage for the current time. Default is `"now"` if a value is not provided. - """ - - def create( - self, - subscription_item: str, - params: "SubscriptionItemUsageRecordService.CreateParams", - options: RequestOptions = {}, - ) -> UsageRecord: - """ - Creates a usage record for a specified subscription item and date, and fills it with a quantity. - - Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. - - The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. - - The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. - """ - return cast( - UsageRecord, - self._request( - "post", - "/v1/subscription_items/{subscription_item}/usage_records".format( - subscription_item=sanitize_id(subscription_item), - ), - base_address="api", - params=params, - options=options, - ), - ) - - async def create_async( - self, - subscription_item: str, - params: "SubscriptionItemUsageRecordService.CreateParams", - options: RequestOptions = {}, - ) -> UsageRecord: - """ - Creates a usage record for a specified subscription item and date, and fills it with a quantity. - - Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. - - The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. - - The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. - """ - return cast( - UsageRecord, - await self._request_async( - "post", - "/v1/subscription_items/{subscription_item}/usage_records".format( - subscription_item=sanitize_id(subscription_item), - ), - base_address="api", - params=params, - options=options, - ), - ) diff --git a/stripe/_subscription_item_usage_record_summary_service.py b/stripe/_subscription_item_usage_record_summary_service.py deleted file mode 100644 index c5e6d6543..000000000 --- a/stripe/_subscription_item_usage_record_summary_service.py +++ /dev/null @@ -1,77 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe._list_object import ListObject -from stripe._request_options import RequestOptions -from stripe._stripe_service import StripeService -from stripe._usage_record_summary import UsageRecordSummary -from stripe._util import sanitize_id -from typing import List, cast -from typing_extensions import NotRequired, TypedDict - - -class SubscriptionItemUsageRecordSummaryService(StripeService): - class ListParams(TypedDict): - 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. - """ - - def list( - self, - subscription_item: str, - params: "SubscriptionItemUsageRecordSummaryService.ListParams" = {}, - options: RequestOptions = {}, - ) -> ListObject[UsageRecordSummary]: - """ - For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). - - The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. - """ - return cast( - ListObject[UsageRecordSummary], - self._request( - "get", - "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( - subscription_item=sanitize_id(subscription_item), - ), - base_address="api", - params=params, - options=options, - ), - ) - - async def list_async( - self, - subscription_item: str, - params: "SubscriptionItemUsageRecordSummaryService.ListParams" = {}, - options: RequestOptions = {}, - ) -> ListObject[UsageRecordSummary]: - """ - For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). - - The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. - """ - return cast( - ListObject[UsageRecordSummary], - await self._request_async( - "get", - "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( - subscription_item=sanitize_id(subscription_item), - ), - base_address="api", - params=params, - options=options, - ), - ) diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index 295fa204e..9a7bfaa1f 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -84,16 +84,6 @@ class Liability(StripeObject): """ _inner_class_types = {"liability": Liability} - class BillingThresholds(StripeObject): - amount_gte: Optional[int] - """ - Monetary threshold that triggers the subscription to create an invoice - """ - reset_billing_cycle_anchor: Optional[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. - """ - class InvoiceSettings(StripeObject): class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] @@ -135,10 +125,6 @@ class TransferData(StripeObject): """ Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: Optional[BillingThresholds] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period - """ collection_method: Optional[ Literal["charge_automatically", "send_invoice"] ] @@ -164,7 +150,6 @@ class TransferData(StripeObject): """ _inner_class_types = { "automatic_tax": AutomaticTax, - "billing_thresholds": BillingThresholds, "invoice_settings": InvoiceSettings, "transfer_data": TransferData, } @@ -228,16 +213,6 @@ class Liability(StripeObject): """ _inner_class_types = {"liability": Liability} - class BillingThresholds(StripeObject): - amount_gte: Optional[int] - """ - Monetary threshold that triggers the subscription to create an invoice - """ - reset_billing_cycle_anchor: Optional[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. - """ - class Discount(StripeObject): coupon: Optional[ExpandableField["Coupon"]] """ @@ -278,12 +253,6 @@ class Issuer(StripeObject): _inner_class_types = {"issuer": Issuer} class Item(StripeObject): - class BillingThresholds(StripeObject): - usage_gte: Optional[int] - """ - Usage threshold that triggers the subscription to create an invoice - """ - class Discount(StripeObject): coupon: Optional[ExpandableField["Coupon"]] """ @@ -298,10 +267,6 @@ class Discount(StripeObject): ID of the promotion code to create a new discount for. """ - billing_thresholds: Optional[BillingThresholds] - """ - Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period - """ discounts: List[Discount] """ The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. @@ -326,10 +291,7 @@ class Discount(StripeObject): """ The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. """ - _inner_class_types = { - "billing_thresholds": BillingThresholds, - "discounts": Discount, - } + _inner_class_types = {"discounts": Discount} class TransferData(StripeObject): amount_percent: Optional[float] @@ -354,20 +316,12 @@ class TransferData(StripeObject): """ Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: Optional[BillingThresholds] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period - """ collection_method: Optional[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. """ - coupon: Optional[ExpandableField["Coupon"]] - """ - ID of the coupon to use during this phase of the subscription schedule. - """ 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). @@ -429,7 +383,6 @@ class TransferData(StripeObject): _inner_class_types = { "add_invoice_items": AddInvoiceItem, "automatic_tax": AutomaticTax, - "billing_thresholds": BillingThresholds, "discounts": Discount, "invoice_settings": InvoiceSettings, "items": Item, @@ -503,12 +456,6 @@ class CreateParamsDefaultSettings(TypedDict): """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionSchedule.CreateParamsDefaultSettingsBillingThresholds" - ] - """ - 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. - """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] @@ -562,16 +509,6 @@ class CreateParamsDefaultSettingsAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class CreateParamsDefaultSettingsBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class CreateParamsDefaultSettingsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -629,22 +566,12 @@ class CreateParamsPhase(TypedDict): """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionSchedule.CreateParamsPhaseBillingThresholds" - ] - """ - 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. - """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ currency: NotRequired[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). @@ -763,7 +690,7 @@ class CreateParamsPhaseAddInvoiceItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -802,16 +729,6 @@ class CreateParamsPhaseAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class CreateParamsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class CreateParamsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ @@ -853,12 +770,6 @@ class CreateParamsPhaseInvoiceSettingsIssuer(TypedDict): """ class CreateParamsPhaseItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionSchedule.CreateParamsPhaseItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ discounts: NotRequired[ "Literal['']|List[SubscriptionSchedule.CreateParamsPhaseItemDiscount]" ] @@ -892,12 +803,6 @@ class CreateParamsPhaseItem(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class CreateParamsPhaseItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class CreateParamsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -919,7 +824,7 @@ class CreateParamsPhaseItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: ( "SubscriptionSchedule.CreateParamsPhaseItemPriceDataRecurring" @@ -1129,12 +1034,6 @@ class ModifyParamsDefaultSettings(TypedDict): """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionSchedule.ModifyParamsDefaultSettingsBillingThresholds" - ] - """ - 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. - """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] @@ -1188,16 +1087,6 @@ class ModifyParamsDefaultSettingsAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class ModifyParamsDefaultSettingsBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class ModifyParamsDefaultSettingsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -1255,22 +1144,12 @@ class ModifyParamsPhase(TypedDict): """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionSchedule.ModifyParamsPhaseBillingThresholds" - ] - """ - 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. - """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ currency: NotRequired[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). @@ -1393,7 +1272,7 @@ class ModifyParamsPhaseAddInvoiceItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -1432,16 +1311,6 @@ class ModifyParamsPhaseAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class ModifyParamsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class ModifyParamsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ @@ -1483,12 +1352,6 @@ class ModifyParamsPhaseInvoiceSettingsIssuer(TypedDict): """ class ModifyParamsPhaseItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionSchedule.ModifyParamsPhaseItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ discounts: NotRequired[ "Literal['']|List[SubscriptionSchedule.ModifyParamsPhaseItemDiscount]" ] @@ -1522,12 +1385,6 @@ class ModifyParamsPhaseItem(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class ModifyParamsPhaseItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class ModifyParamsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -1549,7 +1406,7 @@ class ModifyParamsPhaseItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: ( "SubscriptionSchedule.ModifyParamsPhaseItemPriceDataRecurring" diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index 938df116d..8e0497c68 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -79,12 +79,6 @@ class CreateParamsDefaultSettings(TypedDict): """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionScheduleService.CreateParamsDefaultSettingsBillingThresholds" - ] - """ - 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. - """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] @@ -138,16 +132,6 @@ class CreateParamsDefaultSettingsAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class CreateParamsDefaultSettingsBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class CreateParamsDefaultSettingsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -205,22 +189,12 @@ class CreateParamsPhase(TypedDict): """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionScheduleService.CreateParamsPhaseBillingThresholds" - ] - """ - 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. - """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ currency: NotRequired[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). @@ -339,7 +313,7 @@ class CreateParamsPhaseAddInvoiceItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -378,16 +352,6 @@ class CreateParamsPhaseAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class CreateParamsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class CreateParamsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ @@ -429,12 +393,6 @@ class CreateParamsPhaseInvoiceSettingsIssuer(TypedDict): """ class CreateParamsPhaseItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionScheduleService.CreateParamsPhaseItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ discounts: NotRequired[ "Literal['']|List[SubscriptionScheduleService.CreateParamsPhaseItemDiscount]" ] @@ -468,12 +426,6 @@ class CreateParamsPhaseItem(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class CreateParamsPhaseItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class CreateParamsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -495,7 +447,7 @@ class CreateParamsPhaseItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "SubscriptionScheduleService.CreateParamsPhaseItemPriceDataRecurring" """ @@ -723,12 +675,6 @@ class UpdateParamsDefaultSettings(TypedDict): """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionScheduleService.UpdateParamsDefaultSettingsBillingThresholds" - ] - """ - 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. - """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] @@ -782,16 +728,6 @@ class UpdateParamsDefaultSettingsAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class UpdateParamsDefaultSettingsBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class UpdateParamsDefaultSettingsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -849,22 +785,12 @@ class UpdateParamsPhase(TypedDict): """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionScheduleService.UpdateParamsPhaseBillingThresholds" - ] - """ - 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. - """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ currency: NotRequired[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). @@ -987,7 +913,7 @@ class UpdateParamsPhaseAddInvoiceItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -1026,16 +952,6 @@ class UpdateParamsPhaseAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class UpdateParamsPhaseBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class UpdateParamsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ @@ -1077,12 +993,6 @@ class UpdateParamsPhaseInvoiceSettingsIssuer(TypedDict): """ class UpdateParamsPhaseItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionScheduleService.UpdateParamsPhaseItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ discounts: NotRequired[ "Literal['']|List[SubscriptionScheduleService.UpdateParamsPhaseItemDiscount]" ] @@ -1116,12 +1026,6 @@ class UpdateParamsPhaseItem(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class UpdateParamsPhaseItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class UpdateParamsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -1143,7 +1047,7 @@ class UpdateParamsPhaseItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "SubscriptionScheduleService.UpdateParamsPhaseItemPriceDataRecurring" """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 8cf6732ce..144cfec22 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -75,12 +75,6 @@ class CreateParams(TypedDict): """ Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. """ - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionService.CreateParamsBillingThresholds" - ] - """ - 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. - """ cancel_at: NotRequired[int] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. @@ -95,10 +89,6 @@ class CreateParams(TypedDict): """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ currency: NotRequired[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). @@ -192,10 +182,6 @@ class CreateParams(TypedDict): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ - promotion_code: NotRequired[str] - """ - The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -274,7 +260,7 @@ class CreateParamsAddInvoiceItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -335,16 +321,6 @@ class CreateParamsBillingCycleAnchorConfig(TypedDict): The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. """ - class CreateParamsBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ @@ -382,12 +358,6 @@ class CreateParamsInvoiceSettingsIssuer(TypedDict): """ class CreateParamsItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionService.CreateParamsItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ discounts: NotRequired[ "Literal['']|List[SubscriptionService.CreateParamsItemDiscount]" ] @@ -421,12 +391,6 @@ class CreateParamsItem(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class CreateParamsItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class CreateParamsItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -448,7 +412,7 @@ class CreateParamsItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "SubscriptionService.CreateParamsItemPriceDataRecurring" """ @@ -487,7 +451,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -956,12 +920,6 @@ class UpdateParams(TypedDict): """ Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionService.UpdateParamsBillingThresholds" - ] - """ - 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. - """ cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. @@ -982,10 +940,6 @@ class UpdateParams(TypedDict): """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ - coupon: NotRequired[str] - """ - The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ days_until_due: NotRequired[int] """ Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. @@ -1073,10 +1027,6 @@ class UpdateParams(TypedDict): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ - promotion_code: NotRequired[str] - """ - The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -1155,7 +1105,7 @@ class UpdateParamsAddInvoiceItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] @@ -1194,16 +1144,6 @@ class UpdateParamsAutomaticTaxLiability(TypedDict): Type of the account referenced in the request. """ - class UpdateParamsBillingThresholds(TypedDict): - amount_gte: NotRequired[int] - """ - Monetary threshold that triggers the subscription to advance to a new billing period - """ - reset_billing_cycle_anchor: NotRequired[bool] - """ - Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - """ - class UpdateParamsCancellationDetails(TypedDict): comment: NotRequired["Literal['']|str"] """ @@ -1253,12 +1193,6 @@ class UpdateParamsInvoiceSettingsIssuer(TypedDict): """ class UpdateParamsItem(TypedDict): - billing_thresholds: NotRequired[ - "Literal['']|SubscriptionService.UpdateParamsItemBillingThresholds" - ] - """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - """ clear_usage: NotRequired[bool] """ 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. @@ -1304,12 +1238,6 @@ class UpdateParamsItem(TypedDict): A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ - class UpdateParamsItemBillingThresholds(TypedDict): - usage_gte: int - """ - Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) - """ - class UpdateParamsItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -1331,7 +1259,7 @@ class UpdateParamsItemPriceData(TypedDict): """ product: str """ - The ID of the product that this price will belong to. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ recurring: "SubscriptionService.UpdateParamsItemPriceDataRecurring" """ @@ -1380,7 +1308,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index c66ee964a..beae1e6b2 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -272,7 +272,7 @@ class RetrieveParams(RequestOptions): """ rate_type: Optional[Literal["flat_amount", "percentage"]] """ - Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. + Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. This field is only present for TaxRates created by Stripe Tax. """ state: Optional[str] """ diff --git a/stripe/_token.py b/stripe/_token.py index b537576cf..e2507e5cd 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -164,6 +164,9 @@ class CreateParamsAccountCompany(TypedDict): ownership_exemption_reason: NotRequired[ "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" ] + """ + This value is used to determine if a business is exempt from providing ultimate beneficial owners. See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details. + """ phone: NotRequired[str] """ The company's phone number (used for verification). @@ -808,7 +811,7 @@ class CreateParamsPerson(TypedDict): """ The person's phone number. """ - political_exposure: NotRequired[str] + political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 444e77605..a6ba94479 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -131,6 +131,9 @@ class CreateParamsAccountCompany(TypedDict): ownership_exemption_reason: NotRequired[ "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" ] + """ + This value is used to determine if a business is exempt from providing ultimate beneficial owners. See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details. + """ phone: NotRequired[str] """ The company's phone number (used for verification). @@ -781,7 +784,7 @@ class CreateParamsPerson(TypedDict): """ The person's phone number. """ - political_exposure: NotRequired[str] + political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ diff --git a/stripe/_usage_record.py b/stripe/_usage_record.py deleted file mode 100644 index a53744404..000000000 --- a/stripe/_usage_record.py +++ /dev/null @@ -1,57 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe._createable_api_resource import CreateableAPIResource -from typing import ClassVar -from typing_extensions import Literal - - -class UsageRecord(CreateableAPIResource["UsageRecord"]): - """ - Usage records allow you to report customer usage and metrics to Stripe for - metered billing of subscription prices. - - Related guide: [Metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) - - This is our legacy usage-based billing API. See the [updated usage-based billing docs](https://docs.stripe.com/billing/subscriptions/usage-based). - """ - - OBJECT_NAME: ClassVar[Literal["usage_record"]] = "usage_record" - id: str - """ - Unique identifier for the object. - """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ - object: Literal["usage_record"] - """ - String representing the object's type. Objects of the same type share the same value. - """ - quantity: int - """ - The usage quantity for the specified date. - """ - subscription_item: str - """ - The ID of the subscription item this usage record contains data for. - """ - timestamp: int - """ - The timestamp when this usage occurred. - """ - - @classmethod - def create(cls, **params): - if "subscription_item" not in params: - raise ValueError("Params must have a subscription_item key") - - subscription_item = params.pop("subscription_item") - - url = "/v1/subscription_items/%s/usage_records" % subscription_item - return cls._static_request( - "post", - url, - params=params, - base_address="api", - ) diff --git a/stripe/_usage_record_summary.py b/stripe/_usage_record_summary.py deleted file mode 100644 index 2276bf95e..000000000 --- a/stripe/_usage_record_summary.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional -from typing_extensions import Literal - - -class UsageRecordSummary(StripeObject): - """ - A usage record summary represents an aggregated view of how much usage was accrued for a subscription item within a subscription billing period. - """ - - OBJECT_NAME: ClassVar[Literal["usage_record_summary"]] = ( - "usage_record_summary" - ) - - class Period(StripeObject): - end: Optional[int] - """ - The end date of this usage period. All usage up to and including this point in time is included. - """ - start: Optional[int] - """ - The start date of this usage period. All usage after this point in time is included. - """ - - id: str - """ - Unique identifier for the object. - """ - invoice: Optional[str] - """ - The invoice in which this usage period has been billed for. - """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ - object: Literal["usage_record_summary"] - """ - String representing the object's type. Objects of the same type share the same value. - """ - period: Period - subscription_item: str - """ - The ID of the subscription item this summary is describing. - """ - total_usage: int - """ - The total usage within this usage period. - """ - _inner_class_types = {"period": Period} diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 8892ed94b..12169cb49 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -140,6 +140,8 @@ class CreateParams(RequestOptions): "2024-12-18.acacia", "2025-01-27.acacia", "2025-02-24.acacia", + "2025-03-01.dashboard", + "2025-03-31.basil", ] ] """ @@ -245,6 +247,7 @@ class CreateParams(RequestOptions): "invoice.finalized", "invoice.marked_uncollectible", "invoice.overdue", + "invoice.overpaid", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", @@ -395,6 +398,13 @@ class CreateParams(RequestOptions): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", + "billing.credit_balance_transaction.created", + "billing.credit_grant.created", + "billing.credit_grant.updated", + "billing.meter.created", + "billing.meter.deactivated", + "billing.meter.reactivated", + "billing.meter.updated", ] ] """ @@ -536,6 +546,7 @@ class ModifyParams(RequestOptions): "invoice.finalized", "invoice.marked_uncollectible", "invoice.overdue", + "invoice.overpaid", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", @@ -686,6 +697,13 @@ class ModifyParams(RequestOptions): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", + "billing.credit_balance_transaction.created", + "billing.credit_grant.created", + "billing.credit_grant.updated", + "billing.meter.created", + "billing.meter.deactivated", + "billing.meter.reactivated", + "billing.meter.updated", ] ] ] diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 1faf5ab73..063eab09e 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -121,6 +121,8 @@ class CreateParams(TypedDict): "2024-12-18.acacia", "2025-01-27.acacia", "2025-02-24.acacia", + "2025-03-01.dashboard", + "2025-03-31.basil", ] ] """ @@ -226,6 +228,7 @@ class CreateParams(TypedDict): "invoice.finalized", "invoice.marked_uncollectible", "invoice.overdue", + "invoice.overpaid", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", @@ -376,6 +379,13 @@ class CreateParams(TypedDict): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", + "billing.credit_balance_transaction.created", + "billing.credit_grant.created", + "billing.credit_grant.updated", + "billing.meter.created", + "billing.meter.deactivated", + "billing.meter.reactivated", + "billing.meter.updated", ] ] """ @@ -523,6 +533,7 @@ class UpdateParams(TypedDict): "invoice.finalized", "invoice.marked_uncollectible", "invoice.overdue", + "invoice.overpaid", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", @@ -673,6 +684,13 @@ class UpdateParams(TypedDict): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", + "billing.credit_balance_transaction.created", + "billing.credit_grant.created", + "billing.credit_grant.updated", + "billing.meter.created", + "billing.meter.deactivated", + "billing.meter.reactivated", + "billing.meter.updated", ] ] ] diff --git a/stripe/api_resources/__init__.py b/stripe/api_resources/__init__.py index 99bf65826..a6c38ca89 100644 --- a/stripe/api_resources/__init__.py +++ b/stripe/api_resources/__init__.py @@ -78,6 +78,7 @@ from stripe.api_resources.invoice import Invoice from stripe.api_resources.invoice_item import InvoiceItem from stripe.api_resources.invoice_line_item import InvoiceLineItem + from stripe.api_resources.invoice_payment import InvoicePayment from stripe.api_resources.invoice_rendering_template import ( InvoiceRenderingTemplate, ) @@ -123,8 +124,6 @@ from stripe.api_resources.token import Token from stripe.api_resources.topup import Topup from stripe.api_resources.transfer import Transfer - from stripe.api_resources.usage_record import UsageRecord - from stripe.api_resources.usage_record_summary import UsageRecordSummary from stripe.api_resources.webhook_endpoint import WebhookEndpoint # The end of the section generated from our OpenAPI spec diff --git a/stripe/api_resources/usage_record.py b/stripe/api_resources/invoice_payment.py similarity index 51% rename from stripe/api_resources/usage_record.py rename to stripe/api_resources/invoice_payment.py index af6d4dcda..48d804655 100644 --- a/stripe/api_resources/usage_record.py +++ b/stripe/api_resources/invoice_payment.py @@ -5,17 +5,17 @@ warn( """ - The stripe.api_resources.usage_record package is deprecated, please change your + The stripe.api_resources.invoice_payment package is deprecated, please change your imports to import from stripe directly. From: - from stripe.api_resources.usage_record import UsageRecord + from stripe.api_resources.invoice_payment import InvoicePayment To: - from stripe import UsageRecord + from stripe import InvoicePayment """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: - from stripe._usage_record import ( # noqa - UsageRecord, + from stripe._invoice_payment import ( # noqa + InvoicePayment, ) diff --git a/stripe/api_resources/usage_record_summary.py b/stripe/api_resources/usage_record_summary.py deleted file mode 100644 index 2692d3825..000000000 --- a/stripe/api_resources/usage_record_summary.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from typing_extensions import TYPE_CHECKING -from warnings import warn - -warn( - """ - The stripe.api_resources.usage_record_summary package is deprecated, please change your - imports to import from stripe directly. - From: - from stripe.api_resources.usage_record_summary import UsageRecordSummary - To: - from stripe import UsageRecordSummary - """, - DeprecationWarning, - stacklevel=2, -) -if not TYPE_CHECKING: - from stripe._usage_record_summary import ( # noqa - UsageRecordSummary, - ) diff --git a/stripe/billing/_credit_balance_summary.py b/stripe/billing/_credit_balance_summary.py index c5104d61b..e94dc59dd 100644 --- a/stripe/billing/_credit_balance_summary.py +++ b/stripe/billing/_credit_balance_summary.py @@ -109,7 +109,7 @@ class RetrieveParamsFilter(TypedDict): class RetrieveParamsFilterApplicabilityScope(TypedDict): price_type: NotRequired[Literal["metered"]] """ - The price type that credit grants can apply to. We currently only support the `metered` price type. + The price type that credit grants can apply to. We currently only support the `metered` price type. Cannot be used in combination with `prices`. """ prices: NotRequired[ List[ @@ -117,7 +117,7 @@ class RetrieveParamsFilterApplicabilityScope(TypedDict): ] ] """ - A list of prices that the credit grant can apply to. We currently only support the `metered` prices. + A list of prices that the credit grant can apply to. We currently only support the `metered` prices. Cannot be used in combination with `price_type`. """ class RetrieveParamsFilterApplicabilityScopePrice(TypedDict): diff --git a/stripe/billing/_credit_balance_summary_service.py b/stripe/billing/_credit_balance_summary_service.py index 973672edd..0f6b85720 100644 --- a/stripe/billing/_credit_balance_summary_service.py +++ b/stripe/billing/_credit_balance_summary_service.py @@ -41,7 +41,7 @@ class RetrieveParamsFilter(TypedDict): class RetrieveParamsFilterApplicabilityScope(TypedDict): price_type: NotRequired[Literal["metered"]] """ - The price type that credit grants can apply to. We currently only support the `metered` price type. + The price type that credit grants can apply to. We currently only support the `metered` price type. Cannot be used in combination with `prices`. """ prices: NotRequired[ List[ @@ -49,7 +49,7 @@ class RetrieveParamsFilterApplicabilityScope(TypedDict): ] ] """ - A list of prices that the credit grant can apply to. We currently only support the `metered` prices. + A list of prices that the credit grant can apply to. We currently only support the `metered` prices. Cannot be used in combination with `price_type`. """ class RetrieveParamsFilterApplicabilityScopePrice(TypedDict): diff --git a/stripe/billing/_credit_grant.py b/stripe/billing/_credit_grant.py index 2eb9c67e6..2d2f52c92 100644 --- a/stripe/billing/_credit_grant.py +++ b/stripe/billing/_credit_grant.py @@ -68,11 +68,11 @@ class Price(StripeObject): price_type: Optional[Literal["metered"]] """ - The price type that credit grants can apply to. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. + The price type that credit grants can apply to. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. Cannot be used in combination with `prices`. """ prices: Optional[List[Price]] """ - The prices that credit grants can apply to. We currently only support `metered` prices. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. + The prices that credit grants can apply to. We currently only support `metered` prices. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. Cannot be used in combination with `price_type`. """ _inner_class_types = {"prices": Price} @@ -150,13 +150,13 @@ class CreateParamsApplicabilityConfig(TypedDict): class CreateParamsApplicabilityConfigScope(TypedDict): price_type: NotRequired[Literal["metered"]] """ - The price type that credit grants can apply to. We currently only support the `metered` price type. + The price type that credit grants can apply to. We currently only support the `metered` price type. Cannot be used in combination with `prices`. """ prices: NotRequired[ List["CreditGrant.CreateParamsApplicabilityConfigScopePrice"] ] """ - A list of prices that the credit grant can apply to. We currently only support the `metered` prices. + A list of prices that the credit grant can apply to. We currently only support the `metered` prices. Cannot be used in combination with `price_type`. """ class CreateParamsApplicabilityConfigScopePrice(TypedDict): diff --git a/stripe/billing/_credit_grant_service.py b/stripe/billing/_credit_grant_service.py index cd2614c84..4ebbe19e9 100644 --- a/stripe/billing/_credit_grant_service.py +++ b/stripe/billing/_credit_grant_service.py @@ -83,7 +83,7 @@ class CreateParamsApplicabilityConfig(TypedDict): class CreateParamsApplicabilityConfigScope(TypedDict): price_type: NotRequired[Literal["metered"]] """ - The price type that credit grants can apply to. We currently only support the `metered` price type. + The price type that credit grants can apply to. We currently only support the `metered` price type. Cannot be used in combination with `prices`. """ prices: NotRequired[ List[ @@ -91,7 +91,7 @@ class CreateParamsApplicabilityConfigScope(TypedDict): ] ] """ - A list of prices that the credit grant can apply to. We currently only support the `metered` prices. + A list of prices that the credit grant can apply to. We currently only support the `metered` prices. Cannot be used in combination with `price_type`. """ class CreateParamsApplicabilityConfigScopePrice(TypedDict): diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index 813325857..13d26ba41 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -46,7 +46,7 @@ class CustomerMapping(StripeObject): """ class DefaultAggregation(StripeObject): - formula: Literal["count", "sum"] + formula: Literal["count", "last", "sum"] """ Specifies how events are aggregated. """ @@ -104,9 +104,9 @@ class CreateParamsCustomerMapping(TypedDict): """ class CreateParamsDefaultAggregation(TypedDict): - formula: Literal["count", "sum"] + formula: Literal["count", "last", "sum"] """ - Specifies how events are aggregated. Allowed values are `count` to count the number of events and `sum` to sum each event's value. + Specifies how events are aggregated. Allowed values are `count` to count the number of events, `sum` to sum each event's value and `last` to take the last event's value in the window. """ class CreateParamsValueSettings(TypedDict): diff --git a/stripe/billing/_meter_service.py b/stripe/billing/_meter_service.py index da236bebe..59643251d 100644 --- a/stripe/billing/_meter_service.py +++ b/stripe/billing/_meter_service.py @@ -60,9 +60,9 @@ class CreateParamsCustomerMapping(TypedDict): """ class CreateParamsDefaultAggregation(TypedDict): - formula: Literal["count", "sum"] + formula: Literal["count", "last", "sum"] """ - Specifies how events are aggregated. Allowed values are `count` to count the number of events and `sum` to sum each event's value. + Specifies how events are aggregated. Allowed values are `count` to count the number of events, `sum` to sum each event's value and `last` to take the last event's value in the window. """ class CreateParamsValueSettings(TypedDict): diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 730fe8e54..80a24e616 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -146,22 +146,10 @@ class Address(StripeObject): State, county, province, or region. """ - address: Optional[Address] - carrier: Optional[str] + address: Address + name: str """ - The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - """ - name: Optional[str] - """ - Recipient name. - """ - phone: Optional[str] - """ - Recipient phone (including extension). - """ - tracking_number: Optional[str] - """ - The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + Customer name. """ _inner_class_types = {"address": Address} @@ -615,6 +603,26 @@ class RenderingOptions(StripeObject): invoice_data: InvoiceData _inner_class_types = {"invoice_data": InvoiceData} + class OptionalItem(StripeObject): + class AdjustableQuantity(StripeObject): + enabled: bool + """ + Set to true if the quantity can be adjusted to any non-negative integer. + """ + maximum: Optional[int] + """ + The maximum quantity of this item the customer can purchase. By default this value is 99. You can specify a value up to 999999. + """ + minimum: Optional[int] + """ + The minimum quantity of this item the customer must purchase, if they choose to purchase it. Because this item is optional, the customer will always be able to remove it from their order, even if the `minimum` configured here is greater than 0. By default this value is 0. + """ + + adjustable_quantity: Optional[AdjustableQuantity] + price: str + quantity: int + _inner_class_types = {"adjustable_quantity": AdjustableQuantity} + class PaymentMethodConfigurationDetails(StripeObject): id: str """ @@ -1383,12 +1391,34 @@ class Filters(StripeObject): "us_bank_account": UsBankAccount, } + class Permissions(StripeObject): + update_shipping_details: Optional[ + Literal["client_only", "server_only"] + ] + """ + Determines which entity is allowed to update the shipping details. + + Default is `client_only`. Stripe Checkout client will automatically update the shipping details. If set to `server_only`, only your server is allowed to update the shipping details. + + When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API. + """ + class PhoneNumberCollection(StripeObject): enabled: bool """ Indicates whether phone number collection is enabled for the session """ + class PresentmentDetails(StripeObject): + presentment_amount: int + """ + Amount intended to be collected by this payment, denominated in presentment_currency. + """ + presentment_currency: str + """ + Currency presented to the customer during payment. + """ + class SavedPaymentMethodOptions(StripeObject): allow_redisplay_filters: Optional[ List[Literal["always", "limited", "unspecified"]] @@ -1714,52 +1744,6 @@ class Tax(StripeObject): """ _inner_class_types = {"taxes": Tax} - class ShippingDetails(StripeObject): - class Address(StripeObject): - city: Optional[str] - """ - City, district, suburb, town, or village. - """ - country: Optional[str] - """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - """ - line1: Optional[str] - """ - Address line 1 (e.g., street, PO Box, or company name). - """ - line2: Optional[str] - """ - Address line 2 (e.g., apartment, suite, unit, or building). - """ - postal_code: Optional[str] - """ - ZIP or postal code. - """ - state: Optional[str] - """ - State, county, province, or region. - """ - - address: Optional[Address] - carrier: Optional[str] - """ - The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - """ - name: Optional[str] - """ - Recipient name. - """ - phone: Optional[str] - """ - Recipient phone (including extension). - """ - tracking_number: Optional[str] - """ - The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. - """ - _inner_class_types = {"address": Address} - class ShippingOption(StripeObject): shipping_amount: int """ @@ -1881,7 +1865,7 @@ class CreateParams(RequestOptions): """ cancel_url: NotRequired[str] """ - If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. This parameter is not allowed if ui_mode is `embedded`. + If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. This parameter is not allowed if ui_mode is `embedded` or `custom`. """ client_reference_id: NotRequired[str] """ @@ -2025,6 +2009,16 @@ class CreateParams(RequestOptions): """ The mode of the Checkout Session. Pass `subscription` if the Checkout Session includes at least one recurring item. """ + optional_items: NotRequired[List["Session.CreateParamsOptionalItem"]] + """ + A list of optional items the customer can add to their order at checkout. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). + + There is a maximum of 10 optional items allowed on a Checkout Session, and the existing limits on the number of line items allowed on a Checkout Session apply to the combined number of line items and optional items. + + For `payment` mode, there is a maximum of 100 combined line items and optional items, however it is recommended to consolidate items if there are more than a few dozen. + + For `subscription` mode, there is a maximum of 20 line items and optional items with recurring Prices and 20 line items and optional items with one-time Prices. + """ payment_intent_data: NotRequired[ "Session.CreateParamsPaymentIntentData" ] @@ -2070,6 +2064,7 @@ class CreateParams(RequestOptions): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -2098,6 +2093,7 @@ class CreateParams(RequestOptions): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -2121,6 +2117,12 @@ class CreateParams(RequestOptions): prioritize the most relevant payment methods based on the customer's location and other characteristics. """ + permissions: NotRequired["Session.CreateParamsPermissions"] + """ + This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object. + + For specific permissions, please refer to their dedicated subsections, such as `permissions.update.shipping_details`. + """ phone_number_collection: NotRequired[ "Session.CreateParamsPhoneNumberCollection" ] @@ -2139,7 +2141,7 @@ class CreateParams(RequestOptions): return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the - payment method's app or site. This parameter is required if ui_mode is `embedded` + payment method's app or site. This parameter is required if `ui_mode` is `embedded` or `custom` and redirect-based payment methods are enabled on the session. """ saved_payment_method_options: NotRequired[ @@ -2168,9 +2170,10 @@ class CreateParams(RequestOptions): Literal["auto", "book", "donate", "pay", "subscribe"] ] """ - Describes the type of transaction being performed by Checkout in order to customize - relevant text on the page, such as the submit button. `submit_type` can only be - specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. + Describes the type of transaction being performed by Checkout in order + to customize relevant text on the page, such as the submit button. + `submit_type` can only be specified on Checkout Sessions in + `payment` or `subscription` mode. If blank or `auto`, `pay` is used. """ subscription_data: NotRequired["Session.CreateParamsSubscriptionData"] """ @@ -2180,7 +2183,7 @@ class CreateParams(RequestOptions): """ The URL to which Stripe should send customers when payment or setup is complete. - This parameter is not allowed if ui_mode is `embedded`. If you'd like to use + This parameter is not allowed if ui_mode is `embedded` or `custom`. If you'd like to use information from the successful Checkout Session on your page, read the guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page). """ @@ -2188,7 +2191,7 @@ class CreateParams(RequestOptions): """ Controls tax ID collection during checkout. """ - ui_mode: NotRequired[Literal["embedded", "hosted"]] + ui_mode: NotRequired[Literal["custom", "embedded", "hosted"]] """ The UI mode of the Session. Defaults to `hosted`. """ @@ -2552,13 +2555,13 @@ class CreateParamsLineItemPriceData(TypedDict): """ product: NotRequired[str] """ - The ID of the product that this price will belong to. One of `product` or `product_data` is required. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required. """ product_data: NotRequired[ "Session.CreateParamsLineItemPriceDataProductData" ] """ - Data used to generate a new product object inline. One of `product` or `product_data` is required. + Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required. """ recurring: NotRequired[ "Session.CreateParamsLineItemPriceDataRecurring" @@ -2613,10 +2616,40 @@ class CreateParamsLineItemPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class CreateParamsOptionalItem(TypedDict): + adjustable_quantity: NotRequired[ + "Session.CreateParamsOptionalItemAdjustableQuantity" + ] + """ + When set, provides configuration for the customer to adjust the quantity of the line item created when a customer chooses to add this optional item to their order. + """ + price: str + """ + The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. + """ + quantity: int + """ + The initial quantity of the line item created when a customer chooses to add this optional item to their order. + """ + + class CreateParamsOptionalItemAdjustableQuantity(TypedDict): + enabled: bool + """ + Set to true if the quantity can be adjusted to any non-negative integer. + """ + maximum: NotRequired[int] + """ + The maximum quantity of this item the customer can purchase. By default this value is 99. You can specify a value up to 999999. + """ + minimum: NotRequired[int] + """ + The minimum quantity of this item the customer must purchase, if they choose to purchase it. Because this item is optional, the customer will always be able to remove it from their order, even if the `minimum` configured here is greater than 0. By default this value is 0. + """ + class CreateParamsPaymentIntentData(TypedDict): 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + 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://stripe.com/docs/payments/connected-accounts). """ capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] @@ -3719,6 +3752,18 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPermissions(TypedDict): + update_shipping_details: NotRequired[ + Literal["client_only", "server_only"] + ] + """ + Determines which entity is allowed to update the shipping details. + + Default is `client_only`. Stripe Checkout client will automatically update the shipping details. If set to `server_only`, only your server is allowed to update the shipping details. + + When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API. + """ + class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ @@ -4346,6 +4391,12 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + shipping_options: NotRequired[ + "Literal['']|List[Session.ModifyParamsShippingOption]" + ] + """ + The shipping rate options to apply to this Session. Up to a maximum of 5. + """ class ModifyParamsCollectedInformation(TypedDict): shipping_details: NotRequired[ @@ -4393,6 +4444,127 @@ class ModifyParamsCollectedInformationShippingDetailsAddress(TypedDict): State, county, province, or region. """ + class ModifyParamsShippingOption(TypedDict): + shipping_rate: NotRequired[str] + """ + The ID of the Shipping Rate to use for this shipping option. + """ + shipping_rate_data: NotRequired[ + "Session.ModifyParamsShippingOptionShippingRateData" + ] + """ + Parameters to be passed to Shipping Rate creation for this shipping option. + """ + + class ModifyParamsShippingOptionShippingRateData(TypedDict): + delivery_estimate: NotRequired[ + "Session.ModifyParamsShippingOptionShippingRateDataDeliveryEstimate" + ] + """ + The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + display_name: str + """ + The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + fixed_amount: NotRequired[ + "Session.ModifyParamsShippingOptionShippingRateDataFixedAmount" + ] + """ + Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + """ + type: NotRequired[Literal["fixed_amount"]] + """ + The type of calculation to use on the shipping rate. + """ + + class ModifyParamsShippingOptionShippingRateDataDeliveryEstimate( + TypedDict + ): + maximum: NotRequired[ + "Session.ModifyParamsShippingOptionShippingRateDataDeliveryEstimateMaximum" + ] + """ + The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + """ + minimum: NotRequired[ + "Session.ModifyParamsShippingOptionShippingRateDataDeliveryEstimateMinimum" + ] + """ + The lower bound of the estimated range. If empty, represents no lower bound. + """ + + class ModifyParamsShippingOptionShippingRateDataDeliveryEstimateMaximum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class ModifyParamsShippingOptionShippingRateDataDeliveryEstimateMinimum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class ModifyParamsShippingOptionShippingRateDataFixedAmount(TypedDict): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + 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). + """ + currency_options: NotRequired[ + Dict[ + str, + "Session.ModifyParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions", + ] + ] + """ + Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + """ + + class ModifyParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions( + TypedDict, + ): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -4436,7 +4608,7 @@ class RetrieveParams(RequestOptions): """ client_secret: Optional[str] """ - Client secret to be used when initializing Stripe.js embedded checkout. + The client secret of your Checkout Session. Applies to Checkout Sessions with `ui_mode: embedded`. Client secret to be used when initializing Stripe.js embedded checkout. """ collected_information: Optional[CollectedInformation] """ @@ -4460,7 +4632,7 @@ class RetrieveParams(RequestOptions): """ currency_conversion: Optional[CurrencyConversion] """ - Currency conversion details for [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing) sessions + Currency conversion details for [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing) sessions created before 2025-03-31. """ custom_fields: List[CustomField] """ @@ -4579,6 +4751,10 @@ class RetrieveParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ + optional_items: Optional[List[OptionalItem]] + """ + The optional items presented to the customer at checkout. + """ payment_intent: Optional[ExpandableField["PaymentIntent"]] """ The ID of the PaymentIntent for Checkout Sessions in `payment` mode. You can't confirm or cancel the PaymentIntent for a Checkout Session. To cancel, [expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. @@ -4611,7 +4787,14 @@ class RetrieveParams(RequestOptions): The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. You can use this value to decide when to fulfill your customer's order. """ + permissions: Optional[Permissions] + """ + This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object. + + For specific permissions, please refer to their dedicated subsections, such as `permissions.update.shipping_details`. + """ phone_number_collection: Optional[PhoneNumberCollection] + presentment_details: Optional[PresentmentDetails] recovered_from: Optional[str] """ The ID of the original expired Checkout Session that triggered the recovery flow. @@ -4640,10 +4823,6 @@ class RetrieveParams(RequestOptions): """ The details of the customer cost of shipping, including the customer chosen ShippingRate. """ - shipping_details: Optional[ShippingDetails] - """ - Shipping information for this Checkout Session. - """ shipping_options: List[ShippingOption] """ The shipping rate options applied to this Session. @@ -4674,20 +4853,20 @@ class RetrieveParams(RequestOptions): """ Tax and discount details for the computed total amount. """ - ui_mode: Optional[Literal["embedded", "hosted"]] + ui_mode: Optional[Literal["custom", "embedded", "hosted"]] """ The UI mode of the Session. Defaults to `hosted`. """ url: Optional[str] """ - The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you're using [Custom Domains](https://stripe.com/docs/payments/checkout/custom-domains), the URL will use your subdomain. Otherwise, it'll use `checkout.stripe.com.` + The URL to the Checkout Session. Applies to Checkout Sessions with `ui_mode: hosted`. Redirect customers to this URL to take them to Checkout. If you're using [Custom Domains](https://stripe.com/docs/payments/checkout/custom-domains), the URL will use your subdomain. Otherwise, it'll use `checkout.stripe.com.` This value is only present when the session is active. """ @classmethod def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": """ - Creates a Session object. + Creates a Checkout Session object. """ return cast( "Session", @@ -4703,7 +4882,7 @@ async def create_async( cls, **params: Unpack["Session.CreateParams"] ) -> "Session": """ - Creates a Session object. + Creates a Checkout Session object. """ return cast( "Session", @@ -4719,9 +4898,9 @@ def _cls_expire( cls, session: str, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ - A Session can be expired when it is in one of these statuses: open + A Checkout Session can be expired when it is in one of these statuses: open - After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + After it expires, a customer can't complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired. """ return cast( "Session", @@ -4740,18 +4919,18 @@ def expire( session: str, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ - A Session can be expired when it is in one of these statuses: open + A Checkout Session can be expired when it is in one of these statuses: open - After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + After it expires, a customer can't complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired. """ ... @overload def expire(self, **params: Unpack["Session.ExpireParams"]) -> "Session": """ - A Session can be expired when it is in one of these statuses: open + A Checkout Session can be expired when it is in one of these statuses: open - After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + After it expires, a customer can't complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired. """ ... @@ -4760,9 +4939,9 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ - A Session can be expired when it is in one of these statuses: open + A Checkout Session can be expired when it is in one of these statuses: open - After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + After it expires, a customer can't complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired. """ return cast( "Session", @@ -4780,9 +4959,9 @@ async def _cls_expire_async( cls, session: str, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ - A Session can be expired when it is in one of these statuses: open + A Checkout Session can be expired when it is in one of these statuses: open - After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + After it expires, a customer can't complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired. """ return cast( "Session", @@ -4801,9 +4980,9 @@ async def expire_async( session: str, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ - A Session can be expired when it is in one of these statuses: open + A Checkout Session can be expired when it is in one of these statuses: open - After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + After it expires, a customer can't complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired. """ ... @@ -4812,9 +4991,9 @@ async def expire_async( self, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ - A Session can be expired when it is in one of these statuses: open + A Checkout Session can be expired when it is in one of these statuses: open - After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + After it expires, a customer can't complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired. """ ... @@ -4823,9 +5002,9 @@ async def expire_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ - A Session can be expired when it is in one of these statuses: open + A Checkout Session can be expired when it is in one of these statuses: open - After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + After it expires, a customer can't complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired. """ return cast( "Session", @@ -4993,7 +5172,7 @@ def modify( cls, id: str, **params: Unpack["Session.ModifyParams"] ) -> "Session": """ - Updates a Session object. + Updates a Checkout Session object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( @@ -5010,7 +5189,7 @@ async def modify_async( cls, id: str, **params: Unpack["Session.ModifyParams"] ) -> "Session": """ - Updates a Session object. + Updates a Checkout Session object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( @@ -5027,7 +5206,7 @@ def retrieve( cls, id: str, **params: Unpack["Session.RetrieveParams"] ) -> "Session": """ - Retrieves a Session object. + Retrieves a Checkout Session object. """ instance = cls(id, **params) instance.refresh() @@ -5038,7 +5217,7 @@ async def retrieve_async( cls, id: str, **params: Unpack["Session.RetrieveParams"] ) -> "Session": """ - Retrieves a Session object. + Retrieves a Checkout Session object. """ instance = cls(id, **params) await instance.refresh_async() @@ -5057,13 +5236,15 @@ async def retrieve_async( "customer_details": CustomerDetails, "discounts": Discount, "invoice_creation": InvoiceCreation, + "optional_items": OptionalItem, "payment_method_configuration_details": PaymentMethodConfigurationDetails, "payment_method_options": PaymentMethodOptions, + "permissions": Permissions, "phone_number_collection": PhoneNumberCollection, + "presentment_details": PresentmentDetails, "saved_payment_method_options": SavedPaymentMethodOptions, "shipping_address_collection": ShippingAddressCollection, "shipping_cost": ShippingCost, - "shipping_details": ShippingDetails, "shipping_options": ShippingOption, "tax_id_collection": TaxIdCollection, "total_details": TotalDetails, diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index c930e615f..1e660eaf5 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -42,7 +42,7 @@ class CreateParams(TypedDict): """ cancel_url: NotRequired[str] """ - If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. This parameter is not allowed if ui_mode is `embedded`. + If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. This parameter is not allowed if ui_mode is `embedded` or `custom`. """ client_reference_id: NotRequired[str] """ @@ -192,6 +192,18 @@ class CreateParams(TypedDict): """ The mode of the Checkout Session. Pass `subscription` if the Checkout Session includes at least one recurring item. """ + optional_items: NotRequired[ + List["SessionService.CreateParamsOptionalItem"] + ] + """ + A list of optional items the customer can add to their order at checkout. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). + + There is a maximum of 10 optional items allowed on a Checkout Session, and the existing limits on the number of line items allowed on a Checkout Session apply to the combined number of line items and optional items. + + For `payment` mode, there is a maximum of 100 combined line items and optional items, however it is recommended to consolidate items if there are more than a few dozen. + + For `subscription` mode, there is a maximum of 20 line items and optional items with recurring Prices and 20 line items and optional items with one-time Prices. + """ payment_intent_data: NotRequired[ "SessionService.CreateParamsPaymentIntentData" ] @@ -237,6 +249,7 @@ class CreateParams(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", @@ -265,6 +278,7 @@ class CreateParams(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -288,6 +302,12 @@ class CreateParams(TypedDict): prioritize the most relevant payment methods based on the customer's location and other characteristics. """ + permissions: NotRequired["SessionService.CreateParamsPermissions"] + """ + This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object. + + For specific permissions, please refer to their dedicated subsections, such as `permissions.update.shipping_details`. + """ phone_number_collection: NotRequired[ "SessionService.CreateParamsPhoneNumberCollection" ] @@ -306,7 +326,7 @@ class CreateParams(TypedDict): return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the - payment method's app or site. This parameter is required if ui_mode is `embedded` + payment method's app or site. This parameter is required if `ui_mode` is `embedded` or `custom` and redirect-based payment methods are enabled on the session. """ saved_payment_method_options: NotRequired[ @@ -337,9 +357,10 @@ class CreateParams(TypedDict): Literal["auto", "book", "donate", "pay", "subscribe"] ] """ - Describes the type of transaction being performed by Checkout in order to customize - relevant text on the page, such as the submit button. `submit_type` can only be - specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. + Describes the type of transaction being performed by Checkout in order + to customize relevant text on the page, such as the submit button. + `submit_type` can only be specified on Checkout Sessions in + `payment` or `subscription` mode. If blank or `auto`, `pay` is used. """ subscription_data: NotRequired[ "SessionService.CreateParamsSubscriptionData" @@ -351,7 +372,7 @@ class CreateParams(TypedDict): """ The URL to which Stripe should send customers when payment or setup is complete. - This parameter is not allowed if ui_mode is `embedded`. If you'd like to use + This parameter is not allowed if ui_mode is `embedded` or `custom`. If you'd like to use information from the successful Checkout Session on your page, read the guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page). """ @@ -361,7 +382,7 @@ class CreateParams(TypedDict): """ Controls tax ID collection during checkout. """ - ui_mode: NotRequired[Literal["embedded", "hosted"]] + ui_mode: NotRequired[Literal["custom", "embedded", "hosted"]] """ The UI mode of the Session. Defaults to `hosted`. """ @@ -731,13 +752,13 @@ class CreateParamsLineItemPriceData(TypedDict): """ product: NotRequired[str] """ - The ID of the product that this price will belong to. One of `product` or `product_data` is required. + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required. """ product_data: NotRequired[ "SessionService.CreateParamsLineItemPriceDataProductData" ] """ - Data used to generate a new product object inline. One of `product` or `product_data` is required. + Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required. """ recurring: NotRequired[ "SessionService.CreateParamsLineItemPriceDataRecurring" @@ -792,10 +813,40 @@ class CreateParamsLineItemPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class CreateParamsOptionalItem(TypedDict): + adjustable_quantity: NotRequired[ + "SessionService.CreateParamsOptionalItemAdjustableQuantity" + ] + """ + When set, provides configuration for the customer to adjust the quantity of the line item created when a customer chooses to add this optional item to their order. + """ + price: str + """ + The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. + """ + quantity: int + """ + The initial quantity of the line item created when a customer chooses to add this optional item to their order. + """ + + class CreateParamsOptionalItemAdjustableQuantity(TypedDict): + enabled: bool + """ + Set to true if the quantity can be adjusted to any non-negative integer. + """ + maximum: NotRequired[int] + """ + The maximum quantity of this item the customer can purchase. By default this value is 99. You can specify a value up to 999999. + """ + minimum: NotRequired[int] + """ + The minimum quantity of this item the customer must purchase, if they choose to purchase it. Because this item is optional, the customer will always be able to remove it from their order, even if the `minimum` configured here is greater than 0. By default this value is 0. + """ + class CreateParamsPaymentIntentData(TypedDict): 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 payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + 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://stripe.com/docs/payments/connected-accounts). """ capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] @@ -1936,6 +1987,18 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPermissions(TypedDict): + update_shipping_details: NotRequired[ + Literal["client_only", "server_only"] + ] + """ + Determines which entity is allowed to update the shipping details. + + Default is `client_only`. Stripe Checkout client will automatically update the shipping details. If set to `server_only`, only your server is allowed to update the shipping details. + + When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API. + """ + class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ @@ -2551,6 +2614,12 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/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`. """ + shipping_options: NotRequired[ + "Literal['']|List[SessionService.UpdateParamsShippingOption]" + ] + """ + The shipping rate options to apply to this Session. Up to a maximum of 5. + """ class UpdateParamsCollectedInformation(TypedDict): shipping_details: NotRequired[ @@ -2596,6 +2665,127 @@ class UpdateParamsCollectedInformationShippingDetailsAddress(TypedDict): State, county, province, or region. """ + class UpdateParamsShippingOption(TypedDict): + shipping_rate: NotRequired[str] + """ + The ID of the Shipping Rate to use for this shipping option. + """ + shipping_rate_data: NotRequired[ + "SessionService.UpdateParamsShippingOptionShippingRateData" + ] + """ + Parameters to be passed to Shipping Rate creation for this shipping option. + """ + + class UpdateParamsShippingOptionShippingRateData(TypedDict): + delivery_estimate: NotRequired[ + "SessionService.UpdateParamsShippingOptionShippingRateDataDeliveryEstimate" + ] + """ + The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + display_name: str + """ + The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + fixed_amount: NotRequired[ + "SessionService.UpdateParamsShippingOptionShippingRateDataFixedAmount" + ] + """ + Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + """ + type: NotRequired[Literal["fixed_amount"]] + """ + The type of calculation to use on the shipping rate. + """ + + class UpdateParamsShippingOptionShippingRateDataDeliveryEstimate( + TypedDict + ): + maximum: NotRequired[ + "SessionService.UpdateParamsShippingOptionShippingRateDataDeliveryEstimateMaximum" + ] + """ + The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + """ + minimum: NotRequired[ + "SessionService.UpdateParamsShippingOptionShippingRateDataDeliveryEstimateMinimum" + ] + """ + The lower bound of the estimated range. If empty, represents no lower bound. + """ + + class UpdateParamsShippingOptionShippingRateDataDeliveryEstimateMaximum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class UpdateParamsShippingOptionShippingRateDataDeliveryEstimateMinimum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class UpdateParamsShippingOptionShippingRateDataFixedAmount(TypedDict): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + 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). + """ + currency_options: NotRequired[ + Dict[ + str, + "SessionService.UpdateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions", + ] + ] + """ + Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + """ + + class UpdateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions( + TypedDict, + ): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + def list( self, params: "SessionService.ListParams" = {}, @@ -2640,7 +2830,7 @@ def create( options: RequestOptions = {}, ) -> Session: """ - Creates a Session object. + Creates a Checkout Session object. """ return cast( Session, @@ -2659,7 +2849,7 @@ async def create_async( options: RequestOptions = {}, ) -> Session: """ - Creates a Session object. + Creates a Checkout Session object. """ return cast( Session, @@ -2679,7 +2869,7 @@ def retrieve( options: RequestOptions = {}, ) -> Session: """ - Retrieves a Session object. + Retrieves a Checkout Session object. """ return cast( Session, @@ -2701,7 +2891,7 @@ async def retrieve_async( options: RequestOptions = {}, ) -> Session: """ - Retrieves a Session object. + Retrieves a Checkout Session object. """ return cast( Session, @@ -2723,7 +2913,7 @@ def update( options: RequestOptions = {}, ) -> Session: """ - Updates a Session object. + Updates a Checkout Session object. """ return cast( Session, @@ -2745,7 +2935,7 @@ async def update_async( options: RequestOptions = {}, ) -> Session: """ - Updates a Session object. + Updates a Checkout Session object. """ return cast( Session, @@ -2767,9 +2957,9 @@ def expire( options: RequestOptions = {}, ) -> Session: """ - A Session can be expired when it is in one of these statuses: open + A Checkout Session can be expired when it is in one of these statuses: open - After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + After it expires, a customer can't complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired. """ return cast( Session, @@ -2791,9 +2981,9 @@ async def expire_async( options: RequestOptions = {}, ) -> Session: """ - A Session can be expired when it is in one of these statuses: open + A Checkout Session can be expired when it is in one of these statuses: open - After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + After it expires, a customer can't complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired. """ return cast( Session, diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 2029509ff..b714ddd4f 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -245,7 +245,7 @@ class CreateParams(RequestOptions): """ related_customer: NotRequired[str] """ - Token referencing a Customer resource. + Customer ID """ return_url: NotRequired[str] """ @@ -473,7 +473,7 @@ class RetrieveParams(RequestOptions): """ related_customer: Optional[str] """ - Token referencing a Customer resource. + Customer ID """ status: Literal["canceled", "processing", "requires_input", "verified"] """ diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index 020d52ef1..5af0e97b8 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -41,7 +41,7 @@ class CreateParams(TypedDict): """ related_customer: NotRequired[str] """ - Token referencing a Customer resource. + Customer ID """ return_url: NotRequired[str] """ diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index cc326c614..c607d913b 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -367,6 +367,7 @@ class AmountDetails(StripeObject): "cardholder_verification_required", "insecure_authorization_method", "insufficient_funds", + "network_fallback", "not_allowed", "pin_blocked", "spending_controls", @@ -1539,7 +1540,9 @@ class ListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["closed", "pending", "reversed"]] + status: NotRequired[ + Literal["closed", "expired", "pending", "reversed"] + ] """ Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`. """ @@ -1685,7 +1688,7 @@ class ReverseParams(RequestOptions): """ History of every time a `pending_request` authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined. """ - status: Literal["closed", "pending", "reversed"] + status: Literal["closed", "expired", "pending", "reversed"] """ The current status of the authorization in its lifecycle. """ diff --git a/stripe/issuing/_authorization_service.py b/stripe/issuing/_authorization_service.py index ad1c339c4..f1f7685ad 100644 --- a/stripe/issuing/_authorization_service.py +++ b/stripe/issuing/_authorization_service.py @@ -63,7 +63,9 @@ class ListParams(TypedDict): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["closed", "pending", "reversed"]] + status: NotRequired[ + Literal["closed", "expired", "pending", "reversed"] + ] """ Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`. """ diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 4d71e5fef..094129c26 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -365,7 +365,7 @@ class FlatAmount(StripeObject): """ rate_type: Optional[Literal["flat_amount", "percentage"]] """ - Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. + Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. This field is only present for TaxRates created by Stripe Tax. """ state: Optional[str] """ diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index fbcf45b8c..fbb4bd91b 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -2210,7 +2210,7 @@ class CreateParamsCountryOptionsUs(TypedDict): class CreateParamsCountryOptionsUsLocalAmusementTax(TypedDict): jurisdiction: str """ - A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `14000` (Chicago), `06613` (Bloomington), `21696` (East Dundee), `24582` (Evanston), and `68081` (Schiller Park). + A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `14000` (Chicago), `06613` (Bloomington), `21696` (East Dundee), `24582` (Evanston), `45421` (Lynwood), `64343` (River Grove), and `68081` (Schiller Park). """ class CreateParamsCountryOptionsUsLocalLeaseTax(TypedDict): diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index 3c9f17b3c..71e08073a 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -1230,7 +1230,7 @@ class CreateParamsCountryOptionsUs(TypedDict): class CreateParamsCountryOptionsUsLocalAmusementTax(TypedDict): jurisdiction: str """ - A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `14000` (Chicago), `06613` (Bloomington), `21696` (East Dundee), `24582` (Evanston), and `68081` (Schiller Park). + A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `14000` (Chicago), `06613` (Bloomington), `21696` (East Dundee), `24582` (Evanston), `45421` (Lynwood), `64343` (River Grove), and `68081` (Schiller Park). """ class CreateParamsCountryOptionsUsLocalLeaseTax(TypedDict): diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index c04039e2b..f8382d28b 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -39,7 +39,7 @@ class Configuration( class BbposWiseposE(StripeObject): splashscreen: Optional[ExpandableField["File"]] """ - A File ID representing an image you would like displayed on the reader. + A File ID representing an image to display on the reader """ class Offline(StripeObject): @@ -61,7 +61,7 @@ class RebootWindow(StripeObject): class StripeS700(StripeObject): splashscreen: Optional[ExpandableField["File"]] """ - A File ID representing an image you would like displayed on the reader. + A File ID representing an image to display on the reader """ class Tipping(StripeObject): @@ -327,9 +327,75 @@ class Usd(StripeObject): class VerifoneP400(StripeObject): splashscreen: Optional[ExpandableField["File"]] """ - A File ID representing an image you would like displayed on the reader. + A File ID representing an image to display on the reader """ + class Wifi(StripeObject): + class EnterpriseEapPeap(StripeObject): + ca_certificate_file: Optional[str] + """ + A File ID representing a PEM file containing the server certificate + """ + password: str + """ + Password for connecting to the WiFi network + """ + ssid: str + """ + Name of the WiFi network + """ + username: str + """ + Username for connecting to the WiFi network + """ + + class EnterpriseEapTls(StripeObject): + ca_certificate_file: Optional[str] + """ + A File ID representing a PEM file containing the server certificate + """ + client_certificate_file: str + """ + A File ID representing a PEM file containing the client certificate + """ + private_key_file: str + """ + A File ID representing a PEM file containing the client RSA private key + """ + private_key_file_password: Optional[str] + """ + Password for the private key file + """ + ssid: str + """ + Name of the WiFi network + """ + + class PersonalPsk(StripeObject): + password: str + """ + Password for connecting to the WiFi network + """ + ssid: str + """ + Name of the WiFi network + """ + + enterprise_eap_peap: Optional[EnterpriseEapPeap] + enterprise_eap_tls: Optional[EnterpriseEapTls] + personal_psk: Optional[PersonalPsk] + type: Literal[ + "enterprise_eap_peap", "enterprise_eap_tls", "personal_psk" + ] + """ + Security type of the WiFi network. The hash with the corresponding name contains the credentials for this security type. + """ + _inner_class_types = { + "enterprise_eap_peap": EnterpriseEapPeap, + "enterprise_eap_tls": EnterpriseEapTls, + "personal_psk": PersonalPsk, + } + class CreateParams(RequestOptions): bbpos_wisepos_e: NotRequired["Configuration.CreateParamsBbposWiseposE"] """ @@ -363,11 +429,15 @@ class CreateParams(RequestOptions): """ An object containing device type specific settings for Verifone P400 readers """ + wifi: NotRequired["Literal['']|Configuration.CreateParamsWifi"] + """ + Configurations for connecting to a WiFi network. + """ class CreateParamsBbposWiseposE(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ - A File ID representing an image you would like displayed on the reader. + A File ID representing an image to display on the reader """ class CreateParamsOffline(TypedDict): @@ -688,6 +758,80 @@ class CreateParamsVerifoneP400(TypedDict): A File ID representing an image you would like displayed on the reader. """ + class CreateParamsWifi(TypedDict): + enterprise_eap_peap: NotRequired[ + "Configuration.CreateParamsWifiEnterpriseEapPeap" + ] + """ + Credentials for a WPA-Enterprise WiFi network using the EAP-PEAP authentication method. + """ + enterprise_eap_tls: NotRequired[ + "Configuration.CreateParamsWifiEnterpriseEapTls" + ] + """ + Credentials for a WPA-Enterprise WiFi network using the EAP-TLS authentication method. + """ + personal_psk: NotRequired["Configuration.CreateParamsWifiPersonalPsk"] + """ + Credentials for a WPA-Personal WiFi network. + """ + type: Literal[ + "enterprise_eap_peap", "enterprise_eap_tls", "personal_psk" + ] + """ + Security type of the WiFi network. Fill out the hash with the corresponding name to provide the set of credentials for this security type. + """ + + class CreateParamsWifiEnterpriseEapPeap(TypedDict): + ca_certificate_file: NotRequired[str] + """ + A File ID representing a PEM file containing the server certificate + """ + password: str + """ + Password for connecting to the WiFi network + """ + ssid: str + """ + Name of the WiFi network + """ + username: str + """ + Username for connecting to the WiFi network + """ + + class CreateParamsWifiEnterpriseEapTls(TypedDict): + ca_certificate_file: NotRequired[str] + """ + A File ID representing a PEM file containing the server certificate + """ + client_certificate_file: str + """ + A File ID representing a PEM file containing the client certificate + """ + private_key_file: str + """ + A File ID representing a PEM file containing the client RSA private key + """ + private_key_file_password: NotRequired[str] + """ + Password for the private key file + """ + ssid: str + """ + Name of the WiFi network + """ + + class CreateParamsWifiPersonalPsk(TypedDict): + password: str + """ + Password for connecting to the WiFi network + """ + ssid: str + """ + Name of the WiFi network + """ + class DeleteParams(RequestOptions): pass @@ -754,11 +898,15 @@ class ModifyParams(RequestOptions): """ An object containing device type specific settings for Verifone P400 readers """ + wifi: NotRequired["Literal['']|Configuration.ModifyParamsWifi"] + """ + Configurations for connecting to a WiFi network. + """ class ModifyParamsBbposWiseposE(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ - A File ID representing an image you would like displayed on the reader. + A File ID representing an image to display on the reader """ class ModifyParamsOffline(TypedDict): @@ -1079,6 +1227,80 @@ class ModifyParamsVerifoneP400(TypedDict): A File ID representing an image you would like displayed on the reader. """ + class ModifyParamsWifi(TypedDict): + enterprise_eap_peap: NotRequired[ + "Configuration.ModifyParamsWifiEnterpriseEapPeap" + ] + """ + Credentials for a WPA-Enterprise WiFi network using the EAP-PEAP authentication method. + """ + enterprise_eap_tls: NotRequired[ + "Configuration.ModifyParamsWifiEnterpriseEapTls" + ] + """ + Credentials for a WPA-Enterprise WiFi network using the EAP-TLS authentication method. + """ + personal_psk: NotRequired["Configuration.ModifyParamsWifiPersonalPsk"] + """ + Credentials for a WPA-Personal WiFi network. + """ + type: Literal[ + "enterprise_eap_peap", "enterprise_eap_tls", "personal_psk" + ] + """ + Security type of the WiFi network. Fill out the hash with the corresponding name to provide the set of credentials for this security type. + """ + + class ModifyParamsWifiEnterpriseEapPeap(TypedDict): + ca_certificate_file: NotRequired[str] + """ + A File ID representing a PEM file containing the server certificate + """ + password: str + """ + Password for connecting to the WiFi network + """ + ssid: str + """ + Name of the WiFi network + """ + username: str + """ + Username for connecting to the WiFi network + """ + + class ModifyParamsWifiEnterpriseEapTls(TypedDict): + ca_certificate_file: NotRequired[str] + """ + A File ID representing a PEM file containing the server certificate + """ + client_certificate_file: str + """ + A File ID representing a PEM file containing the client certificate + """ + private_key_file: str + """ + A File ID representing a PEM file containing the client RSA private key + """ + private_key_file_password: NotRequired[str] + """ + Password for the private key file + """ + ssid: str + """ + Name of the WiFi network + """ + + class ModifyParamsWifiPersonalPsk(TypedDict): + password: str + """ + Password for connecting to the WiFi network + """ + ssid: str + """ + Name of the WiFi network + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -1111,6 +1333,7 @@ class RetrieveParams(RequestOptions): stripe_s700: Optional[StripeS700] tipping: Optional[Tipping] verifone_p400: Optional[VerifoneP400] + wifi: Optional[Wifi] deleted: Optional[Literal[True]] """ Always true for a deleted object @@ -1349,4 +1572,5 @@ async def retrieve_async( "stripe_s700": StripeS700, "tipping": Tipping, "verifone_p400": VerifoneP400, + "wifi": Wifi, } diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index 0966627c6..08664f686 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -53,11 +53,15 @@ class CreateParams(TypedDict): """ An object containing device type specific settings for Verifone P400 readers """ + wifi: NotRequired["Literal['']|ConfigurationService.CreateParamsWifi"] + """ + Configurations for connecting to a WiFi network. + """ class CreateParamsBbposWiseposE(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ - A File ID representing an image you would like displayed on the reader. + A File ID representing an image to display on the reader """ class CreateParamsOffline(TypedDict): @@ -378,6 +382,82 @@ class CreateParamsVerifoneP400(TypedDict): A File ID representing an image you would like displayed on the reader. """ + class CreateParamsWifi(TypedDict): + enterprise_eap_peap: NotRequired[ + "ConfigurationService.CreateParamsWifiEnterpriseEapPeap" + ] + """ + Credentials for a WPA-Enterprise WiFi network using the EAP-PEAP authentication method. + """ + enterprise_eap_tls: NotRequired[ + "ConfigurationService.CreateParamsWifiEnterpriseEapTls" + ] + """ + Credentials for a WPA-Enterprise WiFi network using the EAP-TLS authentication method. + """ + personal_psk: NotRequired[ + "ConfigurationService.CreateParamsWifiPersonalPsk" + ] + """ + Credentials for a WPA-Personal WiFi network. + """ + type: Literal[ + "enterprise_eap_peap", "enterprise_eap_tls", "personal_psk" + ] + """ + Security type of the WiFi network. Fill out the hash with the corresponding name to provide the set of credentials for this security type. + """ + + class CreateParamsWifiEnterpriseEapPeap(TypedDict): + ca_certificate_file: NotRequired[str] + """ + A File ID representing a PEM file containing the server certificate + """ + password: str + """ + Password for connecting to the WiFi network + """ + ssid: str + """ + Name of the WiFi network + """ + username: str + """ + Username for connecting to the WiFi network + """ + + class CreateParamsWifiEnterpriseEapTls(TypedDict): + ca_certificate_file: NotRequired[str] + """ + A File ID representing a PEM file containing the server certificate + """ + client_certificate_file: str + """ + A File ID representing a PEM file containing the client certificate + """ + private_key_file: str + """ + A File ID representing a PEM file containing the client RSA private key + """ + private_key_file_password: NotRequired[str] + """ + Password for the private key file + """ + ssid: str + """ + Name of the WiFi network + """ + + class CreateParamsWifiPersonalPsk(TypedDict): + password: str + """ + Password for connecting to the WiFi network + """ + ssid: str + """ + Name of the WiFi network + """ + class DeleteParams(TypedDict): pass @@ -454,11 +534,15 @@ class UpdateParams(TypedDict): """ An object containing device type specific settings for Verifone P400 readers """ + wifi: NotRequired["Literal['']|ConfigurationService.UpdateParamsWifi"] + """ + Configurations for connecting to a WiFi network. + """ class UpdateParamsBbposWiseposE(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ - A File ID representing an image you would like displayed on the reader. + A File ID representing an image to display on the reader """ class UpdateParamsOffline(TypedDict): @@ -779,6 +863,82 @@ class UpdateParamsVerifoneP400(TypedDict): A File ID representing an image you would like displayed on the reader. """ + class UpdateParamsWifi(TypedDict): + enterprise_eap_peap: NotRequired[ + "ConfigurationService.UpdateParamsWifiEnterpriseEapPeap" + ] + """ + Credentials for a WPA-Enterprise WiFi network using the EAP-PEAP authentication method. + """ + enterprise_eap_tls: NotRequired[ + "ConfigurationService.UpdateParamsWifiEnterpriseEapTls" + ] + """ + Credentials for a WPA-Enterprise WiFi network using the EAP-TLS authentication method. + """ + personal_psk: NotRequired[ + "ConfigurationService.UpdateParamsWifiPersonalPsk" + ] + """ + Credentials for a WPA-Personal WiFi network. + """ + type: Literal[ + "enterprise_eap_peap", "enterprise_eap_tls", "personal_psk" + ] + """ + Security type of the WiFi network. Fill out the hash with the corresponding name to provide the set of credentials for this security type. + """ + + class UpdateParamsWifiEnterpriseEapPeap(TypedDict): + ca_certificate_file: NotRequired[str] + """ + A File ID representing a PEM file containing the server certificate + """ + password: str + """ + Password for connecting to the WiFi network + """ + ssid: str + """ + Name of the WiFi network + """ + username: str + """ + Username for connecting to the WiFi network + """ + + class UpdateParamsWifiEnterpriseEapTls(TypedDict): + ca_certificate_file: NotRequired[str] + """ + A File ID representing a PEM file containing the server certificate + """ + client_certificate_file: str + """ + A File ID representing a PEM file containing the client certificate + """ + private_key_file: str + """ + A File ID representing a PEM file containing the client RSA private key + """ + private_key_file_password: NotRequired[str] + """ + Password for the private key file + """ + ssid: str + """ + Name of the WiFi network + """ + + class UpdateParamsWifiPersonalPsk(TypedDict): + password: str + """ + Password for connecting to the WiFi network + """ + ssid: str + """ + Name of the WiFi network + """ + def delete( self, configuration: str, diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index 662bf100c..bb9ce1e80 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -99,6 +99,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ + billie: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the billie payment method. + """ billing_details: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataBillingDetails" ] @@ -217,6 +223,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + nz_bank_account: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ oxxo: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataOxxo" ] @@ -283,6 +295,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ + satispay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the satispay payment method. + """ sepa_debit: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataSepaDebit" ] @@ -317,6 +335,7 @@ class CreateParamsPaymentMethodData(TypedDict): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "cashapp", @@ -334,6 +353,7 @@ class CreateParamsPaymentMethodData(TypedDict): "mobilepay", "multibanco", "naver_pay", + "nz_bank_account", "oxxo", "p24", "pay_by_bank", @@ -344,6 +364,7 @@ class CreateParamsPaymentMethodData(TypedDict): "promptpay", "revolut_pay", "samsung_pay", + "satispay", "sepa_debit", "sofort", "swish", @@ -426,6 +447,9 @@ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): class CreateParamsPaymentMethodDataBancontact(TypedDict): pass + class CreateParamsPaymentMethodDataBillie(TypedDict): + pass + class CreateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|ConfirmationTokenService.CreateParamsPaymentMethodDataBillingDetailsAddress" @@ -637,6 +661,29 @@ class CreateParamsPaymentMethodDataNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class CreateParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + class CreateParamsPaymentMethodDataOxxo(TypedDict): pass @@ -705,6 +752,9 @@ class CreateParamsPaymentMethodDataRevolutPay(TypedDict): class CreateParamsPaymentMethodDataSamsungPay(TypedDict): pass + class CreateParamsPaymentMethodDataSatispay(TypedDict): + pass + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index 687590976..8b002e6f7 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -949,7 +949,7 @@ def create( cls, **params: Unpack["FinancialAccount.CreateParams"] ) -> "FinancialAccount": """ - Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. + Creates a new FinancialAccount. Each connected account can have up to three FinancialAccounts by default. """ return cast( "FinancialAccount", @@ -965,7 +965,7 @@ async def create_async( cls, **params: Unpack["FinancialAccount.CreateParams"] ) -> "FinancialAccount": """ - Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. + Creates a new FinancialAccount. Each connected account can have up to three FinancialAccounts by default. """ return cast( "FinancialAccount", diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index 72d176fce..6cc6f577d 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -509,7 +509,7 @@ def create( options: RequestOptions = {}, ) -> FinancialAccount: """ - Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. + Creates a new FinancialAccount. Each connected account can have up to three FinancialAccounts by default. """ return cast( FinancialAccount, @@ -528,7 +528,7 @@ async def create_async( options: RequestOptions = {}, ) -> FinancialAccount: """ - Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. + Creates a new FinancialAccount. Each connected account can have up to three FinancialAccounts by default. """ return cast( FinancialAccount, diff --git a/stripe/v2/_event.py b/stripe/v2/_event.py index 215971a09..335a83fe8 100644 --- a/stripe/v2/_event.py +++ b/stripe/v2/_event.py @@ -13,6 +13,10 @@ # The beginning of the section generated from our OpenAPI spec class Event(StripeObject): + """ + Events are generated to keep you informed of activity in your business account. APIs in the /v2 namespace generate [thin events](https://docs.stripe.com/event-destinations#benefits-of-thin-events) which have small, unversioned payloads that include a reference to the ID of the object that has changed. The Events v2 API returns these new thin events. [Retrieve the event object](https://docs.stripe.com/event-destinations#fetch-data) for additional data about the event. Use the related object ID in the event payload to [fetch the API resource](https://docs.stripe.com/event-destinations#retrieve-the-object-associated-with-thin-events) of the object associated with the event. Comparatively, events generated by most API v1 include a versioned snapshot of an API object in their payload. + """ + OBJECT_NAME: ClassVar[Literal["v2.core.event"]] = "v2.core.event" class Reason(StripeObject): diff --git a/stripe/v2/_event_destination.py b/stripe/v2/_event_destination.py index 1490f0c71..1b4bf43db 100644 --- a/stripe/v2/_event_destination.py +++ b/stripe/v2/_event_destination.py @@ -6,6 +6,10 @@ class EventDestination(StripeObject): + """ + Set up an event destination to receive events from Stripe across multiple destination types, including [webhook endpoints](https://docs.stripe.com/webhooks) and [Amazon EventBridge](https://docs.stripe.com/event-destinations/eventbridge). Event destinations support receiving [thin events](https://docs.stripe.com/api/v2/events) and [snapshot events](https://docs.stripe.com/api/events). + """ + OBJECT_NAME: ClassVar[Literal["v2.core.event_destination"]] = ( "v2.core.event_destination" ) diff --git a/stripe/v2/core/_event_destination_service.py b/stripe/v2/core/_event_destination_service.py index bb888184e..0aa84c4ba 100644 --- a/stripe/v2/core/_event_destination_service.py +++ b/stripe/v2/core/_event_destination_service.py @@ -101,10 +101,6 @@ class ListParams(TypedDict): """ The page size. """ - page: NotRequired[str] - """ - The requested page. - """ class PingParams(TypedDict): pass diff --git a/stripe/v2/core/_event_service.py b/stripe/v2/core/_event_service.py index 712685824..21d3e09ec 100644 --- a/stripe/v2/core/_event_service.py +++ b/stripe/v2/core/_event_service.py @@ -19,10 +19,6 @@ class ListParams(TypedDict): """ Primary object ID used to retrieve related events. """ - page: NotRequired[str] - """ - The requested page. - """ class RetrieveParams(TypedDict): pass diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 48a1ff85e..9d6c691ff 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -5,7 +5,7 @@ from tests.http_client_mock import HTTPClientMock import io -from stripe import StripeClient +from stripe import StripeClient, _error import pytest @@ -4789,14 +4789,13 @@ async def test_coupons_get_2_service_async( def test_coupons_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.create( percent_off=25.5, - duration="repeating", - duration_in_months=3, + duration="once", ) http_client_mock.assert_requested( "post", path="/v1/coupons", query_string="", - post_data="percent_off=25.5&duration=repeating&duration_in_months=3", + post_data="percent_off=25.5&duration=once", ) def test_coupons_post_service( @@ -4811,19 +4810,13 @@ def test_coupons_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.coupons.create( - { - "percent_off": 25.5, - "duration": "repeating", - "duration_in_months": 3, - } - ) + client.coupons.create({"percent_off": 25.5, "duration": "once"}) http_client_mock.assert_requested( "post", path="/v1/coupons", query_string="", api_base="https://api.stripe.com", - post_data="percent_off=25.5&duration=repeating&duration_in_months=3", + post_data="percent_off=25.5&duration=once", ) @pytest.mark.anyio @@ -4832,14 +4825,13 @@ async def test_coupons_post_async( ) -> None: await stripe.Coupon.create_async( percent_off=25.5, - duration="repeating", - duration_in_months=3, + duration="once", ) http_client_mock.assert_requested( "post", path="/v1/coupons", query_string="", - post_data="percent_off=25.5&duration=repeating&duration_in_months=3", + post_data="percent_off=25.5&duration=once", ) @pytest.mark.anyio @@ -4858,8 +4850,7 @@ async def test_coupons_post_service_async( await client.coupons.create_async( { "percent_off": 25.5, - "duration": "repeating", - "duration_in_months": 3, + "duration": "once", } ) http_client_mock.assert_requested( @@ -4867,7 +4858,7 @@ async def test_coupons_post_service_async( path="/v1/coupons", query_string="", api_base="https://api.stripe.com", - post_data="percent_off=25.5&duration=repeating&duration_in_months=3", + post_data="percent_off=25.5&duration=once", ) def test_coupons_post_2(self, http_client_mock: HTTPClientMock) -> None: @@ -10797,15 +10788,12 @@ async def test_invoiceitems_get_2_service_async( ) def test_invoiceitems_post(self, http_client_mock: HTTPClientMock) -> None: - stripe.InvoiceItem.create( - customer="cus_xxxxxxxxxxxxx", - price="price_xxxxxxxxxxxxx", - ) + stripe.InvoiceItem.create(customer="cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoiceitems", query_string="", - post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", + post_data="customer=cus_xxxxxxxxxxxxx", ) def test_invoiceitems_post_service( @@ -10820,33 +10808,25 @@ def test_invoiceitems_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoice_items.create( - { - "customer": "cus_xxxxxxxxxxxxx", - "price": "price_xxxxxxxxxxxxx", - } - ) + client.invoice_items.create({"customer": "cus_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/invoiceitems", query_string="", api_base="https://api.stripe.com", - post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", + post_data="customer=cus_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_invoiceitems_post_async( self, http_client_mock: HTTPClientMock ) -> None: - await stripe.InvoiceItem.create_async( - customer="cus_xxxxxxxxxxxxx", - price="price_xxxxxxxxxxxxx", - ) + await stripe.InvoiceItem.create_async(customer="cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoiceitems", query_string="", - post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", + post_data="customer=cus_xxxxxxxxxxxxx", ) @pytest.mark.anyio @@ -10865,7 +10845,6 @@ async def test_invoiceitems_post_service_async( await client.invoice_items.create_async( { "customer": "cus_xxxxxxxxxxxxx", - "price": "price_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( @@ -10873,7 +10852,7 @@ async def test_invoiceitems_post_service_async( path="/v1/invoiceitems", query_string="", api_base="https://api.stripe.com", - post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", + post_data="customer=cus_xxxxxxxxxxxxx", ) def test_invoiceitems_post_2( @@ -11672,72 +11651,6 @@ async def test_invoices_send_post_service_async( api_base="https://api.stripe.com", ) - def test_invoices_upcoming_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.Invoice.upcoming(customer="cus_9utnxg47pWjV1e") - http_client_mock.assert_requested( - "get", - path="/v1/invoices/upcoming", - query_string="customer=cus_9utnxg47pWjV1e", - ) - - def test_invoices_upcoming_get_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v1/invoices/upcoming", - "customer=cus_9utnxg47pWjV1e", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.invoices.upcoming({"customer": "cus_9utnxg47pWjV1e"}) - http_client_mock.assert_requested( - "get", - path="/v1/invoices/upcoming", - query_string="customer=cus_9utnxg47pWjV1e", - api_base="https://api.stripe.com", - ) - - @pytest.mark.anyio - async def test_invoices_upcoming_get_async( - self, http_client_mock: HTTPClientMock - ) -> None: - await stripe.Invoice.upcoming_async(customer="cus_9utnxg47pWjV1e") - http_client_mock.assert_requested( - "get", - path="/v1/invoices/upcoming", - query_string="customer=cus_9utnxg47pWjV1e", - ) - - @pytest.mark.anyio - async def test_invoices_upcoming_get_service_async( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v1/invoices/upcoming", - "customer=cus_9utnxg47pWjV1e", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - await client.invoices.upcoming_async( - {"customer": "cus_9utnxg47pWjV1e"} - ) - http_client_mock.assert_requested( - "get", - path="/v1/invoices/upcoming", - query_string="customer=cus_9utnxg47pWjV1e", - api_base="https://api.stripe.com", - ) - def test_invoices_void_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -21887,162 +21800,6 @@ async def test_subscription_items_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_subscription_items_usage_record_summaries_get( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionItem.list_usage_record_summaries( - "si_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", - query_string="limit=3", - ) - - def test_subscription_items_usage_record_summaries_get_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", - "limit=3", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.subscription_items.usage_record_summaries.list( - "si_xxxxxxxxxxxxx", - {"limit": 3}, - ) - http_client_mock.assert_requested( - "get", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", - query_string="limit=3", - api_base="https://api.stripe.com", - ) - - @pytest.mark.anyio - async def test_subscription_items_usage_record_summaries_get_async( - self, http_client_mock: HTTPClientMock - ) -> None: - await stripe.SubscriptionItem.list_usage_record_summaries_async( - "si_xxxxxxxxxxxxx", - limit=3, - ) - http_client_mock.assert_requested( - "get", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", - query_string="limit=3", - ) - - @pytest.mark.anyio - async def test_subscription_items_usage_record_summaries_get_service_async( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", - "limit=3", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - await client.subscription_items.usage_record_summaries.list_async( - "si_xxxxxxxxxxxxx", - {"limit": 3}, - ) - http_client_mock.assert_requested( - "get", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", - query_string="limit=3", - api_base="https://api.stripe.com", - ) - - def test_subscription_items_usage_records_post( - self, http_client_mock: HTTPClientMock - ) -> None: - stripe.SubscriptionItem.create_usage_record( - "si_xxxxxxxxxxxxx", - quantity=100, - timestamp=1571252444, - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", - query_string="", - post_data="quantity=100×tamp=1571252444", - ) - - def test_subscription_items_usage_records_post_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "post", - "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.subscription_items.usage_records.create( - "si_xxxxxxxxxxxxx", - {"quantity": 100, "timestamp": 1571252444}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", - query_string="", - api_base="https://api.stripe.com", - post_data="quantity=100×tamp=1571252444", - ) - - @pytest.mark.anyio - async def test_subscription_items_usage_records_post_async( - self, http_client_mock: HTTPClientMock - ) -> None: - await stripe.SubscriptionItem.create_usage_record_async( - "si_xxxxxxxxxxxxx", - quantity=100, - timestamp=1571252444, - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", - query_string="", - post_data="quantity=100×tamp=1571252444", - ) - - @pytest.mark.anyio - async def test_subscription_items_usage_records_post_service_async( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "post", - "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - await client.subscription_items.usage_records.create_async( - "si_xxxxxxxxxxxxx", - {"quantity": 100, "timestamp": 1571252444}, - ) - http_client_mock.assert_requested( - "post", - path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", - query_string="", - api_base="https://api.stripe.com", - post_data="quantity=100×tamp=1571252444", - ) - def test_subscription_schedules_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -33232,3 +32989,367 @@ async def test_webhook_endpoints_post_2_service_async( api_base="https://api.stripe.com", post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", ) + + def test_v2_billing_meter_event_session_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/meter_event_session", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.meter_event_session.create() + http_client_mock.assert_requested( + "post", + path="/v2/billing/meter_event_session", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_billing_meter_event_adjustment_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/meter_event_adjustments", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.meter_event_adjustments.create( + { + "cancel": {"identifier": "identifier"}, + "event_name": "event_name", + "type": "cancel", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/billing/meter_event_adjustments", + query_string="", + api_base="https://api.stripe.com", + post_data='{"cancel":{"identifier":"identifier"},"event_name":"event_name","type":"cancel"}', + is_json=True, + ) + + def test_v2_billing_meter_event_stream_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/meter_event_stream", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.meter_event_stream.create( + { + "events": [ + { + "event_name": "event_name", + "identifier": "identifier", + "payload": {"undefined": "payload"}, + "timestamp": "1970-01-01T15:18:46.294Z", + }, + ], + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/billing/meter_event_stream", + query_string="", + api_base="https://meter-events.stripe.com", + post_data='{"events":[{"event_name":"event_name","identifier":"identifier","payload":{"undefined":"payload"},"timestamp":"1970-01-01T15:18:46.294Z"}]}', + is_json=True, + ) + + def test_v2_billing_meter_event_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/meter_events", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.meter_events.create( + { + "event_name": "event_name", + "payload": {"undefined": "payload"}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/billing/meter_events", + query_string="", + api_base="https://api.stripe.com", + post_data='{"event_name":"event_name","payload":{"undefined":"payload"}}', + is_json=True, + ) + + def test_v2_core_event_destination_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/event_destinations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.create( + { + "enabled_events": ["enabled_events"], + "event_payload": "thin", + "name": "name", + "type": "amazon_eventbridge", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/core/event_destinations", + query_string="", + api_base="https://api.stripe.com", + post_data='{"enabled_events":["enabled_events"],"event_payload":"thin","name":"name","type":"amazon_eventbridge"}', + is_json=True, + ) + + def test_v2_core_event_destination_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v2/core/event_destinations/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.delete("id_123") + http_client_mock.assert_requested( + "delete", + path="/v2/core/event_destinations/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_core_event_destination_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/event_destinations/id_123/disable", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.disable("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/event_destinations/id_123/disable", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_event_destination_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/event_destinations/id_123/enable", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.enable("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/event_destinations/id_123/enable", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_event_destination_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/event_destinations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.list() + http_client_mock.assert_requested( + "get", + path="/v2/core/event_destinations", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_core_event_destination_post_4_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/event_destinations/id_123/ping", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.ping("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/event_destinations/id_123/ping", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_event_destination_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/event_destinations/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/core/event_destinations/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_core_event_destination_post_5_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/event_destinations/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.update("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/event_destinations/id_123", + 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: + http_client_mock.stub_request( + "get", + "/v2/core/events", + "object_id=object_id", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.events.list({"object_id": "object_id"}) + http_client_mock.assert_requested( + "get", + path="/v2/core/events", + query_string="object_id=object_id", + api_base="https://api.stripe.com", + ) + + def test_v2_core_event_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/events/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.events.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/core/events/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_temporary_session_expired_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/meter_event_stream", + rbody='{"error":{"type":"temporary_session_expired","code":"billing_meter_event_session_expired"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.billing.meter_event_stream.create( + { + "events": [ + { + "event_name": "event_name", + "payload": {"undefined": "payload"}, + }, + ], + } + ) + except _error.TemporarySessionExpiredError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/billing/meter_event_stream", + query_string="", + api_base="https://meter-events.stripe.com", + post_data='{"events":[{"event_name":"event_name","payload":{"undefined":"payload"}}]}', + is_json=True, + ) From 08916a179123e5916d3e64b51d855c9c0538e31d Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Mon, 31 Mar 2025 14:44:29 -0700 Subject: [PATCH 158/179] pin pyflakes (#1479) --- deps/dev-requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deps/dev-requirements.txt b/deps/dev-requirements.txt index 7cc5b2374..3bca687ef 100644 --- a/deps/dev-requirements.txt +++ b/deps/dev-requirements.txt @@ -11,4 +11,5 @@ mypy == 1.7.0 # formatting ruff == 0.9.6 # linting -flake8 +# flake8 7.2.0 bumped to pyflakes 3.3.0, which adds a new lint error around global usage which will need to be manually fixed +flake8==7.1.2 From e5e1019a0aff24bca810fbb1d21caebaa9b5f230 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Mon, 31 Mar 2025 14:56:42 -0700 Subject: [PATCH 159/179] rename StripeStreamResponseAsync.read() (#1474) --- stripe/_stripe_response.py | 3 +-- tests/test_integration.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/stripe/_stripe_response.py b/stripe/_stripe_response.py index f3901d5c9..28f0d69e9 100644 --- a/stripe/_stripe_response.py +++ b/stripe/_stripe_response.py @@ -61,6 +61,5 @@ def __init__( def stream(self) -> AsyncIterable[bytes]: return self._stream - # TODO (MAJOR): rename this to `read_async` - async def read(self) -> bytes: # noqa: ASY100 + async def read_async(self) -> bytes: return b"".join([chunk async for chunk in self._stream]) diff --git a/tests/test_integration.py b/tests/test_integration.py index 843937541..d40bb9340 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -496,7 +496,7 @@ def do_request(self, n): stripe.upload_api_base = "http://localhost:%s" % self.mock_server_port result = await stripe.Quote.pdf_async("qt_123") - assert str(await result.read(), "utf-8") == "hello" + assert str(await result.read_async(), "utf-8") == "hello" async def test_async_httpx_stream_error( self, set_global_async_http_client From e9896f4decdbea99a7f8f521358087da85cbb977 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 23:04:59 +0000 Subject: [PATCH 160/179] Update generated code (#1478) * Update generated code for v1642 * Update generated code for v1642 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_invoice.py | 1 - stripe/_subscription.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 0fef50283..32518f99b 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1640 \ No newline at end of file +v1642 \ No newline at end of file diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 3014f7d36..2b4452640 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -4297,7 +4297,6 @@ class VoidInvoiceParams(RequestOptions): The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) """ status_transitions: StatusTransitions - subscription: Optional[ExpandableField["Subscription"]] subtotal: int """ Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 71d1b35a9..d9329cecf 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -2014,7 +2014,7 @@ class SearchParams(RequestOptions): """ A date in the future at which the subscription will automatically get canceled """ - cancel_at_period_end: Optional[bool] + cancel_at_period_end: bool """ Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. """ From 3f96801d8a30e364db0f58844af2e42d5227f859 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Tue, 1 Apr 2025 14:09:04 -0700 Subject: [PATCH 161/179] Bump version to 12.0.0 --- CHANGELOG.md | 101 ++++++++++++++++++++++++++++++++++++++++++++- VERSION | 2 +- stripe/_version.py | 2 +- 3 files changed, 102 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 096d1d531..44ec8891e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,102 @@ +## 12.0.0 - 2025-04-01 +* [#1463](https://github.com/stripe/stripe-python/pull/1463) Support for APIs in the new API version 2025-03-31.basil + + This release changes the pinned API version to `2025-03-31.basil`. + + ### ⚠️ Breaking changes due to changes in the Stripe API + + Please review details for the breaking changes and alternatives in the [Stripe API changelog](https://docs.stripe.com/changelog/basil) before upgrading. + + * Remove support for resources `SubscriptionItemUsageRecordSummary` and `SubscriptionItemUsageRecord` + * Remove support for `create` method on resource `SubscriptionItemUsageRecord` + * Remove support for `list` method on resource `SubscriptionItemUsageRecordSummary` + * Remove support for `upcomingLines` and `upcoming` methods on resource `Invoice` + * Remove support for `invoice` on `Charge` and `PaymentIntent` + * Remove support for `shipping_details` on `CheckoutSession` + * Remove support for `carrier`, `phone`, and `tracking_number` on `CheckoutSession.CollectedInformation.ShippingDetail` + * Remove support for `refund` on `CreditNote.CreateParams`, `CreditNote.PreviewParams`, `CreditNotePreviewLines.ListParams`, and `CreditNote` + * Remove support for `tax_amounts` on `CreditNoteLineItem`, `CreditNote`, and `InvoiceLineItem` + * Remove support for `amount_excluding_tax` and `unit_amount_excluding_tax` on `CreditNoteLineItem` and `InvoiceLineItem` + * Remove support for `coupon` on `Customer.CreateParams`, `Customer.UpdateParams`, `Invoice.CreatePreviewParamsScheduleDetailPhase`, `Invoice.CreatePreviewParams`, `Subscription.CreateParams`, `Subscription.UpdateParams`, `SubscriptionSchedule.CreateParamsPhase`, `SubscriptionSchedule.Phase`, and `SubscriptionSchedule.UpdateParamsPhase` + * Remove support for `promotion_code` on `Customer.CreateParams`, `Customer.UpdateParams`, `Subscription.CreateParams`, and `Subscription.UpdateParams` + * Remove support for `price` on `Invoice.AddLinesParamsLine`, `Invoice.UpdateLinesParamsLine`, `InvoiceItem.CreateParams`, `InvoiceItem.UpdateParams`, `InvoiceItem`, `InvoiceLineItem.UpdateParams`, and `InvoiceLineItem` + * Remove support for `billing_thresholds` on `Invoice.CreatePreviewParamsScheduleDetailPhaseItem`, `Invoice.CreatePreviewParamsScheduleDetailPhase`, `Invoice.CreatePreviewParamsSubscriptionDetailItem`, `Subscription.CreateParamsItem`, `Subscription.CreateParams`, `Subscription.UpdateParamsItem`, `Subscription.UpdateParams`, `SubscriptionItem.CreateParams`, `SubscriptionItem.UpdateParams`, `SubscriptionItem`, `SubscriptionSchedule.CreateParamsDefaultSetting`, `SubscriptionSchedule.CreateParamsPhaseItem`, `SubscriptionSchedule.CreateParamsPhase`, `SubscriptionSchedule.DefaultSetting`, `SubscriptionSchedule.Phase.Item`, `SubscriptionSchedule.Phase`, `SubscriptionSchedule.UpdateParamsDefaultSetting`, `SubscriptionSchedule.UpdateParamsPhaseItem`, `SubscriptionSchedule.UpdateParamsPhase`, and `Subscription` + * Remove support for `application_fee_amount`, `charge`, `paid_out_of_band`, `paid`, `payment_intent`, `quote`, `subscription`, `subscription_details`, `subscription_proration_date`, `tax`, `total_tax_amounts`, and `transfer_data` on `Invoice` + * Remove support for `discount` on `Invoice` and `Subscription` + * Remove support for `invoice_item`, `proration_details`, `proration`, `tax_rates`, and `type` on `InvoiceLineItem` + * Remove support for `plan` and `subscription_item` on `InvoiceItem` and `InvoiceLineItem` + * Remove support for `unit_amount` on `InvoiceItem.CreateParams`, `InvoiceItem.UpdateParams`, and `InvoiceItem` + * Remove support for `subscription` and `unit_amount_decimal` on `InvoiceItem` + * Remove support for `naver_pay` on `PaymentMethod.UpdateParams` + * Remove support for `aggregate_usage` on `Plan.CreateParams`, `Plan`, `Price.CreateParamsRecurring`, and `Price.Recurring` + * Remove support for `current_period_end` and `current_period_start` on `Subscription` + * Remove support for page on `v2.Event.ListParams` and `v2.EventDestination.ListParams` + + ### Changes + * Change `CheckoutSession.collected_information` to be required + * Change `CheckoutSession.CollectedInformation.shipping_details` to be required + * Change `CheckoutSession.CollectedInformation.ShippingDetail.address` to be required + * Change `CheckoutSession.CollectedInformation.ShippingDetail.name` to be required + * Change `PaymentIntent.ConfirmParamsPaymentMethodOptionWechatPay.client`, `PaymentIntent.CreateParamsPaymentMethodOptionWechatPay.client`, and `PaymentIntent.UpdateParamsPaymentMethodOptionWechatPay.client` to be optional + * Change `political_exposure` on resources `Person` and `Token` and params `Token.CreateParams` from string to `enum("existing" | "none")` + + ### Additions + + * Add support for new resource `InvoicePayment` + * Add support for `list` and `retrieve` methods on resource `InvoicePayment` + * Add support for `billie_payments`, `nz_bank_account_becs_debit_payments`, and `satispay_payments` on `Account.Capability`, `Account.CreateParamsCapability`, and `Account.UpdateParamsCapability` + * Add support for `hosted_payment_method_save` on `Account.Setting.Invoice` and `Account.UpdateParamsSettingInvoice` + * Add support for `invoices` on `Account.CreateParamsSetting` + * Add support for new values `information_missing`, `invalid_signator`, `verification_failed_authorizer_authority`, and `verification_rejected_ownership_exemption_reason` on enums `Account.FutureRequirement.Error.code`, `Account.Requirement.Error.code`, `AccountCapability.FutureRequirement.Error.code`, `AccountCapability.Requirement.Error.code`, `AccountPerson.FutureRequirement.Error.code`, `AccountPerson.Requirement.Error.code`, `BankAccount.FutureRequirement.Error.code`, and `BankAccount.Requirement.Error.code` + * Add support for new values `forwarding_api_retryable_upstream_error` and `setup_intent_mobile_wallet_unsupported` on enums `Invoice.LastFinalizationError.code`, `PaymentIntent.LastPaymentError.code`, `SetupAttempt.SetupError.code`, `SetupIntent.LastSetupError.code`, and `StripeError.code` + * Add support for new values `stripe_balance_payment_debit_reversal` and `stripe_balance_payment_debit` on enum `BalanceTransaction.type` + * Add support for new value `last` on enums `BillingMeter.DefaultAggregation.formula` and `billing.Meter.CreateParamsDefaultAggregation.formula` + * Add support for `presentment_details` on `Charge`, `CheckoutSession`, `PaymentIntent`, and `Refund` + * Add support for `billie` and `satispay` on `Charge.PaymentMethodDetail`, `ConfirmationToken.CreateParamsPaymentMethodDatum`, `ConfirmationToken.PaymentMethodPreview`, `CustomerPaymentMethod`, `PaymentIntent.ConfirmParamsPaymentMethodDatum`, `PaymentIntent.CreateParamsPaymentMethodDatum`, `PaymentIntent.UpdateParamsPaymentMethodDatum`, `PaymentMethod.CreateParams`, `PaymentMethodConfiguration.CreateParams`, `PaymentMethodConfiguration.UpdateParams`, `PaymentMethodConfiguration`, `PaymentMethod`, `SetupIntent.ConfirmParamsPaymentMethodDatum`, `SetupIntent.CreateParamsPaymentMethodDatum`, and `SetupIntent.UpdateParamsPaymentMethodDatum` + * Add support for `nz_bank_account` on `Charge.PaymentMethodDetail`, `ConfirmationToken.CreateParamsPaymentMethodDatum`, `ConfirmationToken.PaymentMethodPreview`, `CustomerPaymentMethod`, `Mandate.PaymentMethodDetail`, `PaymentIntent.ConfirmParamsPaymentMethodDatum`, `PaymentIntent.ConfirmParamsPaymentMethodOption`, `PaymentIntent.CreateParamsPaymentMethodDatum`, `PaymentIntent.CreateParamsPaymentMethodOption`, `PaymentIntent.PaymentMethodOption`, `PaymentIntent.UpdateParamsPaymentMethodDatum`, `PaymentIntent.UpdateParamsPaymentMethodOption`, `PaymentMethod.CreateParams`, `PaymentMethodConfiguration.CreateParams`, `PaymentMethodConfiguration.UpdateParams`, `PaymentMethodConfiguration`, `PaymentMethod`, `SetupAttempt.PaymentMethodDetail`, `SetupIntent.ConfirmParamsPaymentMethodDatum`, `SetupIntent.CreateParamsPaymentMethodDatum`, and `SetupIntent.UpdateParamsPaymentMethodDatum` + * Add support for `optional_items` on `CheckoutSession`, `PaymentLink.CreateParams`, `PaymentLink`, and `checkout.Session.CreateParams` + * Add support for `permissions` on `CheckoutSession` and `checkout.Session.CreateParams` + * Add support for new values `billie` and `satispay` on enum `checkout.Session.CreateParams.payment_method_types` + * Add support for new value `custom` on enums `CheckoutSession.ui_mode` and `checkout.Session.CreateParams.ui_mode` + * Add support for `shipping_options` on `checkout.Session.UpdateParams` + * Add support for new values `billie`, `nz_bank_account`, and `satispay` on enums `ConfirmationToken.CreateParamsPaymentMethodDatum.type`, `PaymentIntent.ConfirmParamsPaymentMethodDatum.type`, `PaymentIntent.CreateParamsPaymentMethodDatum.type`, `PaymentIntent.UpdateParamsPaymentMethodDatum.type`, `SetupIntent.ConfirmParamsPaymentMethodDatum.type`, `SetupIntent.CreateParamsPaymentMethodDatum.type`, and `SetupIntent.UpdateParamsPaymentMethodDatum.type` + * Add support for `buyer_id` on `ConfirmationToken.PaymentMethodPreview.NaverPay`, `CustomerPaymentMethod.NaverPay`, and `PaymentMethod.NaverPay` + * Add support for new values `billie`, `nz_bank_account`, and `satispay` on enums `ConfirmationToken.PaymentMethodPreview.type`, `CustomerPaymentMethod.type`, and `PaymentMethod.type` + * Add support for `refunds` on `CreditNote.CreateParams`, `CreditNote.PreviewParams`, `CreditNotePreviewLines.ListParams`, and `CreditNote` + * Add support for `total_taxes` on `CreditNote` and `Invoice` + * Add support for `taxes` on `CreditNoteLineItem` and `InvoiceLineItem` + * Add support for `checkout_session` on `CustomerBalanceTransaction` + * Add support for new values `checkout_session_subscription_payment_canceled` and `checkout_session_subscription_payment` on enum `CustomerBalanceTransaction.type` + * Add support for new values `billie`, `nz_bank_account`, and `satispay` on enums `CustomerPaymentMethod.ListParams.type`, `PaymentMethod.CreateParams.type`, and `PaymentMethod.ListParams.type` + * Add support for new value `invoice.overpaid` on enum `Event.type` + * Add support for new values `klarna` and `nz_bank_account` on enums `Invoice.CreateParamsPaymentSetting.payment_method_types`, `Invoice.PaymentSetting.payment_method_types`, `Invoice.UpdateParamsPaymentSetting.payment_method_types`, `Subscription.CreateParamsPaymentSetting.payment_method_types`, `Subscription.PaymentSetting.payment_method_types`, and `Subscription.UpdateParamsPaymentSetting.payment_method_types` + * Add support for `pricing` on `Invoice.AddLinesParamsLine`, `Invoice.UpdateLinesParamsLine`, `InvoiceItem.CreateParams`, `InvoiceItem.UpdateParams`, `InvoiceItem`, `InvoiceLineItem.UpdateParams`, and `InvoiceLineItem` + * Add support for `taxability_reason` on `Invoice.AddLinesParamsLineTaxAmount`, `Invoice.UpdateLinesParamsLineTaxAmount`, and `InvoiceLineItem.UpdateParamsTaxAmount` + * Add support for `jurisdiction_level` on `Invoice.AddLinesParamsLineTaxAmountTaxRateDatum`, `Invoice.UpdateLinesParamsLineTaxAmountTaxRateDatum`, and `InvoiceLineItem.UpdateParamsTaxAmountTaxRateDatum` + * Add support for `amount_overpaid`, `confirmation_secret`, and `payments` on `Invoice` + * Add support for `parent` on `InvoiceItem`, `InvoiceLineItem`, and `Invoice` + * Add support for new value `expired` on enums `IssuingAuthorization.status` and `issuing.Authorization.ListParams.status` + * Add support for new value `network_fallback` on enum `IssuingAuthorization.RequestHistory.reason` + * Add support for `naver_pay` on `Mandate.PaymentMethodDetail` and `SetupAttempt.PaymentMethodDetail` + * Add support for `setup_future_usage` on `PaymentIntent.ConfirmParamsPaymentMethodOptionNaverPay`, `PaymentIntent.CreateParamsPaymentMethodOptionNaverPay`, `PaymentIntent.PaymentMethodOption.NaverPay`, and `PaymentIntent.UpdateParamsPaymentMethodOptionNaverPay` + * Add support for `default_value` on `PaymentLink.CreateParamsCustomFieldDropdown`, `PaymentLink.CreateParamsCustomFieldNumeric`, `PaymentLink.CreateParamsCustomFieldText`, `PaymentLink.CustomField.Dropdown`, `PaymentLink.CustomField.Numeric`, `PaymentLink.CustomField.Text`, `PaymentLink.UpdateParamsCustomFieldDropdown`, `PaymentLink.UpdateParamsCustomFieldNumeric`, and `PaymentLink.UpdateParamsCustomFieldText` + * Add support for new values `billie` and `satispay` on enums `PaymentLink.CreateParams.payment_method_types`, `PaymentLink.UpdateParams.payment_method_types`, and `PaymentLink.payment_method_types` + * Add support for `nz_bank_transfer` on `Refund.DestinationDetail` + * Add support for new value `canceled` on enum `Review.closed_reason` + * Add support for `current_period_end` and `current_period_start` on `SubscriptionItem` + * Add support for `wifi` on `TerminalConfiguration`, `terminal.Configuration.CreateParams`, and `terminal.Configuration.UpdateParams` + * Add support for new value `invoice.overpaid` on enums `WebhookEndpoint.CreateParams.enabled_events` and `WebhookEndpoint.UpdateParams.enabled_events` + * Add support for new values `2025-03-01.dashboard` and `2025-03-31.basil` on enum `WebhookEndpoint.CreateParams.api_version` + +### ⚠️ Other Breaking changes in the SDK +* [#1474](https://github.com/stripe/stripe-python/pull/1474) Rename `StripeStreamResponseAsync`'s `.read()` to `read_async()` for consistency + * Rename `StripeStreamResponseAsync.read()` to `.read_async()` + * This brings the method name in line with the conventions used by every other async method in the package, ensuring consistent `async` usage. + * You'll need to update your code if you call `Quote.pdf_async().read()` method. A typechecker will alert you to this change. +* [#1471](https://github.com/stripe/stripe-python/pull/1471) Fix incorrect property name on `ThinEvent.related_object.type` + * Rename `ThinEvent.related_object.type_` to `ThinEvent.related_object.type` + * This was an unintentional typo before. The property name now correctly matches the value you get back from the API + ## 11.6.0 - 2025-02-24 * [#1450](https://github.com/stripe/stripe-python/pull/1450) Update generated code * Add support for `target_date` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsAcssDebit`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsAuBecsDebit`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsBacsDebit`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebit`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccount`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsAcssDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsAuBecsDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsBacsDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccount`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsAcssDebit`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsAuBecsDebit`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsBacsDebit`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsSepaDebit`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccount`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsAcssDebit`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsAuBecsDebit`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsBacsDebit`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSepaDebit`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptionsUsBankAccount` and resource classes `stripe.PaymentIntent.PaymentMethodOptions.AcssDebit`, `stripe.PaymentIntent.PaymentMethodOptions.AuBecsDebit`, `stripe.PaymentIntent.PaymentMethodOptions.BacsDebit`, `stripe.PaymentIntent.PaymentMethodOptions.SepaDebit`, `stripe.PaymentIntent.PaymentMethodOptions.UsBankAccount`, `stripe.checkout.Session.PaymentMethodOptions.AcssDebit`, `stripe.checkout.Session.PaymentMethodOptions.AuBecsDebit`, `stripe.checkout.Session.PaymentMethodOptions.BacsDebit`, `stripe.checkout.Session.PaymentMethodOptions.SepaDebit`, and `stripe.checkout.Session.PaymentMethodOptions.UsBankAccount` @@ -46,7 +145,7 @@ * [#1445](https://github.com/stripe/stripe-python/pull/1445) minor justfile fixes & pin CI version * [#1440](https://github.com/stripe/stripe-python/pull/1440) add justfile, update readme, remove coveralls * [#1442](https://github.com/stripe/stripe-python/pull/1442) Fix V2 ListObject.data type hint - - Change `stripe.v2.ListObject.data` type hint from `List[StripeObject]` to `List[T]` where T is the specific stripe object contained within the list + - Change `stripe.v2.ListObject.data` type hint from `List[StripeObject]` to `List[T]` where T is the specific stripe object contained within the list ## 11.5.0 - 2025-01-27 * [#1443](https://github.com/stripe/stripe-python/pull/1443) Update generated code diff --git a/VERSION b/VERSION index 146d5de79..4044f9086 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.6.0 +12.0.0 diff --git a/stripe/_version.py b/stripe/_version.py index b025d4d4f..2a8345bc8 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "11.6.0" +VERSION = "12.0.0" From a47da3f0f8bc948761079c1f31eae014ae5250b7 Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Thu, 3 Apr 2025 13:46:54 -0700 Subject: [PATCH 162/179] Update to 22.04 in CI (#1485) --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66b649c19..26c71633f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,15 +68,14 @@ jobs: path: dist/ test: - # Specific ubuntu version to support python 3.6 testing - # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 for details - # move to ubuntu-latest when we drop 3.6 - runs-on: ubuntu-20.04 + # Specific ubuntu version to support python 3.7 testing + # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 for list of supported versions + # move to ubuntu-latest when we drop 3.7 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: python_version: - - "3.6" - "3.7" - "3.8" - "3.9" From 7219f8c1ee00e0a3146c241fca16b869f3747158 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Tue, 8 Apr 2025 20:24:22 -0700 Subject: [PATCH 163/179] switch build systems (#1494) --- deps/build-requirements.txt | 5 +++-- justfile | 12 +++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/deps/build-requirements.txt b/deps/build-requirements.txt index ae45d54c1..ff4f371f6 100644 --- a/deps/build-requirements.txt +++ b/deps/build-requirements.txt @@ -1,4 +1,5 @@ # packages needed to package & release -twine -setuptools +# pinned to latest as of 2025-04-08; nothing special about these versions +twine == 6.1.0 +build == 1.2.2 diff --git a/justfile b/justfile index 011c346d6..de11777b3 100644 --- a/justfile +++ b/justfile @@ -31,19 +31,16 @@ format: install-dev-deps format-check: install-dev-deps ruff format . --check --quiet -# remove venv +# remove venv & build artifacts clean: - # clear old files too - rm -rf {{ VENV_NAME }} venv .tox + rm -rf {{ VENV_NAME }} venv .tox dist stripe.egg-info # blow away and reinstall virtual env reset: clean && venv # build the package for upload build: install-build-deps - # --universal is deprecated, so we'll probably need to look at this eventually - # given that we don't care about universal 2 and 3 packages, we probably don't need it? - python -I setup.py clean --all sdist bdist_wheel --universal + python -m build python -m twine check dist/* # typecheck some examples w/ mypy @@ -64,7 +61,8 @@ _install-all: install-dev-deps install-test-deps install-build-deps # installs files out of a {group}-requirements.txt into the local venv; mostly used by other recipes install group: venv - python -I -m pip install -r deps/{{ group }}-requirements.txt --disable-pip-version-check {{ if is_dependency() == "true" {"--quiet"} else {""} }} + # always log deps in CI, but don't do it locally + python -I -m pip install -r deps/{{ group }}-requirements.txt --disable-pip-version-check {{ if env("CI", "") == "true" {""} else if is_dependency() == "true" {"--quiet"} else {""} }} # create a virtualenv if it doesn't exist; always installs the local package [private] From 54b6d62a9e6e4c8cefb4a40961740e11dcba8e49 Mon Sep 17 00:00:00 2001 From: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> Date: Tue, 8 Apr 2025 23:24:45 -0700 Subject: [PATCH 164/179] Remove link for stale youtube video playlist (#1492) --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index aa4f0d2cd..ed72c8329 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,6 @@ API. See the [Python API docs](https://stripe.com/docs/api?lang=python). -See [video demonstrations][youtube-playlist] covering how to use the library. - ## Installation You don't need this source code unless you want to modify the package. If you just @@ -401,7 +399,6 @@ just format [poetry]: https://github.com/sdispater/poetry [stripe-mock]: https://github.com/stripe/stripe-mock [idempotency-keys]: https://stripe.com/docs/api/idempotent_requests?lang=python -[youtube-playlist]: https://www.youtube.com/playlist?list=PLy1nL-pvL2M55YVn0mGoQ5r-39A1-ZypO